archipack_wall2.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def create(self, context):
        curve = context.active_object
        for spline in curve.data.splines:
            bpy.ops.archipack.wall2(auto_manipulate=self.auto_manipulate)
            o = context.scene.objects.active
            d = archipack_wall2.datablock(o)
            d.from_spline(curve.matrix_world, 12, spline)
            if spline.type == 'POLY':
                pt = spline.points[0].co
            elif spline.type == 'BEZIER':
                pt = spline.bezier_points[0].co
            else:
                pt = Vector((0, 0, 0))
            # pretranslate
            o.matrix_world = curve.matrix_world * Matrix([
                [1, 0, 0, pt.x],
                [0, 1, 0, pt.y],
                [0, 0, 1, pt.z],
                [0, 0, 0, 1]
                ])
        return o

    # -----------------------------------------------------
    # Execute
    # -----------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号