Autodesk / Autodesk/3dsmax-usd

[EMSUSD-3929] primvars:normals authored as float3[] instead of normal3f[]

Open Beginner friendly
#40 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
94
Forks
6
Avg merge
6d 20h
Merged PRs (30d)
1

Description

**Describe the bug**
When Exporting via USD Exporter the normals are authored in a `float3` type.

**Steps to reproduce**
Steps to reproduce the behavior:
1. Create an object
2. Export Selected to a .usd file type
3. Be sure geometry normals are authored to primvars
4. Evaluate .usd in usd view

Image

**Expected behavior**
Please refer to this documentation,
https://openusd.org/dev/api/_usd__page__datatypes.html#Usd_Roles

and this:
https://openusd.org/dev/api/class_usd_geom_point_based.html#ac9a057e1f221d9a20b99887f35f84480

This is spelled out in the USD schema itself: UsdGeomPointBased declares the attribute as `normal3f[] normals`, and the same type is expected for `primvars:normals`. Pixar's Sdf datatypes doc lists normal3f with role "Normal" / meaning "transform as a normal," while float3 has no role at all.

Repro: export any mesh with normals and inspect the .usda. You'll see `float3[] primvars:normals` where it should read `normal3f[]`.

Image

**Fix**: author the attribute with SdfValueTypeNames->Normal3fArray instead of Float3Array. The values don't need to change, just the declared type.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the USD Exporter code that authors primvars:normals; first reproduce the issue by exporting a mesh and inspecting the resulting .usda file. Confirm completion when the exported attribute is declared normal3f[] rather than float3[] while its values remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.