浏览代码

Add script for update of this PR

/main
Sebastien Lagarde 7 年前
当前提交
a71a2bfd
共有 1 个文件被更改,包括 39 次插入6 次删除
  1. 45
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs

45
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs


}
}
[MenuItem("Internal/HDRenderPipeline/Update/Update SSS profile indices")]
static void UpdateSSSProfileIndices()
[MenuItem("Internal/HDRenderPipeline/Update/Update diffusion profile")]
static void UpdateDiffusionProfile()
{
var matIds = AssetDatabase.FindAssets("t:DiffusionProfileSettings");
for (int i = 0, length = matIds.Length; i < length; i++)
{
var path = AssetDatabase.GUIDToAssetPath(matIds[i]);
var diffusionProfileSettings = AssetDatabase.LoadAssetAtPath<DiffusionProfileSettings>(path);
bool VSCEnabled = (UnityEditor.VersionControl.Provider.enabled && UnityEditor.VersionControl.Provider.isActive);
CheckOutFile(VSCEnabled, diffusionProfileSettings);
var profiles = diffusionProfileSettings.profiles;
for (int j = 0; j < profiles.Length; j++)
{
if ((uint)profiles[j].transmissionMode == 2)
{
profiles[j].transmissionMode = (DiffusionProfile.TransmissionMode)0;
}
}
EditorUtility.SetDirty(diffusionProfileSettings);
}
}
[MenuItem("Internal/HDRenderPipeline/Update/Update material for clear coat")]
static void UpdateMaterialForClearCoat()
{
try
{

EditorUtility.DisplayProgressBar(
"Setup materials Keywords...",
string.Format("{0} / {1} materials SSS updated.", i, length),
string.Format("{0} / {1} materials clearcoat updated.", i, length),
i / (float)(length - 1));
bool VSCEnabled = (UnityEditor.VersionControl.Provider.enabled && UnityEditor.VersionControl.Provider.isActive);

{
if (mat.HasProperty("_SubsurfaceProfile"))
if (mat.HasProperty("_CoatMask"))
// 3 is Old value for clear coat
float materialID = mat.GetInt("_MaterialID");
if (materialID == 3.0)
continue;
//float value = mat.GetInt("_DiffusionProfile");
//mat.SetInt("_DiffusionProfile", 0);
mat.SetInt("_CoatMask", 0);
EditorUtility.SetDirty(mat);
}

{
/*
bool hasSubsurfaceProfile = false;
int numLayer = (int)mat.GetFloat("_LayerCount");

EditorUtility.SetDirty(mat);
}
*/
}
}
}

正在加载...
取消
保存