archipack_object.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:archipack 作者: s-leger 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号