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

Undo/Redo not working in 3D editor #58251

Closed
mbrlabs opened this issue Feb 17, 2022 · 10 comments
Closed

Undo/Redo not working in 3D editor #58251

mbrlabs opened this issue Feb 17, 2022 · 10 comments

Comments

@mbrlabs
Copy link
Contributor

mbrlabs commented Feb 17, 2022

Godot version

3,x (747d11b)

System information

Windows 11

Issue description

Undo/Redo is not working in the 3D editor when performing transform operations. Seems to only happen directly after starting Godot. When you do an undo/redo operation in the script editor and then try it again in 3D it works.

Does not happen in 3.5 beta1. Not tested on master.

Steps to reproduce

  1. Open Godot
  2. Move some nodes in 3D, then try to undo the move -> not working
  3. Open a script, make an edit and then undo it
  4. Switch to the 3D viewport, move something and undo it-> works

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Feb 17, 2022

This is likely because the script editor intercepts undo/redo shortcuts. This sounds related to #53424, which can be reproduced on 3.4 and 3.5beta1.

@Calinou Calinou added this to the 3.5 milestone Feb 17, 2022
@mbrlabs
Copy link
Contributor Author

mbrlabs commented Feb 17, 2022

I just noticed it's not only the undo/redo shortcuts but also ESC...well probably all shortcuts that are used by the script editor. Or maybe just keyboard inputs in general.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 18, 2022

For whatever reason this is a regression from #57900
I'll see if the same happens on master.

EDIT:
Nope, not happening on master.

@timothyqiu
Copy link
Member

timothyqiu commented Feb 18, 2022

I want to inspect this but I can't reproduce this on my machine :( Undoing 3D transform works both before and after editing any script. Nevermind, I can reproduce it now although I don't know what I did to trigger it ;)

@mbrlabs
Copy link
Contributor Author

mbrlabs commented Feb 18, 2022

@timothyqiu make sure to setup a 3D as main scene before, so you don't have to click anywhere when you launch Godot. Then reopen Godot and you should be able to directly reproduce it in the main scene.

@timothyqiu
Copy link
Member

So far:

  • There is indeed a copy paste mistake in [3.x] Backport CanvasLayer visibility #57900. This second argument should not be there. But removing it does not fix this issue.

    c->_propagate_visibility_changed(p_visible, !p_visible);

  • You don't have to undo in Script editor, simply switch to it and back makes undo working.

  • Seems like the Script editor's edit menu thinks itself visible in tree initially. I'll take a further look.

@timothyqiu
Copy link
Member

OK, I probably know how things happen now, but I wonder why it does not happen on master.

master suffers from the same issue, so does alpha2, but not alpha1:

  1. hide parent
  2. hide child
  3. show child
    • now the child is visible_in_tree, but it shouldn't

CC @KoBeWi

Test Script
# Run with /path/to/godot -s /path/to/this
extends SceneTree

func _init():
	print("---------- start ----------")

	var a := Control.new()
	root.add_child(a)
	var b := Control.new()
	a.add_child(b)

	a.hide()
	b.hide()
	b.show()

	stat("a", a)
	stat("b", b)

	print("---------- done ----------")
	quit()


func stat(name, n):
	prints("%s visible_in_tree: %s visible: %s" % [name, n.is_visible_in_tree(), n.visible])

I wonder if this line is correct:

void CanvasItem::_propagate_visibility_changed(bool p_visible, bool p_was_visible) {
if (p_visible && first_draw) { //avoid propagating it twice
first_draw = false;
}
visible_in_tree = p_visible;

visible_in_tree, or parent_visible_in_tree on 3.x is set to be the same as visible (?)

@KoBeWi
Copy link
Member

KoBeWi commented Feb 19, 2022

Ok, something is definitely bugged here:
godot windows tools 64_S5HJzP7pA8

@akien-mga
Copy link
Member

IIUC this should be fixed by #58386, can someone confirm?

@KoBeWi
Copy link
Member

KoBeWi commented Feb 21, 2022

Yes, this was fixed.

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

No branches or pull requests

5 participants