Notifications
Clear all

[Closed] A file associated, or embedded script?

Is it possible to have a ___.max file run a particular maxscript when opened by 3dsMax?

What I’m trying to do.
We have a bunch of test case files (to test an exporter) that I’ve automated automated using a script written in python. It opens each Max file and exports it.
That is fine for 90% of the files but some of them require a few changes on open …
e.g. Select a certain set of models, change a modifier, bla bla.

It would be great if I could somehow associate a maxscript with a file so that when it is opened by my batch exporter the above modifications are done.

I’m guessing I could put something inside startup.ms so that on file-open it checks against a specific file name list then goes and does a particular modification… but I was hoping for something that would be more individual test file associated.

Thanks.

4 Replies

Hmmmm In writing this I just thought to myself, why dont I make the batch exporter do something like

if in same dir maxscript name == current maxfilename
run max with -ms maxscript

Guess that will solve it.

Still Id like to hear some other suggestions, especially regarding embedding scripts to run on open.

there is a system in the max that calls ‘persistent callback scripts’. you can save with a file any file pre-open or post-open callback script, and have it been executed with the file opening.

Awesome… I will look into this
Thanks.

Know if there is a Maya equivalent?