Jump to content
Sign in to follow this  
Aaron Auty

$JOB variable in primitive string attribute does not get evaluate

Recommended Posts

I am attempting to use an unevaluated $JOB variable to switch predefined texture sets feeding one ubershader.

 

I have "diffMap" promoted on my shader, and a primitive string attribute "diffmap" with the value. ${JOB}/path/to/my/textures.rat (I have tried '$JOB' as well)

 

If I remove the primitive string attibute, and manually enter  "${JOB}/path/to/my/textures.rat" into the promoted "diffMap" slot, it evaluates correctly. Will I need to get into some sort of string reformatting on the promoted parameter?

 

 

Difficult to share a .hip with the $JOB variable... Hope the above makes sense.

 

Cheers,

Aaron.

Share this post


Link to post
Share on other sites

first off, make sure your diffMap primitive value is working -- use a full path to your texture.

 

assuming that's working, then you may need to pass an evaluated version of the path.  which should be fine, i would think.  $JOB evaluated at the time of assignment vs at the time of rendering shouldn't be a big difference unless you've got pre-baked geo.  if that's the case, then you can separate your $JOB portion of the path out of the assignment in your geo and then pass $JOB to your shader as a separate parm and recombine in your shader.

Share this post


Link to post
Share on other sites

I don't think the string attributes are ever being expanded at rendertime, mantra will simply use the string as the texture map and "${JOB}/path/to/my/textures.rat" is obviously not a valid path

so either make sure your attribute contains expanded path to the textures, or do what Miles said and combine in the shader

Share this post


Link to post
Share on other sites

first off, make sure your diffMap primitive value is working -- use a full path to your texture.

 

assuming that's working, then you may need to pass an evaluated version of the path.  which should be fine, i would think.  $JOB evaluated at the time of assignment vs at the time of rendering shouldn't be a big difference unless you've got pre-baked geo.  if that's the case, then you can separate your $JOB portion of the path out of the assignment in your geo and then pass $JOB to your shader as a separate parm and recombine in your shader.

 

Great idea! Thanks for the tip.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×