[Bf-blender-cvs] [e63642f9cd5] master: Fix T60172: UV smart project fails for unselected active object
Campbell Barton
noreply at git.blender.org
Thu Mar 14 01:00:49 CET 2019
Commit: e63642f9cd57d12b0d4b4036e477d61012714181
Author: Campbell Barton
Date: Thu Mar 14 10:47:25 2019 +1100
Branches: master
https://developer.blender.org/rBe63642f9cd57d12b0d4b4036e477d61012714181
Fix T60172: UV smart project fails for unselected active object
Support multi-object edit-mode too.
===================================================================
M release/scripts/startup/bl_operators/uvcalc_smart_project.py
===================================================================
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)
More information about the Bf-blender-cvs
mailing list