     {
         ListView@ terrainBrushes = window.GetChild("BrushesContainer", true);
 
-        String brushesFileLocation = fileSystem.programDir + "Data/Textures/Editor/TerrainBrushes";
+        Array<String>@ resourceDirs = cache.resourceDirs;
+        String brushesFileLocation;
+        for (uint i = 0; i < resourceDirs.length; ++i)
+        {
+            brushesFileLocation = resourceDirs[i] + "Textures/Editor/TerrainBrushes";
+            if (fileSystem.DirExists(brushesFileLocation))
+                break;
+        }
+
         Array<String> files = fileSystem.ScanDir(brushesFileLocation, "*.*", SCAN_FILES, false);
 
         for (uint i = 0; i < files.length; ++i)

            // Make sure its not null (it may have been deleted since last save)
            if (terrainsEdited[i] !is null)
            {
                String fileLocation = fileSystem.programDir + "Data/" + terrainsEdited[i].GetAttribute("Height Map").GetResourceRef().name;

                Array<String> chunks = fileLocation.Split('/');
                Array<String> parts = chunks[chunks.length - 1].Split('.');


        UpdateTerrainSetConstantHeight(image, 0);

        if (!fileSystem.DirExists(GetPath(fileLocation)))
            fileSystem.CreateDir(GetPath(fileLocation));
        image.SavePNG(fileLocation);

        Terrain@ terrain = node.CreateComponent("Terrain");
