How can I deselect a face/poly. The 2.62 way no longer works

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed May 25, 2011 9:32 pm

How can I deselect a face/poly. The 2.62 way no longer works

Post by karljj1 » Sat Sep 29, 2012 5:53 pm


I have a script i am porting over from 2.62 to 2.63. In my script i go through an objects faces and select/deselect based on some criteria. However i have found that deselecting a face/polygon does not work as i expect.

E.G = False

When I examine the face in blender I can see that the face appears to not be selected however it has a yellow outline as if the edges are selected. When I perform an operation on the mesh it treats the face as selected. If I set a face to selected = True it works as 2.62 however the de selection seems to have changed and I cant figure out how to do it. I have tried deselecting the verts and edges but it has no effect.

So how can I deselect a polygon in blender 2.63?



Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Mon Oct 01, 2012 3:53 pm

switch to object mode, set polygons[n].select = False, switch back to edit mode

or: use bmesh api

Code: Select all

import bmesh
ob = bpy.context.object
me =
bm = bmesh.from_edit_mesh(me)
bm.faces[n].select_set(False) # you may use select = False, but make sure you flush selection (see docs)
I'm sitting, waiting, wishing, building Blender in superstition...

Post Reply