loopier / animatron

Animatron for Godot 4.x <
MIT License
16 stars 1 forks source link

Make abstraction of `set[Actor|Animation]Property...()` #8

Closed loopier closed 8 months ago

loopier commented 1 year ago

The current implementation of property setters is a bit verbose. It could probably be reduced to a single method setProperty() that would take the property name from the command address and check the type needed with typeof(object.get(property)). I've started implementing something similar in /relative (see https://github.com/loopier/animatron/commit/434598dba303ad847b4ac5b5611736d7fbb52c74), where it also checks if it's an Actor or an Animation property without having to specify it.

Ideally, we would end up with a dictionary of commands to set properties similar to this:

nodeCommands = {
  "/position": setProperty,
  "/rotation": setProperty,
  "/frame": setProperty,
  ...
}
loopier commented 8 months ago

Command handling has been reimplemented making this issue irrelevant