Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hd/fix wizard defaultvolumeprofile creation #565

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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<VolumeProfile>(defaultSettingsVolumeProfilePath);
if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null))
{
//else create it
AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(defaultSettingsVolumeProfileInPackage), defaultSettingsVolumeProfilePath);
defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath<VolumeProfile>(defaultSettingsVolumeProfilePath);
}
hdrpAsset.defaultVolumeProfile = defaultSettingsVolumeProfile;

EditorUtility.SetDirty(hdrpAsset);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down