You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
The current EditorNode3DGizmoPlugin workflow is like this:
When _set_handle() is called, the plugin updates the Node3D according to the handle value.
When _commit_handle() is called:
If canceled, the plugin resets the Node3D with the provided initial handle value.
If not canceled, the plugin creates an undo-redo entry for the initial & current value.
The initial handle value is fetched by EditorNode3DPlugin when clicking the handle.
Not knowing the initial value makes it hard to switch modes when dragging the handle. For example, when dragging a rectangle CollisionShape2D, it allows you to switch between changing size only and changing both size and position. This is not possible in 3D as you lost the original node translation once dragged.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
With the original value available, properties can be updated in _set_handle() by relative value instead of absolute value.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Provide a way to get the initial handle value.
Add a parameter in _set_handle(), or
Add a method on EditorNode3DGizmo to provide the initial value, or
Add a _prepare_handle() method to let the user record it.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Create a custom EditorNode3DGizmo and add a initial_value property.
In _set_handle(), check if initial_value is ever set. Save the current handle value when not.
In _commit_handle(), clear initial_value.
This is hacky I think because it relies on _commit_handle() always being called, so a "begin" state can be detected.
Is there a reason why this should be core and not an add-on in the asset library?
It needs to modify how 3D gizmo plugin works.
The text was updated successfully, but these errors were encountered:
godotengine/godot#71092 implements begin_handle_action(), called just when clicking the handle and you can use get_handle_value() to get a reliable initial value. Does this resolve the proposal?
Describe the project you are working on
Playing around with the built-in gizmo plugins.
Describe the problem or limitation you are having in your project
The current
EditorNode3DGizmoPlugin
workflow is like this:_set_handle()
is called, the plugin updates theNode3D
according to the handle value._commit_handle()
is called:canceled
, the plugin resets theNode3D
with the provided initial handle value.canceled
, the plugin creates an undo-redo entry for the initial & current value.The initial handle value is fetched by
EditorNode3DPlugin
when clicking the handle.Not knowing the initial value makes it hard to switch modes when dragging the handle. For example, when dragging a rectangle
CollisionShape2D
, it allows you to switch between changing size only and changing both size and position. This is not possible in 3D as you lost the original node translation once dragged.Describe the feature / enhancement and how it helps to overcome the problem or limitation
With the original value available, properties can be updated in
_set_handle()
by relative value instead of absolute value.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Provide a way to get the initial handle value.
_set_handle()
, orEditorNode3DGizmo
to provide the initial value, or_prepare_handle()
method to let the user record it.If this enhancement will not be used often, can it be worked around with a few lines of script?
EditorNode3DGizmo
and add ainitial_value
property._set_handle()
, check ifinitial_value
is ever set. Save the current handle value when not._commit_handle()
, clearinitial_value
.This is hacky I think because it relies on
_commit_handle()
always being called, so a "begin" state can be detected.Is there a reason why this should be core and not an add-on in the asset library?
It needs to modify how 3D gizmo plugin works.
The text was updated successfully, but these errors were encountered: