Use words_separated instead of mixedCase for common functions

This commit is contained in:
2025-01-13 15:50:03 -06:00
parent cb3999de33
commit 21f2278990
3 changed files with 76 additions and 76 deletions

View File

@ -13,7 +13,7 @@ class DSPL_OT_CreatePoseLibrary(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
arm_object.pose_library = bpy.data.actions.new(
name=arm_object.name + "_PoseLib")
arm_object.pose_library.use_fake_user = True
@ -31,7 +31,7 @@ class DSPL_OT_ConvertPoseLibrary(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
if pose_library is None:
arm_object.pose_library = arm_object.animation_data.action
arm_object.animation_data.action = None
@ -52,7 +52,7 @@ class DSPL_OT_AddPose(bpy.types.Operator):
replace: bpy.props.BoolProperty(name="Replace", description="Replace existing pose", default=False, options={'SKIP_SAVE'})
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
if self.replace == False:
pose_markers = pose_library.pose_markers
new_name = self.posename
@ -80,7 +80,7 @@ class DSPL_OT_AddPose(bpy.types.Operator):
pose_markers.new(name=pose_name)
pose_markers[pose_name].frame = new_marker
setKeyframesFromBones(context, arm_object, new_marker)
set_keyframes_from_bones(context, arm_object, new_marker)
pose_library.pose_markers.active = pose_markers[pose_name]
bpy.context.area.tag_redraw()
@ -105,7 +105,7 @@ class DSPL_OT_AddPose(bpy.types.Operator):
new_marker = target_frame
setKeyframesFromBones(context, arm_object, new_marker)
set_keyframes_from_bones(context, arm_object, new_marker)
self.report({'INFO'}, "DSPL: Replaced " + pose_markers[new_name].name + " on frame " + str(pose_markers[new_name].frame))
@ -124,10 +124,10 @@ class DSPL_OT_RemovePose(bpy.types.Operator):
posename: bpy.props.StringProperty()
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
pose_markers = pose_library.pose_markers
if self.posename:
pose_library.pose_markers.active_index = searchPoseMarker(context, posename=self.posename, type="index")
pose_library.pose_markers.active_index = search_pose_marker(context, posename=self.posename, type="index")
active_index = pose_library.pose_markers.active_index
else:
active_index = pose_markers.active_index
@ -173,12 +173,12 @@ class DSPL_OT_RenamePose(bpy.types.Operator):
pose_new_name: bpy.props.StringProperty()
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
pose_markers = pose_library.pose_markers
active_marker = pose_markers.active
if self.posename:
target_marker = searchPoseMarker(context, posename=self.posename, type="marker")
target_marker = search_pose_marker(context, posename=self.posename, type="marker")
else:
target_marker = active_marker
@ -211,12 +211,12 @@ class DSPL_OT_MovePose(bpy.types.Operator):
posename: bpy.props.StringProperty(name="Pose Name", default="", options={'SKIP_SAVE'})
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
pose_markers = pose_library.pose_markers
if self.posename:
active_index = searchPoseMarker(context, posename=self.posename, type="index")
active_marker = searchPoseMarker(context, posename=self.posename, type="marker")
active_index = search_pose_marker(context, posename=self.posename, type="index")
active_marker = search_pose_marker(context, posename=self.posename, type="marker")
active_frame = active_marker.frame
active_posename = active_marker.name
else:
@ -261,21 +261,21 @@ class DSPL_OT_ApplyPose(bpy.types.Operator):
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
pose_markers = pose_library.pose_markers
if self.posename:
active_marker = searchPoseMarker(context, posename=self.posename, type="marker")
active_marker = search_pose_marker(context, posename=self.posename, type="marker")
active_frame = active_marker.frame
active_posename = active_marker.name
pose_library.pose_markers.active_index = searchPoseMarker(context, posename=self.posename, type="index")
pose_library.pose_markers.active_index = search_pose_marker(context, posename=self.posename, type="index")
else:
active_index = pose_markers.active_index
active_marker = pose_markers.active
active_frame = active_marker.frame
active_posename = active_marker.name
setBonesfromKeyframes(context, arm_object, active_marker)
set_bones_from_keyframes(context, arm_object, active_marker)
self.report({'INFO'}, "DSPL: Applied " + active_posename)
@ -284,8 +284,8 @@ class DSPL_OT_ApplyPose(bpy.types.Operator):
def invoke(self, context, event):
if event.ctrl:
# Select
arm_object, pose_library = getArmatureData(context)
pose_library.pose_markers.active_index = searchPoseMarker(context, posename=self.posename, type="index")
arm_object, pose_library = get_armature_data(context)
pose_library.pose_markers.active_index = search_pose_marker(context, posename=self.posename, type="index")
return {'FINISHED'}
elif event.alt:
# Remove
@ -354,7 +354,7 @@ class DSPL_OT_BrowsePoses(bpy.types.Operator):
def invoke(self, context, event):
bpy.context.area.tag_redraw()
self.arm_object, self.pose_library = getArmatureData(context)
self.arm_object, self.pose_library = get_armature_data(context)
if self.pose_library is None:
self.report({'WARNING'}, "DSPL: Pose Library not active")
@ -383,7 +383,7 @@ class DSPL_OT_UnlinkPoseLibrary(bpy.types.Operator):
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
arm_object, pose_library = getArmatureData(context)
arm_object, pose_library = get_armature_data(context)
try:
arm_object.pose_library = None