-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Add bake state info and MultiNodeEdit support for NavigationRegion3D #104210
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
Conversation
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 with simple setups from my Navgiation Area tests. Worked like a charm.
If possible, show a dialog with a message such as "You're attempting to bake multiple NavigationRegion3D nodes. This can freeze the Editor temporarily." Continue | Cancel.
But only if Godot has such a function such as showing a checkbutton between the message and the dialog buttons stating "Don't show this warning again."
The best case would be a queue on a separate thread to prevent potential Editor freezing… Could this be easily achievable with WorkerThreadPool?
Added a new bake dialog. It now processed the regions in a queue with the threaded baking. The warning and exklusive popup Window hopefully enough to keep users from messing up the editor in the meantime. Sorry but we cant allow users editing the scene while the baking runs. Doing edits in the middle of the node parsing is an easy way to cause crashes or data corruption. Switching scenes alone is trouble as the editor does too much problematic stuff in the background with the nodes on a scene switch. We also cant do all the parsing at the begin because that is also an easy way to run into memory crashes later. |
5e53b51
to
92ef751
Compare
Now that we have a new Window dialog added back in the bake state for the steps of the navmesh baking process. |
133463c
to
499c5dc
Compare
ecc0cfa
to
2f3a73d
Compare
2f3a73d
to
f655932
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.
Doing edits in the middle of the node parsing is an easy way to cause crashes or data corruption
Yeah… w/o reliable locking of said resources (+ the visual feedback), this is not advisable. And that would be cumbersome effort
bug: cannot bake (multiple) regions/navmeshes after cancelling once
reproduction steps
- select multiple regions with different navmeshes
- click "Bake NavigationMesh"
- instead of baking, cancel the dialog
- click "Bake NavigationMesh" again
- Nothing happens. De-selecting and re-selecting does not fix the issue
f655932
to
8ebbeab
Compare
2b83af5
to
dcde4bd
Compare
a3ac6d7
to
77b791e
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.
I tested with two planes of the size 1000x1000 with 100 subdivisions, in order to slow down the generation.
bugs
- Clicking "cancel" in the dialog only closes the dialog, it does not cancel the current baking The navmeshes still show up
- the bug I mentioned previously is still there: #104210 (review)
Just something I noticed…
As far as I can tell, NavMeshGeneratorTask3D::TaskStatus::BAKING_FAILED
is never used. Anywhere in the engine.
e.g. NavMeshGenerator3D::generator_bake_from_source_geometry_data
could return that value, which could be used in the calling func NavMeshGenerator3D::generator_thread_bake
to update generator_task->status
That the baking does no longer work after cancelling once at the very begin should be fixed now.
The cancel can only cancel queued navmeshes after the currently baked navmesh. There is currently to way to cancel a navmesh bake that has already started. There is no API for it on either node, server or thirdparty lib. That would be a lot of work not in scope of this PR. |
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.
That the baking does no longer work after cancelling once at the very begin should be fixed now.
Fix is confirmed.
The cancel can only cancel queued navmeshes after the currently baked navmesh
You're right, I mixed that up with my tests on non-unique nav regions. Sorry for the confusion.
refinement suggestions:
- adding to the dialog the note: "Cancelling takes effect after the currently baking region is finished." (or sth. along the lines)
- change button text from "Cancel" to "Close" when there's only 1 unique navmesh, as actually cancelling is impossible in that context
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.
YOLO approved.
Adds MultiNodeEdit support for NavigationRegion3D.
Thanks! |
Adds bake state info and
MultiNodeEdit
support forNavigationRegion3D
.Resolves #104116
Allows to select multiple nodes inside the editor and (re)bake or clear all selected navigation region nodes with one button click.
Adds a new bake dialog that shows how many unique navmeshes need to be baked and how many navigation regions are selected. Revives the old bake state info text that was disabled due to old editor process being broken with threads.
Can't add for
NavigationRegion2D
because the 2d version depends on theAbstractPolygon2DEditorPlugin
. That editor has no support for multi node edit. It is also shared with many other 2d polygon editors so can't be easily modified.