Skip to content

Commit

Permalink
mark pbrSpecGloss as legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Dec 30, 2023
1 parent 7453152 commit b44ff5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Runtime/Scripts/GLTFSettings.cs
Expand Up @@ -66,7 +66,7 @@ internal static void DrawGLTFSettingsGUI()
EditorGUILayout.LabelField("Importing glTF", EditorStyles.largeLabel);
EditorGUILayout.LabelField(new GUIContent(
"Import Extensions and Plugins",
"These plugins are enabled by default when importing a glTF file in the editor or at runtime. Each imported asset can override these settings."
"These plugins are enabled by default when importing a glTF file in the editor or at runtime. Make sure to reimport affected assets after changing these options."
), EditorStyles.boldLabel);
OnPluginsGUI(settings.ImportPlugins);

Expand Down Expand Up @@ -124,7 +124,7 @@ internal static void DrawGLTFSettingsGUI()
}

private static Dictionary<Type, Editor> editorCache = new Dictionary<Type, Editor>();
internal static void OnPluginsGUI(IEnumerable<GltfPlugin> plugins)
internal static void OnPluginsGUI(IEnumerable<GltfPlugin> plugins, bool allowDisabling = true)
{
EditorGUI.indentLevel++;
foreach (var plugin in plugins.OrderBy(x => x ? x.DisplayName : "ZZZ"))
Expand All @@ -137,17 +137,20 @@ internal static void OnPluginsGUI(IEnumerable<GltfPlugin> plugins)
var expanded = SessionState.GetBool(key, false);
using (new GUILayout.HorizontalScope())
{
if (plugin.AlwaysEnabled)
if (plugin.AlwaysEnabled || !allowDisabling)
{
plugin.Enabled = true;
EditorGUI.BeginDisabledGroup(true);
GUILayout.Toggle(true, new GUIContent("", "Always enabled, can't be turned off."), GUILayout.Width(12));
EditorGUI.EndDisabledGroup();
// EditorGUI.BeginDisabledGroup(true);
// GUILayout.Toggle(true, new GUIContent("", "Always enabled."), GUILayout.Width(12));
// EditorGUI.EndDisabledGroup();
if (allowDisabling)
GUILayout.Label(GUIContent.none, GUILayout.Width(12));
}
else
{
plugin.Enabled = GUILayout.Toggle(plugin.Enabled, "", GUILayout.Width(12));
}

var label = new GUIContent(displayName, plugin.Description);
EditorGUI.BeginDisabledGroup(!plugin.Enabled);
var expanded2 = EditorGUILayout.Foldout(expanded, label);
Expand Down
3 changes: 3 additions & 0 deletions Runtime/Scripts/Plugins/MaterialExtensionsImport.cs
@@ -1,3 +1,5 @@
using UnityEngine;

namespace UnityGLTF.Plugins
{
public class MaterialExtensionsImport: GltfImportPlugin
Expand All @@ -8,6 +10,7 @@ public class MaterialExtensionsImport: GltfImportPlugin
public bool KHR_materials_iridescence = true;
public bool KHR_materials_specular = true;
public bool KHR_materials_clearcoat = true;
[HideInInspector] // legacy
public bool KHR_materials_pbrSpecularGlossiness = true;
public bool KHR_materials_emissive_strength = true;

Expand Down

0 comments on commit b44ff5b

Please sign in to comment.