Trying to use one material with file textures ...

   1983   3   1
User Avatar
Member
14 posts
Joined: Nov. 2017
Offline
Hi there,

I'm hoping that this is a simple thing…..

Problem:
I have multiple objects that I want to have unique textures per object

I'm hoping to use one material with a file texture assigned to all objects where the file texture is unique per object based on their name. Meaning, each object has its own file texture. I want to avoid making hundreds of materials.

Is this possible or is it crazy?

Thanks in advance!

Steve
Edited by chrism - Sept. 6, 2019 17:30:14
User Avatar
Member
38 posts
Joined: Oct. 2017
Offline
Yes, you can do that with UDIM tiles, which you can set up with the uvlayout sop (Targets -> Pack into -> select UDIM tiles from menu). This works best if all objects share the same uv layout. Depending on your setup you might want to do this in a for loop for multiple objects. UDIM tile numbering starts with 1001 and your image sequence numbering for the textures should also start at 1001. In the shader you reference the UDIM tile with %(UDIM)d (Mantra) in the file name instead of the frame number (usually $F4), and <UDIM> for Redshift. This will load the corresponding frame number from an image sequence to match the UDIM tile number.
User Avatar
Member
14 posts
Joined: Nov. 2017
Offline
Oh Interesting….I completely forgot about UDIMs. I'll have to look into it.

Thanks phoehsl!
User Avatar
Member
738 posts
Joined: Dec. 2006
Offline
If you don't want to use udims, just create a geometry attribute that contains the path-to-file. If the attribute name is the same name as the parm in the shader, the shader uses the value of the attribute instead. So for example, you might have ten objects with each having a different string prim attribute called “basecolor_texture” (if you're using the principled shader). Similarly you can override any other parm such as “rough” or whatever.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
  • Quick Links