|
Hello;
Is there any c++ way to create a node from a custom type?
I’m searching for something more elegant than:
MGlobal::executeCommand("createNode myCustomNode")
|
|
|
|
Funny enough, by googling my question I found an answer elsewhere :)
anyway, here’s what I get :
MDagModifier dagMod; MObject obj = dagMod.createNode(myCustomNode::id)
dagMod.doIt()
That works pretty well, but how to retrieve the myCustomNode* actual pointer then?
By the way, how do I make sure myCustomNode::id is unique and not used within another plugin?
|
|
|
|
By dishing out at least 1300$ for an ADN Subscription.
Autodesk doesn’t want you to improve the software without paying them first.
Which punches people like Students or people who want to release Plug-Ins for free right in the face.
I guess taking a random ID and hoping for the best is thus the officially accepted method if you can’t afford it.
|
|
|
|
hi there
you can use second method in the class which allows you to create nodes via their names.
MObject oMyNode = dgMod.createNode("Name of the node as MString")
http://download.autodesk.com/us/...9500f5c1f8516c76ea03f92d6
btw I agree with you in terms of ADN! as far as I know APi support was free back in AW.
|
|
|
koalak 02 September 2009 09:55 AM
Funny enough, by googling my question I found an answer elsewhere :)
anyway, here’s what I get :
MDagModifier dagMod; MObject obj = dagMod.createNode(myCustomNode::id)
dagMod.doIt()
That works pretty well, but how to retrieve the myCustomNode* actual pointer then?
By the way, how do I make sure myCustomNode::id is unique and not used within another plugin?
Is this method as well correct for iterating customNode???
// loop for iterating on locator type.
for ( MItDependencyNodes iter( myCustomNode::id ); !iter.isDone(); iter.next()){
MObject = iter.item();
//do something }
|
|
|