QUOTE(Rob Bateman @ 12/06/07, 04:28 AM) [snapback]277658[/snapback]
DagPath != DagNode. The MDagPath is a first type object - basically a handle to a shape or a transform. The MFnDagNode manipulates node's of type MFn::kDagNode. The dag node contains one or more dag paths (for each instance), and a whole load of other attributes and functionality. Similarly MFnSkinCluster manipulates nodes of type MFn::kSkinCluster, or mel name skinCluster. take a look in the Maya help DGnode & Attributes reference for details on the node's attributes, then get/set that data either by using the findPlug() methods on MFnDependencyNode, or the easier to use MFnSkinCluster functions. There is no MSkinCluster object in the API. Neither is there an MDagNode..... They are all referenced by MObjects and transforms & shapes can also be referenced by MDagPaths if you want to be able to specify an instance of that object in the scene. (i.e. same geometry, but parented under 2 transforms, which gives you 1 MObject for the shape, and 2 MDagPaths to represent the instance of that shape).
And tell your boss from me that using the mel command to create the skin cluster is easier than using the API to do everything (i just use MGlobal::executeCommand to create it, then MFnDependencyNode::findPlug() to manipulate the nodes data - which IS the fastest way to do it).
If you do the same thing entirely with get/set with mel (using undoInfo to turn on the undo stack), it's only about 10% slower than the API.
ok thanks.
i want to complete this command "skin>bind skin>smooth bind" by
API functions. so i have this question and i think i should use skinCluster to do it.
does this work? and i don't know how to use MFnskinCluster.
firstly, i know using mel is easier to do this.
and let me introduce my work and myself.
i am studing 3d animation to get my Master degree, and my Master
paper is that constructing somebody's motion library( include lots of
action feature). i choose maya as my programme platform.
and the C++ coder has larger market than mel coder
in my country. however, my boss want me to do C++ programme
so that maybe i can find a better job later.
now when user push the menu( or button ), i want to know what APi functions
be called inside maya. my work is that code functions to complete my model's
action(just like pull the translate/rotate/scale controller).
thanks again for your help. i will do my best to finish it.