diff --git a/doc/base/classes.xml b/doc/base/classes.xml index eb8c6eea2b0..916ca09c924 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -11269,10 +11269,10 @@ - Resource filesystem, as the editor sees it. + Resource filesystem, as the editor sees it. - This object holds information of all resources in the filesystem, their types, etc. + This object holds information of all resources in the filesystem, their types, etc. @@ -11281,14 +11281,14 @@ - Get the type of the file, given the full path. + Get the type of the file, given the full path. - Get the root directory object. + Get the root directory object. @@ -11303,45 +11303,45 @@ - Return the scan progress for 0 to 1 if the FS is being scanned. + Return the scan progress for 0 to 1 if the FS is being scanned. - Return true of the filesystem is being scanned. + Return true of the filesystem is being scanned. - Scan the filesystem for changes. + Scan the filesystem for changes. - Check if the source of any imported resource changed. + Check if the source of any imported resource changed. - Update a file information. Call this if an external program (not Godot) modified the file. + Update a file information. Call this if an external program (not Godot) modified the file. - Emitted if the filesystem changed. + Emitted if the filesystem changed. - Emitted if the source of any imported file changed. + Emitted if the source of any imported file changed. @@ -11350,7 +11350,7 @@ - A diretory for the resource filesystem. + A diretory for the resource filesystem. @@ -11708,7 +11708,7 @@ - Get the filesystem cache for all resources in the project. + Get the filesystem cache for all resources in the project. @@ -12065,6 +12065,13 @@ Get the list of selectes nodes. + + + + + Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild. + + diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index 35ec1ebfcca..8fc18b5b391 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::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 a0b716f560a..59f9d4e4f3f 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();