From 6ee00cfa8393993e6d22b906332ab9ec4da63501 Mon Sep 17 00:00:00 2001 From: Paul Du Bois Date: Mon, 21 Oct 2019 17:25:01 -0700 Subject: [PATCH] b/139670642: Don't filter out empty nodes named "empty_" We use these for non-exportable things. Change-Id: Id000b01514d953a991eee0ba70f12e0c7127b1f1 --- UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs index 6e99bde0..fb02e6dc 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs @@ -430,7 +430,13 @@ static IEnumerable CreateGameObjectsFromNode( ImportState state, Transform parent, GltfNodeBase node, GltfImportResult result, GltfMaterialConverter matConverter, Vector3 translationToApply) { if (node.Mesh == null && !node.Children.Any()) { - yield break; + if (node.name != null && node.name.StartsWith("empty_")) { + // explicitly-empty nodes are used to mark things like non-exportable models + /* fall through */ + } else { + // Other empty nodes can creep in, like the SceneLight_ nodes. Don't want those. + yield break; + } } GameObject obj = new GameObject(node.name);