From ca23fbf5f8793e3cd46f92e670b7f0e2c5458a6b Mon Sep 17 00:00:00 2001 From: Jrius <2261279+Jrius@users.noreply.github.com> Date: Sat, 24 Apr 2021 14:30:24 +0200 Subject: [PATCH] GroupMaster: simplify using has_animation_data --- korman/idprops.py | 8 +------- korman/properties/modifiers/anim.py | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/korman/idprops.py b/korman/idprops.py index f351cb0..40cc474 100644 --- a/korman/idprops.py +++ b/korman/idprops.py @@ -119,13 +119,7 @@ class IDPropObjectMixin(IDPropMixin): def poll_animated_objects(self, value): - if value.animation_data is not None: - if value.animation_data.action is not None: - return True - if value.data is not None and value.data.animation_data is not None: - if value.data.animation_data.action is not None: - return True - return False + return value.plasma_object.has_animation_data def poll_camera_objects(self, value): return value.type == "CAMERA" diff --git a/korman/properties/modifiers/anim.py b/korman/properties/modifiers/anim.py index 05e8f5d..fba352a 100644 --- a/korman/properties/modifiers/anim.py +++ b/korman/properties/modifiers/anim.py @@ -193,11 +193,7 @@ class PlasmaAnimationGroupModifier(ActionModifier, PlasmaModifierProperties): msg = "Animation Group '{}' specifies an invalid object. Ignoring..." exporter.report.warn(msg, self.key_name, ident=2) continue - animation_data = child_bo.animation_data - if animation_data is None or animation_data.action is None: - if child_bo.data is not None: - animation_data = child_bo.data.animation_data - if animation_data is None or animation_data.action is None: + if not child_bo.plasma_object.has_animation_data: msg = "Animation Group '{}' specifies an object '{}' with no valid animation data. Ignoring..." exporter.report.warn(msg, self.key_name, child_bo.name, indent=2) continue