Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring the defaults will cause the editor to crash if the AnimationPlayer has a CollisionShape2D node operating in its track #76771

Closed
magian1127 opened this issue May 6, 2023 · 4 comments · Fixed by #76798

Comments

@magian1127
Copy link
Contributor

Godot version

v4.0.3.rc.mono.custom_build [7839d0f8b]

System information

win11

Issue description

Clicking on the position in the image causes the editor to crash
点击图片中位置,导致编辑器崩溃
DXL(DCHSDDKSO7}`3(SX9J0

CrashHandlerException: Program crashed
Engine version: Godot Engine v4.0.3.rc.mono.custom_build (7839d0f8bc582050f8fdde56b097176e62e66c1f)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] CameraAttributes::get_auto_exposure_speed (D:\Projects\Godot\godot4\scene\resources\camera_attributes.cpp:81)
[1] CameraAttributes::get_auto_exposure_speed (D:\Projects\Godot\godot4\scene\resources\camera_attributes.cpp:81)
[2] CollisionShape2DEditor::forward_canvas_draw_over_viewport (D:\Projects\Godot\godot4\editor\plugins\collision_shape_2d_editor_plugin.cpp:442)
[3] EditorPluginList::forward_canvas_draw_over_viewport (D:\Projects\Godot\godot4\editor\editor_node.cpp:8227)
[4] CanvasItemEditor::_draw_viewport (D:\Projects\Godot\godot4\editor\plugins\canvas_item_editor_plugin.cpp:3792)
[5] Callable::callp (D:\Projects\Godot\godot4\core\variant\callable.cpp:51)
[6] Object::emit_signalp (D:\Projects\Godot\godot4\core\object\object.cpp:1047)
[7] Object::emit_signal<> (D:\Projects\Godot\godot4\core\object\object.h:869)
[8] CanvasItem::_redraw_callback (D:\Projects\Godot\godot4\scene\main\canvas_item.cpp:137)
[9] Callable::callp (D:\Projects\Godot\godot4\core\variant\callable.cpp:51)
[10] MessageQueue::_call_function (D:\Projects\Godot\godot4\core\object\message_queue.cpp:230)
[11] MessageQueue::flush (D:\Projects\Godot\godot4\core\object\message_queue.cpp:292)
[12] SceneTree::process (D:\Projects\Godot\godot4\scene\main\scene_tree.cpp:463)
[13] Main::iteration (D:\Projects\Godot\godot4\main\main.cpp:3169)
[14] OS_Windows::run (D:\Projects\Godot\godot4\platform\windows\os_windows.cpp:1297)
[15] widechar_main (D:\Projects\Godot\godot4\platform\windows\godot_windows.cpp:181)
[16] _main (D:\Projects\Godot\godot4\platform\windows\godot_windows.cpp:205)
[17] main (D:\Projects\Godot\godot4\platform\windows\godot_windows.cpp:217)
[18] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[19] <couldn't map PC to fn name>
-- END OF BACKTRACE --

L0Z`C)S%RYLTGG2JKANM3%B

Steps to reproduce

1 Create a scene A, containing AnimationPlayer and Area2D/CollisionShape2D
2 Create Scene B (inherits Scene A)
3 Set any graphics to Area2D/CollisionShape2D in B
4 Set the AnimationPlayer track in B to disable Area2D/CollisionShape2D
5 Click to restore the graphics in B

1 创建一个场景A,包含 AnimationPlayer 和 Area2D/CollisionShape2D
2 创建场景B(继承场景A)
3 在B中 给 Area2D/CollisionShape2D 设置任意图形
4 在B中的 AnimationPlayer 轨道设置禁用 Area2D/CollisionShape2D
5 点击恢复B中的图形

Minimal reproduction project

testbug.zip

Click bug.tscn Area2D/CollisionShape2D shape restore icon

@Calinou
Copy link
Member

Calinou commented May 6, 2023

CameraAttributes does not exist when working in 2D, as it's only used in 3D.

@Calinou Calinou added the bug label May 6, 2023
@Rindbee
Copy link
Contributor

Rindbee commented May 6, 2023

Reproduced in 64eeb04. Crash when a CollisionShape2D's shape resource is cleared reverted by pressing revert icon in Inspector.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.dev.custom_build (64eeb04d2cb2e269d9710c38bdbf366ab3656e76)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f38835e1520] (??:0)
[2] CircleShape2D::get_radius() const (/opt/godot/godot-editor-l10n/godot/scene/resources/circle_shape_2d.cpp:52)
[3] CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control*) (/opt/godot/godot-editor-l10n/godot/editor/plugins/collision_shape_2d_editor_plugin.cpp:457)
[4] CollisionShape2DEditorPlugin::forward_canvas_draw_over_viewport(Control*) (/opt/godot/godot-editor-l10n/godot/editor/plugins/collision_shape_2d_editor_plugin.h:102)
[5] EditorPluginList::forward_canvas_draw_over_viewport(Control*) (/opt/godot/godot-editor-l10n/godot/editor/editor_node.cpp:7848)
[6] CanvasItemEditor::_draw_viewport() (/opt/godot/godot-editor-l10n/godot/editor/plugins/canvas_item_editor_plugin.cpp:3792)
[7] void call_with_variant_args_helper<CanvasItemEditor>(CanvasItemEditor*, void (CanvasItemEditor::*)(), Variant const**, Callable::CallError&, IndexSequence<>) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:298)
[8] void call_with_variant_args<CanvasItemEditor>(CanvasItemEditor*, void (CanvasItemEditor::*)(), Variant const**, int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:408)
[9] CallableCustomMethodPointer<CanvasItemEditor>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/./core/object/callable_method_pointer.h:105)
[10] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/core/variant/callable.cpp:51)
[11] Object::emit_signalp(StringName const&, Variant const**, int) (/opt/godot/godot-editor-l10n/godot/core/object/object.cpp:1055)
[12] Error Object::emit_signal<>(StringName const&) (/opt/godot/godot-editor-l10n/godot/./core/object/object.h:868)
[13] CanvasItem::_redraw_callback() (/opt/godot/godot-editor-l10n/godot/scene/main/canvas_item.cpp:136)
[14] void call_with_variant_args_helper<CanvasItem>(CanvasItem*, void (CanvasItem::*)(), Variant const**, Callable::CallError&, IndexSequence<>) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:298)
[15] void call_with_variant_args<CanvasItem>(CanvasItem*, void (CanvasItem::*)(), Variant const**, int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:408)
[16] CallableCustomMethodPointer<CanvasItem>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/./core/object/callable_method_pointer.h:105)
[17] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/core/variant/callable.cpp:51)
[18] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (/opt/godot/godot-editor-l10n/godot/core/object/message_queue.cpp:200)
[19] CallQueue::flush() (/opt/godot/godot-editor-l10n/godot/core/object/message_queue.cpp:251)
[20] SceneTree::physics_process(double) (/opt/godot/godot-editor-l10n/godot/scene/main/scene_tree.cpp:430)
[21] Main::iteration() (/opt/godot/godot-editor-l10n/godot/main/main.cpp:3198)
[22] OS_LinuxBSD::run() (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/os_linuxbsd.cpp:889)
[23] /opt/godot/godot-editor-l10n/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(main+0x1fe) [0x564b6052b86e] (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/godot_linuxbsd.cpp:73)
[24] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f38835c8d90] (??:0)
[25] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f38835c8e40] (??:0)
[26] /opt/godot/godot-editor-l10n/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(_start+0x25) [0x564b6052b5a5] (??:?)
-- END OF BACKTRACE --
================================================================

Seems related to #76492.

Incorrectly removed _get_current_shape_type(); in CollisionShape2DEditor::forward_canvas_draw_over_viewport().

@Calinou
Copy link
Member

Calinou commented May 6, 2023

cc @KoBeWi

@Rindbee
Copy link
Contributor

Rindbee commented May 7, 2023

0.mp4

Saving the scene and clicking the revert icon seems to be necessary to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants