Unable to load texture on Promoted Paramter

   2388   3   1
User Avatar
Member
80 posts
Joined: June 2013
Offline
Following Illume Webinar Houdini VOPs [www.sidefx.com] where Mr. Wagner is showing how to access a texture assigned in a Principled Shader VOP. He promotes the basecolor-texture parameter and exposes the parameter node (which can then be wired to a Texture VOP to access the actual texture data.)

However when I promote the texture override on the principledshader1 vop it errors out with this:
[14:11:12] mantra: Unable to load texture '$HFS/houdini/pic/texture/concrete001_basecolor.rat'
Reloading the texture file in the parameter vop doesn't help, files can be selected but report another “unable to load texture” error.

Why would breaking out the texture parameter break the ability to load the texture file?
User Avatar
Member
7762 posts
Joined: Sept. 2011
Online
It's complicated why, but parameter vops pass their default directly to the shader source without evaluating expressions. They work in other cases because the value is normally passed to the parameter from the level above the parameter node. However when a parameter vop is floating naked outside of a builder network, there is no level above to send the evaluation from.

A work around is to expand your expression before setting the default value, or to set a keyframe on the default, so that the evaluation happens before the source is generated. Either way, the value is passed into the shader. If you don't want to do either of those, then the only way is to collapse the nodes into a material builder, so that the expression has an evaluation context. Animated parameters will ALWAYS require this step.
User Avatar
Member
80 posts
Joined: June 2013
Offline
Thanks for the info! so the $HFS never gets expanded in the file path? edit: yes, full path works!

Strange that it appears to work automatically in the webdemo… maybe I missed a step. Or is there a setting that will bring in the global values to the parameter nodes in /mat context?
Edited by Rebus B - June 30, 2017 20:58:17
User Avatar
Member
7762 posts
Joined: Sept. 2011
Online
Rebus B
Thanks for the info! so the $HFS never gets expanded in the file path? edit: yes, full path works!

Strange that it appears to work automatically in the webdemo… maybe I missed a step. Or is there a setting that will bring in the global values to the parameter nodes in /mat context?

At this time, there doesn't appear to be anything one can do to force parameter expansion, aside from the recommended workarounds I outlined above. 1: enclose in material builder. or 2: add a keyframe on the parameter with the expression.

Edit: the file browser itself has the option to swap between expanded/simplified paths, by right clicking on the path in the file chooser.
Edited by jsmack - July 1, 2017 01:08:43
  • Quick Links