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 closed property to Curve3D #86195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GreenCrowDev
Copy link
Contributor

@GreenCrowDev GreenCrowDev commented Dec 15, 2023

Should close godotengine/godot-proposals#6396 and close godotengine/godot-proposals#8650

2023-12-16-21-37-14.mp4

TODO:

  • Change color of start and end points (especially important when the curve is closed and you can't tell where's the start);
  • In and Out gizmo handles display, respectively for Start and End node, when _closed = true;
  • In and Out properties don't show up in inspector right now, but should be displayed when _closed = true;
  • Close Curve button could become a Closed Curve toggle, so that user can easily access the value through the already nice icon on the top bar of the viewport; Path3DEditorPlugin Close Curve button is now a "Toggle Open/Closed Curve" button that just toggles the curve closed property;
  • Documentation;
  • Tests (can you suggest some? I'm not used to them);

TODO (optional):

  • Draw indices text near the respective point to easily identify them (needs a bespoke solution as at the moment there's not a system in place to draw text near 3D gizmos);

If you have suggestions about what behaviour I should try to check if stuff is broken by this change let me know (for example something like PathFollow3D...).

scene/resources/curve.h Outdated Show resolved Hide resolved
scene/resources/curve.cpp Outdated Show resolved Hide resolved
@AThousandShips AThousandShips changed the title Add _closed property to Curve3D Add closed property to Curve3D Dec 15, 2023
@GreenCrowDev
Copy link
Contributor Author

Should I commit the changes to the branch as they are ready or wait to complete all of them? I'm not sure if running CI/CD checks every time is a problem...
Right now I'm adding features to a _dev branch on top of this one.

@GreenCrowDev GreenCrowDev marked this pull request as ready for review December 16, 2023 22:23
@GreenCrowDev GreenCrowDev requested review from a team as code owners December 16, 2023 22:23
scene/resources/curve.cpp Outdated Show resolved Hide resolved
scene/resources/curve.cpp Show resolved Hide resolved
doc/classes/Curve3D.xml Outdated Show resolved Hide resolved
editor/plugins/path_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/path_3d_editor_plugin.cpp Outdated Show resolved Hide resolved
@GreenCrowDev
Copy link
Contributor Author

Any idea when to merge this and set a milestone? 4.3 or 4.4?

@AThousandShips
Copy link
Member

It hasn't been reviewed or decided on so it's in 4.x until some decision or review has been made 🙂

@Chubercik
Copy link
Contributor

Chubercik commented Mar 10, 2024

Should I commit the changes to the branch as they are ready or wait to complete all of them? I'm not sure if running CI/CD checks every time is a problem...
Right now I'm adding features to a _dev branch on top of this one.

No one ever reprimanded me for committing to a live PR branch, so I think it's fine - just be sure to squash your commits afterwards (see: Pull request workflow).

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master 29b3d9e), I noticed some issues:

  • The start/end color for gizmos only appears at certain camera angles. Perhaps two sprite gizmos are overlapping and only one of them is showing up?
path3d_editor.mp4

This also causes the colors to stop appearing depending on the number of points drawn:

path3d_editor_2.mp4

They show up reliably in a top orthogonal view, which is what leads me to think it's an overlapping gizmo sorting issue:

image

Also, as an improvement, I suggest drawing the last line that goes from the last point to the first in a different color:

image

Mockup made in GIMP:

image

This way, you can tell which line is automatically being inferred by the engine as opposed as being designed by the user.

@GreenCrowDev
Copy link
Contributor Author

Thanks for the review @Calinou!

Yes, this worked well before #87901, and there's this other PR #89847 that refines Path3D editor, ready to be merged.

Since they work on the same lines of code, I'd like to wait for #89847 to be merged, that defines stuff the lack of which makes difficult to finalize these last tweaks you mentioned.

Is that okay? 😊

@Chubercik
Copy link
Contributor

Since they work on the same lines of code, I'd like to wait for #89847 to be merged, that defines stuff the lack of which makes difficult to finalize these last tweaks you mentioned.

Let's go.

@GreenCrowDev
Copy link
Contributor Author

GreenCrowDev commented Apr 5, 2024

I fixed the handles issue @Calinou.

Also fixed handles color in the curve edit mode, after the rebase.

I didn't implement the last segment color change though, as I realized that it would require some decent work, since we don't have access to control points but the baked ones. Eventually to add in a later PR?

scene/resources/curve.cpp Outdated Show resolved Hide resolved
scene/resources/curve.cpp Outdated Show resolved Hide resolved
scene/resources/curve.cpp Outdated Show resolved Hide resolved
scene/resources/curve.cpp Outdated Show resolved Hide resolved
scene/resources/curve.cpp Outdated Show resolved Hide resolved
@GreenCrowDev GreenCrowDev force-pushed the curve3d_close branch 2 times, most recently from 1199055 to 3008b6d Compare April 5, 2024 09:15
@GreenCrowDev
Copy link
Contributor Author

Changes implemented.

Also fixed a couple of bugs.

Not sure why it fails the check on Linux 🤔

gpg: keyserver receive failed: Connection reset by peer
Error: Process completed with exit code 2.

@AyyZerrAsa
Copy link

I fixed the handles issue @Calinou.

Also fixed handles color in the curve edit mode, after the rebase.

I didn't implement the last segment color change though, as I realized that it would require some decent work, since we don't have access to control points but the baked ones. Eventually to add in a later PR?

What do you mean in regards to not having access to control points? I made some changes in #90357 that caches baked distance at each original control point. Not sure whether that's relevant here. Great commit btw I was needing this, super suprised closed curves weren't a thing already.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master 79de2ea), it works as expected. I think this is in a good state to be merged early in the 4.4 cycle.

path3d_closed.mp4

@GreenCrowDev
Copy link
Contributor Author

GreenCrowDev commented Jul 8, 2024

Thanks for the review!
I applied the suggestions and rebased 😊

@GreenCrowDev
Copy link
Contributor Author

Rebased :)

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