diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-09-05 22:51:25 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-09-05 22:58:56 +0300 |
commit | 2b83b36a30dfd4f699adc971c12e371983e75bc7 (patch) | |
tree | cfa9f162d498dd6d5fa58af29041fab4ac496b59 /release | |
parent | 9c1150a2956fa0321b0adb2999ead9abdd7a119e (diff) |
Multi-Objects: UV_OT_lightmap_pack
I removed the All Objects option. This doesn't make more sense now that
all the selected objects will be in edit mesh mode.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/uvcalc_lightmap.py | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py index 4ad9bfb7be8..0db63576920 100644 --- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py +++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py @@ -558,32 +558,13 @@ def lightmap_uvpack(meshes, def unwrap(operator, context, **kwargs): - - # only unwrap active object if True - PREF_ACT_ONLY = kwargs.pop("PREF_ACT_ONLY") - - # ensure object(s) are selected if necessary and active object is set - if context.object is None: - if PREF_ACT_ONLY: - operator.report({'WARNING'}, "Active object not set") - return {'CANCELLED'} - elif len(context.selected_objects) == 0: - operator.report({'WARNING'}, "No selected objects") - return {'CANCELLED'} - # switch to object mode is_editmode = context.object and context.object.mode == 'EDIT' if is_editmode: bpy.ops.object.mode_set(mode='OBJECT', toggle=False) # define list of meshes - meshes = [] - if PREF_ACT_ONLY: - obj = context.view_layer.objects.active - if obj and obj.type == 'MESH': - meshes = [obj.data] - else: - meshes = list({me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if me.polygons and me.library is None}) + meshes = list({me for obj in context.selected_objects if obj.type == 'MESH' for me in (obj.data,) if me.polygons and me.library is None}) if not meshes: operator.report({'ERROR'}, "No mesh object") @@ -621,7 +602,6 @@ class LightMapPack(Operator): items=( ('SEL_FACES', "Selected Faces", "Space all UVs evenly"), ('ALL_FACES', "All Faces", "Average space UVs edge length of each loop"), - ('ALL_OBJECTS', "Selected Mesh Object", "Average space UVs edge length of each loop") ), ) @@ -672,13 +652,8 @@ class LightMapPack(Operator): PREF_CONTEXT = kwargs.pop("PREF_CONTEXT") if PREF_CONTEXT == 'SEL_FACES': - kwargs["PREF_ACT_ONLY"] = True kwargs["PREF_SEL_ONLY"] = True elif PREF_CONTEXT == 'ALL_FACES': - kwargs["PREF_ACT_ONLY"] = True - kwargs["PREF_SEL_ONLY"] = False - elif PREF_CONTEXT == 'ALL_OBJECTS': - kwargs["PREF_ACT_ONLY"] = False kwargs["PREF_SEL_ONLY"] = False else: raise Exception("invalid context") |