-
-
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
Debug CanvasItem redraw #79169
Debug CanvasItem redraw #79169
Conversation
I suggest exposing this in the Debug menu at the top of the editor, so that projects can use this more easily 🙂 |
@Calinou oh, that's a very good point. |
Would be awesome for editor plugins and tool scripts |
057ffd9
to
0043be5
Compare
@Calinou done |
0043be5
to
e824034
Compare
Honestly, I would name it differently. "Debug CanvasItem redraw" makes it sound like it is going to highlight each time the CanvasItem is drawn to the screen. When in fact, it is showing when the CanvasItem is recalculating it's properties on the CPU-side. Regardless of whether the CanvasItem recalculates it's properties, it is drawn to the screen. |
@clayjohn No idea, should I call it Debug GUI/2D Node Redraw ? I have no idea what might be better. |
Perhaps. That is slightly better. I guess the real problem is that this type of update is called "redraw" internally. But "redraw" really just means "re-record" commands. Drawing happens every single frame regardless of whether the CanvasItem is "redrawn" |
To me it's fairly established in Godot lingo that "redraw" indeed means "run the |
e824034
to
e4f3241
Compare
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, it works as expected.
This does not work well with update spinner, it's constantly redrawing: godot.windows.editor.dev.x86_64_givobFwGkS.mp4Using
That's because unsaved status is being updated. Maybe it could be skipped if the tab is already marked. EDIT: EDIT2: |
I wanted to add this tool for years and always forget. This command line option: ``` $ godot.exe -e --debug-canvas-item-redraw ``` Allows to see when a canvas item is redrawn. This helps find out if something in the UI is refreshing in a way it should not. Examples as such: * Signals causing more of the UI to redraw. * Container resizing causes more UI elements to redraw. * Something using a timer is redrawing all time time, which can go unnoticed. To my surprise, the editor UI is redrawing very efficiently. There is some weird stuff with the scene tabs, redrawing when the inspector changes but most things for the most part are fine.
e4f3241
to
407b16a
Compare
Rebased to solve merge conflict, and added the warning suggested by @clayjohn. |
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.
Looks good to me. Testing locally it appears to work well.
Thanks! |
I wanted to add this tool for years and always forget. This command line option:
Allows to see when a canvas item is redrawn. This helps find out if something in the UI is refreshing in a way it should not. Examples as such:
To my surprise, the editor UI is redrawing very efficiently. There is some weird stuff with the scene tabs, redrawing when the inspector changes but most things for the most part are fine.
How it looks:
This can be enabled also from the Editor UI to debug canvas item redraws in the running game: