System Information
Win7 64 bits with sp1
Blender Version
Broken: official 2.76b 64 bits
Exact steps for others to reproduce the error
I want to select/deselect some vertices based on some conditions, for example
- for the default scene, we enter the EDIT mode and can find that all the 8 vertices of the cube are selected. Then run this script
import bpy
for obj in bpy.data.meshes:
bpy.ops.object.mode_set(mode="OBJECT")
for vertex in obj.vertices:
if vertex.co.x<0:
vertex.select=False
print (vertex.select)
bpy.ops.object.mode_set(mode="EDIT")
bpy.context.scene.update()We find that nothing changes, and all 8 vertices are still selected!
- now we deselect all vertices by hand( A-key in 3d window), and run this
import bpy
for obj in bpy.data.meshes:
bpy.ops.object.mode_set(mode="OBJECT")
for vertex in obj.vertices:
if vertex.co.x<0:
vertex.select=True #Please note this is True, but above code is False
print (vertex.select)
bpy.ops.object.mode_set(mode="EDIT")
bpy.context.scene.update()we can find 4 vertices are selected now.
We can repeat case 1 and 2 many times as you wish. So I am puzzled, why does Blender operate "vertex.select=True", but omit "vertex.select=False"? For consistency, if one operation is allowed, why not allow another? Or blender should ban 2 operations by make vertex.select is a read-only atributes?