Detect animated toplogy

I want a quick check to determine if a UsdGeom mesh prim has an animated topology.

My hope was that I could look at the samples for points and faceVertexIndices to see if they change size over time. Unfortunately, it looks like I can’t get the dimensions of a sample without loading the data for that sample. This ends up being up too slow for the quick check I wanted.

Technically, I could argue that the topology could be animated even if these attributes do not change size. Perhaps what I really want is a light hash for each sample of faceVertexCounts?

Sounds like I’m going to need to precompute some of this data at export time if it turns out to be necessary. Is there some way I can get the sample sizes faster?

Float-array data should not need to be fully paged in from a crate file to access the size, but for sure integer array data will, because it is compressed.

Whether that is a robust check of topology-variance is an interesting question. In USD-core, array length is the sole determinant of whether two adjacent samples are interpolatable, given an underlying datatype that is. But I imagine it might cause problems for renderers doing motion-blur if two samples of a mesh had the same-sized arrays but different, or differently-wound faces. IIRC, Alembic had a first-class notion of topological variance that could be expressed as a property, which would be helpful here and could be validated, but that also imposes a burden, and we initially decided against it for UsdGeom.

My initial test must have had an error because I’m testing it now and it’s well faster than I need. But good to learn about the difference between int/float attributes.