Created
July 6, 2022 15:05
-
-
Save CGArtPython/c5fb05aab9cc84bff5a73058df3315c0 to your computer and use it in GitHub Desktop.
Blender Python script to deselect verts using thier index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# give Python access to Blender's mesh manipulation functionality | |
import bmesh | |
# give Python access to Blender's functionality | |
import bpy | |
# add cube | |
bpy.ops.mesh.primitive_cube_add() | |
obj = bpy.context.active_object | |
# enable edit mode | |
bpy.ops.object.editmode_toggle() | |
# create a BMesh object to manipulate geometry data (must be done in edit mode) | |
bm = bmesh.from_edit_mesh(obj.data) | |
# make sure we can use the square brackets to access verts | |
bm.verts.ensure_lookup_table() | |
# deselect vert with index 0 | |
bm.verts[0].select = False | |
# deselect vert with index 1 | |
bm.verts[1].select = False | |
# deselect vert with index 2 | |
bm.verts[2].select = False | |
# disable edit mode | |
# bpy.ops.object.editmode_toggle() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment