diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-14 02:47:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-14 02:53:09 +0300 |
commit | e63642f9cd57d12b0d4b4036e477d61012714181 (patch) | |
tree | 524795758f7fb2b7d20dba5f5ef22210576224f2 | |
parent | 3a58e97aed963b43984250e6ce40cd863b71e4b6 (diff) |
Fix T60172: UV smart project fails for unselected active object
Support multi-object edit-mode too.
-rw-r--r-- | release/scripts/startup/bl_operators/uvcalc_smart_project.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 6eb07d5c19f..34aae1b9433 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -728,8 +728,14 @@ def main(context, USER_FILL_HOLES_QUALITY = 50 # Only for hole filling. USER_VIEW_INIT = 0 # Only for hole filling. - obList = [ob for ob in context.selected_editable_objects if ob and ob.type == 'MESH'] - is_editmode = (context.active_object.mode == 'EDIT') + is_editmode = (context.mode == 'EDIT_MESH') + if is_editmode: + obList = context.objects_in_mode_unique_data + else: + obList = [ + ob for ob in context.selected_editable_objects + if ob.type == 'MESH' and ob.data.library is None + ] if not is_editmode: USER_ONLY_SELECTED_FACES = False @@ -737,12 +743,6 @@ def main(context, if not obList: raise Exception("error, no selected mesh objects") - # Reuse variable - if len(obList) == 1: - ob = "Unwrap %i Selected Mesh" - else: - ob = "Unwrap %i Selected Meshes" - # Convert from being button types USER_PROJECTION_LIMIT_CONVERTED = cos(USER_PROJECTION_LIMIT * DEG_TO_RAD) USER_PROJECTION_LIMIT_HALF_CONVERTED = cos((USER_PROJECTION_LIMIT / 2) * DEG_TO_RAD) |