浏览代码

HDRenderPipeline: Update SSS update script, affect all database

/Yibing-Project-2
sebastienlagarde 7 年前
当前提交
a96cb426
共有 1 个文件被更改,包括 18 次插入15 次删除
  1. 33
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs

33
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


{
try
{
var materials = Resources.FindObjectsOfTypeAll<Material>();
var matIds = AssetDatabase.FindAssets("t:Material");
for (int i = 0, length = materials.Length; i < length; i++)
for (int i = 0, length = matIds.Length; i < length; i++)
var path = AssetDatabase.GUIDToAssetPath(matIds[i]);
var mat = AssetDatabase.LoadAssetAtPath<Material>(path);
if (materials[i].shader.name == "HDRenderPipeline/LitTessellation" ||
materials[i].shader.name == "HDRenderPipeline/Lit")
if (mat.shader.name == "HDRenderPipeline/LitTessellation" ||
mat.shader.name == "HDRenderPipeline/Lit")
float fvalue = materials[i].GetFloat("_MaterialID");
float fvalue = mat.GetFloat("_MaterialID");
int ivalue = materials[i].GetInt("_SubsurfaceProfile");
materials[i].SetInt("_SubsurfaceProfile", ivalue + 1);
EditorUtility.SetDirty(materials[i]);
int ivalue = mat.GetInt("_SubsurfaceProfile");
mat.SetInt("_SubsurfaceProfile", ivalue + 1);
EditorUtility.SetDirty(mat);
else if ( materials[i].shader.name == "HDRenderPipeline/LayeredLit" ||
materials[i].shader.name == "HDRenderPipeline/LayeredLitTessellation")
else if ( mat.shader.name == "HDRenderPipeline/LayeredLit" ||
mat.shader.name == "HDRenderPipeline/LayeredLitTessellation")
float fvalue = materials[i].GetFloat("_MaterialID");
float fvalue = mat.GetFloat("_MaterialID");
int numLayer = (int)materials[i].GetFloat("_LayerCount");
int numLayer = (int)mat.GetFloat("_LayerCount");
int ivalue = materials[i].GetInt("_SubsurfaceProfile" + x);
materials[i].SetInt("_SubsurfaceProfile + x", ivalue + 1);
int ivalue = mat.GetInt("_SubsurfaceProfile" + x);
mat.SetInt("_SubsurfaceProfile" + x, ivalue + 1);
EditorUtility.SetDirty(materials[i]);
EditorUtility.SetDirty(mat);
}
}
}

正在加载...
取消
保存