Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

MPxNode derived Nodes get deleted on saving the scene

MPxNode derived Nodes get deleted on saving the scene

Anonymous
Not applicable
574 Views
2 Replies
Message 1 of 3

MPxNode derived Nodes get deleted on saving the scene

Anonymous
Not applicable

Hi there, 

 

I have some of my user defined nodes in the nodegraph editor and when I save the scene,

some get deleted (not visible in the outliner window anymore, so not just removed from the node editor).

 

Both the destructor of the node and the callback 

MDGMessage::addNodeRemovedCallback

get called. I use the callback to get notified when a node is deleted in the node editor, cause the destructor is only called on save/open/new scene. 

 

My nodes are not connected to any maya nodes and I couldn't make out the pattern, which get deleted. 

 

Some are connected with each other, some have no connections (I know that does not make sense, its testwise). 

 

So I need to understand, when Maya does delete nodes, cause deleting them on save is really unintended.

 

 

Sounds like scene cleanup to me, so do I need to connect to some maya node to avoid deletion? 

 

Anybody ideas?

 

Best ,

Kai

0 Likes
Accepted solutions (1)
575 Views
2 Replies
Replies (2)
Message 2 of 3

cheng_xi_li
Autodesk Support
Autodesk Support

Hi schubert,

 

Normally the nodes won't be removed. Can you upload a sample to demostrate this problem? I can try to test it and figure out what happened.

 

Yours,

Li

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Somebody in the CGSociety forums knew the solution. 

 

I had to use these functions of MPXNode:

just set it in the postconstructor of my MPXNode derived class: 

 

Snippet

setExistWithoutInConnections(true);
setExistWithoutOutConnections(true);

 

Because yeah, some of my nodes can exist without outputs and inputs..

 

All good on that, 

Kai

 

p.s. now with company account

0 Likes