private FBXNode CreateNode(string id)
        {
            if (nodes.ContainsKey(id))
            {
                return(nodes[id]);
            }

            FBXNode node = new FBXNode(id);

            node.Target = objects.GetObjectById(id);
            nodes.Add(id, node);

            foreach (var entry in GetConnectEntries(id))
            {
                FBXNode child;
                if (!nodes.TryGetValue(entry.ObjectID, out child))
                {
                    child = CreateNode(entry.ObjectID);
                }

                var binding = new FBXBinding {
                    ConType = entry.ConType, Value = child, Property = entry.Property
                };

                child.ConnectedTo.Add(new FBXBinding {
                    ConType = binding.ConType, Value = node, Property = binding.Property
                });
                node.Connections.Add(binding);
            }

            return(node);
        }
 public bool IsDirectChildOf(FBXNode node)
 {
     for (int i = 0; i < connectedTo.Count; i++)
     {
         if (connectedTo[i].Value == node)
         {
             return(true);
         }
     }
     return(false);
 }
        public FBXNode FindFirstConnectedTo(Func <FBXNode, bool> matchPredicated)
        {
            if (matchPredicated(this))
            {
                return(this);
            }

            for (int i = 0; i < connectedTo.Count; i++)
            {
                FBXNode node = connectedTo[i].Value.FindFirstConnectedTo(matchPredicated);
                if (node != null)
                {
                    return(node);
                }
            }

            return(null);
        }
 private void LoadConnectionHeirarchys()
 {
     sceneGraph = CreateNode("Model::Scene");
 }