Skip to content

Commit 8d139ba

Browse files
alex-vazquez-unity3dEvergreen
authored andcommitted
[Render Pipeline converter]Settings Converter - Fix URP asset generation with their renderers
1 parent c44aa40 commit 8d139ba

File tree

19 files changed

+574
-371
lines changed

19 files changed

+574
-371
lines changed

Packages/com.unity.render-pipelines.core/Editor/Properties/PropertiesPreferencesProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ class Styles
1919

2020
public void PreferenceGUI()
2121
{
22+
EditorGUI.indentLevel++;
2223
AdvancedProperties.enabled = EditorGUILayout.IntPopup(Styles.additionalPropertiesLabel,
2324
AdvancedProperties.enabled ? 1 : 0, Styles.additionalPropertiesNames,
2425
Styles.additionalPropertiesValues) == 1;
26+
EditorGUI.indentLevel--;
2527
}
2628
}
2729
}

Packages/com.unity.render-pipelines.core/Editor/Volume/VolumesPreferences.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ public static VolumeGizmoVisibility volumeGizmosVisibilityOption
8787
/// </summary>
8888
public void PreferenceGUI()
8989
{
90+
EditorGUI.indentLevel++;
9091
EditorGUI.BeginChangeCheck();
9192
var newValue = EditorGUILayout.EnumPopup(Styles.volumeGizmosVisibilityLabel, volumeGizmosVisibilityOption);
9293
if (EditorGUI.EndChangeCheck())
9394
{
9495
volumeGizmosVisibilityOption = (VolumeGizmoVisibility)newValue;
9596
}
97+
EditorGUI.indentLevel--;
9698
}
9799
}
98100
}

Packages/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace UnityEngine.Rendering
99
{
10+
using static UnityEngine.Rendering.HableCurve;
1011
using UnityObject = UnityEngine.Object;
1112

1213
/// <summary>
@@ -1845,6 +1846,7 @@ public static void EnsureFolderTreeInAssetFilePath(string filePath)
18451846
var path = filePath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
18461847
if (!path.StartsWith("Assets" + Path.DirectorySeparatorChar, StringComparison.CurrentCultureIgnoreCase))
18471848
throw new ArgumentException($"Path should start with \"Assets/\". Got {filePath}.", filePath);
1849+
18481850
var folderPath = Path.GetDirectoryName(path);
18491851

18501852
if (!UnityEditor.AssetDatabase.IsValidFolder(folderPath))

Packages/com.unity.render-pipelines.core/Tests/Editor/CoreUtils.Tests.EnsureFolderTreeInAssetFilePath.cs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using NUnit.Framework;
44
using UnityEngine.Rendering;
55

66
namespace UnityEditor.Rendering.Tests
77
{
8+
[Category("Utilities")]
89
partial class CoreUtilsTests
910
{
1011
[Test]
11-
[TestCase("Assets/TestFolder/")]
12-
[TestCase("Assets/TestFolder\\")]
13-
[TestCase("Assets/TestFolder/123/Folder/")]
14-
[TestCase("Assets/TestFolder\\123\\Folder\\")]
15-
[TestCase("Assets/TestFolder/something.mat")]
16-
[TestCase("Assets/TestFolder\\something.mat")]
12+
[TestCase("Assets/", TestName = "Root Assets folder with trailing slash")]
13+
[TestCase("Assets/TestFolder/Folder/", TestName = "Simple folder path with trailing slash")]
14+
[TestCase("Assets/TestFolder\\Folder\\", TestName = "Simple folder path with backslash")]
15+
[TestCase("Assets/TestFolder/123/Folder/", TestName = "Numeric folder name inside path")]
16+
[TestCase("Assets/TestFolder\\123\\Folder\\", TestName = "Numeric folder name with backslashes")]
17+
[TestCase("Assets/TestFolder/something.mat", TestName = "Valid file with extension")]
18+
[TestCase("Assets/TestFolder\\something.mat", TestName = "Valid file with extension and backslashes")]
19+
[TestCase("Assets/TestFolder/Folder-With-Dashes/", TestName = "Folder name containing dashes")]
20+
[TestCase("Assets/TestFolder/Folder With Spaces/", TestName = "Folder name containing spaces")]
21+
[TestCase("Assets/TestFolder/Folder_123/SubFolder/", TestName = "Folder name with underscore and numbers")]
22+
[TestCase("Assets/TestFolder/Folder.Special/", TestName = "Folder name containing a dot")]
23+
[TestCase("Assets/TestFolder/Folder#Test/SubFolder/", TestName = "Folder name containing a hash character")]
24+
[TestCase("Assets/TestFolder/Folder@Test/SubFolder/File.txt", TestName = "File name containing @ character")]
25+
[TestCase("Assets/TestFolder/Folder\\SubFolder/File", TestName = "File without extension")]
26+
1727
public void EnsureFolderTreeInAssetFilePath(string path)
1828
{
1929
string folderPath = Path.GetDirectoryName(path);
2030
CoreUtils.EnsureFolderTreeInAssetFilePath(path);
21-
Assert.True(AssetDatabase.IsValidFolder(folderPath));
31+
Assert.True(AssetDatabase.IsValidFolder(folderPath), $"Folder '{folderPath}' should exist.");
2232
}
2333

2434
[Test]
25-
[TestCase("NotAssetsFolder/TestFolder/", TestName = "EnsureFolderTreeInAssetFilePath throws when filePath does not start with Assets/")]
35+
[TestCase("Assets", TestName = "Just Assets and not Assets/")]
36+
[TestCase("NotAssetsFolder/TestFolder/", TestName = "FilePath does not start with Assets/")]
2637
public void EnsureFolderTreeInAssetFilePathThrows(string folderPath)
2738
{
28-
Assert.False(AssetDatabase.IsValidFolder(folderPath));
2939
Assert.Throws<ArgumentException>(() => CoreUtils.EnsureFolderTreeInAssetFilePath(folderPath));
3040
}
3141

Packages/com.unity.render-pipelines.high-definition/Editor/Core/HDRenderPipelinePreferencesProvider.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ class Styles
4141

4242
public static readonly GUIContent hdrpProjectSettingsPathLabel = EditorGUIUtility.TrTextContent("Resources Folder Name", "Resources Folder will be the one where to get project elements related to HDRP as default scene and default settings.");
4343

44-
public static readonly GUIContent matcapLabel = EditorGUIUtility.TrTextContent("MatCap Mode Default Values");
45-
public static readonly GUIContent matcapViewMixAlbedoLabel = EditorGUIUtility.TrTextContent("Mix Albedo", "Enable to make HDRP mix the albedo of the Material with its material capture.");
46-
public static readonly GUIContent matcapViewScaleLabel = EditorGUIUtility.TrTextContent("Intensity Scale", "Set the intensity of the material capture. This increases the brightness of the Scene. This is useful if the albedo darkens the Scene considerably.");
44+
public static readonly GUIContent matcapViewMixAlbedoLabel = EditorGUIUtility.TrTextContent("MatCap Mode Mix Albedo", "Enable to make HDRP mix the albedo of the Material with its material capture.");
45+
public static readonly GUIContent matcapViewScaleLabel = EditorGUIUtility.TrTextContent("MatCap Mode Intensity Scale", "Set the intensity of the material capture. This increases the brightness of the Scene. This is useful if the albedo darkens the Scene considerably.");
4746
}
4847

4948
static List<string> s_SearchKeywords = new() {
@@ -64,20 +63,19 @@ class Styles
6463
/// </summary>
6564
public void PreferenceGUI()
6665
{
66+
EditorGUI.indentLevel++;
6767
HDProjectSettings.projectSettingsFolderPath = EditorGUILayout.TextField(Styles.hdrpProjectSettingsPathLabel, HDProjectSettings.projectSettingsFolderPath);
6868
DrawConfigPackageDropdown();
6969
DrawMatCapDefaults();
70+
EditorGUI.indentLevel--;
7071
}
7172

7273
void DrawMatCapDefaults()
7374
{
74-
EditorGUILayout.LabelField(Styles.matcapLabel, EditorStyles.boldLabel);
75-
EditorGUI.indentLevel++;
7675
var matCapMode = HDRenderPipelinePreferences.matCapMode;
7776
matCapMode.mixAlbedo.value = EditorGUILayout.Toggle(Styles.matcapViewMixAlbedoLabel, matCapMode.mixAlbedo.value);
7877
if (matCapMode.mixAlbedo.value)
7978
matCapMode.viewScale.value = EditorGUILayout.FloatField(Styles.matcapViewScaleLabel, matCapMode.viewScale.value);
80-
EditorGUI.indentLevel--;
8179
}
8280

8381
private const string k_PackageName = "com.unity.render-pipelines.high-definition-config";

0 commit comments

Comments
 (0)