diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-08 08:57:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 08:57:29 +0100 |
commit | 0154ce2c8d66528d617e10b139640fd4c4405c6b (patch) | |
tree | a6e1a81ab04092b5535401fa0e2434dd3a2fe1bd /editor/create_dialog.cpp | |
parent | d6ba4a223fc394fa2fd9321c19468e05b5de1de0 (diff) | |
parent | 7a8b11ee14f34ca97e6d5023ef15b8abf4d59cda (diff) | |
download | redot-engine-0154ce2c8d66528d617e10b139640fd4c4405c6b.tar.gz |
Merge pull request #43015 from Xrayez/refactor-auto-instaprop
Refactor auto-instantiation of `Object` properties in editor
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 119e81c150..969054cc1b 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -503,17 +503,7 @@ Variant CreateDialog::instance_selected() { } else { obj = ClassDB::instantiate(selected->get_text(0)); } - - // Check if any Object-type property should be instantiated. - List<PropertyInfo> pinfo; - ((Object *)obj)->get_property_list(&pinfo); - - for (const PropertyInfo &pi : pinfo) { - if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) { - Object *prop = ClassDB::instantiate(pi.class_name); - ((Object *)obj)->set(pi.name, prop); - } - } + EditorNode::get_editor_data().instantiate_object_properties(obj); return obj; } |