Notifications
Clear all

[Closed] Camera switching

I have a main scene with three different cameras and i need the next thing:

When i merge the file “scene01.max” into my scene, i need to activate the viewport on VrayCamera 01, if i merge the second file “scene02.max” then it will be switch on VrayCamera 02.

That’s all

THANKS

4 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

but what do you have to do if you merge the file “scene12056.max”?

Here is the RAW script you might want to try, it best to have UI …


file="E:\\001.max" -- change the max file name

fn mergeAndActivateCamera maxFile =
(
	local mergedFile
	cam01 = $VRayPhysicalCamera001
	cam02 = $VRayPhysicalCamera002
	
	if isMaxFile maxFile do 
	(
		mergeMaxfile maxFile #select  #autoRenameDups #mergeDups #autoRenameDups quiet:true
		mergedFile=filenameFromPath file 
	)

	case mergedFile of 
	(
		"001.max" : (if isValidObj cam01 do  viewport.setCamera cam01)
		"002.max" : (if isValidObj cam02 do  viewport.setCamera cam02)
	)
)

-- example of use
mergeAndActivateCamera file

There s another improvement if it developed more…but I think this is what you want right now, right? Cos I dont know your circumstance , I can only guess from what you are asking.
cheer

Thanks


i think that you have much more problems with a pipeline than with a script