Message 1 of 21
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a custom transform node. The calculation of the matrix requires access to the transform nodes rotateOrder attribute. I'm trying to store it using validateAndSet like the documentation suggests for custom attributes. But when I do that it prevents the rotateOrder attribute from changing .It's stuck as "XYZ".
MStatus normalTransformNode::validateAndSetValue(
const MPlug& plug,
const MDataHandle& handle)
{
MStatus status = MS::kSuccess;
// Make sure that there is something interesting to process.
if (plug.isNull())
return MS::kFailure;
MDataBlock block = forceCache();//???
MDataHandle blockHandle = block.outputValue(plug, &status);
//========================
// Rotate
//========================
if (plug == rotateOrder)
{
MGlobal::displayInfo("validate rotateOrder");
int rotateOrderIn = plug.asInt();//???
MGlobal::displayInfo(MString("set to:") + rotateOrderIn);
normalTransformMatrix *ltm = getNormalTransformMatrix();
ltm->setRotateOrder(rotateOrderIn);
//blockHandle.setInt(rotateOrderIn);
//blockHandle.setClean();
//dirtyMatrix();
//return MS::kSuccess;
}
This part of the code is being evaluated but it always prints a value of 0.
Solved! Go to Solution.