godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.46k stars 21.27k forks source link

Camera2D with physics_interpolation_mode off triggers editor and runtime errors #97957

Open hunterloftis opened 1 month ago

hunterloftis commented 1 month ago

Tested versions

Godot v4.3.stable.mono - Fedora Linux 40 (Workstation Edition) - Wayland - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i7-1280P (20 Threads)

System information

Godot v4.3.stable.mono - Fedora Linux 40 (Workstation Edition) - Wayland - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i7-1280P (20 Threads)

Issue description

Turning off physics interpolation on a Camera2D causes ./scene/main/node.h:446 - Parameter "data.tree" is null. errors both in the editor and at runtime:

image

Steps to reproduce

  1. Create a scene
  2. Add a Camera2D
  3. Set "Physics Interpolation" to "Off"

Re-open the project and see:

image

Start the project and see:

image

Minimal reproduction project (MRP)

bug_cam_physics.zip

rburing commented 1 month ago

Thanks for the report!

This issue has already been fixed since 4.4-dev1 due to changes made to Node::set_physics_interpolation_mode in https://github.com/godotengine/godot/pull/92391 (in particular, the part that was forward-ported from https://github.com/godotengine/godot/pull/92784).

Here is the callstack for reference:

Node::get_tree() const (/home/rburing/src/godot/scene/main/node.h:447)
Camera2D::get_camera_transform() (/home/rburing/src/godot/scene/2d/camera_2d.cpp:125)
Camera2D::_notification(int) (/home/rburing/src/godot/scene/2d/camera_2d.cpp:301)
Camera2D::_notificationv(int, bool) (/home/rburing/src/godot/scene/2d/camera_2d.h:37)
Object::notification(int, bool) (/home/rburing/src/godot/core/object/object.cpp:870)
Node::propagate_notification(int) (/home/rburing/src/godot/scene/main/node.cpp:2424)
Node::reset_physics_interpolation() (/home/rburing/src/godot/scene/main/node.cpp:901)
Node::set_physics_interpolation_mode(Node::PhysicsInterpolationMode) (/home/rburing/src/godot/scene/main/node.cpp:894)
void call_with_variant_args_helper<__UnexistingClass, Node::PhysicsInterpolationMode, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(Node::PhysicsInterpolationMode), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/home/rburing/src/godot/core/variant/binder_common.h:304)
void call_with_variant_args_dv<__UnexistingClass, Node::PhysicsInterpolationMode>(__UnexistingClass*, void (__UnexistingClass::*)(Node::PhysicsInterpolationMode), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (/home/rburing/src/godot/core/variant/binder_common.h:451)
MethodBindT<Node::PhysicsInterpolationMode>::call(Object*, Variant const**, int, Callable::CallError&) const (/home/rburing/src/godot/core/object/method_bind.h:345)
ClassDB::set_property(Object*, StringName const&, Variant const&, bool*) (/home/rburing/src/godot/core/object/class_db.cpp:1488)
Object::set(StringName const&, Variant const&, bool*) (/home/rburing/src/godot/core/object/object.cpp:249)
SceneState::instantiate(SceneState::GenEditState) const (/home/rburing/src/godot/scene/resources/packed_scene.cpp:418)
PackedScene::instantiate(PackedScene::GenEditState) const (/home/rburing/src/godot/scene/resources/packed_scene.cpp:2093)
EditorNode::load_scene(String const&, bool, bool, bool, bool, bool) (/home/rburing/src/godot/editor/editor_node.cpp:4056)
EditorNode::_load_open_scenes_from_config(Ref<ConfigFile>) (/home/rburing/src/godot/editor/editor_node.cpp:5228)
EditorNode::_load_editor_layout() (/home/rburing/src/godot/editor/editor_node.cpp:5152)
EditorNode::_sources_changed(bool) (/home/rburing/src/godot/editor/editor_node.cpp:1086)
void call_with_variant_args_helper<EditorNode, bool, 0ul>(EditorNode*, void (EditorNode::*)(bool), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/home/rburing/src/godot/core/variant/binder_common.h:304)
void call_with_variant_args<EditorNode, bool>(EditorNode*, void (EditorNode::*)(bool), Variant const**, int, Callable::CallError&) (/home/rburing/src/godot/core/variant/binder_common.h:418)
CallableCustomMethodPointer<EditorNode, bool>::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/rburing/src/godot/core/object/callable_method_pointer.h:103)
Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/rburing/src/godot/core/variant/callable.cpp:57)
Object::emit_signalp(StringName const&, Variant const**, int) (/home/rburing/src/godot/core/object/object.cpp:1187)
Node::emit_signalp(StringName const&, Variant const**, int) (/home/rburing/src/godot/scene/main/node.cpp:3895)
Error Object::emit_signal<bool>(StringName const&, bool) (/home/rburing/src/godot/core/object/object.h:936)
EditorFileSystem::_notification(int) (/home/rburing/src/godot/editor/editor_file_system.cpp:1470)
EditorFileSystem::_notificationv(int, bool) (/home/rburing/src/godot/editor/editor_file_system.h:140)
Object::notification(int, bool) (/home/rburing/src/godot/core/object/object.cpp:870)
SceneTree::_process_group(SceneTree::ProcessGroup*, bool) (/home/rburing/src/godot/scene/main/scene_tree.cpp:962)
SceneTree::_process(bool) (/home/rburing/src/godot/scene/main/scene_tree.cpp:1039)
SceneTree::process(double) (/home/rburing/src/godot/scene/main/scene_tree.cpp:526)
Main::iteration() (/home/rburing/src/godot/main/main.cpp:4104)
OS_LinuxBSD::run() (/home/rburing/src/godot/platform/linuxbsd/os_linuxbsd.cpp:962)
main (/home/rburing/src/godot/platform/linuxbsd/godot_linuxbsd.cpp:85)
__libc_start_call_main (@__libc_start_call_main:29)
__libc_start_main_impl (@__libc_start_main@@GLIBC_2.34:44)
_start (@_start:15)

The Node part of the changes in 4.x could be back-ported to 4.3, but I don't know if this is worth the effort.