diff --git a/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicImporterEditor.cs b/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicImporterEditor.cs index bc50e185f..362505a1f 100644 --- a/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicImporterEditor.cs +++ b/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicImporterEditor.cs @@ -22,6 +22,8 @@ public override void OnInspectorGUI() AddBoolProperty(serSettings.FindPropertyRelative(() => settings.m_swapHandedness), "Swap handedness", ""); AddBoolProperty(serSettings.FindPropertyRelative(() => settings.m_swapFaceWinding), "Swap face winding", ""); AddBoolProperty(serSettings.FindPropertyRelative(() => settings.m_submeshPerUVTile), "Submesh per UV tile", ""); + AddBoolProperty(serSettings.FindPropertyRelative(() => settings.m_shareVertices), "Merge Vertices (experimental)", "Allow vertex sharing between faces when possible."); + AddBoolProperty(serSettings.FindPropertyRelative(() => settings.m_treatVertexExtraDataAsStatics), "Vertex extra data is static (exp.)", "When set, UV's/normals/tangents are fetched from file only on topology change event."); AddEnumProperty(serSettings.FindPropertyRelative(() => settings.m_normalsMode), "Normals mode", "", settings.m_normalsMode.GetType()); AddEnumProperty(serSettings.FindPropertyRelative(() => settings.m_tangentsMode), "Tangent mode", "", settings.m_tangentsMode.GetType()); diff --git a/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicManualImporterEditor.cs b/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicManualImporterEditor.cs index 3bd5dcc57..bb82a1024 100644 --- a/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicManualImporterEditor.cs +++ b/AlembicImporter/Assets/UTJ/Alembic/Editor/Importer/AlembicManualImporterEditor.cs @@ -86,9 +86,19 @@ public void OnGUI() }); AlembicUI.AddHorzLine(() => { - m_ImportSettings.m_submeshPerUVTile = EditorGUILayout.Toggle("Submesh per UV tile", - m_ImportSettings.m_submeshPerUVTile); + m_ImportSettings.m_submeshPerUVTile = EditorGUILayout.Toggle("Submesh per UV tile", m_ImportSettings.m_submeshPerUVTile); }); + + AlembicUI.AddHorzLine(() => + { + m_ImportSettings.m_shareVertices = EditorGUILayout.Toggle("Merge Vertices (experimental)", m_ImportSettings.m_shareVertices); + }); + + AlembicUI.AddHorzLine(() => + { + m_ImportSettings.m_treatVertexExtraDataAsStatics = EditorGUILayout.Toggle("Vertex extra data is static (experimental)", m_ImportSettings.m_treatVertexExtraDataAsStatics); + }); + AlembicUI.AddHorzLine(() => { string[] enumNamesList = System.Enum.GetNames(typeof(AbcAPI.aiNormalsMode)); diff --git a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AbcAPI.cs b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AbcAPI.cs index 73c221123..63d47d414 100644 --- a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AbcAPI.cs +++ b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AbcAPI.cs @@ -136,6 +136,8 @@ public struct aiConfig public Bool useThreads; public int cacheSamples; public Bool submeshPerUVTile; + public Bool shareVertices; + public Bool treatVertexExtraDataAsStatics; public void SetDefaults() { @@ -149,6 +151,8 @@ public void SetDefaults() useThreads = true; cacheSamples = 0; submeshPerUVTile = false; + shareVertices = true; + treatVertexExtraDataAsStatics = true; } } diff --git a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicSettings.cs b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicSettings.cs index d2ef950ab..1d4174e64 100644 --- a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicSettings.cs +++ b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicSettings.cs @@ -28,6 +28,8 @@ public class AlembicImportSettings [SerializeField] public bool m_swapHandedness = true; [SerializeField] public bool m_swapFaceWinding = false; [SerializeField] public bool m_submeshPerUVTile = false; + [SerializeField] public bool m_shareVertices = true; + [SerializeField] public bool m_treatVertexExtraDataAsStatics = true; [SerializeField] public bool m_importMeshes = true; [SerializeField] public AbcAPI.aiNormalsMode m_normalsMode = AbcAPI.aiNormalsMode.ComputeIfMissing; [SerializeField] public AbcAPI.aiTangentsMode m_tangentsMode = AbcAPI.aiTangentsMode.None; diff --git a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicStream.cs b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicStream.cs index d4761603f..8ad65883f 100644 --- a/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicStream.cs +++ b/AlembicImporter/Assets/UTJ/Alembic/Scripts/Importer/AlembicStream.cs @@ -41,6 +41,7 @@ private bool AbcIsValid() private void AbcSyncConfig() { m_config.swapHandedness = ImportSettings.m_swapHandedness; + m_config.shareVertices = ImportSettings.m_shareVertices; m_config.swapFaceWinding = ImportSettings.m_swapFaceWinding; m_config.normalsMode = ImportSettings.m_normalsMode; m_config.tangentsMode = ImportSettings.m_tangentsMode; @@ -50,6 +51,7 @@ private void AbcSyncConfig() m_config.useThreads = ImportSettings.m_useThreads; m_config.cacheSamples = ImportSettings.m_sampleCacheSize; m_config.submeshPerUVTile = ImportSettings.m_submeshPerUVTile; + m_config.treatVertexExtraDataAsStatics = ImportSettings.m_treatVertexExtraDataAsStatics; if (AbcIsValid()) {