3
$\begingroup$

Is it possible to make multiple objects with the same mesh, material, but different UV maps? If I add multiple UV maps to a mesh, the selector of active map seems to be associated with the mesh itself, making it the same for different objects. Why?

I have several similar objects and I want to keep the same mesh and make a bit different look. I know that it's kind of possible with object index in shaders, but I want to have precise control over each object's look.

I also know UV Map material node. Theoretically, I can use it to get 6 maps, and objects' indices to pick them, but this is actually merging/ramping UV vectors from different maps by distance to each specified object ID, which is too much of ugly boring stuff, so I hope to find a better solution!

$\endgroup$

2 Answers 2

3
$\begingroup$

First you have to understand that materials are linked to the mesh data by default. But you can change this behavior by clicking the Link button and changing it from Data to Object which links your material to the Object instead of the mesh, and now enables you to use another material for the same mesh used by another object. In the Shader Editor of each material just add a UV Map node and assign a different UV Map value for each material. In the following screenshot you can see I have the same mesh for both objects, but I can use a different material and/or UV Map.

First object: enter image description here

Second object: enter image description here

I don't think you can use the same material since the UV Map node used to specify your UV Map is part of the material. You have to create a new material or duplicate the material for each UV Map. But don't fret, you can create a Node Group for the material's nodes so that you can reuse it in all materials and only need to edit this Node Group to make sure all your changes are reflected in all duplicated materials. To make a Node Group, simply select all the essential nodes of your tree and press Ctrl+G. Then you can use tab to get in and out of the Group Node. So basically, you only have to duplicate the following nodes which will most likely never change.

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Hi! Thanks for your answer :) Yeah, I forgot about reusing nodes with a node group... So I already used another approach 😅 $\endgroup$
    – AivanF.
    Jul 17 at 7:55
1
$\begingroup$

The answer by Harry McKenzie allows having smaller materials, but with more materials instead. Before reading their approach, I already made the following, keeping 1 material only. This also allows to use multiple materials in the same mesh!

In materials shaders, we a couple of helpful nodes: UV Map and Object info with object index. So, it's quite possible to distinguish objects and use different UV maps for them using the same both mesh and material. I tried to merge UV coordinates similarly to ColorRamp but with source specified dynamically, and it works! Looks too huge, but allows to achieve my purposes.

merging 6 UV maps

How does it work: for each UV map I specify related object index (which is set manually in Properties ‣ Object Properties ‣ Relations ‣ Pass Index), calculate distance from current ID and UV map's ID to use as a scaling coefficient for the UV coordinates by this map, and then I just sum up all the results.

merging UV map details

My solution can be easily used with a random object index instead of specified ones if someone has no need of manual UV maps setting. In this case, you can simply take a random object's value, calculate mod by the number of your UV maps, and do the same vector math.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .