Skip to content

UsdPrimvarReader incompatible node types #2905

@ld-kerley

Description

@ld-kerley

The USDPreviewSpecification lists a number of different supported UsdPrimvarReader types, the MaterialX implementations do not match this list one-to-one. There are some challenges here with the differing availability of types between the two systems.

Currently we have

USD MaterialX Status
UsdPrimvarReader_float ND_UsdPrimvarReader_float
UsdPrimvarReader_float2 ND_UsdPrimvarReader_vector2 ⚠️
UsdPrimvarReader_float3 ND_UsdPrimvarReader_vector3 ⚠️
UsdPrimvarReader_float4 ND_UsdPrimvarReader_vector4 ⚠️
UsdPrimvarReader_int ND_UsdPrimvarReader_integer ⚠️
UsdPrimvarReader_string ND_UsdPrimvarReader_string
UsdPrimvarReader_normal ND_UsdPrimvarReader_vector3 ⚠️
UsdPrimvarReader_point ND_UsdPrimvarReader_vector3 ⚠️
UsdPrimvarReader_vector ND_UsdPrimvarReader_vector3 ⚠️
UsdPrimvarReader_matrix Does not exist
Does not exist ND_UsdPrimvarReader_boolean
Does not exist ND_UsdPrimvarReader_filename

We clearly need to add a matrix primvar reader to the MaterialX implementation.

I think we should consider removing the boolean and filename nodes, unless we can investigate adding them to USD. We want to be able to allow people to 1:1 round trip their data back and forth without loss.

For the other ⚠️ cases above, one possible solution is to align these names perfectly, creating aliases for the normal/point/vector USD cases.

We could end up with

USD MaterialX Status
UsdPrimvarReader_float ND_UsdPrimvarReader_float
UsdPrimvarReader_float2 ND_UsdPrimvarReader_vector2 -> ND_UsdPrimvarReader_float2
UsdPrimvarReader_float3 ND_UsdPrimvarReader_vector3 -> ND_UsdPrimvarReader_float3
UsdPrimvarReader_float4 ND_UsdPrimvarReader_vector4 -> ND_UsdPrimvarReader_float4
UsdPrimvarReader_int ND_UsdPrimvarReader_int
UsdPrimvarReader_string ND_UsdPrimvarReader_string
UsdPrimvarReader_normal ND_UsdPrimvarReader_normal (aliased to ND_UsdPrimvarReader_float3)
UsdPrimvarReader_point ND_UsdPrimvarReader_point (aliased to ND_UsdPrimvarReader_float3)
UsdPrimvarReader_vector ND_UsdPrimvarReader_vector (aliased to ND_UsdPrimvarReader_float3)
UsdPrimvarReader_matrix ND_UsdPrimvarReader_matrix

Where we're renaming the MaterialX ND_UsdPrimvarReader_vectorX to ND_UsdPrimvarReader_floatX, and ND_UsdPrimvarReader_normal, ND_UsdPrimvarReader_point and ND_UsdPrimvarReader_vector all alias to ND_UsdPrimvarReader_float3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions