Skip to content

Commit

Permalink
add tooltip, hide compression options when no textures are present
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Sep 11, 2023
1 parent c72f3ac commit 849aaa1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Editor/Scripts/GLTFImporter.cs
Expand Up @@ -84,7 +84,8 @@ private static void EnsureShadersAreLoaded()
[SerializeField] internal bool _importMaterials = true;
[Tooltip("Enable this to get the same main asset identifiers as glTFast uses. This is recommended for new asset imports. Note that changing this for already imported assets will break their scene references and require manually re-adding the affected assets.")]
[SerializeField] internal bool _useSceneNameIdentifier = false;
[SerializeField] internal GLTFImporterTextureCompressionQuality _textureCompression = GLTFImporterTextureCompressionQuality.Best;
[Tooltip("Compress textures after import using the platform default settings. If you need more control, use a .gltf file instead.")]
[SerializeField] internal GLTFImporterTextureCompressionQuality _textureCompression = GLTFImporterTextureCompressionQuality.None;

// for humanoid importer
[SerializeField] internal bool m_OptimizeGameObjects = false;
Expand Down
9 changes: 7 additions & 2 deletions Editor/Scripts/GLTFImporterInspector.cs
Expand Up @@ -98,8 +98,13 @@ private void ModelInspectorGUI()
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(GLTFImporter._generateLightmapUVs)), new GUIContent("Generate Lightmap UVs"));
EditorGUILayout.Separator();

EditorGUILayout.LabelField("Compression", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(GLTFImporter._textureCompression)));
// Show texture compression UI if there are any imported textures
var importedTextures = serializedObject.FindProperty("m_Textures");
if (importedTextures.arraySize > 0)
{
EditorGUILayout.LabelField("Compression", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(GLTFImporter._textureCompression)));
}
TextureWarningsGUI(t);
}

Expand Down

0 comments on commit 849aaa1

Please sign in to comment.