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

Add basic editor editing for ConvexPolygonShape2D and ConcavePolygonShape2D #100183

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Dec 8, 2024

Adds basic editor tooling to move the existing points of a ConvexPolygonShape2D or move the segments of a ConcavePolygonShape2D while a CollisionShape2D node is selected.

Removes the configuration warning about those shapes not being supported that added noise to all the CollisionShape2D nodes.

collision_poly_edit

Note this is only intended for very basic editing of moving points, e.g. what you already can do by fumbling with the exposed Resource Inspector arrays.

For more complex editing like adding, removing, splitting or converting shapes the CollisionPolygon2D node is still the way to go as it has a dedicated editor for all those more complex things.

@smix8 smix8 added this to the 4.4 milestone Dec 8, 2024
@smix8 smix8 requested review from a team as code owners December 8, 2024 23:45
@smix8 smix8 force-pushed the collision_polygon_shape_edit branch from d7f6b54 to 5ca4153 Compare December 8, 2024 23:47
Copy link
Member

@rburing rburing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and I like it a lot. Indeed I would say these shapes are fine to use directly. I have personally done so many times, mostly with shapes generated by scripts. The only issue (and probably the real reason for the configuration warning) is that editing them by hand is somewhat tricky: for the convex shape one might want some better feedback/assistance when the polygon is not convex, and for the concave shape one would like the ability to create chains (which is the most common use case).

I would not remove the configuration warning until more of the editor tooling is finished (on par with CollisionPolygon2D). As is, it would be quite confusing for a new user to figure out how to create a ConvexPolygonShape2D or a ConcavePolygonShape2D from scratch (e.g. by entering coordinates in the inspector).

If you want, the configuration warning can be rephrased to address the above.

…hape2D

Adds basic editor tooling to move the existing points of a ConvexPolygonShape2D or move the  segments of a ConcavePolygonShape2D while a CollisionShape2D node is selected.
@smix8 smix8 force-pushed the collision_polygon_shape_edit branch from 5ca4153 to 7c84eba Compare December 11, 2024 01:31
@smix8
Copy link
Contributor Author

smix8 commented Dec 11, 2024

Added a reworded configuration warning back in.

Adding actual capable polygon editing to the CollisionPolygon2D similar to what the CollisionPolygon2D can do is a ton of work and not in scope for this PR.

@Repiteo Repiteo merged commit c4aaad6 into godotengine:master Dec 11, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 11, 2024

Thanks!

@smix8 smix8 deleted the collision_polygon_shape_edit branch December 12, 2024 18:15
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.

4 participants