Skip to content

Commit

Permalink
update_edit_mesh arguments error fix
Browse files Browse the repository at this point in the history
I don't know how this was working previously. Fixes #118
  • Loading branch information
franMarz committed Dec 17, 2021
1 parent 99741a4 commit b3dc7d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions op_island_align_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def invoke(self, context, event):


def main(self, context):
import time
startTime = time.monotonic()
me = bpy.context.active_object.data
bm = bmesh.from_edit_mesh(me)
uv_layers = bm.loops.layers.uv.verify()
Expand Down Expand Up @@ -98,7 +96,7 @@ def main(self, context):
align_island(self, me, bm, uv_layers, faces, calc_loops, x, z, avg_normal.y > 0, False)
else: #abs(avg_normal.x) == max_size
align_island(self, me, bm, uv_layers, faces, calc_loops, y, z, avg_normal.x < 0, False)
print(round(time.monotonic()-startTime, 5))



def align_island(self, me, bm, uv_layers, faces, loops, x=0, y=1, flip_x=False, flip_y=False):
Expand Down Expand Up @@ -158,7 +156,7 @@ def align_island(self, me, bm, uv_layers, faces, loops, x=0, y=1, flip_x=False,
loop[uv_layers].uv = (vec_origin.x + matrix[0][0]*uvs0.x + matrix[0][1]*uvs0.y, vec_origin.y + matrix[1][0]*uvs0.x + matrix[1][1]*uvs0.y)

if self.bool_face:
bmesh.update_edit_mesh(me, False)
bmesh.update_edit_mesh(me, loop_triangles=False)


bpy.utils.register_class(op)
2 changes: 1 addition & 1 deletion op_randomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def main(self, context, udim_tile=1001, column=0, row=0, ob_num=0):
uvs0 = loop[uv_layers].uv - vec_origin
loop[uv_layers].uv = (vec_origin.x + matrix[0][0]*uvs0.x + matrix[0][1]*uvs0.y, vec_origin.y + matrix[1][0]*uvs0.x + matrix[1][1]*uvs0.y)

bmesh.update_edit_mesh(me, False)
bmesh.update_edit_mesh(me, loop_triangles=False)


if self.bool_bounds:
Expand Down
2 changes: 1 addition & 1 deletion op_rectify.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def main(me, bm, uv_layers, selFacesMix, faces_loops, return_discarded_faces=Fal

FollowActiveUV(me, targetFace, selFaces)

bmesh.update_edit_mesh(me, False)
bmesh.update_edit_mesh(me, loop_triangles=False)

if return_discarded_faces:
return discarded_faces
Expand Down

0 comments on commit b3dc7d6

Please sign in to comment.