Loading Maxscripts Dynamically with pymsx

Loading Maxscripts Dynamically with pymsx

andre.anjos
Explorer Explorer
1,370 Views
3 Replies
Message 1 of 4

Loading Maxscripts Dynamically with pymsx

andre.anjos
Explorer
Explorer

Hi there,

 

I'm figuring out a way of dynamically building a Menu with python and maxscripts.

I manage to create the menu, submenus and even actions for the python scripts but not quite getting how to trigger the maxscripts.

 

Perhaps below can help? Just don't know what to add at the moment.

pymsx.runtime.execute(???)

 

Thank you in advance!

 

Andre

0 Likes
Accepted solutions (1)
1,371 Views
3 Replies
Replies (3)
Message 2 of 4

andre.anjos
Explorer
Explorer

Does anyone have some experience with this?
Perhaps there is another way with Python?

 

Thank you in advance!

0 Likes
Message 3 of 4

drew_avis
Autodesk
Autodesk
Accepted solution

Hi there, you can execute MAXScript scripts using 'filein()', so something like this should work:

script = r'C:\My Documents\3ds Max\scripts\my_script.ms'
pymxs.runtime.filein(script)

 

Hope that helps, 

Drew



Drew Avis
Content Experience Designer
Message 4 of 4

andre.anjos
Explorer
Explorer

@drew_avis 

Hi Drew,

Thank you very much!

Will give it go and let you know!

 

Thanks again!

 

Andre

0 Likes