Skip to content

Commit

Permalink
gltf: Switch to new way of handling timestamps
Browse files Browse the repository at this point in the history
This is the other half of go/tbcl/109972, which changes the
attribute name used for timestamps; it's now _TB_TIMESTAMP.

Change-Id: Id000b0153fe68f29268856827234856c69d93f16
  • Loading branch information
dubois committed Oct 1, 2019
1 parent cfcfd60 commit 8b5ec11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion UnitySDK/Assets/TiltBrush/Scripts/BrushDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public enum Semantic {
XyIsUvZIsDistance,
UnitlessVector,
XyIsUv,
Timestamp,
}

public Material Material { get { return m_Material; } }
Expand Down
7 changes: 4 additions & 3 deletions UnitySDK/Assets/TiltBrush/Scripts/Gltf/ImportGltf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,10 @@ private static void StoreDataInMesh(
// The data is not fully hooked-up in the gltf, and it doesn't make its way to THREE.
// So: ignore it.
break;
case "_TB_TIMESTAMP":
// Tilt Brush .glb files don't ever have txc2, so this is a safe place to stuff timestamps
mesh.uvSets[2] = data;
break;
default:
Debug.LogWarningFormat("Unhandled attribute {0}", semantic);
break;
Expand Down Expand Up @@ -1025,9 +1029,6 @@ static Semantic GetTexcoordSemantic(ImportState state, GltfMaterialBase material
return desc.m_uv0Semantic;
} else if (uvChannel == 1) {
return desc.m_uv1Semantic;
} else if (uvChannel == 2) {
// All brushes use texcoord2 as (optional) timestamp data
return Semantic.Timestamp;
} else {
Debug.LogWarningFormat("Unexpected TB texcoord: {0}", uvChannel);
return Semantic.Unspecified;
Expand Down

0 comments on commit 8b5ec11

Please sign in to comment.