View Full Version : Storing hypergraph/node

03 March 2011, 07:58 PM
Hi guys,

Working in python, I want to copy part of the hypergraph in memory. I thought to go node by node, listing and storing their connections.

I need to save the state of a node somewhere (for instance, into an object) and be able to recreate an exact copy of that node later on. That means no use of cmds.duplicate() function.

What I am looking for is a general procedure that works for any kind of node. for instance, if we have a transform node, it will store the transform data, plus all the hidden values. If the node is a shape, I would be able to save all the geo points and so on.

I could use the flag type to first recognize the type of node and reinstantiate it by using cmds.createNode(<nodeType>, ...), but in this way I create an ex-novo node of the same type of the previous, without copying all the information stored in.

I tried to iterate over all the attributes and store their values, but even using flags such as "r" for the readable only, "hd" for the hasData attributes and so on, I still get weird results.

Anybody out there can figure a solution? Maybe the solution the simplest one, but my ideas lightbulb is dark so far..



03 March 2011, 10:10 PM
Export Selected...? ;)


03 March 2011, 10:27 PM
Uhhmm.. Yes and no. I would be able to have a copy of the whole structure in memory, so I can act on specific nodes and links and rebuild the whole network, without the need of navigating through the scene. But you gave me a good input to find a workaround and just in case probably the solution of exporting the selected object and then doing my stuff during the import may work.. I will let you know.

Thank you

CGTalk Moderation
03 March 2011, 10:27 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.