Compare commits

...

10 Commits

Author SHA1 Message Date
Rémi Verschelde f5918a9d35
Merge pull request #113395 from mihe/objectdb-snapshot-crash
Fix crash when capturing ObjectDB snapshot
2025-12-01 13:38:47 +07:00
Rémi Verschelde ad54cd4032
Merge pull request #113353 from SatLess/oversight
Prevent double counting and cyclical error when gathering Resources
2025-12-01 13:38:29 +07:00
Mikael Hermansson 4b573fb080 Fix crash when capturing ObjectDB snapshot 2025-12-01 13:27:03 +07:00
Rémi Verschelde 39c7479839
Merge pull request #113381 from Eshaan-byte/fix-editordock-func-keyword
Doc: Add missing func keyword to EditorDock._update_layout example
2025-12-01 13:13:27 +07:00
Rémi Verschelde 996c9a644e
Merge pull request #113176 from xuhuisheng/dev/ske-mod-error
Fix empty 2D skeleton modification keeps printing error messages
2025-12-01 13:13:19 +07:00
Rémi Verschelde 725cf51353
Merge pull request #113393 from KoBeWi/derootizator
Unassign scene root before freeing
2025-12-01 12:56:34 +07:00
kobewi 7573388c82 Unassign scene root before freeing 2025-12-01 12:48:58 +07:00
Eshaan 7ea96d2817 Doc: Add missing func keyword to EditorDock._update_layout example
The code snippet demonstrating method overriding for _update_layout
was missing the func keyword, which is required in GDScript method
declarations.
2025-12-01 13:08:19 +07:00
Sat 8b79e94fb6 Prevent double counting and cyclical error when gathering Resources 2025-11-30 05:23:23 +07:00
xuhuisheng 37a6043579 Fix empty skeleton modification keeps print error messages 2025-11-26 12:37:14 +07:00
8 changed files with 27 additions and 15 deletions

@ -56,7 +56,7 @@
<description>
Implement this method to handle the layout switching for this dock. [param layout] is one of the [enum DockLayout] constants.
[codeblock]
_update_layout(layout):
func _update_layout(layout):
box_container.vertical = (layout == DOCK_LAYOUT_VERTICAL)
[/codeblock]
</description>

@ -643,6 +643,9 @@ void EditorData::remove_scene(int p_idx) {
editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_scene_file_path());
}
if (edited_scene[p_idx].root == SceneTree::get_singleton()->get_edited_scene_root()) {
SceneTree::get_singleton()->set_edited_scene_root(nullptr);
}
memdelete(edited_scene[p_idx].root);
edited_scene.write[p_idx].root = nullptr;
}

@ -1815,7 +1815,9 @@ void EditorNode::gather_resources(const Variant &p_variant, List<Ref<Resource>>
r_list.push_back(res);
}
}
gather_resources(v, r_list, p_subresources, p_allow_external);
if (Object::cast_to<Node>(v) == nullptr) {
gather_resources(v, r_list, p_subresources, p_allow_external);
}
}
return;
}
@ -1839,8 +1841,12 @@ void EditorNode::gather_resources(const Variant &p_variant, List<Ref<Resource>>
r_list.push_back(res_value);
}
}
gather_resources(kv.key, r_list, p_subresources, p_allow_external);
gather_resources(kv.value, r_list, p_subresources, p_allow_external);
if (Object::cast_to<Node>(kv.key) == nullptr) {
gather_resources(kv.key, r_list, p_subresources, p_allow_external);
}
if (Object::cast_to<Node>(kv.value) == nullptr) {
gather_resources(kv.value, r_list, p_subresources, p_allow_external);
}
}
return;
}
@ -1855,12 +1861,10 @@ void EditorNode::gather_resources(const Variant &p_variant, List<Ref<Resource>>
Variant property_value = p_variant.get(E.name);
Variant::Type property_type = property_value.get_type();
if (property_type == Variant::ARRAY || property_type == Variant::DICTIONARY) {
gather_resources(property_value, r_list, p_subresources, p_allow_external);
continue;
}
Ref<Resource> res = property_value;
if (res.is_null()) {
continue;

@ -5182,9 +5182,9 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
} else {
undo_redo->add_undo_property(object, p_name, value);
}
// We'll use Editor Selection to get the currently edited Node.
Node *N = Object::cast_to<Node>(object);
if (N && (type == Variant::OBJECT || type == Variant::ARRAY || type == Variant::DICTIONARY) && value != p_value) {
bool double_counting = Object::cast_to<Node>(p_value) == N || Object::cast_to<Node>(value) == N;
if (N && !double_counting && (type == Variant::OBJECT || type == Variant::ARRAY || type == Variant::DICTIONARY) && value != p_value) {
undo_redo->add_do_method(EditorNode::get_singleton(), "update_node_reference", value, N, true);
undo_redo->add_do_method(EditorNode::get_singleton(), "update_node_reference", p_value, N, false);
// Perhaps an inefficient way of updating the resource count.

@ -817,11 +817,13 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta
HashSet<String> exported_members;
List<PropertyInfo> pinfo;
p_instance->get_property_list(&pinfo);
for (const PropertyInfo &E : pinfo) {
if (E.usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) {
exported_members.insert(E.name);
if (p_instance) {
List<PropertyInfo> pinfo;
p_instance->get_property_list(&pinfo);
for (const PropertyInfo &E : pinfo) {
if (E.usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) {
exported_members.insert(E.name);
}
}
}

@ -253,6 +253,9 @@ void SkeletonModification2DCCDIK::_draw_editor_gizmo() {
if (!ccdik_data_chain[i].editor_draw_gizmo) {
continue;
}
if (ccdik_data_chain[i].bone_idx < 0) {
continue;
}
Bone2D *operation_bone = stack->skeleton->get_bone(ccdik_data_chain[i].bone_idx);
editor_draw_angle_constraints(operation_bone, ccdik_data_chain[i].constraint_angle_min, ccdik_data_chain[i].constraint_angle_max,

@ -180,7 +180,7 @@ void SkeletonModification2DLookAt::_setup_modification(SkeletonModificationStack
}
void SkeletonModification2DLookAt::_draw_editor_gizmo() {
if (!enabled || !is_setup) {
if (!enabled || !is_setup || bone_idx < 0) {
return;
}

@ -217,7 +217,7 @@ void SkeletonModification2DTwoBoneIK::_setup_modification(SkeletonModificationSt
}
void SkeletonModification2DTwoBoneIK::_draw_editor_gizmo() {
if (!enabled || !is_setup) {
if (!enabled || !is_setup || joint_one_bone_idx < 0) {
return;
}