diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 16ddcb9620e..c408b9f6a8d 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -617,6 +617,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed taaFrameIndex and XR tests 4052 and 4053 - Fixed the prefab integration of custom passes (Prefab Override Highlight not working as expected). - Cloned volume profile from read only assets are created in the root of the project. (case 1154961) +- Fixed Wizard check on default volume profile to also check it is not the default one in package. ### Changed - Improve MIP selection for decals on Transparents diff --git a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Configuration.cs b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Configuration.cs index 9c3d3962740..81526d8115c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Configuration.cs +++ b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Configuration.cs @@ -460,7 +460,9 @@ bool IsDefaultVolumeProfileAssigned() return false; var hdAsset = HDRenderPipeline.currentAsset; - return hdAsset.defaultVolumeProfile != null && !hdAsset.defaultVolumeProfile.Equals(null); + return hdAsset.defaultVolumeProfile != null + && !hdAsset.defaultVolumeProfile.Equals(null) + && hdAsset.defaultVolumeProfile != hdAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; } void FixDefaultVolumeProfileAssigned(bool fromAsyncUnused) { @@ -471,7 +473,19 @@ void FixDefaultVolumeProfileAssigned(bool fromAsyncUnused) if (hdrpAsset == null) return; - EditorDefaultSettings.GetOrAssignDefaultVolumeProfile(hdrpAsset); + VolumeProfile defaultSettingsVolumeProfileInPackage = hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; + string defaultSettingsVolumeProfilePath = "Assets/" + HDProjectSettings.projectSettingsFolderPath + '/' + defaultSettingsVolumeProfileInPackage.name + ".asset"; + + //try load one if one already exist + VolumeProfile defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); + if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null)) + { + //else create it + AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(defaultSettingsVolumeProfileInPackage), defaultSettingsVolumeProfilePath); + defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); + } + hdrpAsset.defaultVolumeProfile = defaultSettingsVolumeProfile; + EditorUtility.SetDirty(hdrpAsset); } diff --git a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs index 614da9582a7..e1f451f0171 100644 --- a/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs +++ b/com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Window.cs @@ -108,7 +108,7 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT error: "Default scene prefab must be set to create HD templated scene!"); public static readonly ConfigStyle hdrpVolumeProfile = new ConfigStyle( label: "Default volume profile", - error: "Default volume profile must be assigned in the HDRP asset!"); + error: "Default volume profile must be assigned in the HDRP asset! Also, for it to be editable, it should be outside of package."); public static readonly ConfigStyle vrLegacyVRSystem = new ConfigStyle( label: "Legacy VR System",