diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2016-04-12 18:21:37 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2016-04-12 20:49:43 +0200 |
commit | 3029f5ee02483021aadd5d5bc48becb2490791f1 (patch) | |
tree | 6655cc75e1e3369ff08b1c1a684a3bbbc49bbad2 | |
parent | d454e64f429affb89de036eed6daa5c6e5278492 (diff) |
Keep editable instances data when replacing tree root node
-rw-r--r-- | scene/main/node.cpp | 10 | ||||
-rw-r--r-- | scene/main/node.h | 2 | ||||
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index b90edb38b2..f4c41256db 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1374,6 +1374,16 @@ bool Node::is_editable_instance(Node *p_node) const { return data.editable_instances.has(p); } +void Node::set_editable_instances(const HashMap<NodePath,int>& p_editable_instances) { + + data.editable_instances=p_editable_instances; +} + +HashMap<NodePath,int> Node::get_editable_instances() const { + + return data.editable_instances; +} + #if 0 diff --git a/scene/main/node.h b/scene/main/node.h index 5c6147d644..560a2e588a 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -239,6 +239,8 @@ public: void set_editable_instance(Node* p_node,bool p_editable); bool is_editable_instance(Node* p_node) const; + void set_editable_instances(const HashMap<NodePath,int>& p_editable_instances); + HashMap<NodePath,int> get_editable_instances() const; /* NOTIFICATIONS */ diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 6b2961ea72..c6115ba87a 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1317,6 +1317,7 @@ void SceneTreeDock::_create() { if (n==edited_scene) { edited_scene=newnode; editor->set_edited_scene(newnode); + newnode->set_editable_instances(n->get_editable_instances()); } //small hack to make collisionshapes and other kind of nodes to work |