fix get_selected_nodes()
This commit is contained in:
parent
65b93d177e
commit
2a003d7b4e
3 changed files with 36 additions and 15 deletions
|
@ -12065,6 +12065,13 @@
|
||||||
Get the list of selectes nodes.
|
Get the list of selectes nodes.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="get_transformable_selected_nodes">
|
||||||
|
<return type="Array">
|
||||||
|
</return>
|
||||||
|
<description>
|
||||||
|
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.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="remove_node">
|
<method name="remove_node">
|
||||||
<argument index="0" name="node" type="Node">
|
<argument index="0" name="node" type="Node">
|
||||||
</argument>
|
</argument>
|
||||||
|
|
|
@ -877,8 +877,7 @@ bool EditorSelection::is_selected(Node * p_node) const {
|
||||||
return selection.has(p_node);
|
return selection.has(p_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array EditorSelection::_get_transformable_selected_nodes() {
|
||||||
Array EditorSelection::_get_selected_nodes() {
|
|
||||||
|
|
||||||
Array ret;
|
Array ret;
|
||||||
|
|
||||||
|
@ -890,6 +889,18 @@ Array EditorSelection::_get_selected_nodes() {
|
||||||
return ret;
|
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() {
|
void EditorSelection::_bind_methods() {
|
||||||
|
|
||||||
ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed);
|
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("add_node","node:Node"),&EditorSelection::add_node);
|
||||||
ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_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_selected_nodes"),&EditorSelection::_get_selected_nodes);
|
||||||
|
ObjectTypeDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes);
|
||||||
ADD_SIGNAL( MethodInfo("selection_changed") );
|
ADD_SIGNAL( MethodInfo("selection_changed") );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,6 +233,8 @@ public:
|
||||||
|
|
||||||
void _update_nl();
|
void _update_nl();
|
||||||
Array _get_selected_nodes();
|
Array _get_selected_nodes();
|
||||||
|
Array _get_transformable_selected_nodes();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
Loading…
Add table
Reference in a new issue