Is pymxs python scripting in Max like Maya's cmds?

Is pymxs python scripting in Max like Maya's cmds?

Anonymous
Not applicable
1,678 Views
6 Replies
Message 1 of 7

Is pymxs python scripting in Max like Maya's cmds?

Anonymous
Not applicable

OK, I struggled with that title. I'm a long time Maya user and a god awful scripter. That being said, I could make some pretty mean python scripts in Maya because the Maya docs break down almost everything you need with examples for almost everything. I'm referring to this section in the docs.

https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__CommandsPython_index_html

 

So... I'm now learning me some python scripting for Max. I'd rather not use my time to learn maxscript and if I can stay in the python world that would be better for me. I'm hoping pymxs works in a similar way to Maya's cmds. If so is there also a similar page in the docs to what I shared above from Maya? 

 

As a hint, the first 3 commands I'm looking for in Max would be ones that match Maya's cmds.undoInfo(), cmds.ls() and cmds.xform().

 

Thank you all.

0 Likes
1,679 Views
6 Replies
Replies (6)
Message 2 of 7

denisT.MaxDoctor
Advisor
Advisor


Yes. It's almost the same mechanic.

 

If you want to use pymxs in 3DS MAX, you must know MaxScript the same well as MEL for scripting using Python cmds working in Maya. The good news is that MaxScript, like MEL, comes with good documentation, help, and examples.

 

Message 3 of 7

Anonymous
Not applicable

Thank you for the reply. It's funny you say that because I have been python scripting in Maya for years and I do not know MEL at all.

 

Would you be able to share with me the Maxscript docs and examples that could help me get started?

0 Likes
Message 4 of 7

denisT.MaxDoctor
Advisor
Advisor

When I talk about knowing MaxScript or MEL, I mean knowing their commands and classes, not the syntax of the language itself ... but that doesn't matter.

All MaxScript documentation is its Help. Nothing else, but it's much better than any other MAX documentation.

Message 5 of 7

denisT.MaxDoctor
Advisor
Advisor

Well... As I know the best and fastest way to learn any programming language is to have a task and to know how to ask questions. There are many skilled members on this forum who are ready to help you.

 

Message 6 of 7

Anonymous
Not applicable

Thanks Denis, that's great. I do have a task and I guess the way I asked was not clear so I'll try again. I think once I understand how to run one Maxscript command from python, others will fall in line but so far I've been going through the docs and I cannot figure it out, so here's my question.

 

What is the equivalent command in Maxscript to Maya's cmds.xform() command, and how would I call that from python?

 

Thank you,

 

 

0 Likes
Message 7 of 7

malcomarmstrong
Advocate
Advocate

Not sure what you want to do in terms of Xform as it differs slightly in Maya, but here is an example of resetXform. It may help. 

 

Im sure that DenisT will point you to a solution also r as he has staed, look at the docs, they are well laid out. Here is a link to the Maxscript page, its a 2016 page, but its still the same.

ResetXform 

 

import pymxs
rt = pymxs.runtime
a_box = rt.box() # create a box.

a_box.name = "My_Box"

a_box.scale = rt.Point3(10,10,10) # scale up 10x

rt.ResetXform(a_box) # scale is back to 100%

 

Hope this helps in some way.

0 Likes