PDA

View Full Version : Delete specific input nodes!


Swahn
05-24-2007, 07:53 AM
Hello, is it possible to point a delete command to specific input nodes on an object?

The thing i need is to check if there are transformGeometry input nodes present in the object and then delete them.
I figured out the easiest way to check the first part is if the object's .rpx/y/z are != than 0 (when freeze transform is applied with flag -apply true) but after that i need to delete all transformGeometry within that selected object. If i use wildcard like ("transformGeometry*") then all the nodes with this string will be deleted. I need to select and delete only the nodes of this string within the selected object.
How can i do this?


I guess this isn't impossible to do with MEL.
If just anyone could help me with this :)
Thanks.

Sick Spider
05-24-2007, 10:37 PM
There you go:
If you want to delete the input node with no question asked, even if its more than one, use:

delete `listConnections -d off -s on myNode.theAttrWithConnection`;

If you want to list them and then delete, go:

string $myInputs[] = `listConnections -d off -s on myNode.theAttrWithConnection`;
print $myInputs;

The "myNode" is the node you are querying, this will not be deleted.
The "theAttrWithConnection" is the Attr that has the connection IN to "myNode" node, whatever gives it the info, will be deleted.
For more look into "listConnections" command.
Hope that helps.

CGTalk Moderation
05-24-2007, 10:37 PM
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.