Q:How to creat a Built-in scirpt for a max file?

I wish this topic come to the right place, forgive me if its not...

Hello Everyone (a bigger hello for MaxScript Masters !)

About my digging into Scripting World, I've faced (and somehow needed and asked) An Script that somehow is bind to A .Max file which is saved with it and ran whenever .Max file opens. is Such thing Possible at all?

For example, Paul Neale has done a sample rig for 3DsMax2008 (A semi-trooper girl who I can't remember her name right now) which in its character control assets there is an Unknown and Unseen-before Max modifier with a totally Different Modifier class that controls such things like char:Low\Hi or Mirroring limbs & etc. I wonder How he has done such thing? I though it May be an Build-in Script with the max file.

Another way to explain what I mean : I want to Create A Callback event which I don't want to run it every time I Start 3dsMax (like putting it to start-up folder) but only run it on a specific project files that I only need them to have my script and somehow make a built-in script for those Project files.

Thanks for any Possible Answer !

Comments

Comment viewing options

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

one of many solutions

Interesting solution will be to create in teses scene some helper object which contains some code in user defined properties or AppData. Then when you open theses files callback will check if that helper object exist and run U.D.P string ei. code.

bga

ArminAnim's picture

Reply

Thank you very much. well that's A tricky way worth to try. But is this the only solution?
and another question : is this solution able to run any script? like a Scripted modifier?

barigazy's picture

yes if you add code inside

yes if you add code inside helper user defined prop.

delete objects
d = Dummy name:"SceneInfo"
str = "for i = 1 to 10 do Box pos:[0,0,30*i];\n"
str += "for i = 1 to 10 do Sphere pos:[0,30*i,0];\n"
str += "for o in geometry do o.wirecolor = random black white"
setUserPropBuffer d str
-- the next line you can add to callback (as function of course)
if (getNodeByName "SceneInfo") != undefined do
(
     if (uProps = getUserPropBuffer (getNodeByName "SceneInfo")) != "" do execute uProps
)

bga

barigazy's picture

...

Or you can set User Props by
Select any object (in this case helper), rightclick to open quad menu > ObjectProperties... > User Defined Tap and paste your scripted modifier code or any other function.

bga

Comment viewing options

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