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

Documentation for SpatialMaterial::set_flag is incorrect. #699

Closed
halzy opened this issue Feb 19, 2021 · 3 comments
Closed

Documentation for SpatialMaterial::set_flag is incorrect. #699

halzy opened this issue Feb 19, 2021 · 3 comments
Labels
bug c: bindings Component: GDNative bindings (mod api) documentation
Milestone

Comments

@halzy
Copy link
Member

halzy commented Feb 19, 2021

https://docs.rs/gdnative/0.9.3/gdnative/api/struct.SpatialMaterial.html#method.set_flag

Should read:

If true, enables the specified flag. Flags are optional behaviour that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to true. See Flags enumerator for options.

Actually reads:

If true, the vertex color is used as albedo color.

The incorrect documentations appears to have been taken from the vertex_color_use_as_albedo setter.

@ghost
Copy link

ghost commented Feb 20, 2021

It seems that other indexed properties are affected as well: https://docs.rs/gdnative/0.9.3/gdnative/api/struct.SpatialMaterial.html#method.set_texture, which reads:

Texture used to control the transmission effect per-pixel. Added to [member transmission].

I think this is due to the assumption that one setter cannot be used for multiple properties, like #689. I think we can check whether the property name matches before using the property docs?

@ghost ghost added c: bindings Component: GDNative bindings (mod api) bug documentation labels Feb 20, 2021
@Bromeon Bromeon added this to the v0.10.1 milestone Nov 1, 2021
@Bromeon Bromeon modified the milestones: v0.10.1, v0.10.2 Jul 16, 2022
@Bromeon Bromeon modified the milestones: v0.10.2, v0.11.x Oct 1, 2022
@chitoyuu
Copy link
Contributor

chitoyuu commented Nov 4, 2022

This should've been fixed in #970 I think?

@Bromeon
Copy link
Member

Bromeon commented Nov 4, 2022

Indeed, the documentation is correct now:

If true, enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to true. See Flags enumerator for options.

Thanks!

@Bromeon Bromeon closed this as completed Nov 4, 2022
@chitoyuu chitoyuu modified the milestones: v0.11.x, v0.11.1 Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: bindings Component: GDNative bindings (mod api) documentation
Projects
None yet
Development

No branches or pull requests

3 participants