[Python] MaxPlus : Object Type?

[Python] MaxPlus : Object Type?

Anonymous
Not applicable
2,644 Views
5 Replies
Message 1 of 6

[Python] MaxPlus : Object Type?

Anonymous
Not applicable

ClassIds resource is a bit empty :

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

 

I am trying to list objects in a scene, then filter bones.

 

From the "demoTypeCasting.py" file, I tried to the get the type from the node GetBaseObject().

From a scene with boxes object and bones getting 2 different object : Animatable(Box) and Animatable(Bone).

 

But well, how to do a comparison of type with such as :

if node.GetBaseObject() is Animatable(Bone): 

    print (" is a bone")

 

Still in the documentation, I find nothing matching with "bone" (using the rearch tool filtering with Python)

 

Is there by chance more demo files than the C:\Program Files\Autodesk\3ds Max 2017\scripts\Python\ resources?

Or maybe another community sharing more about 3dsmax2017 python?


Learning is really painful yet.

Thank you for your assistance 🙂

0 Likes
2,645 Views
5 Replies
Replies (5)
Message 2 of 6

Swordslayer
Advisor
Advisor

Save the output of help(MaxPlus) somewhere handy, you can then do a fulltext search for stuff like this - for example for the MaxPlus.ClassIds.Bone (or BoneGeometry which is probably what you're after) that you can use for comparisons here.

 

node.GetBaseObject().ClassID == MaxPlus.ClassIds.BoneGeometry
0 Likes
Message 3 of 6

Anonymous
Not applicable

Oh thanks it works....
Dude really thanks...

 

 

Not sure who is in charge of the python support but my feedbacks would be :

 

For some curiosity, reading the doc doesn't make any sense...

There is no any exemple.

If you find the INode.ExplodeNodes() from the documentation which I have no idea what is for...  I can't even be curious and read something smart about it then think I could use it for this or that...

 

No really, I do not get it...

Reading the documentation from Maya or Unity3d or even pure Python or c# thing, it always totaly makes sense and often so interesting to read.

 

3dsmax MaxPlus doc... no I do not get it... 

 

Now trying to list animation key from a INode, below my way of research...

↓- iNode >>> Nothing matches with "animation"
http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__developer_maxplus_python_api_introduction_anim... : Yeah ok, animation interval. I am glad.

- Found a class "Animatable" (which I have no idea what is for since there is not even any explanation)

- it contains something like myNode.GetNumKeys() and it return -1. (my object does have animation keys)

- now from Animation class.... Well that's full of statics, probably 3dsmax properties from the timeLine editor...

- Google : "3dsmax 2017 python list animation key" ... almost nothing....

- Google : "3dsmax 2017 python key list from object" ...nothing....

- Google : "3dsmax 2017 python tutorial" ---> A lot of thing from previous Python 3dsmax version not even working (BLUR?)

 

The exemple from the demoAnimation.py file doesn't even care of the iNode animation.

It defines an Animation node, which   anim.SetAnimateButtonState(True) will move object from script and I guess using the autoKey feature will record keys (the worse ever method to generate animation from script method).

 

Finally not reference for object animation node from MaxPlus in the doc?

 

I just wish to learn more about those 3dsmax thing really =_=#....

 

0 Likes
Message 4 of 6

Swordslayer
Advisor
Advisor

MaxPlus is a direct translation of 3ds max C++ SDK, all the classes, methods, logic etc. are explained there (see the 3ds Max SDK Programmer Guide; as a result, using MaxPlus is quite unpythonic). Without knowing the difference between node and object, for example, you'd have a hard time doing node related stuff.

 

If you wanted something artist friendly, try pymxs instead (since you're using 2017), that one mimics maxscript (and is much closer to the blur python you mentioned) and as such you'll find the explanations in maxscript reference.

0 Likes
Message 5 of 6

Anonymous
Not applicable

pymxs sounds like maya.cmds... gonna have a look thanks! ^_^

 

Apparemently, some other falks was having some hard time with MaxPlus as animation key a while ago too!

http://stackoverflow.com/questions/37606543/how-to-create-a-keyframe-with-python-api-for-3d-studio-m...

-http://forums.cgsociety.org/showthread.php?t=1370317

 

One more time thanks for your help on Tech-Artists too! ^_^!

0 Likes
Message 6 of 6

Swordslayer
Advisor
Advisor

@Anonymous wrote:

pymxs sounds like maya.cmds... gonna have a look thanks! ^_^

 


Bit more pythonic, though (no constant string formatting just to get property of an object).

 


@Anonymous wrote:

Apparemently, some other falks was having some hard time with MaxPlus as animation key a while ago too!

http://stackoverflow.com/questions/37606543/how-to-create-a-keyframe-with-python-api-for-3d-studio-max

-http://forums.cgsociety.org/showthread.php?t=1370317

 

One more time thanks for your help on Tech-Artists too! ^_^!


 

Yeah, but he was on max 2016 where there was no pymxs. With pymxs it's as simple as setting the attribute within attime context (with animate on).

0 Likes