static void CreateColoredCubesVolumeDataAssetFromVoxelDatabase()
        {
            string pathToVoxelDatabase = EditorUtility.OpenFilePanel("Choose a Voxel Database (.vdb) file to load", Paths.voxelDatabases, "vdb");

            if (pathToVoxelDatabase.Length != 0)
            {
                string relativePathToVoxelDatabase = Paths.MakeRelativePath(Paths.voxelDatabases + Path.DirectorySeparatorChar, pathToVoxelDatabase);

                // Pass through to the other version of the method.
                VolumeDataAsset.CreateFromVoxelDatabase <ColoredCubesVolumeData>(relativePathToVoxelDatabase);
            }
        }
        static void CreateColoredCubesVolumeDataAssetFromVoxelDatabase()
        {
            // Resulting path already contains UNIX-style seperators (even on Wondows).
            string pathToVoxelDatabase = EditorUtility.OpenFilePanel("Choose a Voxel Database (.vdb) file to load", Paths.voxelDatabases, "vdb");

            if (pathToVoxelDatabase.Length != 0)
            {
                string relativePathToVoxelDatabase = PathUtils.MakeRelativePath(Paths.voxelDatabases + '/', pathToVoxelDatabase);

                // Pass through to the other version of the method.
                VolumeDataAsset.CreateFromVoxelDatabase <ColoredCubesVolumeData>(relativePathToVoxelDatabase);
            }
        }
Esempio n. 3
0
        static void CreateColoredCubesVolumeDataAssetFromVoxelDatabase()
        {
            // Resulting path already contains UNIX-style seperators (even on Wondows).
            string pathToVoxelDatabase = EditorUtility.OpenFilePanel("Choose a Voxel Database (.vdb) file to load", Paths.voxelDatabases, "vdb");

            if (pathToVoxelDatabase.Length != 0)
            {
                // Check the user didn't navigate outside of the required folder.
                string folderContainingSelectedVDB = Path.GetDirectoryName(pathToVoxelDatabase);
                if (PathUtils.IsSameFolderOrSubfolder(folderContainingSelectedVDB, Paths.voxelDatabases) == false)
                {
                    Debug.LogError("The chosen .vdb file must be inside the '" + Paths.voxelDatabases + "' folder");
                    return;
                }

                string relativePathToVoxelDatabase = PathUtils.MakeRelativePath(Paths.voxelDatabases + '/', pathToVoxelDatabase);

                // Pass through to the other version of the method.
                VolumeDataAsset.CreateFromVoxelDatabase <ColoredCubesVolumeData>(relativePathToVoxelDatabase);
            }
        }