def mouse_hover_wall(self, context, event):
"""
convert mouse pos to matrix at bottom of surrounded wall, y oriented outside wall
"""
res, pt, y, i, o, tM = self.mouse_to_scene_raycast(context, event)
if res and o.data is not None and 'archipack_wall2' in o.data:
z = Vector((0, 0, 1))
d = o.data.archipack_wall2[0]
y = -y
pt += (0.5 * d.width) * y.normalized()
x = y.cross(z)
return True, Matrix([
[x.x, y.x, z.x, pt.x],
[x.y, y.y, z.y, pt.y],
[x.z, y.z, z.z, o.matrix_world.translation.z],
[0, 0, 0, 1]
]), o, y
return False, Matrix(), None, Vector()
评论列表
文章目录