Forum

[SOLVED] Switching between different UVmaps layouts possible?

26 June 2018 20:28
Hi everybody,
I am trying to find out if it is possible to switch between different UVmaps layouts like this (please see the image below) by scripting ?


Any idea ?

Thank you for your help
www.mo-systeme.com
26 June 2018 21:59
Yes, by making a copy of the material which only differs in the UVmap used and then switching the materials with Logic Nodes or scripting.
28 June 2018 17:22
Hi Blend4Life,

Thank you for this advice. I try, but without succes.

When I apply the material to a mesh with a different UV map. The material will be maped according to the own mesh UV map and not according to the material linked UV map.
I don't know if I am clear.

Is there any possibility to select one of many saved UV maps from a mesh to apply it to a texture/material that is displayed on this mesh ?

Something like changing the UV map input from the "geometry" node of the material.

Thanks !
www.mo-systeme.com
28 June 2018 20:51
Hmm, you must have done it wrong. Let me show you step by step what I did:

1. In Blender (Render Mode = "Blend4Web", Viewport Shading Mode = "Material"), take the cube and unwrap it with, let's say, Smart Unwrap.

2. Add a second UVmap (make sure it's selected = blue)
and unwrap the Cube differently; for example, the "proper" way with seams.

3. You'll have this:


4. Now, make a Node material, call it "target_material". For this material, in the Geometry Node, have "UVmap" as the selected UVmap!:


5. Then, make a second slot, put the "target_material" into the slot, press on the "2" behind the name to make a copy of the material, and name the material in the second slot "source_material_1". This is a simple copy of the first material.

6. Then, make a third slot, put the "source_material_1" into the slot, press on the "2" behind the name to make a copy of the material, and name the material in the third slot "source_material_2". For this material, in the Geometry Node, have UVmap.001 as the selected UVmap! This is also a simple copy of the first material, only with a different UVmap used:


Take note how the material slots look like. To switch between the two UVmaps, use m_mat.inherit_material() or the following Logic Node setup:


This is my result:

You should get the same.
29 June 2018 19:01
Woww !
Great tutorial !
Thank you very much Blend4Life.

I'll try this asap ! And let you know
www.mo-systeme.com
29 June 2018 21:10
Yes ! it works.
Thank's a lot !
That's very cool from you to take time to explain
www.mo-systeme.com
 
Please register or log in to leave a reply.