{"action":"created","issue":{"url":"https://api.github.com/repos/okamstudio/godot/issues/1943","labels_url":"https://api.github.com/repos/okamstudio/godot/issues/1943/labels{/name}","comments_url":"https://api.github.com/repos/okamstudio/godot/issues/1943/comments","events_url":"https://api.github.com/repos/okamstudio/godot/issues/1943/events","html_url":"https://github.com/okamstudio/godot/pull/1943","id":77830834,"number":1943,"title":"[Need more work] Add Node::reparent","user":{"login":"guilhermefelipecgs","id":1387165,"avatar_url":"https://avatars.githubusercontent.com/u/1387165?v=3","gravatar_id":"","url":"https://api.github.com/users/guilhermefelipecgs","html_url":"https://github.com/guilhermefelipecgs","followers_url":"https://api.github.com/users/guilhermefelipecgs/followers","following_url":"https://api.github.com/users/guilhermefelipecgs/following{/other_user}","gists_url":"https://api.github.com/users/guilhermefelipecgs/gists{/gist_id}","starred_url":"https://api.github.com/users/guilhermefelipecgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilhermefelipecgs/subscriptions","organizations_url":"https://api.github.com/users/guilhermefelipecgs/orgs","repos_url":"https://api.github.com/users/guilhermefelipecgs/repos","events_url":"https://api.github.com/users/guilhermefelipecgs/events{/privacy}","received_events_url":"https://api.github.com/users/guilhermefelipecgs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-18T22:31:37Z","updated_at":"2015-05-20T02:05:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/okamstudio/godot/pulls/1943","html_url":"https://github.com/okamstudio/godot/pull/1943","diff_url":"https://github.com/okamstudio/godot/pull/1943.diff","patch_url":"https://github.com/okamstudio/godot/pull/1943.patch"},"body":"What do you think @reduz? #1905\r\n\r\nI create the Node:reparent and the NOTIFICATION_REPARENT.\r\n\r\nThis method need the documentation yet, I don't know where to put.\r\n\r\nEdit:\r\nMissing code for Spatial."},"comment":{"url":"https://api.github.com/repos/okamstudio/godot/issues/comments/103723167","html_url":"https://github.com/okamstudio/godot/pull/1943#issuecomment-103723167","issue_url":"https://api.github.com/repos/okamstudio/godot/issues/1943","id":103723167,"user":{"login":"okamstudio","id":6318500,"avatar_url":"https://avatars.githubusercontent.com/u/6318500?v=3","gravatar_id":"","url":"https://api.github.com/users/okamstudio","html_url":"https://github.com/okamstudio","followers_url":"https://api.github.com/users/okamstudio/followers","following_url":"https://api.github.com/users/okamstudio/following{/other_user}","gists_url":"https://api.github.com/users/okamstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/okamstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okamstudio/subscriptions","organizations_url":"https://api.github.com/users/okamstudio/orgs","repos_url":"https://api.github.com/users/okamstudio/repos","events_url":"https://api.github.com/users/okamstudio/events{/privacy}","received_events_url":"https://api.github.com/users/okamstudio/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T02:05:20Z","updated_at":"2015-05-20T02:05:20Z","body":"i'm not quite udnerstanding what the problem is with:\n\nnode.get_parent().remove_child( node )\nnew_parent.add_child( node )\n\nI suppose having a reparent may be a helper, but why is there a need for it?\n\n\nOn Tue, May 19, 2015 at 11:03 PM, Juan Linietsky <juan@okamstudio.com>\nwrote:\n\n> _ready() is just an extra call after enter_scene\n>\n> it should still happen when you reparent, add some sort of flag on\n> _exit_scene if you don't want to execute code on it\n>\n>\n>\n> On Tue, May 19, 2015 at 11:01 PM, Hearto <notifications@github.com> wrote:\n>\n>> Ok after many tries, we found the best way to overcome this bug with our\n>> implementation:\n>> https://gfycat.com/UniqueEveryHoki\n>> is to skip ONLY ready on reparent, the calls of enter_tree / exit_tree\n>> are necessary for the integrity of all trees and references from child\n>> nodes, and remove those calls, implies hard to track errors on different\n>> subnodes, the one from the video comes from canvas_node for example, so we\n>> take another approach on this problem, which is don't ignore\n>> enter_tree/exit_tree, give the tools for know when the node is reparenting\n>> and take actions on specifics events from each type of node, so now:\n>>\n>>    - The reparent only ignores the ready event\n>>    - Now exist a new method for query is_reparenting(), this one should\n>>    be queried on enter_tree or exit_tree for skip/change behaviour on\n>>    problematic nodes who loses his state on reparent.\n>>    - Two new notifications,NOTIFICATION_REPARENTING and\n>>    NOTIFICATION_REPARENTED, and is called when the reparenting process start\n>>    and ends, its like an exit/enter tree. This events set the bool of\n>>    is_reparenting to true and false on node.cpp\n>>    - For clarity, the reparent uses the destination parent only, not the\n>>    pos\n>>\n>> For now we modified/check this node as an example with the enter_tree\n>> /exit_tree on reparenting behaviour using the is_reparenting() flag:\n>>\n>>    - Animation Player\n>>\n>> Also my demo for testing reparenting is added to demos/misc/ with many\n>> features for debbuging issues and test if some another nodes lose state on\n>> reparent.\n>> [image: qtsr3sz 1]\n>> <https://cloud.githubusercontent.com/assets/12376042/7717345/d291bac0-fe6d-11e4-8e37-1fafa44dafe4.png>\n>>\n>> For example the error from the video was recreated by moving the node,\n>> then remove it and this trigger erase error on canvas node, this was an\n>> example of the corruption from ignore enter_tree/exit_tree, which is fixed\n>> on my pull request.\n>>\n>> I will open another pull request with this changes for help with the\n>> check and fix of another nodes with the demo, but the core for reparent is\n>> finished.\n>>\n>> —\n>> Reply to this email directly or view it on GitHub\n>> <https://github.com/okamstudio/godot/pull/1943#issuecomment-103721896>.\n>>\n>\n>\n>\n> --\n>\n> *OkamStudio*\n>\n\n\n\n-- \n\n*OkamStudio*\n"}}