You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Massive rewrite to AnimationTree. Many APIs changed in order to:
-Reuse resources -Expose properties in AnimationTree
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/plugins/animation_tree_editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "scene/animation/animation_blend_tree.h"
|
||||
#include "scene/gui/button.h"
|
||||
@@ -13,14 +14,13 @@
|
||||
@author Juan Linietsky <reduzio@gmail.com>
|
||||
*/
|
||||
|
||||
class AnimationNodeBlendTreeEditor : public VBoxContainer {
|
||||
class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
|
||||
|
||||
GDCLASS(AnimationNodeBlendTreeEditor, VBoxContainer);
|
||||
GDCLASS(AnimationNodeBlendTreeEditor, AnimationTreeNodeEditorPlugin);
|
||||
|
||||
Ref<AnimationNodeBlendTree> blend_tree;
|
||||
GraphEdit *graph;
|
||||
MenuButton *add_node;
|
||||
Button *goto_parent;
|
||||
|
||||
PanelContainer *error_panel;
|
||||
Label *error_label;
|
||||
@@ -32,6 +32,7 @@ class AnimationNodeBlendTreeEditor : public VBoxContainer {
|
||||
CheckBox *filter_enabled;
|
||||
|
||||
Map<StringName, ProgressBar *> animations;
|
||||
Vector<EditorProperty *> visible_properties;
|
||||
|
||||
void _update_graph();
|
||||
|
||||
@@ -52,7 +53,7 @@ class AnimationNodeBlendTreeEditor : public VBoxContainer {
|
||||
|
||||
static AnimationNodeBlendTreeEditor *singleton;
|
||||
|
||||
void _node_dragged(const Vector2 &p_from, const Vector2 &p_to, Ref<AnimationNode> p_node);
|
||||
void _node_dragged(const Vector2 &p_from, const Vector2 &p_to, const StringName &p_which);
|
||||
void _node_renamed(const String &p_text, Ref<AnimationNode> p_node);
|
||||
void _node_renamed_focus_out(Node *le, Ref<AnimationNode> p_node);
|
||||
|
||||
@@ -64,11 +65,8 @@ class AnimationNodeBlendTreeEditor : public VBoxContainer {
|
||||
void _scroll_changed(const Vector2 &p_scroll);
|
||||
void _node_selected(Object *p_node);
|
||||
void _open_in_editor(const String &p_which);
|
||||
void _open_parent();
|
||||
void _anim_selected(int p_index, Array p_options, const String &p_node);
|
||||
void _delete_request(const String &p_which);
|
||||
void _oneshot_start(const StringName &p_name);
|
||||
void _oneshot_stop(const StringName &p_name);
|
||||
|
||||
bool _update_filters(const Ref<AnimationNode> &anode);
|
||||
void _edit_filters(const String &p_which);
|
||||
@@ -78,8 +76,19 @@ class AnimationNodeBlendTreeEditor : public VBoxContainer {
|
||||
|
||||
void _node_changed(ObjectID p_node);
|
||||
|
||||
void _property_changed(const StringName &p_property, const Variant &p_value);
|
||||
void _removed_from_graph();
|
||||
|
||||
EditorFileDialog *open_file;
|
||||
Ref<AnimationNode> file_loaded;
|
||||
void _file_opened(const String &p_file);
|
||||
|
||||
enum {
|
||||
MENU_LOAD_FILE = 1000,
|
||||
MENU_PASTE = 1001,
|
||||
MENU_LOAD_FILE_CONFIRM = 1002
|
||||
};
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
@@ -91,27 +100,11 @@ public:
|
||||
void remove_custom_type(const Ref<Script> &p_script);
|
||||
|
||||
virtual Size2 get_minimum_size() const;
|
||||
void edit(AnimationNodeBlendTree *p_blend_tree);
|
||||
|
||||
virtual bool can_edit(const Ref<AnimationNode> &p_node);
|
||||
virtual void edit(const Ref<AnimationNode> &p_node);
|
||||
|
||||
AnimationNodeBlendTreeEditor();
|
||||
};
|
||||
|
||||
class AnimationNodeBlendTreeEditorPlugin : public EditorPlugin {
|
||||
|
||||
GDCLASS(AnimationNodeBlendTreeEditorPlugin, EditorPlugin);
|
||||
|
||||
AnimationNodeBlendTreeEditor *anim_tree_editor;
|
||||
EditorNode *editor;
|
||||
Button *button;
|
||||
|
||||
public:
|
||||
virtual String get_name() const { return "BlendTree"; }
|
||||
bool has_main_screen() const { return false; }
|
||||
virtual void edit(Object *p_object);
|
||||
virtual bool handles(Object *p_object) const;
|
||||
virtual void make_visible(bool p_visible);
|
||||
|
||||
AnimationNodeBlendTreeEditorPlugin(EditorNode *p_node);
|
||||
~AnimationNodeBlendTreeEditorPlugin();
|
||||
};
|
||||
|
||||
#endif // ANIMATION_BLEND_TREE_EDITOR_PLUGIN_H
|
||||
|
||||
Reference in New Issue
Block a user