godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 96 forks source link

Add 3-axis gizmo movement to Path3D points #527

Open nonunknown opened 4 years ago

nonunknown commented 4 years ago

Describe the project you are working on:

A 3D Platformer

Describe the problem or limitation you are having in your project: Working with Paths, For example if I want to move a point only in X Axis, or Y Axis, I simply can't even if I could adding a 3Axis Gizmo would really help

Describe the feature / enhancement and how it helps to overcome the problem or limitation: The solution is adding 3Axis Gizmo like you do for moving Spatial Nodes!

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: Before: Screenshot from 2020-02-26 17-16-29

After: vec

If this enhancement will not be used often, can it be worked around with a few lines of script?: I think its possible to create a plugin that lets you do that, but in my vision this really needs to be core feature!

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

RobAley commented 4 years ago

I support this proposal, moving path nodes is currently too error prone when you only want to go in one direction. I think the

Related, it would also be helpful if the colour of the in/out control handles (I think that's what they're called, the extra two handles you get per point when you shift-click and drag it) could be a different color to the point location handle itself. In a path with many points it's hard to tell which handles are which. Either that, or a line joining them to the main point position handle. The 3 Axis handle proposed above would presumably be also added to these two control handles as well?

nonunknown commented 4 years ago

I support this proposal, moving path nodes is currently too error prone when you only want to go in one direction. I think the

Related, it would also be helpful if the colour of the in/out control handles (I think that's what they're called, the extra two handles you get per point when you shift-click and drag it) could be a different color to the point location handle itself. In a path with many points it's hard to tell which handles are which. Either that, or a line joining them to the main point position handle. The 3 Axis handle proposed above would presumably be also added to these two control handles as well? I didnt understood well, can you use a image?

RobAley commented 4 years ago

I've realised I was slightly wrong, there are already lines, they just can't always be seen.

So, in the path pictured below, I have shift-clicked on the middle point and dragged outwards, this adds two new handles (joined with a feint grey line to the point) which control the in/out curve to that point :

path

As you can see, both additional handles are the same colour as the original point handle (a kind of red/pink). Now, in my app, I'm using a CSGPolygon with pathfollow to attach a roadway to the path :

road

As you can see, the grey lines that join the in/out control handles to the main point handles are no longer visible (which is why I initially stated it would be nice to have lines!), and all of the handles are the same colour. So at a glance, it's hard to see which handle is which, and I frequently adjust the wrong one. So it would be nice if the handles were different colours, and perhaps the grey lines had a thin outline so they could be seen against a grey background.

But to relate it back to your proposal, it would be good if these additional in/out handles also had the 3axis gizmos on as well.

Muzz commented 4 years ago

Adding further wishes for this. Both drawing debug lines ontop of geometry and the 3 axis.

Also adding the ability to affect the line tilt in editor would be good. It's already a feature of bezier curves, but it isn't exposed.

This would let beziers be a much more complete solution to in game content creation.

rcorre commented 4 years ago

A few thoughts:

And two additional requests, which may or may not belong in a separate issue:

nonunknown commented 4 years ago

@rcorre Nice additions, Fully agree with you!!!

Calinou commented 4 years ago

Closed loop editing. When you click "close loop" while editing a path, it adds a final point in the same position as the first point. This is fine until you try to edit that point and end up breaking your loop.

I guess this requires adding a closed property to Path3D? We'll also want to do the same in 2D for consistency.

balloonpopper commented 4 years ago

I'd like to see numerical fields for precise editing of the values for both the points and the handles. It would remove a lot of tedious minor edits that are required to try and get placement and orientation exactly how you want it. I've been trying to create a path that follows a curve around exactly 90 degrees - no matter what I do to the last point I can't get the rotation to come out at 90 degrees to the starting point and have to script in a correction that wouldn't be necessary if precise editing was possible.

rcorre commented 3 years ago

https://github.com/godotengine/godot-blender-exporter/pull/380 is merged. It is now possible to export bezier curves from blender using godot-blender-exporter.

Zireael07 commented 3 years ago

One more thing that path3D needs, apart from visual tweaks to the gizmo and a snap to collider option, would be axis constraints which would prevent placing the point in the wrong position in the first place. The Waterways addon has managed to implement those: https://github.com/Arnklit/Waterways/blob/main/addons/waterways/water_helper_methods.gd

fire commented 2 years ago

As https://github.com/godotengine/godot/pull/50748 subgizmos was merged, Godot Engine 4 has all the things needed to add this.

TheDuckCow commented 2 years ago

Agree with much of this thread. @balloonpopper I was so frustrated with working with curves, I ended up making a plugin to get that precise editing panel (demo here; will reply back to that twitter thread once I release source code for it). I think this is a quite critical functionality to have in core.

Something else to add to this conversation, and pairs with this idea of a precise editing xyz box, is a concept of an "active point". Similar to how there is an active object, it would be nice if we could click into a curve to edit and select points. This way, gizmos could be added only to one point at a time (having gizmos appear on all points all the time would be a lot of visual overload), plus it also allows for a concept of selecting in and out handles in addition to the position point. I realize that introduces an entire other editing state which is a layer on top of what is there today, but maybe something like a tracker for the last interacted with point just ends up setting some reference index variable?

Hiiamwilliam commented 2 years ago

It is not Wednesday my dudes, and I did a thing (for Godot 3). My addon CustomPathGizmo is now live on the Asset Store! It has several features from this thread:

A small difference is that translations snap to 0.1 by default. I don't know how to read from the Transform > Configure Snap, so I had to assume a small value. The addon technically could be made to work withou snap, but this will require a refactoring I'm not going to do since I had plans to use this addon with another addon.

Should mostly work fine, but do report bugs if you find any.

no matter what I do to the last point I can't get the rotation to come out at 90 degrees

Yeah I think there's something wrong as well. Setting tilt to X degrees does not rotate an object following a PathFollow exactly X degrees. It gets close enough, but not exactly there. This addon doesn't solve that.

fire commented 11 months ago

Is there interest in me porting this to be in core Godot Engine?

Edited: It may already be implemented.

https://github.com/godotengine/godot-proposals/assets/32321/0e51a4d9-4a5a-4cb7-9814-ea22ec2bea59

Muzz commented 11 months ago

@fire That's a huge improvement, i'd love to see it in.

fire commented 11 months ago

The latest Godot Engine 4.2 builds should have this better 3-axis gizmo for paths.

Calinou commented 11 months ago

What @fire is showing isn't 3-axis gizmo movement (see OP for what's expected), it's tilt handles. This proposal is still not implemented as of 4.2.

FabriceCastel commented 8 months ago

Hey y'all. This is a HUGE paint point for me in my current project, and I can't really wait around until this makes its way to core so I wrote up a very, very rough plugin to help work around this issue here: https://github.com/FabriceCastel/better-path3d-gizmos

image

It does just enough to get the job done for me. I'm not planning on doing any fixes/improvements/etc to this plugin, but if anyone wants to push that I don't mind going over pull requests or letting anyone just take what I've got and build something better on top.

Hope this helps.

fire commented 8 months ago

@FabriceCastel Would you be ok if I ported it to c++ core?

FabriceCastel commented 8 months ago

Yeah sure thing @fire 👍