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

    {
        String nodeName;
        String meshName;
        Vector3 pos;
        Vector3 rot;
        Vector3 scale;
        bool castShadows = false;
        float drawDistance = 0;
        Array<String> materialNames;

                pos = GetVector3FromStrings(coords, 0);
                rot = GetVector3FromStrings(coords, 3);
                scale = GetVector3FromStrings(coords, 6);
            }
            
            compElem = compElem.GetNext("component");
        }

        // For now we are only interested of meshes
        if (!meshName.empty)
        {
            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");

            // Calculate final transform in an Ogre-like fashion
            Quaternion quat = Quaternion(rot);
            Quaternion meshQuat = Quaternion(meshRot);            
            Quaternion finalQuat = quat * meshQuat;
            Vector3 finalScale = scale * meshScale;
            Vector3 finalPos = pos + quat * (scale * meshPos);

            newNode.SetTransform(finalPos, finalQuat, finalScale);
            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"));
        }

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

    UpdateSceneWindow();
    UpdateWindowTitle();    
}

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