Notifications
Clear all

[Closed] Is this doable

I need a script to be link to a max file and I want it to start the script when I load the scene in max

3 Replies

If you want a script to execute every time a scene file is loaded you need to register the code as a #filePostOpen callback. The best thing to do would be to create a script that contains the code you want to execute and the command to register it as a a callback and put that script into \max\scripts\startup. That way the callback will be automatically registered each time Max starts.

Read the “General Event Callback Mechanism” section of the MAXScript help file. Callbacks are pretty easy to understand.

so in otherwords not from the file it needs to be in the startup.

You could put a script controller onto a helper object. Use a variable to tell if the script has benn run already to stop it cbeing evaluated every frame.

J.