Пример #1
0
    public static FbxConnectionCache Build(FbxData data)
    {
        var res = new FbxConnectionCache();

        var node = data.Node.GetChild("Connections");

        foreach (var conn in node.Childs)
        {
            var sourceId = new FbxObjectId {
                Id = (long)conn.Properties[1]
            };
            var distId = new FbxObjectId {
                Id = (long)conn.Properties[2]
            };
            if (!res.ConnectBySourceMap.ContainsKey(sourceId))
            {
                res.ConnectBySourceMap.Add(sourceId, new List <FbxObjectId>());
            }
            if (!res.ConnectByDistMap.ContainsKey(distId))
            {
                res.ConnectByDistMap.Add(distId, new List <FbxObjectId>());
            }

            res.ConnectBySourceMap[sourceId].Add(distId);
            res.ConnectByDistMap  [distId].Add(sourceId);
        }

        return(res);
    }
Пример #2
0
 public FbxDocument(FbxData data)
 {
     ObjectCache     = new FbxObjectCache();
     ConnectionCache = FbxConnectionCache.Build(data);
     Object          = new FbxObject(this, data);
 }