黑猫鸣泣时吧 关注:12贴子:129
  • 0回复贴,共1

blender通过python创建自定义模型

只看楼主收藏回复

import bpy
verts = [(0,0,0),(0,1,0),(1,0,0),(1,1,0)]
edges = [(0,1),(1,3),(3,2),(2,0)]#参数为顶点的索引
faces = [(0,1,3,2)]#参数为顶点的索引
mesh = bpy.data.meshes.new('Pyramid_Mesh')
mesh.from_pydata(verts, edges,faces)
mesh.update()
pyramid = bpy.data.objects.new('Pyramid', mesh)
scene = bpy.context.scene
#scene.objects.link(pyramid)
bpy.context.scene.collection.objects.link(pyramid)


IP属地:广西1楼2020-02-16 11:17回复