Use Object.pose_library instead of Object.dspl.pose_library

This commit is contained in:
2024-12-28 04:50:52 -06:00
committed by Blazer Silving
parent b2fc121a88
commit d008e4750c
4 changed files with 42 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,13 @@ 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.use_fake_user = False
# if not arm_object.pose_library.name.startswith("del_"):
# arm_object.pose_library.name = "del_{}".format(arm_object.pose_library.name)
except:
pass
arm_object.pose_library = None
return {'FINISHED'}