PDA

View Full Version : 3ds max 2010 include compatibility


cridalab
03-16-2010, 04:08 AM
I just upgraded to 2010 and am trying to run my scripts made with 2009. It seems the API is backwardly compatible but including other files is handled differently. I was able to get my script working by pasting all my included sections in the same file, but I would rather keep them separate.

Has the way include works been changed at all? - the maxscript reference for include look the same ...

Gravey
03-16-2010, 08:19 AM
I have had no problems with include between 2009 and 2010. what exactly is the error you are getting and can you post an example where it happens?

cridalab
03-17-2010, 12:37 AM
Say A.ms imports B.ms.

When I update B.ms in the editor and then run A.ms, the changes to B.ms are not used. To force a refresh of B.ms I have to restart 3ds max.

Further, a global variable defined in B.ms becomes undefined in A.ms.

Weird huh!

Bobo
03-17-2010, 01:45 AM
Say A.ms imports B.ms.

When I update B.ms in the editor and then run A.ms, the changes to B.ms are not used. To force a refresh of B.ms I have to restart 3ds max.

Further, a global variable defined in B.ms becomes undefined in A.ms.

Weird huh!

Weird. A global variable that WAS already defined cannot become undefined. So I must be missing something.

Keep in mind the include() really works like copy&paste at source level, so the location where the include() is placed within A.ms will define from which point on the variable would be visible. If the variable is referenced before B.ms' source code is evaluated, then a new global variable will the value of undefined will be created, in any version of Max.

Are you saying it was working ok in previous versions and now it is broken?
Can you create a very simple 3 line example of A.ms and B.ms and post them so we can try in our builds of Max 2010 and higher?

cridalab
03-25-2010, 06:05 AM
Weird. A global variable that WAS already defined cannot become undefined. So I must be missing something.

I found that this only happens for my netrender backburner connection. I have a netrender connection but it somehow loses the connection after each render. My temporary work around is to remake the connection after each render.


Keep in mind the include() really works like copy&paste at source level, so the location where the include() is placed within A.ms will define from which point on the variable would be visible. If the variable is referenced before B.ms' source code is evaluated, then a new global variable will the value of undefined will be created, in any version of Max.

The module is being imported fine, but only the code that was written before opening max is imported. To force an import of updated content I have to close and reopen max. This makes development cumbersome so I have combined all code into a single file.



Are you saying it was working ok in previous versions and now it is broken?

yes worked in 2009 but all computers were upgraded here to 2010, which broke our script.

cridalab
03-25-2010, 06:07 AM
Another problem we are now facing since upgrading is running max from the command line.
For example we used to run:
""C:/Program Files/Autodesk/3ds Max Design 2010/3dsmax.exe" -U MAXScript energy_render.ms -mxs "main()" "
But now in 2010 this opens max and closes quickly. If I open max manually and run main() it works.

If I add main() within the script and then try:
""C:/Program Files/Autodesk/3ds Max Design 2010/3dsmax.exe" -U MAXScript energy_render.ms" "
then max opens but does nothing.

CGTalk Moderation
03-25-2010, 06:07 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.