godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Move Polygon2D's UV Editor to bottom dock, rename to Polygon Editor #8209

Open aXu-AP opened 1 year ago

aXu-AP commented 1 year ago

Describe the project you are working on

Looking to resurrect an old 2D platformer game which uses textured polygons for characters and environments.

Describe the problem or limitation you are having in your project

The fact that Polygon2D's UV editor is a separate dialog has currently many limitations:

Renaming makes sense because it's not just UV editor. It currently handles also polygon creation and bone weight painting. Also see proposal for color editor: #8195

Describe the feature / enhancement and how it helps to overcome the problem or limitation

When selecting a Polygon2D node, in the bottom dock appears editor named "Polygon". The functionality of the editor is unchanged. You can edit polygons in the dock or use tools that are available in canvas editor's toolbar. To iterate on previous points:

Renaming the editor boosts feature discoverability. The little "UV" button in toolbar doesn't really tell you that this is also how you change bone weights.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

kuva I have already made a proof of concept on this, you can check it at aXu-AP/godot/uv-editor-enhanced (WIP)

If this enhancement will not be used often, can it be worked around with a few lines of script?

Used often.

Is there a reason why this should be core and not an add-on in the asset library?

Improves core editor functionality and makes the code easier to maintain.


This is one part of multiple UV editor enhancements: #4118

KoBeWi commented 1 year ago

This would possibly supersede #266

aXu-AP commented 1 year ago

@KoBeWi as UV editor currently works only on Polygon2D, not necessarily. Down the line we could consider adding CollisionPolygon2D and LightOccluder2D support to it. But this proposal doesn't cover that.

KoBeWi commented 1 year ago

Ah right. Well, at least it would make it possible to easily resolve that proposal, as the required functionality already exists.

aXu-AP commented 1 year ago

Interestingly, @reduz implied multiple times in #4565 that polygon editor is in the bottom dock. Citing:

This makes sense for the most part because most things in the bottom panels (console, debugger, animation editor, tile editor, polygon editor, etc) would simply not function on the side.

Contextual editors like Tile Editor, Polygon Editor, Animation Tree Editor and many others (which only one should open at the same time and only when the node or resource is being edited) should still remain hard-coded to the bottom panels

Was this at some point planned or does he talk about something else entirely?

KoBeWi commented 1 year ago

He was probably referring to the texture region editor, which was since then moved to a dedicated dialog opened from the inspector.

aXu-AP commented 1 year ago

I didn't know that texture region editor was in the dock at some point, but it makes sense that it's its own dialog now as it's for one off edits. Unlike polygon editor, which can be more of an iterative work, hence bottom dock ftw 😊

miss-programgamer commented 1 month ago

I'm interested in this rework of the polygon2d editor becoming a reality, and would even be willing to work on it. I've been working on a card game where I want character animations to use 2D skeleton animations, and the process of editing "meshes" (polygons) is really not great as it stands, heh.

aXu-AP commented 1 month ago

I can finish my work on this and make a pr, I believe it more or less just needs a rebase and some small things. I have been waiting because there wasn't much support on this proposal. Altough there seems to be some at least, and notably I have seen no criticism towards the idea. I guess the best thing you can do to get this implemented is to try to get more community backing for the idea. It's not hard to implement, but the maintainers need to see that this is a valuable change.

I made a reddit post about this and other proposed modifications to polygon editor, which generated some buzz (votes stand at +52, with 96% upvote rate), but that's hard to convert into github likes.