Skip to content

Commit

Permalink
Fix #38 pointcloud rerendering twice
Browse files Browse the repository at this point in the history
This issue happened, because every time the "vertc" variable was modified, it would trigger a rerender.
Instead, the function calling it should decide itself when it rerenders
  • Loading branch information
AlexanderRitter02 committed Aug 1, 2022
1 parent 795f69a commit ca17db1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gui/gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def __init__(self, master, control):
self.control.vertc = BooleanVar()
self.mesh = BooleanVar()
# handle vertc variable with tracing since it is changed at model import
check_vertc = Checkbutton(master=self, text="Vertex color", variable=self.control.vertc, anchor="w")
check_vertc = Checkbutton(master=self, text="Vertex color", variable=self.control.vertc, anchor="w", command=self.control.re_render)
self.control.vertc.trace_add("write", self.update_vertex_color)
check_mesh = Checkbutton(master=self, text="Plane", variable=self.mesh, anchor="w", command=self.add_plane)

Expand Down Expand Up @@ -615,7 +615,6 @@ def update_vertex_color(self, var, index, mode):
widget_set_enabled(self.lbl_color, True)
widget_set_enabled(self.btn_picker, True)
delete_vertex(self.control.material.material)
self.control.re_render()

# calls the addplane function in CreatePointcloudFromObject
def add_plane(self):
Expand Down

0 comments on commit ca17db1

Please sign in to comment.