Skip to content

Commit 5782561

Browse files
Revert: Add import dialog to add a new diffusion profile to the global settings #4743 (#5288)
1 parent 0023bea commit 5782561

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6969
- Added two toggles to control occluder rejection and receiver rejection for the ray traced ambient occlusion (case 1330168).
7070
- Added the receiver motion rejection toggle to RTGI (case 1330168).
7171
- Added info box when low resolution transparency is selected, but its not enabled in the HDRP settings. This will help new users find the correct knob in the HDRP Asset.
72-
- Added a dialog box when you import a Material that has a diffusion profile to add the diffusion profile to global settings.
7372
- Added support for Unlit shadow mattes in Path Tracing (case 1335487).
7473
- Added a shortcut to HDRP Wizard documentation.
7574
- Added support of motion vector buffer in custom postprocess

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

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -363,67 +363,6 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
363363
continue;
364364

365365

366-
void AddDiffusionProfileToSettings(string propName)
367-
{
368-
if (Application.isBatchMode || HDRenderPipelineGlobalSettings.instance == null
369-
|| HDRenderPipelineGlobalSettings.instance.diffusionProfileSettingsList == null) return;
370-
371-
bool diffusionProfileCanBeAdded = HDRenderPipelineGlobalSettings.instance.diffusionProfileSettingsList.Length < 15;
372-
DiffusionProfileSettings diffusionProfile = null;
373-
374-
if (material.HasProperty(propName))
375-
{
376-
var diffusionProfileAsset = material.GetVector(propName);
377-
string guid = HDUtils.ConvertVector4ToGUID(diffusionProfileAsset);
378-
diffusionProfile = AssetDatabase.LoadAssetAtPath<DiffusionProfileSettings>(AssetDatabase.GUIDToAssetPath(guid));
379-
380-
if (diffusionProfile != null && !HDRenderPipelineGlobalSettings.instance.diffusionProfileSettingsList.Any(d => d == diffusionProfile))
381-
{
382-
string materialName = material.name;
383-
string diffusionProfileName = diffusionProfile.name;
384-
385-
if (!diffusionProfileCanBeAdded)
386-
Debug.LogWarning("There is no space in the global settings to add the diffusion profile " + diffusionProfileName);
387-
else if ((!Application.isBatchMode) &&
388-
(EditorUtility.DisplayDialog("Diffusion Profile Import",
389-
"A Material (" + materialName + ") is being imported with a diffusion profile (" + diffusionProfileName + ") not already added to the HDRP Global Settings.\n If the Diffusion Profile is not referenced in the global settings, HDRP cannot use it.\nDo you want to add the diffusion profile to the HDRP Global Settings asset?", "Yes", "No")))
390-
{
391-
diffusionProfileCanBeAdded = HDRenderPipelineGlobalSettings.instance.AddDiffusionProfile(diffusionProfile);
392-
}
393-
}
394-
}
395-
}
396-
397-
AddDiffusionProfileToSettings("_DiffusionProfileAsset");
398-
399-
// Special Eye case that uses a node with diffusion profiles.
400-
if (material.shader.IsShaderGraphAsset())
401-
{
402-
var matProperties = MaterialEditor.GetMaterialProperties(new UnityEngine.Object[] { material });
403-
for (int propIdx = 0; propIdx < matProperties.Length; ++propIdx)
404-
{
405-
var attributes = material.shader.GetPropertyAttributes(propIdx);
406-
bool hasDiffusionProfileAttribute = false;
407-
foreach (var attribute in attributes)
408-
{
409-
if (attribute == "DiffusionProfile")
410-
{
411-
propIdx++;
412-
hasDiffusionProfileAttribute = true;
413-
break;
414-
}
415-
}
416-
417-
var propName = ShaderUtil.GetPropertyName(material.shader, propIdx);
418-
var type = ShaderUtil.GetPropertyType(material.shader, propIdx);
419-
if (hasDiffusionProfileAttribute &&
420-
type == ShaderUtil.ShaderPropertyType.Vector)
421-
{
422-
AddDiffusionProfileToSettings(propName);
423-
}
424-
}
425-
}
426-
427366
(HDShaderUtils.ShaderID id, GUID subTargetGUID) = HDShaderUtils.GetShaderIDsFromShader(material.shader);
428367
var latestVersion = k_Migrations.Length;
429368

0 commit comments

Comments
 (0)