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

Missing getter/setter for RootMotionView properties #90

Open
tayloraswift opened this issue Apr 29, 2021 · 4 comments
Open

Missing getter/setter for RootMotionView properties #90

tayloraswift opened this issue Apr 29, 2021 · 4 comments
Labels

Comments

@tayloraswift
Copy link

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:

  • cell_size
  • color
  • radius
  • zero_y
@akien-mga akien-mga changed the title missing getter/setter RootMotionView::animation_path Missing getter/setter for RootMotionView properties Apr 29, 2021
@akien-mga
Copy link
Member

akien-mga commented Apr 29, 2021

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 godotengine/godot@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 godotengine/godot#46432 (comment).

@BastiaanOlij
Copy link
Collaborator

@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
Copy link
Member

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
Copy link

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.

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

No branches or pull requests

5 participants