// The implementation here is a bit different from its counterpart C++ sample because // .NET SDK decides not to support the obsolete C++ API: // // bool connectTargetAttribute (void *opaqueTarget, int index, MObject &constraintAttr); // protected override bool connectTarget(MDagPath targetPath, int index) { try { MObject targetObject = new MObject(targetPath.node); MFnDagNode targetDagNode = new MFnDagNode(targetObject); connectTargetAttribute(targetPath, index, targetDagNode.attribute("worldMesh"), GeometrySurfaceConstraint.targetGeometry); } catch (Exception) { MGlobal.displayError("Failed to connect target."); return(false); } return(true); }
// The implementation here is a bit different from its counterpart C++ sample because // .NET SDK decides not to support the obsolete C++ API: // // bool connectTargetAttribute (void *opaqueTarget, int index, MObject &constraintAttr); // protected override bool connectTarget( MDagPath targetPath, int index ) { try { MObject targetObject = new MObject(targetPath.node); MFnDagNode targetDagNode = new MFnDagNode(targetObject); connectTargetAttribute(targetPath, index, targetDagNode.attribute("worldMesh"), GeometrySurfaceConstraint.targetGeometry); } catch (Exception) { MGlobal.displayError("Failed to connect target."); return false; } return true; }