AcademySoftwareFoundation / AcademySoftwareFoundation/MaterialX
Angle units handling
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 451
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Description
There are a few issues I'd like to clarify in this posting.
First, if you open the mtlx in the attached zip, you are greeted by an error:
[unit_test.zip](https://github.com/user-attachments/files/16631315/unit_test.zip)

While the error mentions meters, the line causing the issue is line #6 where the angle input is specified.
My understanding is that it's trying to convert the angle to meters.
Adding a unit attribute (like in the commented line #8) gets rid of the error and everything seem to work.
My concern is that, if I were to do something similar to the input above it (line #5, where I use "distance") and add a unit attribute there, when I check the material in Viewer and change the scene units in the Advanced Settings, the size does not adjust automatically any more.
I am not sure the unit attribute should be in the nodedef, and other libraries seem to only use the unittype there. But since I had to add it to the angle input, I'm afraid that might prevent the automatic scaling of the angle as it does for distances.
One other thing missing is that the Viewer allows us to change the distance units, but not the Angle one. If the above issue gets resolved we would need that to test it.
Contributor guide
Research direction
Start with the attached unit_test.zip and inspect the mtlx lines 5-8, especially the angle input, unit attribute, and unittype usage. Reproduce the error in Viewer, then compare angle handling with distance handling and the Advanced Settings scene-unit changes. Done means angle inputs no longer produce the meter conversion error, distance scaling remains automatic, and Viewer supports changing angle units.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100