-
-
Notifications
You must be signed in to change notification settings - Fork 23k
Closed
Description
While working on Godot-Python, I've encountered my share of quirks in the GDNative API, I guess it's time to fix them for Godot 4.0 ;-)
Issues in api.json
:
- methods parameters of type
StringName
are exposed asString
. BulletPhysicsServer
not marked as singleton but inheritsPhysicsServer
Object.free
is virtual (should usegodot_object_destroy
instead of calling it directly), but not info about it inapi.json
- field
instanciable
renamed intoinstantiable
? - missing
Script.has_property
,Script.has_method
andScript.has_script_signal
- Some properties has
/
in there name to indicate they need an additional parameter (provided by the "index" field, which is set to-1
when the value is not needed...). Would be better to provide aadditional_arguments
parameter that take a list, or have a booleanhas_index_argument
field (in the style of thehas_default_value
boolean field) Object.set/get
doesn't return a boolean to indicate if the operation couldn't succeed if the property doesn't exists- default values are... strange. This is due to the fact they are formatted by there
operator String()
which often lack clarity (and is subject of innocent modifications breaking theapi.json
format !). It would be better to define those informations throught a custom string (this is already done in the doc xml files). Exemple of strange values:[Object:null]
andNull
[RID]
((1, 0), (0, 1), (0, 0))
(should beVector3((1, 0), (0, 1), (0, 0))
)- PoolColorArray displayed as
[PoolColorArray]
but PoolVector2Array displayed as[]
1, 0, 0, 0, 1, 0, 0, 0, 1 - 0, 0, 0
for Transform here the-
is especially misleading :/
- property
PrimitiveMesh.material
has typeSpatialMaterial,ShaderMaterial
. This is fine from a documentation point of view, but given the documentation already overwrite fields in it xml files, I guess it would be better to replace that by a simplerMaterial
value - missing
Object.get_class_name
(which returns aStringName
, useful for fast retrieval of a wrapper class when getting a generic object from variant). This would bring a bit of confusion withObject.get_class
though, I guess we could rename that intoString Object.get_class_name()
andStringName Object.get_class_name_as_string_name()
Issues in gdnative api:
godot_quat_new_with_axis_angle
inconsistent withgodot_basis_new_with_axis_and_angle
- missing
godot_basis_get_column
(but oddlygodot_basis_get_row
is present) - missing
godot_array_operator_equal
&godot_pool_x_array_operator_equal
- missing
Transform2D
origin/axis getter/setter - missing
godot_basis_axis
(unlikegodot_vector3_axis
which is present) - missing
Transform2D(Transform)
- missing
Transform(Basis)
- missing
Transform(Transform2D)
pluginscript api usegodot_string
everywhere where most of the timegodot_string_name
would be better suited (e.g.godot_bool godot_pluginscript_instance_desc_set_prop(godot_pluginscript_instance_data* p_data, godot_string* p_name, godot_variant* p_value)
) (Use StringName in pluginscript's set/get_prop and add_global_constant #35812)ScriptLanguage::add_named_global_constant
(exposed by pluginscript) api is weird: global constant can only be integer, but the function takes a variant as parameter- missing pluginscript binding of
ScriptLanguage::add_named_global_constant
andScriptLanguage::remove_named_global_constant
. On top of thatadd_named_global
andadd_global_constant
have misleading names (from what I understand, the difference between them is the later can have any type of value where the former is only an integer...) get_rpc_mode
andget_rset_mode
fields ingodot_pluginscript_instance_desc
are never used and should be removed (Remove useless pluginscript godot_pluginscript_script_desc.get_rpc/rset_mode fields #35811)godot_dictionary_operator_equal
doesn't do key/value comparison but only test if the underlying hashmap is the same (Modify Array/Dictionary::operator== to do real key/value comparison #35816)Remove deprecated GDNative wrapper code (Is GDNATIVE_API_INIT & GDnative wrapper lib still used ? #27054)
Issues in ptrcall:
- return value need to be initialized by the caller even if it is always overwritten (see [GDnative] ptrcall returning godot_string need to initialized #34264)
OS.get_static_memory_usage
returns a uint64_t which is not compatible with godot_int (see [GDnative] ptrcall on OS.get_static_memory_usage cause segfault due to godot_int != uint64_t #34254, solved by GDNative: Make godot_int an int64_t #36163)
That's a big wishlist I guess ! I guess I've already found what I'll be working on at next week's GodotCon sprints ^^
Zireael07, Calinou, Sslaxx, SleepProgger, TicklesTheBrain and 11 moreGameDevLlama, LennyPhoenix and MalkverbenaArdaE and Malkverbena