Blair Pierpont
blair_p
About Me
EXPERTISE
Technical Director
INDUSTRY
Film/TV
Connect
LOCATION
United States
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Python Node accessing Python Object Feb. 23, 2016, 1:39 p.m.
You don't have access to each node's code, so the code itself would have to store python objects in the node's user data.
You can specify strings in userData, or objects in cachedUserData. So you could have the following in nodeA
class Foo(object):
pass
node.setCachedUserData('foo', Foo())
node.setUserData('bar', ‘baz’)
and then access it in nodeC with the following:
nodeA = node.inputs()
foo = nodeA.cachedUserData('foo')
bar = nodeA.userData('bar')
Keep in mind that userData is volatile, it gets deleted once the scene is closed. cachedUserData is stored in the file itself, and thus never deleted.
You can specify strings in userData, or objects in cachedUserData. So you could have the following in nodeA
class Foo(object):
pass
node.setCachedUserData('foo', Foo())
node.setUserData('bar', ‘baz’)
and then access it in nodeC with the following:
nodeA = node.inputs()
foo = nodeA.cachedUserData('foo')
bar = nodeA.userData('bar')
Keep in mind that userData is volatile, it gets deleted once the scene is closed. cachedUserData is stored in the file itself, and thus never deleted.
changes in new H14 Popnet Sept. 16, 2015, 1 p.m.
try out pop spin, pop drag spin.
installation and file structure considerations March 18, 2014, 3:15 p.m.
If you base everything off of where your hip files exist then it can be extremely simple since you only use $HIP to determine the base directory.
datadir = $HIP/data
picdir = $HIP/pic
etc.
It can get more complicated when using logical paths but you can always overwrite $HIP in 456.cmd/456.py
datadir = $HIP/data
picdir = $HIP/pic
etc.
It can get more complicated when using logical paths but you can always overwrite $HIP in 456.cmd/456.py