Custom node slowness

56 views
Skip to first unread message

Hector Jimenez Muñoz

unread,
Dec 5, 2024, 2:55:37 AM12/5/24
to Python Programming for Autodesk Maya
Hello! Nice to meet you! I'm new on this forum and it's a pleasure being here!

I am trying to create a new MPxBlendShape node, but using a new custom attribute slow down the computation when using keyframes, if I use the 'weight' attribute instead of the new one, doesn't have that slowness:
BlendShapeTemplate0.gif

Is there any way of aligning my new attribute to the 'weight' attribute without loosing performance when using keyframes?

Thank you so much for your attention.

Best regards,
Héctor

Marcus Ottosson

unread,
Dec 5, 2024, 5:11:09 AM12/5/24
to Python Programming for Autodesk Maya
Some clarifying questions:

1. Why not use the 'weight' attribute if it's faster?
2. What does your custom attribute do, how was it created and is there any compute handler for it?
3. Can you reproduce the slowness in another superclass, like the MPxSurfaceNode?
4. Can you share a reproducible source file?

Hector Jimenez Muñoz

unread,
Dec 5, 2024, 6:08:09 AM12/5/24
to Python Programming for Autodesk Maya
I will answer each one of the questions:

1. Why not use the 'weight' attribute if it's faster? -> Because I need to replicate that efficient behaviour in custom attributes, to avoid being limited using only that one.
2. What does your custom attribute do, how was it created and is there any compute handler for it? -> My custom attribute affects the outputGeom attribute. Do I need a custom compute handler for it?
3. Can you reproduce the slowness in another superclass, like the MPxSurfaceNode? -> Yes, initially I tested using an MPxDeformerNode, but I got the same behaviour on my custom attributes when are keyframed.
4. Can you share a reproducible source file? I can share the Python script. For the Maya scene I'm using an sphere with a high resolution (around 1.1 Million verts), with low resolution it doesn't affect too much, but with higher it's noticeable. For the input attribute, I'm using a floatConstant with 2 keyframes (at 0 and 120).

Thanks for the help!
templateBlendShape.py

Hector Jimenez Muñoz

unread,
Dec 9, 2024, 10:05:36 AM12/9/24
to Python Programming for Autodesk Maya
After running some other tests, I realised that even using the weight native attribute, is not updating the output geometry I believe that's why it was running at 100 fps when using keyframes.
Adding the logic to the setDependentsDirty method to force and trigger the deformation to update the output mesh using the weight attribute makes the computation work at 10 fps...
BlendShapeTemplate3.gif
Reply all
Reply to author
Forward
0 new messages