Search - User list
Full Version: Can't channel ref in a python partitioner?
Root » PDG/TOPs » Can't channel ref in a python partitioner?
Andrew Graham
I'm trying to simply eval an int from a channel in a python partitioner, but seeing as I cant do this on a python partitioner…

import hou
node = hou.pwd()
parm = node.parent('some_int').eval()

Then I'm not sure how to eval any parm/int on the parent hda. in this case pwd will just return ‘/’.

Hacky way is to set the int as an attribute, and pull it that way- but then I'm finding I have to make the partitioner dynamic in order to reliably read that attribute which is not desirable.

Thanks if anyone has a pointer for this.
Andrew Graham
Thanks to jens for this one. The solution is

self['some_int'].evaluateInt()
9of9
Thanks, was just struggling with that this morning!
tpetrick
This has been addressed in tomorrow's daily build of 17.5. hou.pwd(), hou.parm(“../../some_relative_path”), etc should all be working as expected now. If you want to evaluate a parameter with respect to a particular PDG work item, you'll still need to go through PDG's API as mentioned above. For example:

for upstream_item in upstream_items:
    val = self['some_int'].evaluateInt(upstream_item)
Andrew Graham
Thanks for getting the hou.parm functionality working for us.
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