From a503f8aadcb8cbc85bde589fb25ea06e599b367b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 10 Jan 2017 01:04:31 -0300 Subject: Groundbreaking!! Godot resources can now be flagged to be local to the scene being edited! This means that each time this scene is instanced, the resource will be unique! As such, thanks to this, the following features were implemented: -ButtonGroup is no longer a control, it's now a resource local to the scene -ViewportTexture can be created from the editor and set to any object, making ViewportSprite and other kind of nodes obsolete! --- tools/editor/editor_node.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/editor/editor_node.cpp') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 5eb5f4200..2306f9834 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3745,7 +3745,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo sdata->set_path(lpath,true); //take over path } - Node*new_scene=sdata->instance(true); + Node*new_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_MAIN); if (!new_scene) { @@ -5365,8 +5365,15 @@ void EditorNode::_bind_methods() { } +static Node* _resource_get_edited_scene() { + + return EditorNode::get_singleton()->get_edited_scene(); +} + EditorNode::EditorNode() { + Resource::_get_local_scene_func=_resource_get_edited_scene; + VisualServer::get_singleton()->textures_keep_original(true); EditorHelp::generate_doc(); //before any editor classes are crated -- cgit v1.2.3-70-g09d2