Message 1 of 9
set attribute value in matrix type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, How I can create a matrix for control position of an object and save it in attributes?
I write this codes but it crashed. i have rotate and translate:
MPlug outMatrixAttrPlug(oThis, outMatrixAttr);
MDataHandle outMatrixHandle = outMatrixAttrPlug.asMDataHandle();
MTransformationMatrix m;
double scale[3] = { 1,1,1 };
m.setScale(scale, MSpace::kTransform);
MEulerRotation rr(MVector(0,45,0), MEulerRotation::RotationOrder::kXYZ);
m.rotateTo(rr);
MVector translate(0, 11, 0);
m.setTranslation(translate, MSpace::kTransform);
//
outMatrixHandle.setMMatrix(m.asMatrix());