Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

MPxGeometryFilter help sample code not working on Maya 2022 latest updates (tested on 2022.4 and 2022.5)

MPxGeometryFilter help sample code not working on Maya 2022 latest updates (tested on 2022.4 and 2022.5)

golaem
Enthusiast Enthusiast
328 Views
1 Reply
Message 1 of 2

MPxGeometryFilter help sample code not working on Maya 2022 latest updates (tested on 2022.4 and 2022.5)

golaem
Enthusiast
Enthusiast

Hello,

 

We are using some nodes inheriting from MPxGeometryFilter for our plugin. After meeting some bugs and doubting about our implementation, we went back to testing the vanilla sample using ::compute() method that can be found on the help :
https://help.autodesk.com/view/MAYAUL/2022/ENU/?guid=Maya_SDK_cpp_ref_class_m_px_geometry_filter_htm...

 

We use compute() and not deform(), as we do have some computation to do for all inputs at once, namely an IA inference.

This sample code has only been modified to get the envelope value, and shift all vertices by envelope value in 3 dimensions, in order to see quickly if things are working. Deformation code is  :

float envelopeValue = dataBlock.inputValue(envelope).asFloat();

for (; !iter.isDone(&status); status = iter.next()) {
 MPoint pt = iter.position();
 pt += MPoint(envelopeValue, envelopeValue, envelopeValue);
 iter.setPosition(pt);
}


It has been built for 2022.4, 2022.5 and 2020.4.

 

On 2020.4, things are all good, the input mesh is shifted in all directions (tested with a basic cube in 0,0,0).

 

But on 2022.4 and 2022.5, the exact same code does not work. In debug mode, I can see that the iterator directly goes to the end of loop as if it had no vertex.

I tried using the deform() method and put this code as deformation, and things are OK with it.

What has changed in the MPxGeometryFilter default compute, or geometry iterator code, since 2020.4 ? Could you point me the the required modifications to use a custom MPxGeometryFilter::compute() method or send me the default implementation of MPxGeometryFilter ::compute for 2022.4 and further versions ?

 

Thank you

 

Sebastien / Golaem

0 Likes
329 Views
1 Reply
Reply (1)
Message 2 of 2

golaem
Enthusiast
Enthusiast

Here is a minimal sample plugin to reproduce that.


You may use directly the src folder and make your own project, or use cmake and tweak the platform (vs2017) and MAYA_VERSION and MAYA_ROOTDIR

On Maya 2020, launch and load the plugin, create a cube, and after selecting the cube if not already done, call the cmd in a python invite file :

cmds.deformer(type="GeometryFilterSample", before=True)
 
You will see that the cube is shifter, and playing with envelope moves the cube
 
Repeat and rinse with 2022, the cube is not moving.
Debugging the plugin will let you see that the iterator skips the deformation code.

 

Thank you for any help

 

 

 

0 Likes