2026-01-01

This commit is contained in:
2026-03-17 15:16:34 -06:00
parent ec4cf523fb
commit b80274187b
263 changed files with 95164 additions and 3848 deletions
+12 -5
View File
@@ -1049,13 +1049,13 @@ def only_selected_bones(self, context):
def data_type_update(self, context):
obj = self.id_data
anim_data = anim_data_type(obj)
obj.als['layer_index'] = 0
if anim_data is None:
obj.Anim_Layers.clear()
return
if not len(anim_data.nla_tracks):
obj.Anim_Layers.clear()
return
obj.als.layer_index = 0
register_layers(obj, anim_data.nla_tracks)
#change bake method if working with shapekeys
@@ -1980,12 +1980,14 @@ class AddAnimLayer(bpy.types.Operator):
#starting animation layers and getting the default sync layer names
obj.als.auto_rename = context.preferences.addons[__package__].preferences.auto_rename
#Adding base layer
obj.als['layer_index'] = 0
add_animlayer(base_name, index = 0, blend_type = blend_type)
#using a temporary variable instead of calling update_track_list all the time with obj.als.layer_index
index = 0
if anim_data.action:
add_animlayer(layer_name, blend_type = blend_type)
add_animlayer(layer_name, index, blend_type = blend_type)
index += 1
anim_data.action.use_fake_user = True
anim_data.action = None
@@ -2705,10 +2707,10 @@ class AddSlot(bpy.types.Operator):
return {'FINISHED'}
if not hasattr(anim_data, 'action_slot'):
return {'FINISHED'}
index = obj.als.layer_index
if not len(anim_data.nla_tracks[index].strips):
return {'FINISHED'}
index = obj.als.layer_index
strip = anim_data.nla_tracks[index].strips[0]
action = strip.action
@@ -2734,10 +2736,10 @@ class RemoveSlot(bpy.types.Operator):
return {'FINISHED'}
if not hasattr(anim_data, 'action_slot'):
return {'FINISHED'}
index = obj.als.layer_index
if not len(anim_data.nla_tracks[index].strips):
return {'FINISHED'}
index = obj.als.layer_index
strip = anim_data.nla_tracks[index].strips[0]
action = strip.action
action_slot = strip.action_slot
@@ -3260,7 +3262,12 @@ def add_action_slot(obj, action):
if action.slots:
for slot in action.slots:
if obj in slot.users():
if obj.als.data_type != slot.target_id_type:
continue
# Shapekey slot users are the shapekey data, object slot users are the objects
item = obj.data.shape_keys if hasattr(obj.data, 'shape_keys') and obj.als.data_type == 'KEY' else obj
if item in slot.users():
return slot
slot = action.slots.new(obj.als.data_type, obj.name)