浏览代码

HDRenderPipeline: update "reset material keyword" script so it work with Perforce

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
8447a0e4
共有 1 个文件被更改,包括 21 次插入13 次删除
  1. 34
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs

34
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


camera.gameObject.AddComponent<HDAdditionalCameraData>();
}
}
static void CheckOutFile(bool VSCEnabled, Material mat)
{
if (VSCEnabled)
{
UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(mat, UnityEditor.VersionControl.CheckoutMode.Both);
if (!task.success)
{
Debug.Log(task.text + " " + task.resultCode);
}
}
}
// This script is a helper for the artists to re-synchronize all layered materials
[MenuItem("Internal/HDRenderPipeline/Synchronize all Layered materials")]

bool VSCEnabled = (UnityEditor.VersionControl.Provider.enabled && UnityEditor.VersionControl.Provider.isActive);
CheckOutFile(VSCEnabled, mat);
LayeredLitGUI.SynchronizeAllLayers(mat);
EditorUtility.SetDirty(mat);
}

try
{
var materials = Resources.FindObjectsOfTypeAll<Material>();
bool VSCEnabled = (UnityEditor.VersionControl.Provider.enabled && UnityEditor.VersionControl.Provider.isActive);
for (int i = 0, length = materials.Length; i < length; i++)
{

i / (float)(length - 1));
CheckOutFile(VSCEnabled, materials[i]);
HDEditorUtils.ResetMaterialKeywords(materials[i]);
}
}

try
{
var matIds = AssetDatabase.FindAssets("t:Material");
bool VSCEnabled = (UnityEditor.VersionControl.Provider.enabled && UnityEditor.VersionControl.Provider.isActive);
for (int i = 0, length = matIds.Length; i < length; i++)
{

string.Format("{0} / {1} materials cleaned.", i, length),
i / (float)(length - 1));
CheckOutFile(VSCEnabled, mat);
HDEditorUtils.ResetMaterialKeywords(mat);
}
}

}
}
static void CheckOutFile(bool VSCEnabled, Material mat)
{
if (VSCEnabled)
{
UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(mat, UnityEditor.VersionControl.CheckoutMode.Both);
if (!task.success)
{
Debug.Log(task.text + " " + task.resultCode);
}
}
}

正在加载...
取消
保存