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()
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()
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"}:
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.input_type = "OFF"
self.number_input = []
+8 -6
View File
@@ -118,11 +118,14 @@ class Snap(bonsai.core.tool.Snap):
@classmethod
def insert_polyline_point(cls, input_panel):
x = float(input_panel['X'])
y = float(input_panel['Y'])
z = float(input_panel['Z'])
d = input_panel['D']
a = input_panel['A']
x = float(input_panel["X"])
y = float(input_panel["Y"])
try:
z = float(input_panel["Z"])
except:
z = Vector((0, 0, 0))
d = input_panel["D"]
a = input_panel["A"]
snap_vertex = bpy.context.scene.BIMModelProperties.snap_mouse_point[0]
if cls.use_default_container:
@@ -371,7 +374,6 @@ class Snap(bonsai.core.tool.Snap):
else:
return None, None, None
try:
polyline_data = bpy.context.scene.BIMModelProperties.polyline_point
last_polyline_point = polyline_data[len(polyline_data) - 1]