教程
QA
Python控制台输出乱码
在py脚本添加# -*- coding: utf-8 -*-
Python脚本
四棱锥
# -*- coding: utf-8 -*-import bpy#Define vertices, faces, edgesverts = [(0,0,0),(0,5,0),(5,5,0),(5,0,0),(2.5,2.5,4.5)]faces = [(0,1,2,3), (0,4,1), (1,4,2), (2,4,3), (3,4,0)]#Define mesh and objectmesh = bpy.data.meshes.new("Cube")object = bpy.data.objects.new("Cube", mesh)#Set location and scene of objectobject.location = bpy.context.scene.cursor.locationbpy.context.scene.collection.objects.link(object)#Create meshmesh.from_pydata(verts,[],faces)mesh.update(calc_edges=True)

