pymxs documentation

pymxs documentation

malcomarmstrong
Advocate Advocate
7,664 Views
13 Replies
Message 1 of 14

pymxs documentation

malcomarmstrong
Advocate
Advocate

Does anyone know if they are planning to do a better set of docs for pymxs? What I have found so far is not up to scratch and mostly have found scraps and threads on a few places, but nothing definitive.

I have used the Blur python implementation for quite a while and am mostly familiar with it, but that was also quite a bit thin on the docs as well and I don't really want to have to go through the same trial and error with different syntax to see if the command works or not.

 

MaxPlus is ok(ish) but a bit long winded and not well documented either. The class list and module list in the docs are a little ambiguous and you have to trawl through other pages to find half bits of code that do not provide an example. Yes, there are some demp scripts, but they don't really cover anything to form a basic understanding of the code and its uses in simple object creation. It was a ballache having to work out how to make point helpers with the right settings and unless I find some sort of help, I will probably just go back to Maya, where python makes sense.

 

So, anyone know of a pymxs docs resource that is not the mutant that was released in the official docs?

7,665 Views
13 Replies
Replies (13)
Message 2 of 14

drew_avis
Autodesk
Autodesk

Hi there, since pymxs is a wrapper for MAXScript, we recommend you consult the MAXScript Guide for usage.  Once you have the basics of translating values between Python and MAXScript, the rest is basically pure MAXScript.

 

Drew



Drew Avis
Content Experience Designer
0 Likes
Message 3 of 14

malcomarmstrong
Advocate
Advocate

I cannot accept that as a solution to the poor level of documentation. Its an offhand way to not provide documentation to people who may be attempting coding with pymxs. You are basically saying "Go learn Maxscript, then some fundamentals about python and then guess what the syntax should be" which is ridiculous. Its not always a straightforward replacement in the syntax.

 

box name: "Bellend" length: 50 width: 20 height: 75 pos: (Point3 0 0 100) isSelected: on

 

is not directly transferable to

 

pymxs.runtime.Box(name = "Bellend", length = 50.0, width = 100.0, height = 25.0, isSelected = True, position = rt.Point3(0, 50, 0))

 

while it is similar, its not directly transferable and this is a very low level example. What about creating script controllers or accessing/creating particle systems or bone chains? What about index access to sub object components or creating a UI with python and using it? Would I have to use Maxplus for that part or can I only use pymxs? So many questions and no answers or information available, just trial and error?

 

For people who have used the Blur Python implementation that pymxs seems to be based on, this may  not be an issue, but as I have said, those starting out come up against a wall of extremely limited documentation and would be stuck. Max documentation has always been flaky, with pages to link through to, read about and the code more often than not has little or no example. If there is, its buried somewhere on a page that as stated, is one of many you have to negotiate to find out anything.

 

The documentation for Maya is great, why cant a similar redevelopment of maxs documentation be done like that?

 

The MaxPlus documentation is somewhat better, but still a convoluted mess to go through and has woefully limited, if any, direct examples. Again just links to blasé example files with poor filenames which do not deal with fundamental needs. Too much is expected of a user when using any Max python implementation and its a chore to try and learn with it when it should not be that way because Autodesk has not seen fit to provide its users with adequate documentation.

 

Much of Maxs documentation is not even at the right version when you link to it.

 

 

 

 

 

Message 4 of 14

Martin_L_A
Contributor
Contributor

I totally agree, I'm coming from Maya and learning maxscript is already a chore since the documentation is really really really poor, and the language itself not intuitive. At all.

I'm currently looking for information about pymxs but can barely find any, and it seems that learning pymxs requires years of development in maxscript to learn it, which I don't have. As malcomarmstrong mentioned, it is not directly transferable, and the information are nowhere to be found (even for simple maxscript too).

Message 5 of 14

Anonymous
Not applicable

 

Hello, 

 

I'm having the same problem than all of you. 

I was glad to hear that Python was better implemented in Max, and maybe it is, but we couldn't know, since no valid documentation exists...

Frankly, the page about pymxs is far too empty...

I just have some basic examples to show that we can not rely on maxscript documentation to use pymxs :

 

- the out value to get a layer's nodes : 

In Maxscript :

layer.nodes &thenodes

 

How does this translate in Python??

 

- Merge a max file.

Ok you have two solutions, with Maxplus and pymxs. But it was impossible to find how to translate those kind of arguments :

 

 

#useSceneMtlDups quiet:true

Are these args? stuff that we have to pass to the method?

 

Maybe there is a simple solution, and I miss knowledge, but it's impossible to find it in your documentation!

Or maybe it is just half implemented and I have to execute maxscript with MaxPlus.Core.EvalMAXScript ? That's the only solution I found for some issues and it's such a dirty way of doing things

 

 

 

"Once you have the basics of translating values between Python and MAXScript, the rest is basically pure MAXScript."

Is that really the official answer from Autodesk?

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

Do you really think that this page is enough information on how to translate maxscript to python?

Even the many examples you provide don't cover everything

 

As for Maxplus documentation, the doc is just empty of explanation, it just looks like an automatically generated doc...

I appreciate the direction the dev team is taking by implementing python, but I am so angry to lose so much time looking for basic info like that and that the answer I find in the doc is :

 

 

help() and dir() are two of the most useful functions in Python.

I know that, thanks... But if we don't have an explanation of the big picture, how the classes work together, it's pointless. I don't want to spend my day doing reverse engineering, it's just a waste of time.

For a software that is used in so many big studios, "integrated" in so many pipelines, how is it that making a proper documentation is not one of your main objective?

Maybe we'll have something working in 2025...

Regards

 

Message 6 of 14

drew_avis
Autodesk
Autodesk

Hi folks, so first of all I want to say that I didn't mean my previous comment to seem like I was dismissing your concerns.  Obviously people are not finding the pymxs documentation sufficient, and we would like to address this.  I have started creating some tickets on the pymxs docs and will look at adding more explicit examples and adding more details to the current topics.

 

One thing that helps us out a lot is specific input and questions - like this one:

 

"In Maxscript :

layer.nodes &thenodes

 

How does this translate in Python??"

 

This is very helpful, because I can create a ticket on this to update the docs and add an example (which I have done).  The solution is documented under the section "pymxs API Introduction > By Reference Parameter Handling", though not this specific example, which would be something like:

 

>>> rt.layer.nodes(pymxs.mxsreference(theNodes))
 

I will also look at adding an example that merges max files.

 

Regards,

Drew

 

 



Drew Avis
Content Experience Designer
Message 7 of 14

Anonymous
Not applicable

Hello Drew, thanks for your answer.

And I also want to apologize if I was a bit harsh in my previous comment, I spent kind of a bad day looking for things and not finding it, and some things I said were uncalled for... 

Anyway, i'm sorry and glad to hear that you will add things to pymxs doc!

Do you plan on doing a documentation in a Read the Docs style (only for the python API maybe)?

I find it very fast and clear to read. It would be the best

Thx

Regards

Message 8 of 14

drew_avis
Autodesk
Autodesk

Hi there, don't worry about it, we appreciate all feedback, even harsh feedback 🙂

 

I really like the Read the Docs style too, it's very usable and clean.  Unfortunately the product teams don't control the "look and feel" of our docs, we mostly create the content.  We're also tied to Doxygen as our API reference generator, which limits options a bit.  However, I've noticed that on the Autodesk Forge site they are using a doc system that looks a lot like Read The Docs (eg https://developer.autodesk.com/en/docs/data/v2/overview/).  I will have to ask that team about their system and see if we can adapt some of their ideas.s

 

Regards,

Drew



Drew Avis
Content Experience Designer
Message 9 of 14

Anonymous
Not applicable

How would you use the layer nodes code as shown? with pymxs, NOT MaxPlus.

 

If i want to get the nodes from a particular layer, how would I use this? As it stands, running it does nothing, so I am assuming that it needs to be included in a line of code that precedes it. This is just the sort of thing I find frustrating when trying to resolve issues with pymxs when its not documented properly. A proper example is required as it just guess work again. I have used this before, but its not really a good way as I have to then filter out the geometry to get the nodes. I would just like to use the nodes &nodes if possible as the code below is cubersome. I collect the layers and then in a for loop, go through them and collect the nodes in a list.

layer_nodes = rt.refs.dependents(all_layers[i].layerAsRefTarg)

 

Also, when typing code, when you get to a certain point, there are no further .attributes to use in the auto complete section, just "getmxsprop" and "setmxsprop" but tagging known attributes works, but unless you know this, then it will confuse you.

if i type:

layer_nooodes = rt.LayerManager.

the next option is as I have said, get or set, but if i type:

layer_nooodes = rt.LayerManager.GetLayerFromName(rt.LayerManager.GetLayer(1))

then its ok, but max does not offer you anything after the first attribute and as said, if you dont know and are applying "trial and error" to the code, then it is a nightmare to try and work with.

I could not find the reference to this in the docs as ytou said is there, link please.

 

 

0 Likes
Message 10 of 14

Huston94
Enthusiast
Enthusiast

The part with these "#someSortOfName" types of arguments/attributes (no idea what they are called) has been the my constant headache. I will get rolling on a Python script and then inevitably I will run into a portion that utilizes them and there is very little reference to what they are let alone how to translate them into a pymxs script. And as mentioned in this thread I REALLY don't like using the "MaxPlus.Core.EvalMAXScript" for anything.

 

Maxscript examples

vfbControl #trackmouse false

 

How I though it would work in pymxs

rt.vfbControl("#trackmouse", False)

or

rt.vfbControl(rt.someKindOfFunction("#trackmouse"), False)

 

Does anyone have any info on this? This would be a HUGE lifesaver for me.

0 Likes
Message 11 of 14

denisT.MaxDoctor
Advisor
Advisor
rt.vfbControl("trackmouse", False)

all mxs Name Values go to pymxs as strings

0 Likes
Message 12 of 14

drew_avis
Autodesk
Autodesk

You are looking for:

rt.vfbControl(rt.name("trackmouse"), False)

See "MAXScript Names" here: http://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=__developer_using_pymxs_html

 

Hope that helps,

Drew



Drew Avis
Content Experience Designer
Message 13 of 14

denisT.MaxDoctor
Advisor
Advisor

@drew_avis wrote:
rt.vfbControl(rt.name("trackmouse"), False)

yes. this's the right answer. i was wrong with auto-conversion of name to string

0 Likes
Message 14 of 14

Huston94
Enthusiast
Enthusiast

Thank you so much!!!

0 Likes