UnityEditor.SubstanceImporter.ExportBitmaps C# (CSharp) Method

ExportBitmaps() public method

Export the bitmaps generated by a ProceduralMaterial as TGA files.

public ExportBitmaps ( ProceduralMaterial material, string exportPath, bool alphaRemap ) : void
material UnityEngine.ProceduralMaterial The ProceduralMaterial whose output textures will be saved.
exportPath string Path to a folder where the output bitmaps will be saved. The folder will be created if it doesn't already exist.
alphaRemap bool Indicates whether alpha channel remapping should be performed.
return void
        public void ExportBitmaps(ProceduralMaterial material, string exportPath, bool alphaRemap)
        {
            if (material == null)
            {
                throw new ArgumentException("Invalid ProceduralMaterial");
            }
            if (exportPath == "")
            {
                throw new ArgumentException("Invalid export path specified");
            }
            if (!Directory.CreateDirectory(exportPath).Exists)
            {
                throw new ArgumentException("Export folder " + exportPath + " doesn't exist and cannot be created.");
            }
            this.ExportBitmapsInternal(material, exportPath, alphaRemap);
        }

Usage Example

 public static void ExportBitmaps(MenuCommand command)
 {
     m_Importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(command.context)) as SubstanceImporter;
     m_Importer.ExportBitmaps(command.context as ProceduralMaterial);
 }