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

Unhide hidden members by renaming them and rebind Mesh enums #36382

Merged
merged 8 commits into from
Dec 5, 2020

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Feb 20, 2020

The entire purpose of this PR is to break compatibility. It benefits the scripting API due to not having members shadow one another, and it increases verbosity. For details, see #15763 (comment), but this PR does not close that issue since there are still a few other things.

  • Rename XR get_type and get_name to get_tracker_type and get_tracker_name.

  • Rename CPUParticles/CPUParticles2D/ParticlesMaterial Flags enum to ParticleFlags.

  • Rename PathFollow2D rotate bool to rotates.

  • Rebind Mesh/ArrayMesh enums based on where they are used and to not have a duplicate ArrayType enum.

  • Rename LightOccluder2D light_mask to occluder_light_mask to avoid masking light_mask.

  • Rename RD uniform type to uniform_type (newly exposed in April 2020).

  • Rename RD texture type to texture_type (newly exposed sometime in mid-2020).

  • Rename EditorNode3DGizmoPlugin get_name to get_gizmo_name.

In a nutshell, we should avoid ambiguous words like name and type and flags. For example, with RDUniform type, how do you know that "type" refers to a variable of type enum RenderingDevice.UniformType? Maybe it could be the type of the variable in Variant TYPE (so Variant::INT)? Maybe it could be some way to express the struct type RDUniform? What if you just have var u in GDScript and then u.type with no mention of "Uniform"? We should try to write things to be self-evident and not confusing. Also, type in a getter is get_type, which in C# would be GetType(), which conflicts with C#'s GetType().

@aaronfranke aaronfranke added this to the 4.0 milestone Feb 20, 2020
@aaronfranke aaronfranke requested a review from a team as a code owner February 20, 2020 10:57
@aaronfranke aaronfranke force-pushed the unhide-the-hidden branch 2 times, most recently from 7337231 to 37a16ba Compare March 16, 2020 08:04
@aaronfranke aaronfranke force-pushed the unhide-the-hidden branch 2 times, most recently from 8fbd3b6 to 55c1c9c Compare April 7, 2020 07:59
@aaronfranke aaronfranke force-pushed the unhide-the-hidden branch from 5b1b93e to e09ac85 Compare May 7, 2020 06:53
@aaronfranke aaronfranke requested a review from reduz May 7, 2020 06:56
@aaronfranke aaronfranke force-pushed the unhide-the-hidden branch 2 times, most recently from 13949ad to cc8ac33 Compare May 15, 2020 04:05
@aaronfranke aaronfranke requested a review from BastiaanOlij May 21, 2020 23:01
doc/classes/Mesh.xml Outdated Show resolved Hide resolved
scene/resources/mesh.cpp Outdated Show resolved Hide resolved
Now called get_tracker_type and get_tracker_name
"Flags" was a bit too ambiguous, and in 3D it hid GeometryInstance.Flags
"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
@akien-mga akien-mga merged commit 744ab88 into godotengine:master Dec 5, 2020
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants