diff options
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/callable_method_pointer.h | 8 | ||||
-rw-r--r-- | core/object/class_db.cpp | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/core/object/callable_method_pointer.h b/core/object/callable_method_pointer.h index 53410a9acf..3cd9ad3819 100644 --- a/core/object/callable_method_pointer.h +++ b/core/object/callable_method_pointer.h @@ -51,6 +51,14 @@ protected: void _setup(uint32_t *p_base_ptr, uint32_t p_ptr_size); public: + virtual StringName get_method() const { +#ifdef DEBUG_METHODS_ENABLED + return StringName(text); +#else + return StringName(); +#endif + } + #ifdef DEBUG_METHODS_ENABLED void set_text(const char *p_text) { text = p_text; diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 72a98ca20c..3df4db9c5e 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -1632,7 +1632,8 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con // Some properties may have an instantiated Object as default value, // (like Path2D's `curve` used to have), but that's not a good practice. // Instead, those properties should use PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT - // to be auto-instantiated when created in the editor. + // to be auto-instantiated when created in the editor with the following method: + // EditorNode::get_editor_data().instantiate_object_properties(obj); if (var.get_type() == Variant::OBJECT) { Object *obj = var.get_validated_object(); if (obj) { |