Closed Vodurden closed 7 months ago
Oh it looks like GodotSharp
does have a native function exposed. Not sure if we can access it in this source generator though :thinking:
Hi Vodurden.
Thanks for finding this and for investigating. Pull request contains tests & changes required to fix the problem. Much appreciated if you could test it your end before we release :) I've uploaded a pre-release nuget and also a config you can use to easily add local packages via visual studio if that helps.
Caveats:
Cheers.
I tried this locally and it works! Thanks for resolving this so quickly :slightly_smiling_face:
Great, thanks for that. Nuget pre-release uploaded. I'll give it a few days/downloads, then create a proper release.
Cheers.
Problem
Thanks for the really useful library! Unfortunately I think I've run into an issue with the
SceneTree
generator.[SceneTree]
seems to generate a property / field with the typeGPUParticles3D
, but the actual C# type isGpuParticles3D
(presumably because of this)This fails to build with
I imagine this will affect other similar classes where the C# type name doesn't match the casing conventions stored in the
.tscn
file.Example
If I have a scene like this:
And I have a script like this:
This will generate (snippet):
The generated code is invalid because it uses
GPUParticles3D
, but the GodotSharp type isGpuParticles3D
. This causes the build to fail with:Possible Fixes
It seems like the naming transaction for C# is done in the get_base_class_name C++ function, which ultimately uses the
pascal_to_pascal_case
function.There also seems to be a few hardcoded overrides here.
I'm guessing we can't directly call the bindgen functions, so I imagine we'd need to title case the functions and then apply the same set of hardcoded overrides?