Removed propagation of UV changes across boundary of selection #116914

Closed
Jonas Dichelle wants to merge 4 commits from JonasDichelle:jonasdichelle-patch-1 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 18 additions and 9 deletions

View File

@ -6,6 +6,7 @@ from bpy.types import Operator
from bpy.props import (
EnumProperty,
BoolProperty,
)
STATUS_OK = (1 << 0)
@ -16,7 +17,7 @@ STATUS_ERR_MISSING_UV_LAYER = (1 << 4)
STATUS_ERR_NO_FACES_SELECTED = (1 << 5)
def extend(obj, EXTEND_MODE, use_uv_selection):
def extend(obj, EXTEND_MODE, use_uv_selection, rip_modified_quads):
import bmesh
from .uvcalc_transform import is_face_uv_selected
@ -205,13 +206,14 @@ def extend(obj, EXTEND_MODE, use_uv_selection):
for f_triple in walk_face():
apply_uv(*f_triple)
# Propagate UV changes across boundary of selection.
for (v, original_uv, source) in uv_updates:
# Visit all loops associated with our vertex.
for loop in v.link_loops:
# If the loop's UV matches the original, assign the new UV.
if loop[uv_act].uv == original_uv:
loop[uv_act].uv = source
if not rip_modified_quads:
# Propagate UV changes across boundary of selection.
for (v, original_uv, source) in uv_updates:
# Visit all loops associated with our vertex.
for loop in v.link_loops:
# If the loop's UV matches the original, assign the new UV.
if loop[uv_act].uv == original_uv:
loop[uv_act].uv = source
bmesh.update_edit_mesh(me, loop_triangles=False)
return STATUS_OK
@ -230,7 +232,7 @@ def main(context, operator):
for ob in ob_list:
num_meshes += 1
ret = extend(ob, operator.properties.mode, use_uv_selection)
ret = extend(ob, operator.properties.mode, use_uv_selection, operator.properties.rip_modified_quads)
if ret != STATUS_OK:
num_errors += 1
status |= ret
@ -264,6 +266,13 @@ class FollowActiveQuads(Operator):
('LENGTH_AVERAGE', "Length Average", "Average space UVs edge length of each loop"),
),
default='LENGTH_AVERAGE',
)
rip_modified_quads: BoolProperty(
name="Rip Modified UVs",
description="Disconnect modified UV quads from their neighbors",
default=True,
)
@classmethod