Use Object.pose_library instead of Object.dspl.pose_library

This commit is contained in:
2024-12-28 04:50:52 -06:00
parent edeaa12f5e
commit 592a9602d8
4 changed files with 40 additions and 37 deletions

View File

@ -14,9 +14,9 @@ class DSPL_OT_CreatePoseLibrary(bpy.types.Operator):
def execute(self, context):
arm_object = getArmatureObject(context)
arm_object.dspl.pose_library = bpy.data.actions.new(
arm_object.pose_library = bpy.data.actions.new(
name=arm_object.name + "_PoseLib")
arm_object.dspl.pose_library.use_fake_user = True
arm_object.pose_library.use_fake_user = True
return {'FINISHED'}
@ -32,7 +32,7 @@ class DSPL_OT_ConvertPoseLibrary(bpy.types.Operator):
def execute(self, context):
arm_object = getArmatureObject(context)
arm_object.dspl.pose_library = arm_object.animation_data.action
arm_object.pose_library = arm_object.animation_data.action
arm_object.animation_data.action = None
return {'FINISHED'}
@ -399,8 +399,11 @@ class DSPL_OT_UnlinkPoseLibrary(bpy.types.Operator):
arm_object = getArmatureObject(context)
pose_library = getPoseLib(context)
arm_object.dspl.pose_library.name = "del_" + arm_object.dspl.pose_library.name
arm_object.dspl.pose_library = None
try:
arm_object.pose_library.name = "del_" + arm_object.pose_library.name
except:
pass
arm_object.pose_library = None
return {'FINISHED'}