【问题标题】:Blender Python select vertices of a mesh with their indexBlender Python 选择网格的顶点及其索引
【发布时间】:2015-07-21 22:15:19
【问题描述】:

我如何告诉脚本在存储在列表中的不确定性中选择网格的顶点?例如,“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

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

提前致谢。

【问题讨论】:

    标签: python blender mesh vertex


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2013-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-21
      • 2017-02-10
      • 2018-01-02
      • 2023-03-26
      • 2019-04-21
      相关资源
      最近更新 更多