-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Ignore class's property array when generating extension_api.json (not… #64428
Conversation
Probably because it can be By the way, when I added that check to mono I copied it from Line 530 in 4bd7700
|
According to #63066 @raulsntos I'd rather updated this PR to ignore all |
One example of something that would break if we remove/unexpose the count properties: in C# we use the |
@raulsntos Thanks for the feedback ! I've updated my PR with your fix then ;-) |
Since the changes seem related to each other it might be best to squash them, and use the commit description to clarify what the changes do instead of separate commits. BTW it seems like you opened this PR by creating a branch on the upstream Godot repo instead of your fork. That means double the amount of CI runs (when pushing to the branch, and in the PR). To note for future PRs :) |
if (F.name.find("/") >= 0) { | ||
// Ignore properties with '/' (slash) in the name. These are only meant for use in the inspector. | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if that's always true.
At least some of them seem to be real but badly named properties:
doc/classes/AudioEffectDelay.xml: <member name="feedback/active" type="bool" setter="set_feedback_active" getter="is_feedback_active" default="false">
doc/classes/AudioEffectDelay.xml: <member name="feedback/delay_ms" type="float" setter="set_feedback_delay_ms" getter="get_feedback_delay_ms" default="340.0">
doc/classes/AudioEffectDelay.xml: <member name="feedback/level_db" type="float" setter="set_feedback_level_db" getter="get_feedback_level_db" default="-6.0">
doc/classes/AudioEffectDelay.xml: <member name="feedback/lowpass" type="float" setter="set_feedback_lowpass" getter="get_feedback_lowpass" default="16000.0">
doc/classes/AudioEffectDelay.xml: <member name="tap1/active" type="bool" setter="set_tap1_active" getter="is_tap1_active" default="true">
doc/classes/AudioEffectDelay.xml: <member name="tap1/delay_ms" type="float" setter="set_tap1_delay_ms" getter="get_tap1_delay_ms" default="250.0">
doc/classes/AudioEffectDelay.xml: <member name="tap1/level_db" type="float" setter="set_tap1_level_db" getter="get_tap1_level_db" default="-6.0">
doc/classes/AudioEffectDelay.xml: <member name="tap1/pan" type="float" setter="set_tap1_pan" getter="get_tap1_pan" default="0.2">
doc/classes/AudioEffectDelay.xml: <member name="tap2/active" type="bool" setter="set_tap2_active" getter="is_tap2_active" default="true">
doc/classes/AudioEffectDelay.xml: <member name="tap2/delay_ms" type="float" setter="set_tap2_delay_ms" getter="get_tap2_delay_ms" default="500.0">
doc/classes/AudioEffectDelay.xml: <member name="tap2/level_db" type="float" setter="set_tap2_level_db" getter="get_tap2_level_db" default="-12.0">
doc/classes/AudioEffectDelay.xml: <member name="tap2/pan" type="float" setter="set_tap2_pan" getter="get_tap2_pan" default="-0.4">
doc/classes/CharacterBody2D.xml: <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.08">
doc/classes/CharacterBody3D.xml: <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" default="0.001">
doc/classes/Joint3D.xml: <member name="collision/exclude_nodes" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true">
doc/classes/Joint3D.xml: <member name="nodes/node_a" type="NodePath" setter="set_node_a" getter="get_node_a" default="NodePath("")">
doc/classes/Joint3D.xml: <member name="nodes/node_b" type="NodePath" setter="set_node_b" getter="get_node_b" default="NodePath("")">
doc/classes/Joint3D.xml: <member name="solver/priority" type="int" setter="set_solver_priority" getter="get_solver_priority" default="1">
See #17558.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fixing those in #44876.
488fc63
to
b68ae22
Compare
In extension_api.json we want to expose properties that are meant to access a class attribute from script (i.e. `Node2D.position`). However property system is also used in Godot to declare attributes accessible from the node editor: - property with '/' in their name - property array with NIL type that represents an array
b68ae22
to
a696332
Compare
@akien-mga thanks for the review ! I've squashed and rebase the commits and improved the commit message as you asked
Sorry for this (I can't even say it's the first time, shame on me !), I'll try to be more careful next time ;-)
So do you want me to remove the check on |
No I think it's ok. Those properties with |
Thanks! |
fix #64426
fix #63066
I've copied the code from the mono's bindings_generator.cpp (I'm not sure why the
F.type == Variant::NIL
part is needed givenPropertyInfo::add_property_array
always set the type toVariant::NIL
)In the long run, we should probably replace this by a proper factorization (for instance adding a
PropertyInfo::is_fake_property
method) as there is multiple places where thisE.usage & PROPERTY_USAGE_CATEGORY || ...
pattern is used (sometime without the check toPROPERTY_USAGE_ARRAY
and no comment to easily understand if it is a desired behavior ^^)EDIT: I've also included a commit that filter out the properties with
/
in there name (this also comes from mono's bindings_generator.cpp ) as they are also not real properties (if you ask me, in the long run we should have a dedicatedPROPERTY_...
for this kind of "editor only" property). Tell me you'd rather have it as a separate PR ;-)