ScriptSpot

Script

Create Vray Camera from Perspective View

By oliveremley · Credited author: Oliver Emley · 2013-06-15

Version
1.0
Version requirement
Max 2013 & Higher
Other software required
VRAY
Date updated
2013-06-15
Votes
6
Description

This is a script that will allow you to create a Max Standard Target Camera (Ctrl+C) at the click of a button. More importantly it will allow you to create a VRay Phycical Camera from prespect view at the touch of a button. No more having to align your Vray-camera with the standard Max Camera. You can also choose which camera to display in the selected viewport from a drop-down list

 

 

Additional Info

To install simply copy the downloaded macroscript file to C:\Users\(Username...)\AppData\Local\Autodesk\3dsMaxDesign\2013\ENU\usermacros You may need to enable show hidden files to access the folder. After that you open 3ds max, go to customize> Customize User Interface> Toolbars. Under category find Oliver Emley and then drag CAMVIEW to an existing toolbar or create a new one. I have created it in Max 2013 but it may work in prevous versions. Hope it makes all your lives easier.

 

 

Attachments

Tags: script, VRay, camera, viewport, 3ds max, VRayPhysicalCamera

Comments (9)

2018 Max

ereju · 2019-01-31

It does not work for 2018 version. Not for Vray physical camera at least. The 3ds camera works fine.

VRay Phycical Camera

alizehi3d · 2019-01-25

by Con+c we can create default 3ds max camera, what about VRay Phycical Camera?
why chaos group did not working on this?
https://irancgcenter.com/

Corona

vfga10 · 2018-11-09

Does it work with Corona Cameras?
Could you update the script for it please?

Thank you

JCR2011 · 2016-01-18

So much for this incredibly useful script!

--- a rip off from max

fajar · 2014-05-04


--- a  rip off from max create camera from viewport ported to vray physical camera
-- assign some keyboard to it , to make it easy
macroScript VRayPhysicalCamera_From_View
ButtonText:"Create V-Ray Camera From View"
category:"VRay" 
internalCategory:"Lights and Cameras"
Tooltip:"Create V-Ray Physical Camera From View"
Icon:#("Cameras",3)
	
(
	on IsEnabled return (If (viewport.Gettype() == #view_persp_user) do return true)
	
	on execute do
	(
	fn verifyRenderer=
	(
		if (matchpattern ((renderers.current) as string) pattern:"v_ray*" ignoreCase:true) then return "vray" else return "other"
	)
	
	myCamColor=(color 5 54 179)
	myCamTarget=getscreenscalefactor [0,0,0]
	myCamVOF= getViewFOV()
	myCamXForm= Inverse(viewport.getTM())
	
	if viewport.Gettype() == #view_persp_user do
		(
			if (verifyRenderer()) == "vray" then	
			(	
				sCam=vrayPhysicalCamera  target_Distance:myCamTarget isSelected:on \
							wirecolor:myCamColor
				sCam.specify_fov=true
				sCam.fov= myCamVOF	
				sCam.Transform = myCamXForm 
				viewport.setcamera sCam	
				sCam.targeted=true	
				scam.target.wirecolor=myCamColor
				sCam.type = 0
			)
			else
			(
				stdCam = Freecamera  targetDistance:myCamTarget isSelected:on wirecolor:myCamColor
				stdCam.fov = myCamVOF
				stdCam.orthoProjection = false 
				stdCam.Transform = myCamXForm 
				viewport.setcamera stdCam
				if(Perspective_Match.IsMatching() == false) then
				(
					stdCam.type = #target
					stdCam.target.wirecolor = myCamColor
				)	
				--messageBox "\tCreate V-Ray PhysicalCamera \nonly support when you're set V-Ray as renderer !" title:"3ds Max"
			)
		)
	)
)

assign to your ctrl+c shortcut....it'll create vray camera instead standard camera when its detect your renderer is vray , n standard camera if the renderer isnt vray.

VRay Phycical Camera

3dmax farsi · 2016-06-07

by Con+c we can create default 3ds max camera, what about VRay Phycical Camera?
why chaos group did not working on this?
http://www.3dmaxfarsi.ir/

MrTom · 2013-08-19

A VRay camera can be aligned to the perspective view by creating it in another viewport, activating perspective view and THEN use 'CTRL + C' as normal.

This will align the new VRay camera to the perspective view....in fact it'll align any selected VRay camera to the perspective view.

zeablyk · 2014-01-31

Yeah, but you can find this in Z Tools, you can find more here 

dsp_418 · 2013-06-19

Very useful, thank you!