godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.75k stars 577 forks source link

[4.3] Resource::get_rid is not exposed as virtual #1640

Open mohsenph69 opened 1 week ago

mohsenph69 commented 1 week ago

Godot version

4.3

godot-cpp version

4.3

System information

Linux manjaro

Issue description

Resource::get_rid is not exposed as virtual, and that make it impossible to create a custom mesh!

Steps to reproduce

NOTHING

Minimal reproduction project

NOTHING

dsnopek commented 1 week ago

The virtual function is Resource::_get_rid() (with an underscore)

mohsenph69 commented 1 week ago

The virtual function is Resource::_get_rid() (with an underscore)

Yeah with an underscore, it exist in GDScript but not GDExtension!

dsnopek commented 1 week ago

Ah, I see, it's only in Godot master not 4.3. This was fixed in https://github.com/godotengine/godot/pull/84944

It would be theoretically possible to implement for 4.3, using GDExtensionClassCreationInfo::get_rid_func, but would require some custom code, since Resource::_get_rid() isn't a normal virtual function in 4.3 and earlier.