Skip to content

Class 'ImGuiController' isn't exposed (Godot 4.5 Dev 2) #103

Open
@millerbyte

Description

@millerbyte

I only started getting this error when I upgraded to the latest Godot 4.5.dev2.mono (C#)) build.

Summary of Specs:

Godot Engine v4.5.dev2.mono.official.af2c71397 - https://godotengine.org
Vulkan 1.3.289 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 4090

OS:
Image

Error:

E 0:00:01:543   ImGuiRoot.gd:18 @ _enter_tree(): Class 'ImGuiController' isn't exposed.
  <C++ Error>   Condition "!ti->exposed" is true. Returning: nullptr
  <C++ Source>  core/object/class_db.cpp:549 @ _instantiate_internal()
  <Stack Trace> ImGuiRoot.gd:18 @ _enter_tree()

Image

ImGuiRoot.gd:

extends Node

signal imgui_layout

const csharp_controller := "res://addons/imgui-godot/ImGuiGodot/ImGuiController.cs"
const csharp_sync := "res://addons/imgui-godot/ImGuiGodot/ImGuiSync.cs"

func _enter_tree():
	var has_csharp := false
	print(ClassDB.class_exists("CSharpScript"))
	print(ClassDB.class_exists("ImGuiController"))

	if ClassDB.class_exists("CSharpScript"):
		var script := load(csharp_sync)
		has_csharp = script.get_instance_base_type() == "Object"

	if ClassDB.class_exists("ImGuiController"):
		var controllerInstance = ClassDB.instantiate("ImGuiController");
		print(controllerInstance)
		# native
		add_child(ClassDB.instantiate("ImGuiController"))
		if has_csharp:
			var obj: Object = load(csharp_sync).new()
			obj.SyncPtrs()
			obj.free()
	else:
		# C# only
		if has_csharp:
			add_child(load(csharp_controller).new())

These added print statements output:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions