     
     Array<String> convertedMaterials;
     Array<String> convertedMeshes;
-    
+
     // Clear old scene, then create a zone and a directional light first
     CreateScene();
 

                pos = GetVector3FromStrings(coords, 0);
                rot = GetVector3FromStrings(coords, 3);
                scale = GetVector3FromStrings(coords, 6);
                
                // Fix coordinate system
                //pos = Vector3(pos.x, pos.z, pos.y);
                //rot = Vector3(rot.x, -rot.z + 180, rot.y);
            }
            
            compElem = compElem.GetNext("component");
        }

        // For now we are only interested of meshes
        if (meshName.empty)
            continue;
        
        for (uint i = 0; i < materialNames.length; ++i)
        {
            bool found = false;
            for (uint j = 0; j < convertedMaterials.length; ++j)
            {
                if (convertedMaterials[j] == materialNames[i])
                {
                    found = true;
                    break;
                }                    
            }

            if (!found)
            {
                ConvertMaterial(materialNames[i], filePath);
                convertedMaterials.Push(materialNames[i]);
            }
        }

        bool found = false;
        for (uint i = 0; i < convertedMeshes.length; ++i)
        {
            if (convertedMeshes[i] == meshName)
            {
                found = true;
                break;
            }
        }
        if (!found)
            ConvertModel(meshName, filePath);

        Node@ newNode = editorScene.CreateChild(nodeName, useLocalIDs ? LOCAL : REPLICATED);
        StaticModel@ model = newNode.CreateComponent("StaticModel");
        
        newNode.SetTransform(pos, Quaternion(rot), scale);
        model.model = cache.GetResource("Model", "Models/" + meshName.Replaced(".mesh", ".mdl"));
        model.drawDistance = drawDistance;
        model.castShadows = castShadows;
        for (uint i = 0; i < materialNames.length; ++i)
            model.materials[i] = cache.GetResource("Material", "Materials/" + materialNames[i].Replaced(".material", ".xml"));

        UpdateSceneWindow();

        entityElem = entityElem.GetNext("entity");
    }
}

String GetComponentAttribute(XMLElement compElem, const String&in name)

        while (!compElem.isNull)
        {
            String compType = compElem.GetAttribute("type");

            if (compType == "EC_Mesh")
            {
                Array<String> coords = GetComponentAttribute(compElem, "Transform").Split(',');
                meshPos = GetVector3FromStrings(coords, 0);
                meshRot = GetVector3FromStrings(coords, 3);
                meshScale = GetVector3FromStrings(coords, 6);
                meshName = GetComponentAttribute(compElem, "Mesh ref");
                castShadows = GetComponentAttribute(compElem, "Cast shadows").ToBool();
                drawDistance = GetComponentAttribute(compElem, "Draw distance").ToFloat();
