Skip to content

Commit 736858c

Browse files
Add support for batchmode (#542)
1 parent 3c0f629 commit 736858c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void RegisterUpgraderReimport()
6767
{
6868
string commandLineOptions = System.Environment.CommandLine;
6969
bool inTestSuite = commandLineOptions.Contains("-testResults");
70-
if (!inTestSuite && fileExist)
70+
if (!inTestSuite && fileExist && !Application.isBatchMode)
7171
{
7272
EditorUtility.DisplayDialog("HDRP Material upgrade", "The Materials in your Project were created using an older version of the High Definition Render Pipeline (HDRP)." +
7373
" Unity must upgrade them to be compatible with your current version of HDRP. \n" +

com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,15 @@ static void GetAllValidHDRPAssets()
394394
}
395395

396396
// Prompt a warning if we find 0 HDRP Assets.
397-
if (_hdrpAssets.Count == 0)
397+
if (_hdrpAssets.Count == 0 && !Application.isBatchMode)
398+
{
398399
if (EditorUtility.DisplayDialog("HDRP Asset missing", "No HDRP Asset has been set in the Graphic Settings, and no potential used in the build HDRP Asset has been found. If you want to continue compiling, this might lead to VERY long compilation time.", "Ok", "Cancel"))
399-
throw new UnityEditor.Build.BuildFailedException("Build canceled");
400+
throw new UnityEditor.Build.BuildFailedException("Build canceled");
401+
}
402+
else
403+
{
404+
Debug.LogWarning("There is no HDRP Asset provided in GraphicsSettings. Build time can be extremely long without it.");
405+
}
400406

401407
/*
402408
Debug.Log(string.Format("{0} HDRP assets in build:{1}",

0 commit comments

Comments
 (0)