繁体   English   中英

Blender Python使用其索引选择网格的顶点

[英]Blender Python select vertices of a mesh with their index

我该如何告诉脚本在存储在列表中的索引内选择网格的顶点? 例如,“ currentFace”包含顶点6,7,8; 这些是创造面子的顶点。

现在,我想选择这些顶点以为其分配材料。

mesh.vertices[currentFace].select = True # Select Mesh's currentFace-verts
bpy.ops.object.material_slot_assign() # assign selected material in mesh material-slot to selected verts

控制台说不支持列表。 还有其他方法可以在其索引内选择网格的顶点吗?

提前致谢。

您不能将列表用作数组的索引。 使它起作用的方法是遍历列表中的每个值-

for i in currentFace:
    mesh.vertices[i].select = True

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM