Message 1 of 4

Not applicable
06-08-2016
09:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a wierd unexpected crash in DependEngine.dll. I have a custom MPxNode in c++, I have removed all code but the very minimum to repro this bug. I also have a very simple .ma file, only my node and a locator.
To crash, I launch Maya 2016, open this .ma file, then click the timeline to change the time twice. On the second time change it will crash inside my compute, but actually inside the call to MDataHandle::setFloat, which is totally strange.
Here the relevant part of the .ma file:
createNode transform -n "Left_Ctrl" -p "Left_Grp"; (skip transform attributes) createNode myNode -n "myNode1"; addAttr -w false -ci true -sn "lips_AA" -ln "lips_AA" -at "float"; connectAttr ":time1.o" "myNode1.tm"; connectAttr "myNode1.lips_AA" "Left_Ctrl.translateX"
And the simplified node basically has only the initialize and this:
class myNode: public MPxNode (skip trivial other stuff) MStatus myNode::compute( const MPlug& plug, MDataBlock& block ) { MStatus status; if (MFnDependencyNode(thisMObject()).isNewAttribute(plug.attribute())) { { MDataHandle data = block.outputValue(plug.attribute(), &status); data.setFloat(0.0f); // Will crash inside this call block.setClean(plug.attribute()); return MStatus::kSuccess; } } return MStatus::kSuccess; } MStatus myNode::setDependentsDirty( const MPlug& plugBeingDirtied, MPlugArray &affectedPlugs ) { if (plugBeingDirtied == MPlug(thisMObject(), xml) || plugBeingDirtied == MPlug(thisMObject(), time) || plugBeingDirtied == MPlug(thisMObject(), forcedirty)) { // Add all dynamic outputs to affectedPlugs MFnDependencyNode fnDependNode(thisMObject()); for ( unsigned i=0; i<fnDependNode.attributeCount(); i++ ) { MObject attribute = fnDependNode.attribute(i); if (fnDependNode.attributeClass(attribute)==MFnDependencyNode::kLocalDynamicAttr) { MPlug plug(thisMObject(), attribute); affectedPlugs.append(plug); // with the supplied .ma test file, this will be called once on the plug called lips_AA } } } return( MS::kSuccess ); }
Solved! Go to Solution.