Exemple #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);
    }
Exemple #2
0
    public FbxObject(FbxDocument fbxDocument, FbxData data)
    {
        var objNode = data.Node.GetChild("Objects");

        foreach (var child in objNode.Childs)
        {
            switch (child.Name)
            {
            case "Geometry":
                Geometry.Add(new FbxGeometry(fbxDocument, child));
                break;

            case "Material":
                Materials.Add(new FbxObjectMaterial(fbxDocument, child));
                break;

            case "Texture":
                Textures.Add(new FbxObjectTexture(fbxDocument, child));
                break;
            }
        }
    }
Exemple #3
0
 public FbxDocument(FbxData data)
 {
     ObjectCache     = new FbxObjectCache();
     ConnectionCache = FbxConnectionCache.Build(data);
     Object          = new FbxObject(this, data);
 }