bl_info = { "name": "Copy Multiple Bone Animations", "blender": (2, 80, 0), "category": "Animation", } import bpy class CopyMultipleBoneAnimationsOperator(bpy.types.Operator): bl_idname = "object.copy_multiple_bone_animations" bl_label = "Copy Multiple Bone Animations" bl_description = "Copy animations from multiple bones to specified target bones" # Kaynak ve hedef kemik çiftlerini burada tanımlayın bone_pairs = [ ("SourceBone1", "TargetBone1"), ("SourceBone2", "TargetBone2"), ("SourceBone3", "TargetBone3"), # Daha fazla kemik çifti ekleyebilirsiniz ] def execute(self, context): armature = bpy.context.object # Armature kontrolü if armature.type != 'ARMATURE': self.report({'ERROR'}, "Please select an armature object.") return {'CANCELLED'} # Her bir kaynak-hedef kemik çifti için animasyon kopyala for source_bone_name, target_bone_name in self.bone_pairs: # Kaynak ve hedef kemiklerin varlık kontrolü if source_bone_name not in armature.pose.bones or target_bone_name not in armature.pose.bones: self.report({'ERROR'}, f"Bone '{source_bone_name}' or '{target_bone_name}' not found.") continue # Animasyon kopyalama işlemi action = armature.animation_data.action for fcurve in action.fcurves: # Kaynak kemiğe ait fcurves'leri bul if fcurve.data_path.endswith(f'["{source_bone_name}"]'): # Hedef kemik için yeni fcurve oluştur new_fcurve = action.fcurves.new( data_path=fcurve.data_path.replace(source_bone_name, target_bone_name), index=fcurve.array_index ) # Keyframe noktalarını kopyala for keyframe in fcurve.keyframe_points: new_fcurve.keyframe_points.insert( keyframe.co[0], keyframe.co[1], options={'FAST'} ) self.report({'INFO'}, "Animations copied for all specified bone pairs.") return {'FINISHED'} def menu_func(self, context): self.layout.operator(CopyMultipleBoneAnimationsOperator.bl_idname) def register(): bpy.utils.register_class(CopyMultipleBoneAnimationsOperator) bpy.types.VIEW3D_MT_pose.append(menu_func) def unregister(): bpy.utils.unregister_class(CopyMultipleBoneAnimationsOperator) bpy.types.VIEW3D_MT_pose.remove(menu_func) if __name__ == "__main__": register()