Skip to content

Commit b3fc3f6

Browse files
committed
Fix confirm and cancel changes buttons error
1 parent d99593f commit b3fc3f6

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

functions_modal_buttons.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,15 +654,15 @@ def toggle_individual_loops(self, arguments):
654654
arguments[0]._individual_loops = self.bool_val
655655
arguments[0]._container.set_draw_tris(
656656
arguments[0]._individual_loops)
657-
657+
658658
if self.bool_val == False:
659659
sel_pos = get_selected_points(arguments[0], any_selected=True)
660660
arguments[0]._container.sel_status[arguments[0]._container.vert_link_ls[sel_pos]] = True
661661

662662
if arguments[0]._container.act_status.any():
663663
act_verts = arguments[0]._container.loop_verts[arguments[0]._container.act_status]
664-
arguments[0]._container.act_status[arguments[0]._container.vert_link_ls[act_verts]] = True
665-
664+
arguments[0]._container.act_status[arguments[0]
665+
._container.vert_link_ls[act_verts]] = True
666666

667667
arguments[0].redraw = True
668668
return
@@ -805,13 +805,11 @@ def finish_point_mode(self, arguments):
805805

806806
def end_modal(self, arguments):
807807
if self.custom_id[0] == 0:
808-
finish_modal(arguments[0], False)
809-
status = {'FINISHED'}
808+
arguments[0]._confirm_modal = True
810809
if self.custom_id[0] == 1:
811-
finish_modal(arguments[0], True)
812-
status = {'CANCELLED'}
810+
arguments[0]._cancel_modal = True
813811

814-
return status
812+
return
815813

816814

817815
def reset_vectors(self, arguments):

operators_modal.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ def modal(self, context, event):
6969
status = basic_keymap(self, context, event)
7070
self._prev_mouse_loc[:] = self._mouse_reg_loc
7171

72+
if self._confirm_modal:
73+
finish_modal(self, False)
74+
status = {"FINISHED"}
75+
elif self._cancel_modal:
76+
finish_modal(self, True)
77+
status = {"CANCELLED"}
78+
7279
refresh_batches(self, context)
7380

7481
self._modal_running = True
@@ -141,6 +148,9 @@ def invoke(self, context, event):
141148
self._mirror_y = False
142149
self._mirror_z = False
143150

151+
self._confirm_modal = False
152+
self._cancel_modal = False
153+
144154
self._current_filter = ''
145155

146156
self._draw_area = context.area

0 commit comments

Comments
 (0)