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

Issues with GDExtension for Bindings with C# #68224

Closed
antonWetzel opened this issue Nov 3, 2022 · 1 comment
Closed

Issues with GDExtension for Bindings with C# #68224

antonWetzel opened this issue Nov 3, 2022 · 1 comment

Comments

@antonWetzel
Copy link
Contributor

antonWetzel commented Nov 3, 2022

Godot version

latest beta (current: 4.0 beta 4) (e675154)

System information

Windows 11

Issue description

I am working on C# Bindings for GDExtension and I have problems with the API

Problems

Notifications (Annoying)

  • Problem
    • Node and `Mainloop share the same Notifications
    • 2D, 3D and Control use the same Names with different values
  • Result
    • Global Enum for Notifications not possible
  • Solutions?
    1. rearrange Notifications from 2d, 3d and Control so same names have the same values (very unstable and hard to manage)
    2. No global Enum is possible

Getter and Setter (Strange)

  • Problem
    • some properties have not valid setter or getter method in the extension api (list below)

After final GDNativeInitialization some things are not initialized (Severe)

  • Problem
    • register_platform_apis and register_scene_singletons is called after the last level
    • register can't access some classes
  • Solution
    • add more levels

List of setter / getter without method

  • if the name is empty the property has no setter/getter
  • this list is only the properties where both setter and getter are invalid
AnimationNode setter _set_filters and getter _get_filters not found
AnimationNodeBlendSpace2D setter _set_triangles and getter _get_triangles not found
BitMap setter _set_data and getter _get_data not found
Control setter _set_layout_mode and getter _get_layout_mode not found
Control setter _set_anchors_layout_preset and getter _get_anchors_layout_preset not found
Image setter _set_data and getter _get_data not found
LightmapGIData setter _set_light_textures_data and getter _get_light_textures_data not found
LightmapGIData setter _set_user_data and getter _get_user_data not found
LightmapGIData setter _set_probe_data and getter _get_probe_data not found
MultiMesh setter _set_transform_array and getter _get_transform_array not found
MultiMesh setter _set_transform_2d_array and getter _get_transform_2d_array not found
MultiMesh setter _set_color_array and getter _get_color_array not found
MultiMesh setter _set_custom_data_array and getter _get_custom_data_array not found
NavigationMesh setter _set_polygons and getter _get_polygons not found
NavigationPolygon setter _set_polygons and getter _get_polygons not found
NavigationPolygon setter _set_outlines and getter _get_outlines not found
Polygon2D setter _set_bones and getter _get_bones not found
PolygonPathFinder setter _set_data and getter _get_data not found
ResourcePreloader setter _set_resources and getter _get_resources not found
ShapeCast2D setter  and getter _get_collision_result not found
ShapeCast3D setter  and getter _get_collision_result not found
SpriteFrames setter _set_animations and getter _get_animations not found
Translation setter _set_messages and getter _get_messages not found
VisualShaderNode setter _set_output_ports_expanded and getter _get_output_ports_expanded not found
VisualShaderNodeCustom setter _set_initialized and getter _is_initialized not found
VisualShaderNodeParameterRef setter _set_parameter_type and getter _get_parameter_type not found
@antonWetzel antonWetzel changed the title Issues with GDExtension for [C# Bindings for GDExtension](https://github.com/antonWetzel/GDExtensionCSharp) Issues with GDExtension for Bindings with C# Nov 3, 2022
@raulsntos
Copy link
Member

We prefer opening one issue for one bug instead of opening one big issue (see https://github.com/godotengine/godot/blob/master/CONTRIBUTING.md#reporting-bugs). Also, you may be able to get answers to some of this questions in the #gdextension channel on Rocket Chat.

About a global Notifications enum, I don't think that's possible because each Object derived class defines the notifications that it may notify about and base classes in the hierarchy don't need to be aware of them. In C# we currently generate them as constants in the type that defines them.

About the missing setter/getter, since they all starts with an underscore (_) it sounds like this:

About a new initialization level, this may be relevant:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants