Previous Thread  Next Thread

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

karljj1

Posted: Sat Sep 29, 2012 4:53 pm
Joined: 25 May 2011
Posts: 5
Hi,

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

myFace.select = 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?

Thanks

Karl
Reply with quote


CoDEmanX

Posted: Mon Oct 01, 2012 2:53 pm
Joined: 05 Apr 2009
Posts: 699
switch to object mode, set polygons[n].select = False, switch back to edit mode

or: use bmesh api
Code:
import bmesh
ob = bpy.context.object
me = ob.data
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...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group