-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose low level properties of animation_tree #77347
base: master
Are you sure you want to change the base?
Expose low level properties of animation_tree #77347
Conversation
da8ca9f
to
85b6f3b
Compare
It is okay to add a way to get some informations, but there are some properties that should not have setter and they should be readonly. We must avoid the possibility of users doing unsafe access by publishing properties. It would easily break AniamtionTree's internal processes. If you want to have rollback features as described in the proposal, you need to implement a secure API that can handle the rollback without breaking those properties. If you want to do something like the video, you can add a class like AnimationTreeRecorder that extends AnimationTree with properties like "buffer time" and "rollback time" to record and rollback the state. I think it would be more acceptable to add that to the core than to publish these properties. |
85b6f3b
to
b2e7b2a
Compare
832d56e
to
ca8e7db
Compare
This solution is very basic and unsafe, but not unreasonable. Although I can't provide other use case of exposing low level properties, I think this pr can do more thing, not only for rollback feature.
Rollback feature is quite specific and non-universal, I am not sure it is worth to add a class to do this. By the way, I still not clearify that which properties should be retrieved when process rollbacking (I remain comments in code to describe my understanding and why not publish them), I need help. |
Godot basically can't implement something for which there is no use case to the core. This means that we cannot publish these dangerous properties without a reason. I agree that there are practical use cases where it is worthwhile to implement rollback for replays of rhythm games where the characters dance, or for online play. So I think it is better to brush up the functionality for rollback to increase the generic utility of it than to focus on publishing these properties. |
If we agree that "rollback" can be a generic utility of godot animation system, I will design function-oriented apis instead of publishing properties. Here have two set of apis by adding a class
The first way seem more high performance, but the second way is more simple and easy to use. No matter which option I choose, I need to clearify which low level properties should be gathered as "State/Record". This is an important topic, too. |
The former looks better. However, I don't see the need to call Instead, it would be fine to have a |
Let's do some change: For automatically time base recording, add For manually record, change |
ca8e7db
to
890d806
Compare
// "input_activity_map" is updated when update properties, expose it is not make sense. | ||
// It seem "input_activity_map_get" only used in edior. | ||
// "properties_dirty", "last_animation_player" are changed automatically and not effect the work logic, expose them is not make sense. | ||
// ================================ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several comments explaining things that I don't think are helpful here
Did we expose the ring buffer implementation in Godot Engine to GDScript? I don't think we ever did. https://github.com/godotengine/godot/blob/master/core/templates/ring_buffer.h A RingBuffer was mentioned in |
890d806
to
ce4adb4
Compare
ce4adb4
to
991be6e
Compare
Using |
doc/classes/AnimationTree.xml
Outdated
<member name="property_map" type="Dictionary" setter="set_property_map" getter="get_property_map" default="{}"> | ||
</member> | ||
<member name="root_motion_position" type="Vector3" setter="set_root_motion_position" getter="get_root_motion_position" default="Vector3(0, 0, 0)"> | ||
Retrieve the motion delta of position with the [member root_motion_track] as a [Vector3] that can be used elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the text here is still for a function just getting the value, needs a new wording
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My English is not goodt. Although I update the description, it need review.
b5f6b57
to
db5feb2
Compare
db5feb2
to
82691f1
Compare
In #77395, I add a new template |
Implement #6807.
Expose some low level properties of
AnimationTree
to realize recordable animation system.AnimRecord.2.mp4