Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@
<member name="docks/scene_tree/center_node_on_reparent" type="bool" setter="" getter="">
If [code]true[/code], new node created when reparenting node(s) will be positioned at the average position of the selected node(s).
</member>
<member name="docks/scene_tree/enable_editable_children_by_default" type="bool" setter="" getter="">
If [code]true[/code], instantiated nodes will automatically have Editable Children set to [code]true[/code] in the scene tree dock.
</member>
<member name="docks/scene_tree/hide_filtered_out_parents" type="bool" setter="" getter="">
If [code]true[/code], the scene tree dock will only show nodes that match the filter, without showing parents that don't. This settings can also be changed in the Scene dock's top menu.
</member>
Expand Down
7 changes: 7 additions & 0 deletions editor/docks/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ void SceneTreeDock::_perform_instantiate_scenes(const Vector<String> &p_files, N
undo_redo->create_action_for_history(TTRN("Instantiate Scene", "Instantiate Scenes", instances.size()), editor_data->get_current_edited_scene_history_id());
undo_redo->add_do_method(editor_selection, "clear");

bool enable_editable_children_by_default = EDITOR_GET("docks/scene_tree/enable_editable_children_by_default");

for (int i = 0; i < instances.size(); i++) {
Node *instantiated_scene = instances[i];

Expand All @@ -376,6 +378,11 @@ void SceneTreeDock::_perform_instantiate_scenes(const Vector<String> &p_files, N
undo_redo->add_do_reference(instantiated_scene);
undo_redo->add_undo_method(p_parent, "remove_child", instantiated_scene);

if (enable_editable_children_by_default) {
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_editable_instance", instantiated_scene, true);
undo_redo->add_do_method(instantiated_scene, "set_display_folded", true);
}

String new_name = p_parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
undo_redo->add_do_method(ed, "live_debug_instantiate_node", edited_scene->get_path_to(p_parent), p_files[i], new_name);
Expand Down
5 changes: 5 additions & 0 deletions editor/scene/3d/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5718,6 +5718,11 @@ bool Node3DEditorViewport::_create_instance(Node *p_parent, const String &p_path
undo_redo->add_undo_method(p_parent, "remove_child", instantiated_scene);
undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene);

if (EDITOR_GET("docks/scene_tree/enable_editable_children_by_default")) {
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_editable_instance", instantiated_scene, true);
undo_redo->add_do_method(instantiated_scene, "set_display_folded", true);
}

String new_name = p_parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
undo_redo->add_do_method(ed, "live_debug_instantiate_node", EditorNode::get_singleton()->get_edited_scene()->get_path_to(p_parent), p_path, new_name);
Expand Down
5 changes: 5 additions & 0 deletions editor/scene/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6421,6 +6421,11 @@ bool CanvasItemEditorViewport::_create_instance(Node *p_parent, const String &p_
undo_redo->add_undo_method(p_parent, "remove_child", instantiated_scene);
undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene);

if (EDITOR_GET("docks/scene_tree/enable_editable_children_by_default")) {
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "set_editable_instance", instantiated_scene, true);
undo_redo->add_do_method(instantiated_scene, "set_display_folded", true);
}

String new_name = p_parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
undo_redo->add_do_method(ed, "live_debug_instantiate_node", edited_scene->get_path_to(p_parent), p_path, new_name);
Expand Down
1 change: 1 addition & 0 deletions editor/settings/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("docks/scene_tree/center_node_on_reparent", false);
_initial_set("docks/scene_tree/hide_filtered_out_parents", true);
_initial_set("docks/scene_tree/accessibility_warnings", false);
_initial_set("docks/scene_tree/enable_editable_children_by_default", false);

// FileSystem
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "docks/filesystem/thumbnail_size", 64, "32,128,16")
Expand Down