Select / Sync UV Channel / Layer between multiple objects

Hi!

I’ve made a simple script that lets you sync the active UV layer / channel between multiple objects. Primarily this sped up my lightmapping workflow a lot. If a corresponding channel doesn’t exist, it also creates a matching one for the selected objects. This also lets you set the render UV map for multiple objects.

Link to plugin, it’s free
https://gum.co/Batch_UV_Operations_Blender

SyncActiveMap

7 Likes

New Version, updated the post above. I added functionality to delete and split the active render set and simple active set to separate buttons / operators.

1 Like

Nice one! Blender’s default way of (not) handling UV Sets of multiple objects can be a real pain in the a**. We cobbled together our own little tool for that a while back (not to be released any time soon), maybe you can find something useful there. It’s a slightly different approach though:

1 Like

Haha yes I agree. Blender lacks some functionality for working with multiple objects. From changing common parameters (modifiers for example), to more complex things like physics and UVs.

This was super essential though :slight_smile: Although I think my version offers more functionality while also including yours. I’m thinking of introducing an index (2nd layer instead of “LightmapUVs”) way of selection instead of name matching but I haven’t found a need for that yet.

@MadLLama
Hi,

Maybe you would interest, I found addon with options to moving UV up and down in the list, modified it slightly with adding sorting, and moved it to expandable panel under UV Maps.

Also changed your Batch panel to be consistent
12
uv_map_list_tools.py (6.0 KB)

and your __init__.py modified
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

bl_info = {
    "name" : "BatchUVMaps",
    "author" : "Arnas Karmaza",
    "description" : "Extra Batch UV Operators",
    "blender" : (2, 93, 0),
    "version" : (1, 0, 1),
    'location': 'Properties > Mesh Properties > UV Maps',
    "warning" : "",
    "category" : "Object"
}
import bpy

from . operators import OBJECT_OT_set_active_render_uv, OBJECT_OT_set_active_uv, OBJECT_OT_delete_active_uv
from . operators import Operator
from bpy.types import Panel

class UVMAPS_PT_batch_tools(Panel):
    bl_label = "UV Batch Tools"    
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "data"
    bl_parent_id = "DATA_PT_uv_texture"
    bl_options = {'DEFAULT_CLOSED'}
    
    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.operator('object.set_active_uv_for_selected_objects', icon ='RIGHTARROW', text="Sync Active")
        row.operator('object.set_active_uv_render_layer_for_selected_objects', icon='RESTRICT_RENDER_OFF', text="Set Active")
        row.operator('object.delete_active_uv_layer_for_selected_objects', icon='TRASH', text="Delete Active")

#defining classes here
classes = (
    UVMAPS_PT_batch_tools,
    OBJECT_OT_set_active_uv,
    OBJECT_OT_delete_active_uv,
    OBJECT_OT_set_active_render_uv
)

#def draw(self, context):
#    layout = self.layout
#    layout.label(text="Batch UV Tools:")
#    row = layout.row()
#    row.operator('object.set_active_uv_for_selected_objects', icon ='RIGHTARROW', text="Sync Active")
#    row.operator('object.set_active_uv_render_layer_for_selected_objects', icon='RESTRICT_RENDER_OFF', text="Set Active")
#    row.operator('object.delete_active_uv_layer_for_selected_objects', icon='TRASH', text="Delete Active")

    
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    # Drawing the Operator in UV maps panel
    #bpy.types.DATA_PT_uv_texture.append(draw)
   

def unregister():
    from bpy.utils import unregister_class
    for cls in classes:
        unregister_class(cls)

    # Removing the operator from UV maps panel
    #bpy.types.DATA_PT_uv_texture.remove(draw)

4 Likes

Thanks! People may find that useful, but really I’m fine with the current addon’s functionality, I haven’t ran into issues with it yet.

1 Like

Hi
I think this is a very useful add-on!
However, it does not work as shown in the video
When I press the Sync active map button, the UV channel is selected, but the channel does not increase
Is this a bug?
Blender : 2.93.4
Batch UV Operators : 1.0.1

@InamuraJIN Hey! Sorry I missed that. It goes over selected objects and sets the active UV map to the one with the same name. If a layer with the same name doesn’t exist on some object, it will create a UV layer with that name.

In your example it works as expected, not sure what outcome you’re looking for?

To anyone who finds this thread, I’ve updated the addon with a ton of new functionality!
Here’s the new thread with info, gifs, links:

UPDATED


Hi!
I’ve updated batch UV tools. This plugin let’s you manage UV maps / layers on multiple objects at once.


Adding UVs to multiple objects

  • same function can also be used for switching between maps

AddingLightmap-min

Copy Unique UVs

  • easily find issues with naming and order

CleanupUVs - min


Added a few useful functions like layer reordering, copying unique and layer order syncing for easy cleanup

Get it on Gumroad for free or support me and Blenderfund and get it on Blendermarket


Functions:

  1. Set Or Create Active Map for multiple objects
  • Sets a UV map active in each selected object. If a map with the same name doesn’t exist, it’ll be created automatically.
  1. Delete Active Map for multiple objects
  • Deletes a UV channel with a matching name in all selected objects.
  1. Set Active Render Map for multiple objects
  • Sets a UV channel as the active render channel in all selected objects.
  1. Copy Unique
  • Copies all unique named channels in selection, to each selected object.
  1. Sync Layers Order
  • Tries to match order of layers in each object to the active object.
  1. Move Up / Down
  • Moves a layer in the selected object up or down in the stack, active object only, use sync order for other objects.

Hope you find it useful, happy blending!

7 Likes

@madlady37 Woudn’t be better instead of just plain label, have it as collapsible pannel just like @APEC made?

image
anyway, here updated APEC modification for never version: init.py|attachment (3.2 KB)


btw uv up/down button from screen is from gret addon

Hey! Yeah perhaps, I don’t think it’s that cluttered, but will definitely consider something like that in the future, thanks!

1 Like