PDA

View Full Version : How do I create a node that only I can delete?



3dleo
03-03-2011, 01:33 PM
Hello!!
I have been using MEL for a while. I have created a small plugin using MEL, which creates a main node that holds the plugs of many other nodes and thus controls their pocesses. The main node can be deleted using the delete option in the plugin's menu which systematicaly removes all the nodes from the scene without leaving any junk nodes, but the main node also can be deleted directly from the outliner. That will leave all dependent nodes isolated(no meaning of them without the main node).
1) I want to make the main node non-deletable by the user but it should be deletable using the delete option in the plugins menu.
-or-
2) If the main node is deleted directly by the user, all the dependent nodes should also be deleted automaticaly. I do not want to use scriptNodes or scriptJobs because they themselves can be manipulated by the user.

If you have an API solution, then please give me the complete program that deletes the related nodes if the main node is deleted. please include the headers, class, doit, initializeplugin etc.. because I am weak at that.

bravo2zero
04-26-2011, 07:55 AM
You would be better off using maya api to control creation and destruction of your nodes .

The way maya is built is node biased so if you delete a node you can add a new one back in and reconnect it to the rest of the node network .

What you can do is parent nodes to the master so if you delete the master or controlling node the rest of the nodes are removed as well , how ever i dont think you can do that with the mel interface , only the maya api through c++.