Jump to content
rmross

Changing instance objects texture map based on attribute

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.

Share this post


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

Share this post


Link to post
Share on other sites

Redshift-- so stylesheet script that reads the prim string attribute?  

Share this post


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

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

×