//------------------------------------------------------------ MStatus moveManip::connectToDependNode(const MObject &node) //------------------------------------------------------------ { MStatus stat; // Connect the plugs // //für späteres onScreenGl view = M3dView::active3dView(); MFnDependencyNode nodeFn(node,&stat); if(stat == MS::kFailure)stat.perror("Fehler bei depNode: "); MPlug tPlug = nodeFn.findPlug("endPoint", &stat); if(stat == MS::kFailure)stat.perror("Fehler bei tPlug: "); MFnFreePointTriadManip freePointManipFn(fFreePointManip); //transFn initialisieren transFn.setObject(fFreePointManip); stat = freePointManipFn.connectToPointPlug(tPlug); if(stat == MS::kFailure)stat.perror("Fehler bei connectToPlug: "); freePointIndex = freePointManipFn.pointIndex(); /* translatePlugIndex = addManipToPlugConversionCallback(tPlug, (manipToPlugConversionCallback) &moveManip::moveOthersCB); /* addPlugToManipConversionCallback(freePointManipFn.pointIndex(), (plugToManipConversionCallback) &moveManip::moveOthersCBReverse); */ MPlug togglePlug = nodeFn.findPlug("fv"); MFnToggleManip toggleFn(fToggleManip); toggleFn.connectToTogglePlug(togglePlug); toggleFn.setLength(0.0); addPlugToManipConversionCallback(toggleFn.startPointIndex(), (plugToManipConversionCallback) &moveManip::setPointCB2); INVIS(cout<<freePointIndex<<" = freePointIndex "<<endl;)
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); }