diff --git a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfMaterialConverter.cs b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfMaterialConverter.cs index 028ca3ef..06b69a53 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfMaterialConverter.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/GltfMaterialConverter.cs @@ -25,8 +25,11 @@ namespace TiltBrushToolkit { public class GltfMaterialConverter { private static readonly Regex kTiltBrushMaterialRegex = new Regex( @".*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"); + // Matches + // http://.../shadername.glsl + // /.../-.glsl private static readonly Regex kTiltBrushShaderRegex = new Regex( - @".*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/"); + @".*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})[/-]"); /// /// Information about a Unity material generated from a Gltf node. diff --git a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs index b6c65155..b7abaa31 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs @@ -1009,8 +1009,7 @@ static Semantic GetTexcoordSemantic(ImportState state, GltfMaterialBase material // Thus it needs to be data-driven. if (desc == null) { // Might happen in gltf2 - Gltf2Material material2 = (Gltf2Material)material; - if (material2 == null) { + if (!(material is Gltf2Material material2)) { Debug.LogWarning("Unexpected: Non-BrushDescriptor geometry in gltf1"); return Semantic.Unspecified; } else {