I'm having problem in working with various objects in blender. I'm writing a code to change the vertices of a object; but, it does not work when there are several objects at the scene, the problem is that I'm not getting change to the edit mode because of the "type" of the selection that I'm doing. When I select one object it do not necessary became the "master" object and so commands like bpy.ops.object.editmode_toggle() doesn't work.
I will put a photo to try to explain what a want to say with 'master' object
even when I select the "Circle" and deselect the "Empty" object, the last one remains marked. If someone can help, I appreciate.
bpy ops
commands, be aware that they work on the active object, not the selected one(s). The active object is usually the last object selected. $\endgroup$obj.select_set(False)
(Blender 3.0) $\endgroup$