How to inspect existing global attributes?
568 3 1-
- ajz3d
- Member
- 617 posts
- Joined: Aug. 2014
- Offline
-
- tpetrick
- Staff
- 613 posts
- Joined: May 2014
- Offline
-
- ajz3d
- Member
- 617 posts
- Joined: Aug. 2014
- Offline
I'd also like to ask about the lifetime of a Graph (Global) variable. It seems that global variables persist even if nodes that created them are deleted from the graph.
For example, if I:
Then even though there is nothing in the graph that creates the
I can delete a global variable by temporarily creating an Attribute Delete TOP, piping it to anything and cooking it. Afterwards this node can be removed. This is very counterintuitive and extraordinary, which brings me to a question: is this behavior intentional? Why do global variables live on without the nodes that created them?
For example, if I:
- Drop an Attribute Create TOP and create a string global variable named
foo
and set it tobar
. - Cook this node.
- Delete it.
- Drop another Attribute Create TOP, create a string attribute named
dar
(of any scope) and set its value to`@foo`
.
Then even though there is nothing in the graph that creates the
foo=bar
attribute, it will still be available and its value will be pulled from thin air. As a result, the value of dar
becomes bar
. This persists between hipfile reloads.I can delete a global variable by temporarily creating an Attribute Delete TOP, piping it to anything and cooking it. Afterwards this node can be removed. This is very counterintuitive and extraordinary, which brings me to a question: is this behavior intentional? Why do global variables live on without the nodes that created them?
Edited by ajz3d - Feb. 12, 2025 17:11:22
-
- tpetrick
- Staff
- 613 posts
- Joined: May 2014
- Offline
If you want the global attribute to be deleted when the work item that created it is deleted, then you should create the attribute using the Graph (Bound) type instead of the Graph (Global) type as described here: https://www.sidefx.com/docs/houdini/nodes/top/attributecreate.html#stringscope [www.sidefx.com]
Truly global attrbutes are saved as part of the graph if the Save Graph Attributes to .hip toggle is enabled on the network manager node. The purpose of unbound global attributes is provide a persistent place that work items can score key/value data, for example if you wanted to output file versions between multiple consecutive cooks of the same TOP network.
Truly global attrbutes are saved as part of the graph if the Save Graph Attributes to .hip toggle is enabled on the network manager node. The purpose of unbound global attributes is provide a persistent place that work items can score key/value data, for example if you wanted to output file versions between multiple consecutive cooks of the same TOP network.
-
- Quick Links