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 3-axis gizmo movement to Path3D points #527

Open
nonunknown opened this issue Feb 26, 2020 · 20 comments
Open

Add 3-axis gizmo movement to Path3D points #527

nonunknown opened this issue Feb 26, 2020 · 20 comments

Comments

@nonunknown
Copy link

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
Copy link

RobAley commented Mar 5, 2020

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
Copy link
Author

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
Copy link

RobAley commented Mar 6, 2020

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
Copy link

Muzz commented May 18, 2020

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.

@Calinou Calinou changed the title Add 3 Axis movement to path points Add 3-axis gizmo movement to path points Jul 16, 2020
@Calinou Calinou changed the title Add 3-axis gizmo movement to path points Add 3-axis gizmo movement to Path3D points Jul 16, 2020
@rcorre
Copy link

rcorre commented Jul 23, 2020

A few thoughts:

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

  • A "snap to floor" setting for translating path points. I'm guessing most uses of paths in games follow the terrain?
  • 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.

@nonunknown
Copy link
Author

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

@Calinou
Copy link
Member

Calinou commented Jul 23, 2020

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
Copy link

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 added a commit to rcorre/godot-blender-exporter that referenced this issue Nov 15, 2020
Fixes godotengine#330.
Relates to godotengine/godot-proposals#527.

Previously, curves in blender were exported to meshes in Godot.

Now, a bezier curve created in blender will be exported as a Path node
with a Curve3D resource matching the blender data. The curve will have a
child MeshInstance that renders the bevel.

Only bezier curves are exported to Godot Path nodes. Other curves, such
as Nurbs, export only as meshes as they did previously.
rcorre added a commit to rcorre/godot-blender-exporter that referenced this issue Nov 16, 2020
Fixes godotengine#330.
Relates to godotengine/godot-proposals#527.

Previously, curves in blender were exported to meshes in Godot.

Now, a bezier curve created in blender will be exported as a Path node
with a Curve3D resource matching the blender data. The curve will have a
child MeshInstance that renders the bevel.

Only bezier curves are exported to Godot Path nodes. Other curves, such
as Nurbs, export only as meshes as they did previously.
Jason0214 pushed a commit to godotengine/godot-blender-exporter that referenced this issue Dec 16, 2020
* Export Curve objects as Godot Path nodes.

Fixes #330.
Relates to godotengine/godot-proposals#527.

Previously, curves in blender were exported to meshes in Godot.

Now, a bezier curve created in blender will be exported as a Path node
with a Curve3D resource matching the blender data. The curve will have a
child MeshInstance that renders the bevel.

Only bezier curves are exported to Godot Path nodes. Other curves, such
as Nurbs, export only as meshes as they did previously.

* Export all splines but only assign the active one.

* Remove curve test scenes for now.

They are generated with too recent of a blender version. We'll add them
again after bumping the blender CI version.

* Fix pylint warnings.
@rcorre
Copy link

rcorre commented Dec 22, 2020

godotengine/godot-blender-exporter#380 is merged. It is now possible to export bezier curves from blender using godot-blender-exporter.

@Zireael07
Copy link

Zireael07 commented May 13, 2021

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
Copy link
Member

fire commented Jan 6, 2022

As godotengine/godot#50748 subgizmos was merged, Godot Engine 4 has all the things needed to add this.

@Calinou Calinou added this to the 4.x milestone Jan 6, 2022
@TheDuckCow
Copy link

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
Copy link

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:

  • Three axis translation gizmo for curve points and in/out handles
  • The lines should be visible across geometry. I think.
  • Ability to set tilt in editor (in degrees, which gets converted to radians)
  • Snap to collider (from camera perspective)
  • Closed loop editing. Now there's also a button to open loop
  • Prints points position on double click (#3853)
  • Uses the concept of "active point" (handles only show for the last selected curve point)

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
Copy link
Member

fire commented Nov 6, 2023

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

Edited: It may already be implemented.

Curve3D.Screen.Recording.2023-11-06.at.9.45.04.AM.mov

@Muzz
Copy link

Muzz commented Nov 22, 2023

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

@fire
Copy link
Member

fire commented Nov 22, 2023

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

@Calinou
Copy link
Member

Calinou commented Nov 22, 2023

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
Copy link

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
Copy link
Member

fire commented Jan 28, 2024

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

@FabriceCastel
Copy link

Yeah sure thing @fire 👍

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

No branches or pull requests