Node.Accept

Node.Accept method

Walks through all descendant nodes(including the current node) and call the visitor with the node. Visitor can break the walk-through by returning false

public bool Accept(NodeVisitor visitor)
ParameterTypeDescription
visitorNodeVisitorVisitor callback to visit the node

Return Value

true means visitor has broke the walk through.

Examples

The following code shows how to get all meshes from a scene

Scene scene = Scene.FromFile("input.fbx");
List<Mesh> meshes = new List<Mesh>();
scene.RootNode.Accept((node) =>
{
    if(node.Entity is Mesh)
        meshes.Add((Mesh)node.Entity);
    //continue searching
    return true;
});

See Also