Hi,
if i understand correct you want to integrate your self coded navigation system in the editor.
Have a look at the tool feature here:
a simple trick to trigger an action in the editor when in tool mode is
export(bool) var update = false setget _set_update #<-will be called when changed in inspector
func _set_update(value):
#just dont set the value, make your update
do_the_update()
or if you need more features read about making plugins here
you want to integrate your self coded navigation system in the editor
yes
Robotex | 2020-09-01 09:25
I can’t clearly imagine what functionality should this plugin provide to create needed navigation graph nodes and edges for the given scene.
I imagine it like I should click on button at editor, then click somewhere in scene and set maximum amount of iterations and then recursive algorithm will make this graph. Is my vision correct?
Robotex | 2020-09-01 09:28
To precompute you graph you have to run code in the editor.
For that you have to write a tool script to do so.
Collect all needed informations for your precomputing via export variables.
The starting point for your flood-fill-algorythm could be the tool nodes position in the scene.
tool
extends Position3D
class_name myNavGraph #will appear under this name in create node
export(float) var resolution = 1.0 #example of needed informations
export(bool) var update = false setget _set_update #<-will be called when changed in inspector
func _set_update(value):
#just dont set the value, make your update
var start_at = transform_global.origin
analyse_scene_make_graph( start_at )
klaas | 2020-09-01 09:35
remember … you have to store your data somehow.
You can infact make your own resource object. But that is another subject.