1

How can I tell a script to select the vertices of a mesh within their indecies that are stored in a list? For example, "currentFace" contains the verts 6,7,8; these are the verts that create the face.

Now I want to select those vertecies to assign a material to them.

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

The console says that lists are not supported. Is there any other way to select the vertices of the mesh within its index?

Thanks in advance.

1 Answer 1

0

You can't use a list as an index into an array. The way to get it to work is to loop through each value in the list -

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.