summaryrefslogtreecommitdiff
path: root/editor/plugins/spatial_editor_plugin.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-30 15:42:30 +0100
committerGitHub <noreply@github.com>2018-12-30 15:42:30 +0100
commitac46862097902da0f89af7f255292517a55d47bb (patch)
treefc0b87c7241c73d4d313c0a5b792b63f3f57284b /editor/plugins/spatial_editor_plugin.h
parentdcc7f2b54b562ad5a58dcd0dfe72ad8e6f05deb9 (diff)
parent6b15b4f90469375ac388a73477356c90bd6e194d (diff)
Merge pull request #24506 from JFonS/expose_gizmos
Expose the new gizmo plugin system to scripting
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.h')
-rw-r--r--editor/plugins/spatial_editor_plugin.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index c515a4aaf9..3b057fa840 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -615,7 +615,7 @@ private:
void _instance_scene();
void _init_indicators();
- void _init_gizmos_menu();
+ void _update_gizmos_menu();
void _init_grid();
void _finish_indicators();
void _finish_grid();
@@ -710,7 +710,8 @@ public:
return viewports[p_idx];
}
- void register_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> ref);
+ void add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin);
+ void remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin);
void edit(Spatial *p_spatial);
void clear();
@@ -764,6 +765,7 @@ private:
HashMap<String, Vector<Ref<SpatialMaterial> > > materials;
protected:
+ static void _bind_methods();
virtual bool has_gizmo(Spatial *p_spatial);
virtual Ref<EditorSpatialGizmo> create_gizmo(Spatial *p_spatial);
@@ -773,18 +775,18 @@ public:
void create_handle_material(const String &p_name, bool p_billboard = false);
void add_material(const String &p_name, Ref<SpatialMaterial> p_material);
- Ref<SpatialMaterial> get_material(const String &p_name, EditorSpatialGizmo *p_gizmo = NULL);
+ Ref<SpatialMaterial> get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo = Ref<EditorSpatialGizmo>());
- virtual String get_name() const = 0;
+ virtual String get_name() const;
virtual bool can_be_hidden() const;
virtual bool is_selectable_when_hidden() const;
- virtual void redraw(EditorSpatialGizmo *p_gizmo) {}
- virtual String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const { return ""; }
- virtual Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const { return Variant(); }
- virtual void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {}
- virtual void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false) {}
- virtual bool is_gizmo_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int idx) const { return false; }
+ virtual void redraw(EditorSpatialGizmo *p_gizmo);
+ virtual String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
+ virtual Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
+ virtual void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ virtual bool is_gizmo_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
Ref<EditorSpatialGizmo> get_gizmo(Spatial *p_spatial);
void set_state(int p_state);