Skip to content

Commit

Permalink
Fix confirm and cancel changes buttons error
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyWinch committed Apr 25, 2021
1 parent d99593f commit b3fc3f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 6 additions & 8 deletions functions_modal_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,15 @@ def toggle_individual_loops(self, arguments):
arguments[0]._individual_loops = self.bool_val
arguments[0]._container.set_draw_tris(
arguments[0]._individual_loops)

if self.bool_val == False:
sel_pos = get_selected_points(arguments[0], any_selected=True)
arguments[0]._container.sel_status[arguments[0]._container.vert_link_ls[sel_pos]] = True

if arguments[0]._container.act_status.any():
act_verts = arguments[0]._container.loop_verts[arguments[0]._container.act_status]
arguments[0]._container.act_status[arguments[0]._container.vert_link_ls[act_verts]] = True

arguments[0]._container.act_status[arguments[0]
._container.vert_link_ls[act_verts]] = True

arguments[0].redraw = True
return
Expand Down Expand Up @@ -805,13 +805,11 @@ def finish_point_mode(self, arguments):

def end_modal(self, arguments):
if self.custom_id[0] == 0:
finish_modal(arguments[0], False)
status = {'FINISHED'}
arguments[0]._confirm_modal = True
if self.custom_id[0] == 1:
finish_modal(arguments[0], True)
status = {'CANCELLED'}
arguments[0]._cancel_modal = True

return status
return


def reset_vectors(self, arguments):
Expand Down
10 changes: 10 additions & 0 deletions operators_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def modal(self, context, event):
status = basic_keymap(self, context, event)
self._prev_mouse_loc[:] = self._mouse_reg_loc

if self._confirm_modal:
finish_modal(self, False)
status = {"FINISHED"}
elif self._cancel_modal:
finish_modal(self, True)
status = {"CANCELLED"}

refresh_batches(self, context)

self._modal_running = True
Expand Down Expand Up @@ -141,6 +148,9 @@ def invoke(self, context, event):
self._mirror_y = False
self._mirror_z = False

self._confirm_modal = False
self._cancel_modal = False

self._current_filter = ''

self._draw_area = context.area
Expand Down

0 comments on commit b3fc3f6

Please sign in to comment.