OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

UsdAbc: translate the property's arrayExtent metadata into elementSize

Open cameronwhite opened this issue 2 months ago • 1 comments

Description of Change(s)

For the example file in the referenced bug report, the Alembic property has the metadata arrayExtent: 3, podExtent: 1, podName: float32_t. This was translated into a float[] array with too many elements since the arrayExtent was ignored. This metadata seems to have an equivalent meaning to USD's elementSize, describing a grouping of consecutive elements in the array.

Houdini's Alembic exporter, for example, uses this in the generic case for translating float tuple attributes (which might have an arbitrary tuple size) if they're not a standard type like positions or colors.

(Note that if the property instead had metadata arrayExtent:1, podExtent:3, this behaved correctly as-is and would translate into a float3[] array)

Link to proposal (if applicable)

N/A

Fixes Issue(s)

Fixes: #3362

Checklist

cameronwhite avatar Dec 16 '25 16:12 cameronwhite

Filed as internal issue #USD-11727

(This is an automated message. See here for more information.)

jesschimein avatar Dec 16 '25 17:12 jesschimein

@cameronwhite , while I can't be sure, it seems like arrayExtent is more general than just primvars in alembic? Last year we introduced arraySizeConstraint metadata for general array types in USD, and would like to promote it as preferred over elementSize (since it is also more expressive).

Could we ask that when reading in Alembic, you also add arraySizeConstraint to the attribute spec, and when writing from USD to alembic, check for that first and translate it to arrayExtent if present?

spiffmon avatar Jan 27 '26 07:01 spiffmon