Fixed is_action_for_object failing when action had multiple slots
This commit is contained in:
@@ -35,7 +35,7 @@ def get_sequences_propnames_from_source(sequence_source: str) -> Tuple[str, str]
|
|||||||
|
|
||||||
|
|
||||||
def is_action_for_object(obj: Object, action: Action):
|
def is_action_for_object(obj: Object, action: Action):
|
||||||
if action is None or len(action.fcurves) == 0:
|
if len(action.fcurves) == 0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if obj is None or obj.animation_data is None or obj.type != 'ARMATURE':
|
if obj is None or obj.animation_data is None or obj.type != 'ARMATURE':
|
||||||
@@ -44,7 +44,11 @@ def is_action_for_object(obj: Object, action: Action):
|
|||||||
armature_data = typing_cast(Armature, obj.data)
|
armature_data = typing_cast(Armature, obj.data)
|
||||||
bone_names = set([x.name for x in armature_data.bones])
|
bone_names = set([x.name for x in armature_data.bones])
|
||||||
|
|
||||||
for fcurve in action.fcurves:
|
# The nesting here is absolutely bonkers.
|
||||||
|
for layer in action.layers:
|
||||||
|
for strip in layer.strips:
|
||||||
|
for channelbag in strip.channelbags:
|
||||||
|
for fcurve in channelbag.fcurves:
|
||||||
match = re.match(r'pose\.bones\[\"([^\"]+)\"](\[\"([^\"]+)\"])?', fcurve.data_path)
|
match = re.match(r'pose\.bones\[\"([^\"]+)\"](\[\"([^\"]+)\"])?', fcurve.data_path)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user