Polyline wall - you now can press 'C' to close the polyline

This commit is contained in:
Bruno Perdigão
2024-08-12 16:01:25 -03:00
parent 8d53141d5a
commit bc70130123
2 changed files with 16 additions and 0 deletions
@@ -553,6 +553,12 @@ class DrawPolylineWall(bpy.types.Operator):
if event.value == "RELEASE" and event.type == "LEFTMOUSE":
tool.Snap.insert_polyline_point()
tool.Blender.update_viewport()
if event.value == "PRESS" and event.type == "C":
tool.Snap.close_polyline()
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
tool.Blender.update_viewport()
if not self.is_input_on:
if event.value == "RELEASE" and event.type == "BACK_SPACE":
+10
View File
@@ -104,6 +104,16 @@ class Snap(blenderbim.core.tool.Snap):
polyline_point.y = snap_vertex.y
polyline_point.z = default_container_elevation
@classmethod
def close_polyline(cls):
polyline_data = bpy.context.scene.BIMModelProperties.polyline_point
if len(polyline_data) > 2:
first_point = polyline_data[0]
polyline_point = bpy.context.scene.BIMModelProperties.polyline_point.add()
polyline_point.x = first_point.x
polyline_point.y = first_point.y
polyline_point.z = first_point.z
@classmethod
def clear_polyline(cls):
bpy.context.scene.BIMModelProperties.polyline_point.clear()