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
# -----------------------------------------------------
评论列表
文章目录