Autodesk / Autodesk/arnold-usd
Shaders linked via primvars removed on AiSceneWrite
- Dominant language
- Python
- Stars
- 284
- Forks
- 68
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 14
Description
**Describe the bug**
When a .usd file is loaded and resaved either via kick or AiSceneWrite directly if a shader is only linked via a custom primvar the the shader is removed from the `ArnoldUnassignedShaders` prim
**To Reproduce**
Steps to reproduce the behavior:
1. download the example [test_custom_shader.usda.zip](https://github.com/user-attachments/files/24525397/test_custom_shader.usda.zip)
2. run the kick comand: `kick -i test_custom_shader.usda -resave test_custom_shader_resaved.usda`
3. the resulting usda file removed the `ArnoldUnassignedShaders` nodegraph
**Expected behavior**
All shaders in and `ArnoldUnassignedShaders` Prim should remain on resaving the USD file via AiSceneWrite
**Used Software Versions**
- Arnold: 7.4.4
**Additional context**
If I remove the line
```
string inputs:name = "myRefShader"
```
The nodegaph remains when re-saving
Contributor guide
Research direction
Start by reproducing the issue with `kick -i test_custom_shader.usda -resave test_custom_shader_resaved.usda`, then trace the `AiSceneWrite` resave path for shaders linked through the `myRefShader` custom primvar. Done means the resaved USDA retains the `ArnoldUnassignedShaders` nodegraph and its shaders.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100