Load textures using a single file string

   3182   2   1
User Avatar
Member
240 posts
Joined: March 2015
Offline
Hi, I'm not sure of the exact terminology so I'll try to explain my question.

I have a set of shader nodes with names matching the texture set. ie. Engine shader has 4 texture maps. Engine_Base, Engine_Roughness, etc.

When working with a lot of textures, I have a fairly simple (but tedious) workflow of copying the name from the shader node and pasting into each file string for the maps.

What I'd like to do is use 1 file string for each map that looks at the name of the shader and appends _Base, _Roughness etc.

ie.
$HIP/tex/“somethingsimplebutclever”_Base.png
$HIP/tex/“somethingsimplebutclever”_Roughness.png
etc

I'd be very grateful if someone can enlighten me.

thanks
Rob
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
If you name your shader “Engine” you can reference the name of the shader in your path like this: “$HIP/tex/$OS.Base.png” $OS is the name of the current node.
It doesn't resolve when there is an underscore after it so name your texture like this instead: Engine.Base.png.

An other option is to make your own variables: Edit->Aliases and Variables->Variables. Here you could make variables for whatever you want and reference them in your nodes to your hearts content.

-b

https://www.sidefx.com/docs/houdini13.0/expressions/_globals [sidefx.com]
http://www.racecar.no [www.racecar.no]
User Avatar
Member
240 posts
Joined: March 2015
Offline
Thanks for your help. I knew it was something simple but I was using underscores.

I'll see if I can cope without using underscores for everything and look at the other option if (when) that fails.

thanks
Rob
  • Quick Links