Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command line "3dsmax.exe -mxs" not working with "fileIn" command

2 REPLIES 2
Reply
Message 1 of 3
daniel.regi
993 Views, 2 Replies

Command line "3dsmax.exe -mxs" not working with "fileIn" command

Hi Guys,

 

Can anyone help me with the following problem:

 

I am making a Python program that can open Max files and perform different kinds of action on them.

I am using the command line to start 3ds Max and I would like to pass custom variables to 3ds Max. The new 3dsmaxbatch.exe worked fine, however, from time to time some of the files became unresponsive and it made the program unstable. So I decided to rather use "3dsmax.exe -batch" because in that case, I can get the Windows process ID of each 3ds Max instances and close them later if they freeze.

 

I tried to use the "-msx" switch to pass the variables and run a script after with the "fileIn" command. If I use the "fileIn" command, the file is not opening. It seems that it only doesn't work with "fileIn", because if I delete it I can use other commands after -mxs. 

 

Currently, I'm using the following code to start 3ds Max from Python:

\"C:\\Program Files\\Autodesk\\3ds Max 2021\\3dsmax.exe\" -batch -silent -ms -mxs \"fileIn \"S:\\*** location of the max script ***\\test.ms\"\" \"M:\\*** location of the max file ***\\maxfile.max\"

 

Does anybody have any idea why it doesn't work with "fileIn" while it works with other commands? 

 

Thank you!

Labels (2)
2 REPLIES 2
Message 2 of 3
yvesadam4016
in reply to: daniel.regi

Wish I had an answer for you as that would fix it, but I'm in the same boat it appears.

 

I'm trying to use the Send to 3ds Max package for Sublime text 3, which works perfect on my old

workstation. But I'm trying to configure my new one and I can't get it to work. Looks like

the fileIn command just isn't being received by 3ds Max.

Message 3 of 3
daniel.regi
in reply to: yvesadam4016

Thank you for your response.


In the meantime, I figured out a way how to use "fileIn" with "3dsmax.exe -mxs". It took a while.. 🙂
If you use the "3dsmaxbatch.exe" with a custom maxscript and specific arguments it works fine, but for various reasons, using 3dsmaxbatch.exe wasn't a good solution for me. As I noticed the 3dsmaxbach.exe starts a regular 3dsmax.exe so in the Windows Task Manager I added to the columns the "Command line" option and I checked what command the 3dsmaxbatch.exe uses while starting the 3dsmax.exe. So basically it seems that you can use the advanced 3dsmaxbatch.exe command line options while running a simple 3dsmax.exe from the command line.

 

You can find below the command line code that worked for me! I marked with blue the parts where you need to use custom path.

\"*** max folder ***\\3dsmax.exe\" -batch -silent -ms -_pipe:74248_131863234 -secure off -pythonver 3 -mxs \"(maxOps.mxsCmdLineArgs = dictionary #name ' custom argument':\\\"custom argument value\\\"); filein @\\\"*** maxscript location ***\\\")\" \"*** maxfile location ***\"

 

I hope it helps! 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report