AnswerBun.com

Switching beetween UV sets across multiple objects

I have multiple objects on scene with 2 UV sets, first default and second for one shared lightmap.
Now if i select all the objects (they have the same names for UVs) and try to switch between UV sets only active one will change. This forces me to tidiously selecting models one by one and changing UV sets for further edition in multi edit mode.
Is there any way to switch between all object’s UVs at once?

Blender Asked by JZK on December 30, 2020

3 Answers

3 Answers

Toggle UV script

Going by question remit, ie objects having two UV maps, here is a script to toggle between them on selected objects.

Note script for 2.8 see How to change UVMap index? for prior.

import bpy

context = bpy.context

for o in context.selected_objects:
    if o.type != 'MESH':
        continue # only meshes?
    uv = o.data.uv_layers
    ai = uv.active_index
    uv.active_index = 0 if ai else 1
    uv.active.active_render = True

or set absolutely, script below sets all active UV maps to that of index 0.

import bpy

context = bpy.context

for o in context.selected_objects:
    if o.type != 'MESH':
        continue # only meshes?
    uv = o.data.uv_layers
    ai = uv.active_index
    uv.active_index = 0
    uv.active.active_render = True

Answered by batFINGER on December 30, 2020

You could make a "Mix Vector" node and drive the Fac by a common property...

enter image description here enter image description here

Answered by Ron Jensen on December 30, 2020

Not sure if this helps...

If it's a case of switching maps, (as opposed to images) The UV Map shader input node looks up by name. The Cube and sphere in the illustrations share a map: 'Shared UV', and each has a map: 'UV Map' of its own.

enter image description here

enter image description here

They share the material, so the switch can be made in the UV Map node.

Answered by Robin Betts on December 30, 2020

Add your own answers!

Related Questions

Some objects not showing in object mode

0  Asked on December 9, 2021 by knut

 

Reselect faces that was already selected?

2  Asked on December 6, 2021 by afws

 

Can’t Unlock from Constraint Z Axis

1  Asked on December 6, 2021 by synch-games

   

How to select one (or multi) particular particle hair?

1  Asked on December 6, 2021 by michael-white

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.