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

Godot 4.3 Beta 1 - 0.7.2 install spams console with errors about "PhantomCameraManager" not declared #323

Closed
ar1a opened this issue Jun 5, 2024 · 22 comments
Labels
bug Something isn't working Investigating

Comments

@ar1a
Copy link

ar1a commented Jun 5, 2024

Issue description

Just updated from 0.7.1 to 0.7.2 and got spammed with errors like this:

  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:177 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:179 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  (2) res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:256 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:360 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  modules/gdscript/gdscript.cpp:2943 - Failed to load script "res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd" with error "Parse error". (User)
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:522 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:524 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:525 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:540 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/gizmos/phantom_camera_gizmo_plugin_3d.gd:-1 - Compile Error: 
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:470 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:473 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:474 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:478 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:522 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:524 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:525 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:540 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:141 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:155 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:156 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:160 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:161 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:167 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:180 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/plugin.gd:-1 - Compile Error: 
  modules/gdscript/gdscript.cpp:2943 - Failed to load script "res://addons/phantom_camera/plugin.gd" with error "Compilation failed". (User)

Afterwards, I removed the folder from my /addons, and also deleted all the pcamhost/pcams etc around my scene. I reinstalled from the godot asset lib and still came across the errors above!

Steps to reproduce

  1. install addon
  2. ???
  3. cry

(Optional) Minimal reproduction project

No response

@ramokz
Copy link
Owner

ramokz commented Jun 5, 2024

That sounds very strange, it should be loaded when the plugin.gd is read.

Did a few fresh installs and patch trials yesterday and couldn't spot any issues.

Does it also occur in freshly made projects?
Also, which Godot version and OS are you using?

@ar1a
Copy link
Author

ar1a commented Jun 5, 2024

4.3 beta 1 on Windows 11.

I'll create a new project and see if it happens, but I only made this project this morning (~16 hours ago) so it's definitely pretty fresh. Possibly related to my editor freezing and needing to be killed during the update dialog?

About to go test the new project, but I tried to revert to 0.7.1 and am now getting #263, which is very strange because I started originally on 0.7.1! not on <0.7

@ar1a
Copy link
Author

ar1a commented Jun 5, 2024

Can confirm it happens in a new project:
image

Project:
pcam-test.zip

@Burloe
Copy link

Burloe commented Jun 5, 2024

I also have the same issue. Though not as many messages. I installed the update, did the reload which crashed Godot and when I restarted, got a ton of errors messages and notifications about scripts not being able to load. Mainly the plugin.gd. Using 4.3 beta 1 on Win 10
image
image

@liquid8d
Copy link

liquid8d commented Jun 5, 2024

Same here on 4.3beta1/Windows 11.

Manually adding the PhantomCameraManager (res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd) autoload and restart seemed to do the trick for me, not sure why plugin.gd couldn't do add_autoload_singleton.

@lightway82
Copy link

lightway82 commented Jun 5, 2024

Same problem afrer update Godot v 4.2

@ramokz
Copy link
Owner

ramokz commented Jun 5, 2024

I haven't been able to replicate it in Godot 4.2, but can reproduce it in Godot 4.3 Beta 1.
@lightway82 would you be able to share a tiny sample project with the issue present?

Tried setting up a test plugin project with autoload in Godot 4.3. The first time I tried it, it didn't load. When I repeated it, it worked as expected. So something really weird is going on.

@ramokz
Copy link
Owner

ramokz commented Jun 5, 2024

About to go test the new project, but I tried to revert to 0.7.1 and am now getting #263, which is very strange because I started originally on 0.7.1! not on <0.7

Have you used Phantom Camera before 0.7 in any projects within the same parent directory?
Getting a suspicion that it might be related to a cache directory in a parent folder for Godot projects.

@ramokz
Copy link
Owner

ramokz commented Jun 5, 2024

Manually adding the PhantomCameraManager (res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd) autoload and restart seemed to do the trick for me, not sure why plugin.gd couldn't do add_autoload_singleton.

This also appears to work for me.

Interestingly, I could not replicate the issue in Godot 4.3 dev 6 — tried multiple times in multiple newly created projects.
Opening a project with Phantom Camera already installed that was made using dev 6 and then in Beta 1 makes it work as expected, which was also the flow I had initially tested the release in.

What add_autoload_singleton does internally is that it automatically assigns the PhantomCameraManager to the Autoload list, which can be found inside Project Settings. Beta 1, unlike dev 6, does not seem to do that when the function is being called in the plugin.gd script.

@ramokz ramokz added bug Something isn't working Investigating labels Jun 5, 2024
@liquid8d
Copy link

liquid8d commented Jun 5, 2024

I have wrote my own addon that adds autoloads and that has worked for me since before and up to 4.3 beta1. Cached data does seem to be an issue in Godot for a few things, but this was a new class/autoload in this version, right?

Could it be just the custom types trying to access PhantomCameraManager before the autoload?

	# Phantom Camera Nodes
	add_custom_type(PCAM_2D, "Node2D", preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd"), preload("res://addons/phantom_camera/icons/phantom_camera_2d.svg"))
	add_custom_type(PCAM_3D, "Node3D", preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd"), preload("res://addons/phantom_camera/icons/phantom_camera_2d.svg"))
	add_custom_type(PCAM_HOST, "Node", preload("res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd"), preload("res://addons/phantom_camera/icons/phantom_camera_2d.svg"))

	add_autoload_singleton(PHANTOM_CAMERA_MANAGER, "res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd")

@ramokz
Copy link
Owner

ramokz commented Jun 5, 2024

I have wrote my own addon that adds autoloads and that has worked for me since before and up to 4.3 beta1. Cached data does seem to be an issue in Godot for a few things, but this was a new class/autoload in this version, right?

The singleton is new to this release, yes.

From what I can tell, it seems like it's specifically Godot 4.3 Beta 1 that is having trouble with adding new autoloads via code. If you had it applied to a project before Beta 1, then it should still be working as intended. Did for me, at least.

Could it be just the custom types trying to access PhantomCameraManager before the autoload?

Don't think so. Like mentioned above, the issue doesn't seem to be reproducible in 4.2 or 4.3 dev 6.

@ar1a
Copy link
Author

ar1a commented Jun 6, 2024

About to go test the new project, but I tried to revert to 0.7.1 and am now getting #263, which is very strange because I started originally on 0.7.1! not on <0.7

Have you used Phantom Camera before 0.7 in any projects within the same parent directory? Getting a suspicion that it might be related to a cache directory in a parent folder for Godot projects.

No, unfortunately

@cdrch
Copy link

cdrch commented Jun 6, 2024

Adding a data point: I received the same issue on Godot 4.2.2.stable.official [15073afe3] (from Steam, on Windows 10). After I enabled it, I could not add any Phantom Camera nodes to the scene, receiving a trio of errors each time I tried - the only one I recall (thanks to doing a search for the error online) was Parameter "p_object" is null.

Unfortunately for reproducibility, after a restart of Godot all of these problems went away. I suppose that supports this being some kind of cache issue? I also happened to be using Phantom camera just a few days ago on the same Godot version in a different project, with zero issues.

@ramokz ramokz pinned this issue Jun 6, 2024
@ramokz ramokz changed the title 0.7.2 install spams console with errors about "PhantomCameraManager" not declared Godot 4.3 Beta 1 - 0.7.2 install spams console with errors about "PhantomCameraManager" not declared Jun 6, 2024
@LoonOfNature
Copy link

Hi there, just wanted to mention I had the issue after upgrading from 7.0 to 7.2 using Godot 4.2 on Windows, but fixed it by deleting Phantom Camera from the project, switching the project to 4.2.2, enabling the plugin, then reloading.

I should mention when I checked the autoloads in 7.2 that the PhantomCameraManager.gd was actually there already.

@liquid8d
Copy link

liquid8d commented Jun 6, 2024

Just wanted to add a note, I have no problems now with disabling PhantomCamera in the plugins and re-enabling, the autoload is properly removed and re-added whenever the addon is re-enabled. So it was just that initial load for some reason.

@victorlapin
Copy link

Looks like similar issue: godotengine/godot#74514

@ramokz
Copy link
Owner

ramokz commented Jun 6, 2024

Looks like similar issue: godotengine/godot#74514

Not sure if that's related to this. Since they're trying to access the signal from the same script they're initializing the Autoload setter from. So looks more like a chicken-and-egg problem.

@RectangleEquals
Copy link

RectangleEquals commented Jun 11, 2024

Can confirm, happens to me in a completely fresh v4.2.2.stable.official [15073afe3] project.
Literally just create an empty project, click AssetLib, search for camera and install Phantom Camera and watch as everything immediately explodes.

Can also confirm that manually disabling & enabling the plugin from Project Settings > Plugins, then saving and reloading the project seems to show no errors and it properly loads

@MichaelrMentele
Copy link

I seem to have this happen in Godot 4.2.1. Disable/Enable with reload didn't make a difference. It explodes on enable.

Godot Engine v4.2.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:63 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:177 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:179 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  (2) res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:256 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd:360 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  modules/gdscript/gdscript.cpp:2788 - Failed to load script "res://addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd" with error "Parse error". (User)
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:522 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:524 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:525 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:540 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/gizmos/phantom_camera_gizmo_plugin_3d.gd:-1 - Compile Error: 
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:470 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:473 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:474 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:478 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:522 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:524 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:525 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd:540 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:141 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:155 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:156 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:160 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:161 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:167 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:180 - Parse Error: Identifier "PhantomCameraManager" not declared in the current scope.
  res://addons/phantom_camera/plugin.gd:-1 - Compile Error: 
  modules/gdscript/gdscript.cpp:2788 - Failed to load script "res://addons/phantom_camera/plugin.gd" with error "Compilation failed". (User)
  res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd:141 - Compile Error: Identifier not found: PhantomCameraManager
  res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd:470 - Compile Error: Identifier not found: PhantomCameraManager
  res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd:-1 - Compile Error: 
  modules/gdscript/gdscript.cpp:2788 - Failed to load script "res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd" with error "Compilation failed". (User)
Add Autoload
  res://addons/phantom_camera/plugin.gd:54 - Invalid get index 'scene_changed' (on base: 'Control (viewfinder.gd)').

@DanielChaseButterfield
Copy link

Had a similar issue, adding the Autoload manually to the project settings, and then restarting, fixed it for me.

image

@DanielChaseButterfield
Copy link

Although, it seems that the autoload is removing itself, which is incredibly annoying.

@ramokz
Copy link
Owner

ramokz commented Jun 22, 2024

Should be resolved by #338 in the latest release (0.7.2.1).

@ramokz ramokz unpinned this issue Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Investigating
Projects
None yet
Development

No branches or pull requests