summaryrefslogtreecommitdiffstats
path: root/editor/editor_resource_picker.cpp
diff options
context:
space:
mode:
authorAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-10-22 22:02:57 +0300
committerAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2021-12-28 15:50:44 +0200
commit7a8b11ee14f34ca97e6d5023ef15b8abf4d59cda (patch)
tree14ea1d867c1043c0fb2f6a1d573e14cabc847c9b /editor/editor_resource_picker.cpp
parent28174d531b7128f0281fc2b88da2f4962fd3513e (diff)
downloadredot-engine-7a8b11ee14f34ca97e6d5023ef15b8abf4d59cda.tar.gz
Refactor auto-instantiation of `Object` properties in editor
Auto-instantiation is used by the create dialog, but should also be used by the editor inspector. This refactors object properties auto-instantiation into a dedicated method to be reused throughout editor (and possibly scripting).
Diffstat (limited to 'editor/editor_resource_picker.cpp')
-rw-r--r--editor/editor_resource_picker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index 6a6634d7e5..dc97514ed3 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -375,6 +375,8 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
Resource *resp = Object::cast_to<Resource>(obj);
ERR_BREAK(!resp);
+ EditorNode::get_editor_data().instantiate_object_properties(obj);
+
edited_resource = RES(resp);
emit_signal(SNAME("resource_changed"), edited_resource);
_update_resource();