Add AnimationNodeObservers for signaling animation events#118789
Add AnimationNodeObservers for signaling animation events#118789a-johnston wants to merge 1 commit into
Conversation
e3260c4 to
91cbac8
Compare
|
The direction should be right, since we agreed on it during the animation meeting. I suggest creating a base class called At last, it would be better to include the following in the description of the NodeOneShot documentation: |
Would anything live in that base class or would it stay empty for now? I omitted the shared base class in my first pass since the signal signatures would be different although the usage pattern was very similar. |
I think empty class is fine, and you can register it as abstract class. GDREGISTER_ABSTRACT_CLASS(AnimationNodeObserver);FYI, the base class of class Texture : public Resource {
GDCLASS(Texture, Resource);
}; |
|
The base class turned out to be a good spot for the local to scene override. For the observer classes is the following signal set acceptable: In particular, should we pass the closest index through that signal? It would only be useful for fetching the position or associated animation root node, and isn't currently exposed anywhere else. I think it makes sense to just leave that empty and rely on users to track whatever state they need. |
|
For the naming consistency:
Basically, signals should only be emitted in cases where they cannot be tracked state by the user (implicitly occurred by the core), and that is the case I was referring to. I have provided further details below: AnimationNodeObserverOneShot
AnimationNodeObserverBlendSpace
AnimationNodeObserverTransition
It's debatable whether we should standardize the naming of "changed" signals to “state_changed“ or whether they should indicate the arguments like "closest_point_changed / port_changed". I'd like to hear others' opinions as well. |
2e412fe to
ee7399d
Compare
|
This is more or less ready. I opted to use |
|
CI failed with |
ee7399d to
564a34f
Compare
There was a problem hiding this comment.
That should be fine for the most part. It should be documented that Observers are available (such as link and sample code) in the extension classes of AnimationNodes that support Observers.
Since we are currently in feature freeze for 4.7, we will review this later at the AnimationMeeting as scope for 4.8.
|
Ah right I forgot to update those other docs. I'll do that and separately I can make a docs pr for adding it to the animation tree tutorial. Although that would also need to wait for after 4.7 ofc |
564a34f to
46e1c6b
Compare
46e1c6b to
a6fe6f0
Compare
… signaling animation events)
This implements godotengine/godot-proposals#13386 For
AnimationNodeOneShot,AnimationNodeTransition,AnimationNodeBlendSpace1D, andAnimationNodeBlendSpace2D.The new parameter matches how it looks in the proposed mockup:
And here's how it appears in the tree itself:
I think this is OK although the view within the AnimationTree tab is a bit confusing without labels or tooltips.
Usage is to manually set the observer in the animation tree's parameter list and then in code like:
The following test project has scenes testing each of the new observer types. Arrow keys to drive the animation node(s) and escape to return to the main menu.
animation_tree_test.zip