diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_data.cpp | 16 | ||||
-rw-r--r-- | tools/editor/editor_data.h | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index 35ec1ebfcc..8fc18b5b39 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -877,8 +877,7 @@ bool EditorSelection::is_selected(Node * p_node) const { return selection.has(p_node); } - -Array EditorSelection::_get_selected_nodes() { +Array EditorSelection::_get_transformable_selected_nodes() { Array ret; @@ -890,6 +889,18 @@ Array EditorSelection::_get_selected_nodes() { return ret; } +Array EditorSelection::_get_selected_nodes() { + + Array ret; + + for (Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) { + + ret.push_back(E->key()); + } + + return ret; +} + void EditorSelection::_bind_methods() { ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed); @@ -897,6 +908,7 @@ void EditorSelection::_bind_methods() { ObjectTypeDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node); ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node); ObjectTypeDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); + ObjectTypeDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes); ADD_SIGNAL( MethodInfo("selection_changed") ); } diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index a0b716f560..59f9d4e4f3 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -233,6 +233,8 @@ public: void _update_nl(); Array _get_selected_nodes(); + Array _get_transformable_selected_nodes(); + protected: static void _bind_methods(); |