Git Product home page Git Product logo

Comments (10)

facontidavide avatar facontidavide commented on August 16, 2024 1

fixed

from groot.

unvestigate avatar unvestigate commented on August 16, 2024

I had a look in MainWindow::saveToXML() and found this:

auto abs_root = abs_tree.rootNode();
if( abs_root->children_index.size() == 1 &&
    abs_root->model.registration_ID == "Root"  )
{
    // mofe to the child of ROOT
    abs_root = abs_tree.node( abs_root->children_index.front() );
}

After that it proceeds to serialize abs_root. So this tells me that if we have a node with registration ID "Root" and exactly one child, we skip the node (thus leaving it out of the data) and move to its first node. This poses a problem when the root node has multiple children, as the "Root" node which apparently is supposed to be left out gets included in the data.

Why was the saving code set up like this? Why not just start serializing the root node and all of its children recursively? This effectively prevents Groot from ever having trees where the root node has more than one child.

from groot.

renan028 avatar renan028 commented on August 16, 2024

Hi @unvestigate ,
I am working with Groot also.
I didn't understand the issue. BT's root must have one and only one child. You are not supposed to create a BT like the second image.
Do you think Groot should not allow the connection?

from groot.

unvestigate avatar unvestigate commented on August 16, 2024

I will admit I haven't had much practical experience working with BTs (that's why I am here now) so excuse my ignorance. Why would a tree where the root has multiple children not be possible?

I am not talking about the exact tree in my example, but some other two nodes as children of root.

Finally, if such a tree truly is not allowed, we should probably not allow creating such a tree in Groot.

from groot.

renan028 avatar renan028 commented on August 16, 2024

Why would a tree where the root has multiple children not be possible?

Because then the root would not be the root, but a Control Node instead. You will have to create a logic on how it "ticks" its children, and that logic is for Control Nodes. You can have a look here Theory

Finally, if such a tree truly is not allowed, we should probably not allow creating such a tree in Groot.

Yes. I think that is an issue.

from groot.

unvestigate avatar unvestigate commented on August 16, 2024

I looked around the net a bit for examples of BTs and it seems they all have a sequence or selector node as the sole child of the root. This makes sense when you consider how the tree will be traversed. Is this what you were referring to @renan028 ?

So maybe we should just prevent Groot from trying to save such a tree? There is already the validation with the green/red icon...

from groot.

unvestigate avatar unvestigate commented on August 16, 2024

Ah, I see you just answered :) Thanks!

from groot.

facontidavide avatar facontidavide commented on August 16, 2024

it is indeed a bug. Something like this is not supposed to happen (the graphical editor must not allow you to attach multiple children to Root!

I will need to address this.

from groot.

facontidavide avatar facontidavide commented on August 16, 2024

FYI, in the XML there is no "Root".

That is something that is needed only in Groot for technical reasons.

from groot.

unvestigate avatar unvestigate commented on August 16, 2024

FYI, in the XML there is no "Root".

Except when there is :)

from groot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.