apply a state for every camera in the scene!

I have a house in 3d and a background in it! I want to create scene states for every camera, so when I switch to any of them, I would see automatically the changes according to it's state! Any ideas?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artrender.info's picture

a simple thing

a takes so much time to think, rethink and so on!

barigazy's picture

wait a minute

wait a minute

bga

artrender.info's picture

how to inform max

which object it should understand like target objects that should move, why if there are more then one object that should have their own transformations?

artrender.info's picture

however

not to copy, but to save!
and then, to be able to reload them again

artrender.info's picture

I think inside of ca

it should copy/paste object transform like in this script

http://www.scriptspot.com/3ds-max/scripts/copy-paste-transforms

artrender.info's picture

Thank you, barigazy!!!

I've found some info about custom attributes here
http://www.paulneale.com/tutorials/custAttributes/customAttributes.htm

should I have smth like that?

ca=attributes object transform
(
	--Function for getting info about move, scale, roate
	fn move_scale_rotate object =
	(
             get move
             get rotate
             get scale
	)
)
artrender.info's picture

Oh, yeeeeeeeeeeeeeees!!!

that's amazing! You have done all the script! That's really incredible! Thx Barigazy! Just my fault is that I didn't noticed that scene states do not support object transforms- I wanted to move/rotate the plane and save scene states for it! It is possible to copy and hide, but if I have heavy models to copy and hide then this would not be a good way! Why didn't they do object transform for scene states?!! 3dMax always needs a lot of improvements that had to be done 6 years ago! However,I don't imagine my life without it! hm...

barigazy's picture

...

You can store transform in a struct or even better castom attribute and assigne to the camera

bga

artrender.info's picture

I want

to link somehow for every camera a scene state, so when switching to camera I would get this scene state switched on!

barigazy's picture

;)

I wrote en example script for old (msx2012) scene state. For versions above 2012 you need to change state scene method. But concept that you ask is the same.
Cheers!

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
	fn collectStates = (for s in 1 to sceneStateMgr.GetCount() collect sceneStateMgr.GetSceneState s)
	fn collectCameras ddl lb = if (cams = for c in cameras where not isKindof c TargetObject collect c).count != 0 do
	(
		local states = collectStates(), stCamList = #(), avCamList = #()
		for c in cams do
		(
			userProp = getUserPropBuffer c
			if userProp == "" then append avCamList c.name else
			(
				if findItem states userProp != 0 then append stCamList c.name else
				(
					setUserPropBuffer c "" ; append avCamList c.name
				)
			)
		)
		ddl.items = avCamList ; lb.items = stCamList
	)
	dropDownList ddl1 "Scene States:" width:190 pos:[5,5]
	dropDownList ddl2 "Available Cameras:" width:190 pos:[5,45]
	button btn1 "Set State To Camera" width:110 height:20 pos:[5,86]
	button btn2 "Refresh All" width:78 height:20 pos:[117,86]
	listbox lbox "State Cameras:" width:190 height:15 pos:[5,110]
	fn init = (bgaRoll.ddl1.items = collectStates() ; collectCameras bgaRoll.ddl2 bgaRoll.lbox)
	on bgaRoll open do init()
	on btn2 pressed do init()
	on btn1 pressed do 
	(
		if bgaRoll.ddl1.items.count != 0 and bgaRoll.ddl2.items.count != 0 do
		(
			if (cam = getNodeByName bgaRoll.ddl2.selected) != undefined do
			(			
				setUserPropBuffer cam bgaRoll.ddl1.selected
				bgaRoll.lbox.items = append bgaRoll.lbox.items bgaRoll.ddl2.selected
				bgaRoll.ddl2.items = deleteitem bgaRoll.ddl2.items bgaRoll.ddl2.selection
			)
		)
	)
	on lbox selected itm do 
	(
		if isValidNode (c = (getNodeByName bgaRoll.lbox.selected)) then select c else init()
	)
	on lbox doubleClicked itm do 
	(
		if isValidNode (c = (getNodeByName bgaRoll.lbox.selected)) then 
		(
			if sceneStateMgr.FindSceneState (st = getUserPropBuffer c) != 0 do
			(
				sceneStateMgr.RestoreAllParts st
				viewport.setCamera c
			)
		) else init()
	)
)
createDialog bgaRoll 200 330 10 110 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.