Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ryan Peach |
So I’m writing my first GDNative module and have created a single Path2D class. It has several parameters and methods I have exposed:
void OrbitPath2D::_register_methods() {
register_method("_draw", &OrbitPath2D::_draw);
register_method("_init", &OrbitPath2D::_init);
register_property<OrbitPath2D, float>("semi_major_axis", &OrbitPath2D::set_semi_major_axis, &OrbitPath2D::get_semi_major_axis, 10.0);
register_property<OrbitPath2D, float>("eccentricity", &OrbitPath2D::set_eccentricity, &OrbitPath2D::get_eccentricity, 0.0);
register_property<OrbitPath2D, float>("argument_of_periapsis", &OrbitPath2D::set_argument_of_periapsis, &OrbitPath2D::get_argument_of_periapsis, 0.0);
register_property<OrbitPath2D, int>("draw_resolution", &OrbitPath2D::set_draw_resolution, &OrbitPath2D::get_draw_resolution, 100);
register_property<OrbitPath2D, Color>("draw_color", &OrbitPath2D::set_draw_color, &OrbitPath2D::get_draw_color, godot::Color(0,0,0));
}
But when I attach it to a node, I don’t see any exported parameters.
Please see:
src/OrbitalPath2D.hpp
src/gdlibrary.cpp
demo/bin/Orbit2D.gdnlib
demo/bin/OrbitPath2D.gdns
Code Location:
Note I’m working in Godot 4.0 as a contributor on a custom branch. Nothing too drastic.
Output when working in project:
Godot Engine v4.0.dev.custom_build.f4d24d3e8 - https://godotengine.org
Registered camera USB Camera with id 1 position 0 at index 0
Registered camera FaceTime HD Camera (Built-in) with id 2 position 0 at index 1
Editing project: /Users/ryapeach/Documents/GameDev/Orbits2D/demo (::Users::ryapeach::Documents::GameDev::Orbits2D::demo)
arguments
0: /Users/ryapeach/Documents/GameDev/godot/bin/godot.osx.tools.64
1: --path
2: /Users/ryapeach/Documents/GameDev/Orbits2D/demo
3: --editor
Current path: /Users/ryapeach/Documents/GameDev/Orbits2D
Godot Engine v4.0.dev.custom_build.f4d24d3e8 - https://godotengine.org
ERROR: 1 shaders of type VolumetricFogShaderRD were never freed
at: ~ShaderRD (servers/rendering/rasterizer_rd/shader_rd.cpp:470)
ERROR: Some texture bindings were not properly freed (leaked CanvasItems?)
at: ~RasterizerCanvasRD (servers/rendering/rasterizer_rd/rasterizer_canvas_rd.cpp:2500)
(anaconda3) ryapeach@C02D574YMD6R ~/Documents/GameDev/Orbits2D main ✔ 1005 00:30:12
Registered camera USB Camera with id 1 position 0 at index 0
Registered camera FaceTime HD Camera (Built-in) with id 2 position 0 at index 1
ERROR: does not have a library for the current platform.
at: init_library (modules/gdnative/nativescript/nativescript.cpp:1680)
ERROR: Condition "!script_data" is true.
at: _update_placeholder (modules/gdnative/nativescript/nativescript.cpp:94)
ERROR: does not have a library for the current platform.
at: init_library (modules/gdnative/nativescript/nativescript.cpp:1680)
ERROR: 1 shaders of type VolumetricFogShaderRD were never freed
at: ~ShaderRD (servers/rendering/rasterizer_rd/shader_rd.cpp:470)
ERROR: Some texture bindings were not properly freed (leaked CanvasItems?)
at: ~RasterizerCanvasRD (servers/rendering/rasterizer_rd/rasterizer_canvas_rd.cpp:2500)