MDGModifier !

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  10 October 2005
MDGModifier !

When create a sphere in maya, looking in hypergraph, i see that there are two node with connection between them, one is nurbsSphere, and the other is makeNurbSphere. The ouputsurface attribute of makeNurbSphere is connected to the create Attr of nurbsSphere.
So, i tried to make the same thing with maya API.

When using MFnDependencyNode to create node, it work ok. But when i use MDGModifier, it doesn't work (the compilation is ok). Load my plugin in maya, execute the my command, and nothing happen, no node was created !

Here is my code.


class myCmd : public MPxCommand{
virtual MStatus doIt(const MArgList&);
virtual MStatus undoIt();
virtual MStatus redoIt();
virtual bool isUndoable() const{return true;};
static void *creator(){return new myCmd;}
MDGModifier mdg;

MStatus initializePlugin(MObject obj){
MFnPlugin pluginFn(obj,"","1.0");
MStatus stat;
stat = pluginFn.registerCommand("myPlug",myCmd::creator);
stat.perror("registerCommand failed");
return stat;

MStatus uninitializePlugin(MObject obj){
MFnPlugin pluginFn(obj);
MStatus stat;
stat = pluginFn.deregisterCommand("myPlug");
stat.perror("deregisterCommand failed");
return stat;

//doIt function

MStatus myCmd::doIt(const MArgList&){

MObject sphere=mdg.createNode("nurbsSurface");
MObject makeSphere=mdg.createNode("makeNurbSphere");
MFnDependencyNode Fnsphere(sphere);
MFnDependencyNode FnmakeSphere(makeSphere);

return redoIt();

MStatus myCmd::redoIt(){
return mdg.doIt();

MStatus myCmd::undoIt(){
return mdg.undoIt();

The implementation like the one of David Gould (complete maya program).

Did i miss something ?
  10 October 2005
It take me a long time to test other nodes like blinn, lambert... and these nodes work ok, only nodes like nurbsSphere, circle .... doesn't.
I don't know why !!!
  10 October 2005
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:15 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.