Hi
my created topnetwork is
/obj/geo1/topnet1
When I try to get “../../null1” relative to “obj/geo1/null1” using pythonprocessor
Why do I get the root object “/”
My purpose is to obtain Label by specifying Token of orderd Menu of the acquired hou.node object
thanks
PythonProcesser get relative sopNode path
1786 2 1- soru
- Member
- 1 posts
- Joined: May 2017
- Offline
- kenxu
- Member
- 544 posts
- Joined: Sept. 2012
- Offline
This is due to the fact that PDG exists as something quite separate from Houdini, and that TOPs is only a Houdini wrapper that goes over PDG. The Python code you write is executed in the PDG framework, and not Houdini. A consequence of this is that when the Python code runs, it doesn't know where “here” is relative to the Houdini node hierarchy. However, if the PDG node is created from a TOP node, it does know the TOP node's session id. With that session id you can look up the TOP node, and then go from there to reference other nodes.
Details are noted in this post here:
https://www.sidefx.com/forum/topic/67324/ [www.sidefx.com]
The reason things are this way is that ultimately we (and indeed the community) would like PDG to be able to run completely independent of Houdini, and so it is architected as such. The downside of this however is annoying artifacts like this, where things don't work quite the way you'd expect.
Details are noted in this post here:
https://www.sidefx.com/forum/topic/67324/ [www.sidefx.com]
The reason things are this way is that ultimately we (and indeed the community) would like PDG to be able to run completely independent of Houdini, and so it is architected as such. The downside of this however is annoying artifacts like this, where things don't work quite the way you'd expect.
- Ken Xu
- chrisgreb
- Member
- 603 posts
- Joined: Sept. 2016
- Offline
The normal way to get such data into a python processor is to add a spare parm with an expression on it to query whatever data you need from Houdini, rather than trying to use hou within the PDG script code. Take a look at the “Evaluate spare parameters” snippet in the Generate tab of that node.
You could also think about using an attributecreate node instead.
You could also think about using an attributecreate node instead.
-
- Quick Links