ScriptSpot

Forum topic · General Scripting

restore a scene state with maxscript

By pproestos · 2011-10-09

Description

Hello.
Because I am very new to scripting and
I need these functions to know how
to initiate them through maxscript:

1.
How to restore a scenestate?

2.
How to export to a file format

3.
How to set the rendering resolution

thank you all.

Comments (4)

quick help

Anubis · 2011-10-10

I never used sceneStateMgr interface in scripting,
so take next code just as "getting started" tip.

ssm = sceneStateMgr
ss_id = ssm.FindSceneState "02" -- get the state index
if ss_id > 0 do -- if found...
(
	ssi = ssm.GetSceneState ss_id -- the state
	-- get it parts...
	ssp = ssm.GetParts "02"
	ssm.Restore "02" ssp
	-- OR use...
	---ssm.RestoreAllParts "02"
)

THANK YOUUUUUUU

pproestos · 2011-10-11

ANUBIS YOU ARE THE BEST THANK YOU VERY MUCH

br0t · 2011-10-09

1. search in the documentation for "sceneStateMgr"

2. search in the documentation for "exportFile"

3. to see what renderers you have installed and assign one of them try this:


rendererClass.classes --execute this to get a list of strings
renderers.current = "V_Ray_Adv_2_10_01" --use the strings to set the current renderer

EDIT: oh ive red solution and not resolution lol...
the resolution is easily set using "renderWidth" and "renderHeight"
Cheers

thanks but I dont understand :)

pproestos · 2011-10-09

br01, really thanks for your immediate reply.
Unfortunately I don't have a lot of time to learn maxscipt right now.
So at list if I know for the beginning some functions and
after some time I wish to learn in a good way how to scipt in max.

In the help documentation of 3dsmax I found these, but
when I put them into script listener, many errors occurs.

Interface: sceneStateMgr

Restore name parts

Restores the scene state with the given name using the supplied array of parts. Returns true on success, false otherwise.

How should I put them for ex to restore a scene state named "02"?

thanks again very much