Jump to content

Changing instance objects texture map based on attribute


rmross

Recommended Posts

I have a picture frame geo that I'm importing from an FBX.  It has a frame and a canvas in it. I'm then copying that geo to some scattered points to make hundreds of picture frames.  How do you think would be a good procedural way to assign the texture of just the canvas to be one of a folder of texture images?
 
I made a parameter called variant which assigns an integer to each of the frames.  And I made a folder of images with names like "canvas_1" and "canvas_2".  But I'm stuck on how one would apply the corresponding image as a texture to just the canvas geo.
Link to comment
Share on other sites

what renderer are u using. the method will be different for each.

easiest it is with Mantra, where u can create a per primitive string attribute (path to the texture). loading this attribute in the shader and plugging it into diffuse slot or whatever, will render the corresponding textures.
in Arnold I remember you have some limited tokens, but for texture variation it's sufficient
in Redshift you can use stylesheet script that reads the prim string attribute (it's simple but a bit cryptic and i don't remember how to do it from top of my head, to be honest)

cheers.

Link to comment
Share on other sites

yes, that i think stylesheet is the easiest method if you have many textures.

if you only have 3 or so, you can have attrib with values 0-2, and then use color mix to switch textures with it on shader level.

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