- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I have come across a very odd crash that I cannot explain.
(by the way, using Maya 2020)
So, I have got a custom MPxLocatorNode and at each frame, I am reading its parent's transform values.
The parent is connected to the output of a decomposeMatrix node and I get correct values... until I don't.
At some point (not always the same frame), it throws an exception saying:
Exception thrown at 0x00007FF803A3C454 (Foundation.dll) in maya.exe: 0xC0000005: Access violation writing location 0x0000000000000000.
Here is a code snippet.
MStatus status;
const MFnDagNode dagNode( object, &status ); // Object is my custom MPxLocator node's MObject
if( status != MStatus::kSuccess ) return;
const MObject parentObject = dagNode.parent( 0 );
const bool null = parentObject.isNull(); // is false
const MFnDagNode parentDag( parentObject );
const MString apiType = parentObject.apiTypeStr(); // is kTransform
const MFnTransform transform( parentObject, &status ); // status is fine {fStatusCode=0 '\0' fInternalStatusCode=255 'ÿ' fStatus=true }
MString name = transform.name(); // has the correct name
const MTransformationMatrix matrix = transform.transformation(); // Crash
As you can see, I still get the correct name and api type of the MFnTransform.
But on transform.transformation(), I get a crash.
I also get a crash at some point if I try transform.getTranslation( MSpace::kTransform, &status );
I know this is not much to work with, but I was hoping for suggestions on how to maybe check if the transform is valid, or being able to get the values any other way.
I'm fine if there is a test saying that there is bad data in the transform and to not attempt to read it.
I just don't want a crash.
Any help would be much appreciated.
Cheers,
Sebastian
Solved! Go to Solution.