Importing and exporting a material / shader does not respect "Include Namespaces" turned off
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Describe the bug**
When a USD file is imported in a namespace, and then exported again with "Include Namespaces" turned off, the namespace is still included in the name of the exported shader.
**Steps to reproduce**
Steps to reproduce the behavior:
1. Create the input file or open the `cube_namespace.usda` in the attached zip file:
1. Open a new scene
2. Create a simple `polyCube`
3. "Export all..." with "USD Export" with default settings:

4. Rename the `Material` prim to `MyShadingGroup` (so we can easily track it)
2. Create a new empty scene
3. Import the usda file with default settings in a new namespace:

4. Note that the shader is in the expected namespace:

6. Export the scene again with "Include Namespaces" turned off:

7. Inspect the created USDA file and note that the namespace is included:
```usd
def Scope "mtl"
{
def Material "test_MyShadingGroup"
{
token outputs:surface.connect =
def Shader "test_MyShadingGroup_standardSurface"
{
uniform token info:id = "UsdPreviewSurface"
float inputs:clearcoat = 0
float inputs:clearcoatRoughness = 0.1
color3f inputs:diffuseColor = (0.4, 0.4, 0.4)
color3f inputs:emissiveColor = (0, 0, 0)
float inputs:ior = 1.5
float inputs:metallic = 0
normal3f inputs:normal = (1, 1, 1)
float inputs:roughness = 0.4
color3f inputs:specularColor = (1, 1, 1)
token outputs:displacement
token outputs:surface
}
}
}
```
Note the incorrect name with the prepended `test_`.
**Expected behavior**
The name should not be prepended with the namespace of a material/shader when it is exported with "Include Namespaces" turned off.
**Attachments**
* [cube_namespace.zip](https://github.com/Autodesk/maya-usd/files/11478834/cube_namespace.zip): The input and output USD files.
**Specs (if applicable):**
* OS & version Windows 10
* Maya version Maya 2022
* Maya USD commit v0.23.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.