[Bf-blender-cvs] [7e9f76944c3] blender2.8: Fix T59461: Follow active quad asserts
Campbell Barton
noreply at git.blender.org
Tue Dec 18 03:36:22 CET 2018
Commit: 7e9f76944c3117f99045f9cde6253e2592953330
Author: Campbell Barton
Date: Tue Dec 18 13:35:43 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB7e9f76944c3117f99045f9cde6253e2592953330
Fix T59461: Follow active quad asserts
===================================================================
M release/scripts/startup/bl_operators/uvcalc_follow_active.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
index 58d60426464..21c89444a32 100644
--- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py
+++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
@@ -34,14 +34,14 @@ STATUS_ERR_NOT_QUAD = (1 << 3)
def extend(obj, operator, EXTEND_MODE):
import bmesh
me = obj.data
- # script will fail without UVs
- if not me.uv_layers:
- me.uv_layers.new()
bm = bmesh.from_edit_mesh(me)
+ faces = [f for f in bm.faces if f.select and len(f.verts) == 4]
+ if not faces:
+ return 0
+
f_act = bm.faces.active
- uv_act = bm.loops.layers.uv.active
if f_act is None:
return STATUS_ERR_ACTIVE_FACE
@@ -50,7 +50,11 @@ def extend(obj, operator, EXTEND_MODE):
elif len(f_act.verts) != 4:
return STATUS_ERR_NOT_QUAD
- faces = [f for f in bm.faces if f.select and len(f.verts) == 4]
+ # Script will fail without UVs.
+ if not me.uv_layers:
+ me.uv_layers.new()
+
+ uv_act = bm.loops.layers.uv.active
# our own local walker
def walk_face_init(faces, f_act):
@@ -222,16 +226,9 @@ def main(context, operator):
num_errors = 0
status = 0
- ob_list = [ob for ob in context.selected_objects if ob and ob.type == 'MESH']
+ ob_list = context.objects_in_mode_unique_data
for ob in ob_list:
- ob.data.tag = False
-
- for ob in ob_list:
- if ob.data.tag:
- continue
-
num_meshes += 1
- ob.data.tag = True
ret = extend(ob, operator, operator.properties.mode)
if ret != STATUS_OK:
More information about the Bf-blender-cvs
mailing list