ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Submitted by artrender.info on Tue, 2013-05-14 09:07
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?
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?
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...
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 20033010110 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
Comments
a simple thing
a takes so much time to think, rethink and so on!
wait a minute
wait a minute
bga
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?
however
not to copy, but to save!
and then, to be able to reload them again
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
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?
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...
...
You can store transform in a struct or even better castom attribute and assigne to the camera
bga
I want
to link somehow for every camera a scene state, so when switching to camera I would get this scene state switched on!
;)
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!
bga