load 3ds max as standalone in python outside of 3dsMax

load 3ds max as standalone in python outside of 3dsMax

Anonymous
Not applicable
1,351 Views
3 Replies
Message 1 of 4

load 3ds max as standalone in python outside of 3dsMax

Anonymous
Not applicable

Hi,
Is it possible to load 3dsMax (2016 or 2017) as a standalone library in a python script outside of 3dsmax, like is it possible in maya?

thanks

 

0 Likes
1,352 Views
3 Replies
Replies (3)
Message 2 of 4

kevinvandecar
Community Manager
Community Manager

Hi, 3ds Max does not have exactly the same idea as Maya. But you can launch 3dsMax.exe from the environment as you want (ie. vie python). Then using the -U MAXScript switch, you can have it run a maxscript (which can contain python; as you may know maxscript/python is integrated pretty well. note that it is even better in 2017). there is also a windows environment variable you can use to "locate" the install location of 3ds max in the command environment. For example, you could do this:

 

"%ADSK_3DSMAX_x64_2017%\3dsmax.exe" -U MAXScript doit.ms

 

If the "doit.ms" script has the command to exit (ie. quitMax), then it will run completely unattended if there are no errors (and there are ways to run to completion if you have good error handling.)

 

It's not as easy perhaps as Maya, but I think you should be able to accomplish the same idea using maxscript and python together.

 

hope it helps,

kevin

 

 

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes
Message 3 of 4

Anonymous
Not applicable
Is there any way to print messages directly in the command prompt (stdout) with MaxScript ? I tried using DotNet but was unsuccessful...
0 Likes
Message 4 of 4

kevinvandecar
Community Manager
Community Manager

By default the stdout and sterr go to the listener window. This can be pushed to a log file with the openLog function.

http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_263B5831_EC57_4ED9_B5DB_DD26FC93A38...

 

You could also directly log output to a file using the FileStream tools...

http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_BB041082_3EEF_4576_9D69_5B258A59065...

 

In mentioning the.NET approach, do you already see this?: https://cbuelter.wordpress.com/2014/12/09/writing-to-stdout-and-stderr-from-maxscript/

If that idea is acceptable and is not working, can you provide what you tried? For me it looks reasonable what they are doing. The .NET API is independent of 3ds Max, so it should redirect stdout/stderr.

 

hope it helps,

kevin

 

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes