godotengine / godot-demo-projects

Demonstration and Template Projects
https://godotengine.org
MIT License
5.83k stars 1.63k forks source link

2.5D Demo get_editor_viewport invalid call #1016

Closed awardell closed 5 months ago

awardell commented 8 months ago

Which demo project is affected: misc/2.5d

OS/device including version: Godot v4.2.2.rc (991454b8b) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 Ti (NVIDIA; 31.0.15.3623) - AMD Ryzen Threadripper 1950X 16-Core Processor (32 Threads)

godot-demo-projects commit c423f3bf

Issue description: When opening the demo using Godot 4.2.2, receive the following error: res://addons/node25d/node25d_plugin.gd:13 - Invalid call. Nonexistent function 'get_editor_viewport' in base 'EditorInterface'.

Line 13 is get_editor_interface().get_editor_viewport().add_child(main_panel_instance)

get_editor_interface() is deprecated and should be EditorInterface, but that isn't the issue. The real issue is that get_editor_viewport() has been split into get_editor_viewport_2d() and get_editor_viewport_3d() I'm unsure which is appropriate, but the fixed line would look something like

EditorInterface.get_editor_viewport_3d().add_child(main_panel_instance)

aaronfranke commented 5 months ago

Fixed by #1041