mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Small fix after 14917d2c3
This commit is contained in:
@@ -26,7 +26,7 @@ from math import sin, cos, radians, degrees, atan2, acos
|
||||
from bpy.types import SpaceView3D
|
||||
import math
|
||||
from bpy_extras import view3d_utils
|
||||
from mathutils import Vector, Matrix
|
||||
from mathutils import Vector, Matrix, Quaternion
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
from gpu_extras.presets import draw_circle_2d
|
||||
from typing import Union
|
||||
@@ -564,9 +564,12 @@ class PolylineDecorator:
|
||||
rl = 0
|
||||
snap_prop = context.scene.BIMPolylineProperties.snap_mouse_point[0]
|
||||
mouse_point = Vector((snap_prop.x, snap_prop.y, snap_prop.z))
|
||||
snap_obj = bpy.data.objects[snap_prop.snap_object]
|
||||
try:
|
||||
snap_obj = bpy.data.objects[snap_prop.snap_object]
|
||||
except:
|
||||
snap_obj = None
|
||||
snap_element = tool.Ifc.get_entity(snap_obj)
|
||||
rot_mat = Vector((0.0, 0.0, 0.0))
|
||||
rot_mat = Quaternion()
|
||||
if snap_element and snap_element.is_a("IfcWall"):
|
||||
rot_mat = snap_obj.matrix_world.to_quaternion()
|
||||
|
||||
|
||||
@@ -112,7 +112,11 @@ class Snap(bonsai.core.tool.Snap):
|
||||
snap_vertex.y = snap_point[1]
|
||||
snap_vertex.z = snap_point[2]
|
||||
snap_vertex.snap_type = snap_type
|
||||
snap_vertex.snap_object = snap_obj.name
|
||||
if snap_obj:
|
||||
snap_vertex.snap_object = snap_obj.name
|
||||
else:
|
||||
snap_vertex.snap_object = ''
|
||||
|
||||
|
||||
@classmethod
|
||||
def clear_snapping_point(cls):
|
||||
|
||||
Reference in New Issue
Block a user