godot-extended-libraries/godot-interpolated-camera3d

The interpolated camera 3d node does not show up among the available node types

RicardRC opened this issue · 10 comments

imagen
imagen

Though the gdscript autocomplete seems to recognize it in some form:
imagen

Does it work with other nodes added by plugins? If not, this is likely a bug in Godot rather than the plugin.

I'd check, but I haven't been able to find another plugin that just adds a node type for 4.0, all of the plugins that I could find are 3.2 or older. Sorry. Do you know of any such repo or plugin?

Do you know of any such repo or plugin?

Not that I know of 🙁

It only started showing up in the add node dialog for me in Godot 4 Alpha 1 when I added the following to plugin.gd:

func _enter_tree():
	add_custom_type("InterpolatedCamera3D", "Camera3D", preload("interpolated_camera_3d.gd"), preload("interpolated_camera_3d.svg"))
	
func _exit_tree():
	remove_custom_type("InterpolatedCamera3D")

I'm not sure if this was supposed to change in Godot 4 (since there's an icon decorator and whatnot), but this is basically how it was done in 3.x too. The docs for "latest" also still say to include these lines.

I can create a PR if you'd like? Like I said, I'm not sure if we're still supposed to be doing it this way in Godot 4.

add_custom_type()/remove_custom_type() is considered deprecated in favor of class_name since Godot 3.1. class_name creates actual custom types, unlike add_custom_type()/remove_custom_type() which is an editor-only helper.

There is a script in the plugin designed so the class names can be seen when the plugin is enabled: https://github.com/godot-extended-libraries/godot-interpolated-camera3d/blob/master/addons/interpolated_camera_3d/plugin.gd

For reference, this is why a dummy script is needed: godotengine/godot#30048

That's what I figured, but I'm a bit confused why the new node type isn't showing up out of the box for at least two people even after checking the enabled checkbox. Maybe this'll be resolved when Godot hits beta

Back when I first created this add-on, it worked, so this may be a regression from the GDScript rewrite in master (although the rewrite was already merged back in September 2020).

Edit: I can confirm this is actually a regression in master: godotengine/godot#57668

Thanks for looking into this and creating the issue on the godot repo!

This seems to be fixed now and I cannot replicate this issue in Godot 4.0.3. After enabling the plugin the InterpolatedCamera3D does show up among the available node types.

Closing per the above comment.