I am beginer on Blender, and Python.
After running the following script:
import bpy # retrieve the active object bpy.ops.object.mode_set(mode = 'OBJECT') obj = bpy.context.active_object # retrieve the active face i = obj.data.faces.active # deselect everything bpy.ops.object.mode_set(mode = 'EDIT') bpy.ops.mesh.select_all(action = 'DESELECT') # reselect the originally selected face obj.data.faces[i].select = True
I would expect to see in the 3D view, in EDIT mode, the originally selected face of the active object still selected.
This is not the case, everything is deselected.
Can somebody explain to me where my reasoning is wrong ?