-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 handles to control Curve3D tilt #68873
Conversation
I like the disk idea for UI, though I do think the up vector should probably be indicated too (line + disk?) |
Agree. And perhaps the (line + disk + tilt handle)could use a color different than default handles(white), to indicate they are in a separate group. |
The real value (for me given I came looking) is in the "PATH_ROTATION_PATH_FOLLOW_TILT" addition to CSGPolygon noted in https://github.com/Ademan/godot/tree/wip_csg_use_up_vector as currently CSGPolygon seem to completely ignore tilt values. @Ademan Is the intent to merge this also in a separate PR? or can it be included here? |
@@ -448,6 +569,13 @@ EditorPlugin::AfterGUIInput Path3DEditorPlugin::forward_3d_gui_input(Camera3D *p | |||
ur->add_undo_method(c.ptr(), "set_point_in", i, c->get_point_in(i)); | |||
ur->commit_action(); | |||
return EditorPlugin::AFTER_GUI_INPUT_STOP; | |||
} else if (dist_to_p_up < click_dist && c->is_up_vector_enabled()) { | |||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be changed to EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton(); to compile with latest mainline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ademan Bump 🙂
Seems to work pretty well from my quick testing. I don't think the handles looking the same is a deal breaker. That could potentially be adjusted in a later pass. From the context of the curve, it seems easy to tell what's what. |
There was a problem hiding this 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 dfebfd1). I like the idea, it mostly works as expected, but I have 2 noticeable issues:
- Input seems to be reversed when I drag the tilt gizmos in the 3D scene. To rotate clockwise, I need to make counterclockwise movements with the mouse and vice versa.
- Tilt gizmos look the exact same, both for the line and icon. This should be changed before the PR is merged, as it's too easy to confuse them for the curve smoothing ones.
That said, even with this PR, I can't quite get smooth camera movement with tilting to work. This PR will help a little, but it's still hard to control the curve editor in general (also because it's hard to see whether the curve's tilt is even the right way up – the fishbones could be less "open" to improve on this.)
Testing project: 4.zip
Hi, I looked over the code and feels it is too hacky, so make this PR #80329, trying to do it properly. |
@xiongyaohua thank you for taking this idea further! I have not had any time to work on it. |
Superseded by #80329. Thanks for your contribution! |
First PR, please be gentle, I tried to read the relevant contributing guides but I'm happy to correct anything I've missed.
This change allows interactive modification of the tilt values of a Curve3D.
Because the up vector is difficult to predict ahead of time, and changes in ways that are unintuitive (at least to me!) it was difficult to make good use of them. There's at least two of us who think this 😉 See #47445
This change allows for a more intuitive way to edit tilts and affect the up vector along the path. The handles point in the direction of the up vector, with tilt applied, and only appear when up vectors are enabled on the underlying curve.
I think its usefullness is more apparent with a CSGPolygon3D that uses the tilt values (cherry pick the tip of https://github.com/Ademan/godot/tree/wip_csg_use_up_vector and you'll get something more exciting like this:
The major drawbacks of this change are