poohcom1 / godot-animation-player-refactor Goto Github PK
View Code? Open in Web Editor NEWAnimationPlayer refactoring addon for Godot!
Home Page: https://godotengine.org/asset-library/asset/1777
License: MIT License
AnimationPlayer refactoring addon for Godot!
Home Page: https://godotengine.org/asset-library/asset/1777
License: MIT License
This addon currently supports value and method tracks, but value tracks should technically support most other types of tracks (this needs to be tested). What's missing are different icon types for each track, as only value (white) and method (green) icons are configured:
We can add icons to other tracks by editing the following files:
EditInfo.Type
:
Currently, icons are drawn based on the value lookup from the node itself. The main purpose for EditInfo.type
was to store value type when editing the value (i.e. know that we're editing a method even if the value is invalid), but we should be able to extend it to also apply correct icons.
If an animation player node's libraries are from external files, refactoring anything using the addon will remove the link to the resource files, and turn the libraries into built-in resources on the scene.
When refactoring a property, you can edit the full path and easily change the node of a single property. This is straightforward because each property track is tied to a single full path (node_path
:property_name
)
However, this is currently disabled for methods:
This is because a method isn't tied to a single track. A method track can contain multiple methods, and a single method could be used in multiple tracks, so this action is a bit more complicated than just changing the full path of a track. Here are the issues to consider:
On one hand, I prefer to be the least destructive in case something goes wrong, so not removing or reusing track will be the safest route. On the other hand, if one refactors a lot, you can end up with a lot of empty or single-use tracks which can be a bit messy.
As such, the ideal solution would be to make both of these cases an editor setting, such as editors/animation/refactor/remove_empty_method_tracks
and editors/animation/refactor/reuse_method_track
. But because of this, this implementation will be rather complicated.
Currently, the intended use case of the addon is for fixing broken references for nodes/properties already changed in the scene/scripts. As such, the inputs don't offer much validation currently, as it's expected that the developer already knows what they want.
However, it might be better UX for the addon to offer a list of valid options to select from and only allow arbitrary string input after the user toggles an "Advance" option or something similar. Even better, we can combine both into one, where we show a tree with a search bar on top and always have an extra option in the tree to match any arbitrary value currently in the search bar to allow users the freedom to set existing or new values.
Currently, the addon automatically saves all changes directly to the scene or animation library resources, so it is no possible to undo changes:
The code is being handled by the static utility class anim_player_refactor.gd
, which might not be ideal to add undo/redo features. The static methods can be converted to instance methods with references to EditorPlugin
so it can access undo/redo, or all its functionality can be moved to plugin.gd
. We can store a snapshot of all the animation resources in a stack before each change, and simply revert to old snapshots on each undo.
Error message appears when refactoring saved animation libraries, but without any obvious effects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.