Jump to content

$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.

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...