"Import Pose Library" fails with incorrect context

Issue #126 resolved
Alec Vallintine created an issue

Blender 2.83, import-daz 1.4.2

When importing a pose using the “Import Pose Library” button, no pose library gets created and you get the error message:

Operator bpy.ops.poselib.pose_add.poll() failed, context is incorrect

The problem seems to be that when pose_add() gets called on line 617 of animation.py the current mode of the rig is “OBJECT” and pose_add() needs to be called in “POSE” mode. The mode is getting switched to “OBJECT” earlier in the code on line 345:

if rig.type == 'ARMATURE':
    bpy.ops.object.mode_set(mode='OBJECT')
    self.prepareRig(rig)

So, even if you’re in “POSE” mode when you click the button the mode gets switched to “OBJECT” and pose_add() fails when it eventually gets called.

Comments (4)

  1. Thomas Larsson repo owner

    Should work now. I have tested to import pose, poselib and action without errors.

  2. Log in to comment