Browse Source

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."
master
Adam Johnson 1 week ago
parent
commit
b059bb07a9
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 19
      korman/nodes/node_messages.py

19
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:
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):

Loading…
Cancel
Save