Skip to content

Commit

Permalink
wip showing extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Dec 29, 2023
1 parent 5777810 commit db6bd69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Expand Up @@ -9,7 +9,6 @@ namespace GLTF.Schema
/// </summary>
public class MSFT_LODExtension : IExtension
{

public List<int> NodeIds { get; set; }
public MSFT_LODExtension(List<int> nodeIds)
{
Expand Down
11 changes: 11 additions & 0 deletions Runtime/Plugins/GLTFSerialization/Schema/GLTFProperty.cs
Expand Up @@ -9,6 +9,17 @@ namespace GLTF.Schema
{
public class GLTFProperty
{
public static IReadOnlyList<string> RegisteredExtensions
{
get
{
lock (_extensionRegistry)
{
return _extensionRegistry.Keys.ToList();
}
}
}

private static Dictionary<string, ExtensionFactory> _extensionRegistry = new Dictionary<string, ExtensionFactory>()
{
{ ExtTextureTransformExtensionFactory.EXTENSION_NAME, new ExtTextureTransformExtensionFactory() },
Expand Down
10 changes: 10 additions & 0 deletions Runtime/Scripts/GLTFSettings.cs
Expand Up @@ -7,6 +7,7 @@
using UnityEngine;
using System.IO;
using System.Linq;
using GLTF.Schema;
using UnityEngine.UIElements;
using UnityGLTF.Cache;
using UnityGLTF.Plugins;
Expand Down Expand Up @@ -120,6 +121,15 @@ internal static void OnPluginsGUI()
}
EditorGUILayout.EndFoldoutHeaderGroup();
}

EditorGUILayout.LabelField("Supported Extensions (Import)", EditorStyles.boldLabel);
// All plugins in the extension factory are supported for import.
// TODO Some of them have extra package requirements (e.g. meshopt/draco), could be shown here
// TODO help buttons and docs/tooltip would be great
foreach (var ext in GLTFProperty.RegisteredExtensions)
{
EditorGUILayout.ToggleLeft(ext, true);
}
}

}
Expand Down

0 comments on commit db6bd69

Please sign in to comment.