mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
Polytool, fixed error with setting the plane method
This commit is contained in:
@@ -512,6 +512,7 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
else:
|
else:
|
||||||
if event.value == "RELEASE" and event.type in {"ESC"}:
|
if event.value == "RELEASE" and event.type in {"ESC"}:
|
||||||
|
tool.Snap.set_snap_axis_method(None)
|
||||||
PolylineDecorator.uninstall()
|
PolylineDecorator.uninstall()
|
||||||
tool.Snap.clear_polyline()
|
tool.Snap.clear_polyline()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|||||||
@@ -2485,21 +2485,21 @@ class MeasureTool(bpy.types.Operator):
|
|||||||
if event.shift and event.value == "PRESS" and event.type == "X":
|
if event.shift and event.value == "PRESS" and event.type == "X":
|
||||||
tool.Snap.set_use_default_container(False)
|
tool.Snap.set_use_default_container(False)
|
||||||
PolylineDecorator.set_use_default_container(False)
|
PolylineDecorator.set_use_default_container(False)
|
||||||
tool.Snap.set_snap_plane_method("YZ")
|
tool.Snap.cycle_snap_plane_method("YZ")
|
||||||
tool.Snap.set_snap_axis_method(None)
|
tool.Snap.set_snap_axis_method(None)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
if event.shift and event.value == "PRESS" and event.type == "Y":
|
if event.shift and event.value == "PRESS" and event.type == "Y":
|
||||||
tool.Snap.set_use_default_container(False)
|
tool.Snap.set_use_default_container(False)
|
||||||
PolylineDecorator.set_use_default_container(False)
|
PolylineDecorator.set_use_default_container(False)
|
||||||
tool.Snap.set_snap_plane_method("XZ")
|
tool.Snap.cycle_snap_plane_method("XZ")
|
||||||
tool.Snap.set_snap_axis_method(None)
|
tool.Snap.set_snap_axis_method(None)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
if event.shift and event.value == "PRESS" and event.type == "Z":
|
if event.shift and event.value == "PRESS" and event.type == "Z":
|
||||||
tool.Snap.set_use_default_container(False)
|
tool.Snap.set_use_default_container(False)
|
||||||
PolylineDecorator.set_use_default_container(False)
|
PolylineDecorator.set_use_default_container(False)
|
||||||
tool.Snap.set_snap_plane_method("XY")
|
tool.Snap.cycle_snap_plane_method("XY")
|
||||||
tool.Snap.set_snap_axis_method(None)
|
tool.Snap.set_snap_axis_method(None)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
@@ -2514,6 +2514,8 @@ class MeasureTool(bpy.types.Operator):
|
|||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
else:
|
else:
|
||||||
if event.value == "RELEASE" and event.type in {"ESC"}:
|
if event.value == "RELEASE" and event.type in {"ESC"}:
|
||||||
|
tool.Snap.set_snap_plane_method(None)
|
||||||
|
tool.Snap.set_snap_axis_method(None)
|
||||||
PolylineDecorator.uninstall()
|
PolylineDecorator.uninstall()
|
||||||
tool.Snap.clear_polyline()
|
tool.Snap.clear_polyline()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_snap_plane_method(cls, value=True):
|
def set_snap_plane_method(cls, value=True):
|
||||||
|
cls.snap_plane_method = value
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def cycle_snap_plane_method(cls, value=True):
|
||||||
if cls.snap_plane_method == value:
|
if cls.snap_plane_method == value:
|
||||||
cls.snap_plane_method = None
|
cls.snap_plane_method = None
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user