From b059bb07a95f53c8256634c300fc5ffc8880499b Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 7 Jun 2025 12:19:27 -0500 Subject: [PATCH] Differentiate between "controllable" and "uncontrollable" animations. This improves the "no controllable animations" error very slightly - if no animations are available at all, we now report "No animations found." OTOH, if there are animations, but they are SDL animations, we say "No controllable animations found." --- korman/nodes/node_messages.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/korman/nodes/node_messages.py b/korman/nodes/node_messages.py index 97c33cf..0d06130 100644 --- a/korman/nodes/node_messages.py +++ b/korman/nodes/node_messages.py @@ -255,7 +255,7 @@ class PlasmaAnimCmdMsgNode(idprops.IDPropMixin, PlasmaMessageWithCallbacksNode, msg.addCallback(cb) msg.setCmd(plAnimCmdMsg.kAddCallbacks, True) - def convert_message(self, exporter, so): + def convert_message(self, exporter: Exporter, so: plSceneObject): msg = plAnimCmdMsg() # We're either sending this off to an AGMasterMod or a LayerAnim @@ -271,13 +271,18 @@ class PlasmaAnimCmdMsgNode(idprops.IDPropMixin, PlasmaMessageWithCallbacksNode, texture = self.target_texture if obj is None and material is None and texture is None: self.raise_error("At least one of: target object, material, texture MUST be specified") - target = exporter.mesh.material.get_texture_animation_key(obj, material, texture, self.anim_name) - - target = [i for i in target if not isinstance(i.object, (plAgeGlobalAnim, plLayerSDLAnimation))] - if not target: - self.raise_error("No controllable animations were found.") - for i in target: - msg.addReceiver(i) + target = tuple(exporter.mesh.material.get_texture_animation_key(obj, material, texture, self.anim_name)) + + filtered_target = [i for i in target if not isinstance(i.object, (plAgeGlobalAnim, plLayerSDLAnimation))] + if not filtered_target and target: + self.raise_error("No controllable animations were found!") + elif not filtered_target and not target: + self.raise_error("No animations were found!") + elif filtered_target: + for i in filtered_target: + msg.addReceiver(i) + else: + raise RuntimeError() # Check the enum properties to see what commands we need to add for prop in (self.go_to, self.action, self.play_direction, self.looping):