検索 - User list
Full Version: Creating Global Attribute through Python
Root » PDG/TOPs » Creating Global Attribute through Python
blaven
Hello:
I know how to create a global attribute through the AttributeCreate node but I was wondering how I would create one in a PythonProcessor or PythonScript node? I saw the docs mention using pdg.Graph but I'm not sure I'm using it correctly as I don't seem to see any attributes created ( https://www.sidefx.com/docs/houdini/tops/attributes.html#global-vs-work-item-attributes [www.sidefx.com] ) Thank you!
tpetrick
pdg.Graph has all of the same methods as pdg.WorkItem for adding/setting attributes. For example, in a Python Script. you can use the following to create a global string attribute named "example" that appears in the MMB menu on the TOP Network itself:

graph.setStringAttrib("example", "value")
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB