How do I reference a variable between img and obj networks?

   1495   1   0
User Avatar
Member
10 posts
Joined: May 2016
Offline
I have a geometry node in my obj network group, and an image network in my img network. The image network contains a file op that loads an image for the current frame using the $F global variable (something like <my directory>/<my prefix>.$F6.png. I would like to add a custom variable to this path so that I can control the source directory. For example: <my directory>/<subdir>$MYVAR/<my prefix>.$F6.png

In my geometry network I am creating a custom SOP in C++. This SOP will pull the rastered data from the image network. I would like this SOP to determine which sub directory the image file rasters (in brief, controlling MYVAR).

Is using a global variable like this the correct approach? If so, how do I set an environment variable from a C++ SOP? I haven't found an API to do so yet.

Thanks!
User Avatar
Member
2534 posts
Joined: June 2008
Offline
I'm not sure if this answers your question but you can reference a result from COPs in SOPs via a path with the prefix of op:. In the image I simply dragged the default_pic from the COP Tree to the SOP field node then typed "op:" in front of the name.
Edited by Enivob - Aug. 23, 2016 22:16:49

Attachments:
Untitled-1.jpg (87.6 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links