Groot2 tree nodes model best practices #707
-
I've noticed that when you have a project with multiple subtrees in separate files that re-use the same node, the TreeNodesModel used by Groot2 is created in each of the subtree's xml files, as well as in your btproj file. To me this seems suboptimal for a few reasons:
To me, it would make sense if the TreeNodesModels were stored only in the btproj file - it seems reasonable to me that they would be separated out from the tree definitions, since they aren't actually required by the process that runs the behaviortree and therefore don't need to be loaded there, but maybe there's something I'm missing relating to attaching to a running tree in monitor mode. Any recommended practices here? Is the duplicated TreeNodesModels expected, or is that an artifact of us incorrectly setting things up somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If we do that, Groot2 will stop being able to open a single file, and it will be only able to open an entire project.
it is expected and desired (by me) for the reason above (each file should be self-contained).
This seems a weird statement. A model should reflect a C++ implementation. If it changes, in multiple places, it is because it MUST change.
Don't do it by hand :) This problem of consistency happens only if you mix using Groot2 and editing by hand. As you pointed out, BT.CPP itself doesn't require at all the My recommendation is to use Groot2 for editing and trust what it does. Said that, I will be happy to add a feature in Groot2 to remove the TreeNodesModel from individual files, but I am sure that you will come back to me complaining that now you can't open those files anymore, because they don't have a model 😛 |
Beta Was this translation helpful? Give feedback.
If we do that, Groot2 will stop being able to open a single file, and it will be only able to open an entire project.
This seems to be a very annoying limitation.
it is expected and desir…