Fix lightmap UV calculation ignoring unselected objects in edit-mode

This commit is contained in:
Campbell Barton
2023-04-13 13:14:15 +10:00
parent ad5ec544c8
commit 11ad851fbe
@@ -526,11 +526,14 @@ def unwrap(operator, context, **kwargs):
# switch to object mode
is_editmode = context.object and context.object.mode == 'EDIT'
if is_editmode:
objects = context.objects_in_mode_unique_data
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
else:
objects = context.selected_objects
# define list of meshes
meshes = list({
me for obj in context.selected_objects
me for obj in objects
if obj.type == 'MESH'
if (me := obj.data).polygons and me.library is None
})