2
$\begingroup$

I wrote a python script that modifies an existing blender armature that I have and some of these modifications include some commands that are only possible in Edit Mode. I know that depending on what is selected, some modes are not possible to switch to. In my case Pose, Edit and Object mode are the three available modes when I select my armature. In this instance, the following three commands could be used:

bpy.ops.object.mode_set(mode='POSE')

bpy.ops.object.mode_set(mode='EDIT')

bpy.ops.object.mode_set(mode='OBJECT')

Of the above three only the second one switches to wrong mode i.e. Object Mode. I found no similar questions/forums on this kind of issue. When trying to change to Edit Mode, blender changes to Object mode and my commands that are intended for edit mode show context error messages (as expected if in Pose/Object mode..) making it not possible for my script to apply the correct changes.

Does anyone have any idea why this is happening and how I could stop this from happening?? Thanks

$\endgroup$
  • 2
    $\begingroup$ Could we see your script, please? It might be faulty. $\endgroup$ – Lukasz-40sth Jan 22 at 9:59
  • $\begingroup$ right in the beginning, when you try to switch to edit mode it does not work. When you select the armature, the menu bar with the modes shows Pose, Edit and Object Mode and the corresponding commands work except for the Edit mode one.. its the first like of my script... $\endgroup$ – Yasmine Jan 23 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.