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

3D editor transform gizmo is no longer visible by default #99305

Closed
zedrun00 opened this issue Nov 16, 2024 · 9 comments · Fixed by #99354
Closed

3D editor transform gizmo is no longer visible by default #99305

zedrun00 opened this issue Nov 16, 2024 · 9 comments · Fixed by #99354

Comments

@zedrun00
Copy link

Tested versions

master

System information

win10 21H2,Vulkan API 1.2.0

Issue description

2024-11-16_10-36-22.mp4

Steps to reproduce

look video

Minimal reproduction project (MRP)

none

@ghmart
Copy link

ghmart commented Nov 16, 2024

Could you check if "View Transform Gizmo" option is turned on?

view_transform_gizmo

@matheusmdx
Copy link
Contributor

I tested master (v4.4.dev.custom_build [6c05ec3]) rn and indeed this version is starting new projects with View Transform Gizmo being false for some reason.

@clayjohn I think this issue is not OS related, but if is the author OS is windows, but you put as android 😄

@matheusmdx
Copy link
Contributor

Bisected to #96922, @Nodragem

image

@clayjohn clayjohn moved this from Unassessed to Very Bad in 4.x Release Blockers Nov 16, 2024
@Nodragem
Copy link
Contributor

I will have a look tomorrow at how to solve the issue. For context, my PR intends to solve some input conflicts between Gridmap editor and 3d editor. When a Gridmap is selected, there are several input modes (e.g. transform, selection, paint, erase, picker), and I make the gizmo only visible and usable when the user selects the Transform mode.

The intended behaviour is that the gizmo is made invisible when a Gridmap is selected and it is made visible again if the transform mode is selected or if the Gridmap is deselected.

@DarkyMago
Copy link

DarkyMago commented Nov 16, 2024

I checked a bit on this, and running a gdb session on a empty project.godot I managed to pinpoint the trace at the end.

TLDR : while le plugin is loaded, calling set_pressed on select_mode_button (grid_map_editor_plugin.cpp:1354) executes connected call _on_tool_mode_changed which set default viewport View Transform Gizmo parameter to false,
as created scenes viewport options seems to carry from the last one, it persists on.

Removing the set_pressed line seems to fix the issue.

The relevant stack trace :
run equivalent to godot -e --path projectfolder where project.godot in projectfolder is an empty file.

Thread 1 "godot.dev" hit Breakpoint 1, GridMapEditor::_show_viewports_transform_gizmo (this=0x555574c12e70, p_value=false)
    at modules/gridmap/editor/grid_map_editor_plugin.cpp:635
635             new_state["transform_gizmo"] = p_value;
(gdb) where
#0  GridMapEditor::_show_viewports_transform_gizmo (this=0x555574c12e70, p_value=false)
    at modules/gridmap/editor/grid_map_editor_plugin.cpp:635
#1  0x00005555574c3677 in GridMapEditor::_on_tool_mode_changed (this=0x555574c12e70)
    at modules/gridmap/editor/grid_map_editor_plugin.cpp:1255
#2  0x00005555574cb355 in call_with_variant_args_helper<GridMapEditor>(GridMapEditor*, void (GridMapEditor::*)(), Variant const**,
 Callable::CallError&, IndexSequence<>) (p_instance=0x555574c12e70, 
    p_method=(void (GridMapEditor::*)(GridMapEditor * const)) 0x5555574c362c <GridMapEditor::_on_tool_mode_changed()>, 
    p_args=0x7fffffffc2e0, r_error=...) at ./core/variant/binder_common.h:304
#3  0x00005555574cac2b in call_with_variant_args<GridMapEditor> (p_instance=0x555574c12e70, 
    p_method=(void (GridMapEditor::*)(GridMapEditor * const)) 0x5555574c362c <GridMapEditor::_on_tool_mode_changed()>, 
    p_args=0x7fffffffc2e0, p_argcount=0, r_error=...) at ./core/variant/binder_common.h:418
#4  0x00005555574ca3fa in CallableCustomMethodPointer<GridMapEditor, void>::call (this=0x555574c6a180, 
    p_arguments=0x7fffffffc2e0, p_argcount=0, r_return_value=..., r_call_error=...)
    at ./core/object/callable_method_pointer.h:107
#5  0x000055555aecb156 in Callable::callp (this=0x555574c6a1f0, p_arguments=0x7fffffffc2e0, p_argcount=0, r_return_value=..., 
    r_call_error=...) at core/variant/callable.cpp:57
#6  0x000055555aecf81d in CallableCustomUnbind::call (this=0x555574c6a1e0, p_arguments=0x7fffffffc2e0, p_argcount=1, 
    r_return_value=..., r_call_error=...) at core/variant/callable_bind.cpp:260
#7  0x000055555aecb156 in Callable::callp (this=0x7fffffffc120, p_arguments=0x7fffffffc2e0, p_argcount=1, r_return_value=..., 
    r_call_error=...) at core/variant/callable.cpp:57
#8  0x000055555b29873e in Object::emit_signalp (this=0x555574c66420, p_name=..., p_args=0x7fffffffc2e0, p_argcount=1)
    at core/object/object.cpp:1200
#9  0x0000555558e8f869 in Node::emit_signalp (this=0x555574c66420, p_name=..., p_args=0x7fffffffc2e0, p_argcount=1)
    at scene/main/node.cpp:3986
#10 0x00005555576a47ed in Object::emit_signal<bool> (this=0x555574c66420, p_name=...) at ./core/object/object.h:920
#11 0x0000555558fa0fc3 in BaseButton::_toggled (this=0x555574c66420, p_pressed=true) at scene/gui/base_button.cpp:144
#12 0x0000555558fa1577 in BaseButton::set_pressed (this=0x555574c66420, p_pressed=true) at scene/gui/base_button.cpp:229
--Type <RET> for more, q to quit, c to continue without paging--
#13 0x000055555635de3e in GridMapEditor::GridMapEditor (this=<optimized out>, this=<optimized out>)
    at modules/gridmap/editor/grid_map_editor_plugin.cpp:1354
#14 0x00005555563633a4 in GridMapEditorPlugin::GridMapEditorPlugin (this=<optimized out>, this=<optimized out>)
    at modules/gridmap/editor/grid_map_editor_plugin.cpp:1742
#15 0x00005555574b6e53 in EditorPlugins::creator<GridMapEditorPlugin> () at ./editor/plugins/editor_plugin.h:279
#16 0x0000555557ec751e in EditorPlugins::create (p_idx=62) at ./editor/plugins/editor_plugin.h:286
#17 0x00005555565156af in EditorNode::EditorNode (this=<optimized out>, this=<optimized out>) at editor/editor_node.cpp:7769
#18 0x00005555569de4fd in Main::start () at main/main.cpp:4043
#19 0x00005555568ff674 in main (argc=4, argv=0x7fffffffdea8) at platform/linuxbsd/godot_linuxbsd.cpp:84

@Calinou Calinou changed the title 3d gizmos has disappeared 3D editor transform gizmo is no longer visible by default Nov 16, 2024
@Calinou Calinou added this to the 4.4 milestone Nov 16, 2024
@Nodragem
Copy link
Contributor

Oh right, I did not realise that the GridmapEditor initialisation function would be called at Godot's start-up. I assumed it was called on the creation of a Gridmap node.

The idea is that when a Gridmap Editor node is created, the default mode is the selection mode. In selection mode the gizmo is hidden.

There are two possible fixes:

  • move the code that selects the default mode to another event such as when the Gridmap Editor is shown/clicked in the bottom tabs
  • change the default tool mode to Transform mode (which makes the Gizmo visible)

The first solution is probably the best. I will test it out now.

@Nodragem
Copy link
Contributor

It should work now; sorry for the inconvinience!

@LuxyCeremy
Copy link

I've tested #99354 on my project. It seems like opening some scene, gizmo is always ok, other is not.
The way to make the bad scene gizmo back, is to add a gridmap and then delete it. After that, everytime I open this scene, it will be with gizmo.

@Nodragem
Copy link
Contributor

Note that if your project had already the gizmo hidden (because of the bug), this fix won't restore its visibility.

This fix prevents the gridmap to hide the gizmo in the first place; it does not restore the gizmo visibility.

To restore the gizmo visibility, you can simply go in the viewport menu and check the option 'View Transform Gizmo', as shown in a screenshot above this post.

Let me know if that explains what you've experienced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging a pull request may close this issue.

8 participants