Merge pull request #39 from Symstract/anther-align-edge-fix

Fix Align Island by Edge only working in Blender 2.83
master
SavMartin 4 years ago committed by GitHub
commit a2d7470a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,9 +126,14 @@ def align_island(uv_vert0, uv_vert1, faces):
loop[uv_layers].select = True
diff = uv_vert1 - uv_vert0
current_angle = math.atan2(diff.y, diff.x)
current_angle = math.atan2(diff.x, diff.y)
angle_to_rotate = round(current_angle / (math.pi/2)) * (math.pi/2) - current_angle
# For some reason bpy.ops.transform.rotate rotates in the opposite
# direction in Blender 2.83 than in other versions.
if float(bpy.app.version_string[0:4]) == 2.83:
angle_to_rotate = -angle_to_rotate
bpy.ops.uv.select_linked()
bpy.context.tool_settings.transform_pivot_point = 'CURSOR'

Loading…
Cancel
Save