godotengine / godot-headers

Headers for the Godot API supplied by the GDNative module.
MIT License
381 stars 91 forks source link

Missing getter/setter for RootMotionView properties #90

Open tayloraswift opened 3 years ago

tayloraswift commented 3 years ago

The property RootMotionView::animation_path defined in the api.json uses accessors get_animation_path, set_animation_path, but these functions are not present in the api description. there is a similar issue with the following properties:

akien-mga commented 3 years ago

This seems to be because RootMotionView is registered as an editor-only class with a somewhat unconventional pattern: it's registered as core class, then disabled, and re-enabled in the editor:

https://github.com/godotengine/godot/blob/690c00d52261ab3132c520ddb317dd1c4e5f23b1/scene/register_scene_types.cpp#L477-L478

https://github.com/godotengine/godot/blob/690c00d52261ab3132c520ddb317dd1c4e5f23b1/editor/editor_node.cpp#L5870

This was done on purpose by @reduz in https://github.com/godotengine/godot/commit/c633b770cb6.

ClassDB::get_method_list() ignores disabled classes, while ClassDB::get_property_list() doesn't, which is why properties end up listed but not the methods. Not sure if that's a bug or just a design quirk from this weird pattern.

See also https://github.com/godotengine/godot/pull/46432#issuecomment-824287974.

BastiaanOlij commented 3 years ago

@akien-mga I don't know if we changed this for extensions but on a broader discussion, I don't think we should filter out editor only classes, maybe just flag them in the api.json. We need those classes in order to make plugins that add features for the editor. I guess we just need to figure out a good way to prevent those classes from being used in runtime as they will give an error.

To this particular problem, I wonder why its done this way? Sounds like Reduz only did the trick so he could debug an in editor issue and should probably have reverted it.

akien-mga commented 3 years ago

To this particular problem, I wonder why its done this way? Sounds like Reduz only did the trick so he could debug an in editor issue and should probably have reverted it.

RootMotionView is an editor-specific helper node, but as it's a node it's something which you place in your scene tree directly - and thus it needs to be registered in core. It's the only component which is like this in Godot AFAIK.

ParadoxV5 commented 1 year ago

Excuse me for necroposting, but descriptions for RootMotionView members are up from 3.3 to present (4.0). I don’t know what issue/PR is associated as I haven’t searched deeply.