Parent object relative path

   6686   3   1
User Avatar
Member
30 posts
Joined: 1月 2015
オフライン
Hello everybody,

Is there a way to get a relative path to the parent of an object. By parent, I do not mean the parent “network container”. I mean the node connected to Input 0.

For example, inside a CHOP Network, which is inside an SOP, I have an Object node. I want the Reference Object parm to point to the SOP object's parent.
Let's say the parent name is “Null”. The relative path is “../../../Null”. However, I do not want to hardcode “Null”. I would like this to be dynamic.

Is there a way to do this?

Thanks in advance
User Avatar
スタッフ
6743 posts
Joined: 7月 2005
オフライン
I think this is what you want?

`opinputpath(“../../..”, 0)`
User Avatar
Member
9281 posts
Joined: 7月 2007
オフライン
so let's say your hierarchy is
/obj/GeoObject/chopnet/ObjectCHOP

to get Object connected to first input of GeoObject from ObjectCHOP's targetpath parm you will type:

`opinputpath(“../..”, 0)`

it will simply get first input node of the node 2 levels above the ObjectCHOP, which is first input of GeoObject node

EDIT: too slow
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
30 posts
Joined: 1月 2015
オフライン
awesome, thanks guys
  • Quick Links