Fixed Polyline Wall after changes in Measure tool input

This commit is contained in:
Bruno Perdigão
2024-08-22 16:11:22 -03:00
parent 301cb4bbdc
commit 3bd0caade1
2 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -378,7 +378,7 @@ class DrawPolylineWall(bpy.types.Operator):
tool.Blender.update_viewport() tool.Blender.update_viewport()
if event.value == "RELEASE" and event.type == "LEFTMOUSE": if event.value == "RELEASE" and event.type == "LEFTMOUSE":
tool.Snap.insert_polyline_point() tool.Snap.insert_polyline_point(self.input_panel)
tool.Blender.update_viewport() tool.Blender.update_viewport()
if event.value == "PRESS" and event.type == "C": if event.value == "PRESS" and event.type == "C":
@@ -448,7 +448,7 @@ class DrawPolylineWall(bpy.types.Operator):
if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}: if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}:
self.recalculate_inputs(context) self.recalculate_inputs(context)
tool.Snap.insert_polyline_point(float(self.input_panel["X"]), float(self.input_panel["Y"])) tool.Snap.insert_polyline_point(self.input_panel)
self.is_input_on = False self.is_input_on = False
self.input_type = "OFF" self.input_type = "OFF"
self.number_input = [] self.number_input = []
+8 -6
View File
@@ -118,11 +118,14 @@ class Snap(bonsai.core.tool.Snap):
@classmethod @classmethod
def insert_polyline_point(cls, input_panel): def insert_polyline_point(cls, input_panel):
x = float(input_panel['X']) x = float(input_panel["X"])
y = float(input_panel['Y']) y = float(input_panel["Y"])
z = float(input_panel['Z']) try:
d = input_panel['D'] z = float(input_panel["Z"])
a = input_panel['A'] except:
z = Vector((0, 0, 0))
d = input_panel["D"]
a = input_panel["A"]
snap_vertex = bpy.context.scene.BIMModelProperties.snap_mouse_point[0] snap_vertex = bpy.context.scene.BIMModelProperties.snap_mouse_point[0]
if cls.use_default_container: if cls.use_default_container:
@@ -371,7 +374,6 @@ class Snap(bonsai.core.tool.Snap):
else: else:
return None, None, None return None, None, None
try: try:
polyline_data = bpy.context.scene.BIMModelProperties.polyline_point polyline_data = bpy.context.scene.BIMModelProperties.polyline_point
last_polyline_point = polyline_data[len(polyline_data) - 1] last_polyline_point = polyline_data[len(polyline_data) - 1]