MManipData swissArmyLocatorManip::startPointCallback(unsigned /*index*/) const { MManipData manipData; MFnNumericData numData; MObject numDataObj = numData.create(MFnNumericData::k3Double); MVector vec = nodeTranslation(); numData.setData(vec.x, vec.y, vec.z); manipData = numDataObj; return manipData; }
void swissArmyLocatorManip::draw(M3dView & view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus status) { MPxManipContainer::draw(view, path, style, status); view.beginGL(); MPoint textPos = nodeTranslation(); char str[100]; sprintf(str, "Swiss Army Manipulator"); MString distanceText(str); view.drawText(distanceText, textPos, M3dView::kLeft); view.endGL(); }
void customAttrManip::updateManipLocations() // // Description // This method places the manip in the scene according to the information // obtained from the attached transform node. The position and orientation // of the distance manip is determined. // { MVector trans = nodeTranslation(); MQuaternion q = nodeRotation(); MFnDistanceManip freePointManipFn(fManip); MVector vecX(1.0, 0.0, 0.0); freePointManipFn.setDirection(vecX); freePointManipFn.rotateBy(q); freePointManipFn.setTranslation(trans, MSpace::kWorld); }