Pref attribute exported with bad name
Describe the bug
We export assets from Maya to USD with the option referenceObjectMode=attributeOnly to get the Pref attribute. It works, but maya-usd sets the attribute name to pref and Arnold expects it to be Pref to use the standard AOV of the same name.
Steps to reproduce Steps to reproduce the behavior:
- Create a cube
- Go to Texturing -> Create Texture Reference Object
- Select the cube and Export Selection to a USD file with the option referenceObjectMode=attributeOnly (available through scripting only)
- Load cube in Houdini Solaris ;)
- Add an Arnold node
- Check the standard AOV named Pref
- Render and look at Pref AOV.
- All is black.
Expected behavior We should see the values of the Pref attribute in the render directly.
Attachments If applicable, add screenshots, sample files, etc to help explain your problem.
Specs (if applicable):
- OS & version : Windows 10
- Maya version: Maya 2024.2
- Maya USD version: 0.30.0
- Pixar USD version: 2024.02
Thank you for reporting. We will look into this.
Can you validate more about your export settings. Are you enabling Arnold in the export context?
Hi @flord I tested on my end and following your steps I do see what you mean. However, because you want to use this option with Arnold you will need to enable the Arnold job context and then you should see an attribute with "Prefs" and also one with "prefs" one for Arnold and one for USD. The following is what I used for exporting and it works:
import maya.cmds as cmds
cmds.mayaUSDExport(
mergeTransformAndShape=True,
file="/home/santosd/Documents/tmp/cubeExport.usda",
shadingMode="useRegistry",
referenceObjectMode="attributeOnly",
jobContext=["Arnold"]
)
Hi @flord, I wanted to check back on this and see if my previous comment helped resolve this issue. Let us know if you have any further questions or if the issue persists.
Oh sorry guys, I hadn't seen your messages.
We do not use the Arnold context because it exports a ton of things we don't want in our pipeline. We are using Maya to export the modeling and animation layers in USD. We want these layers to contain the smallest amount of information possible and have other information come from other layers.
Here is what the hierarchy looks like for the modeling layer of a simple asset before and after enabling the Arnold context:
All these extra prims might be useful when exporting a whole scene, but not for an asset or the animation of an asset instance. They would pollute the hierarchy way too much. On top of that I see that the option exports the mesh normals which we don't want.
I had never noticed that the Pref attribute was named properly, but then you end up with two attributes for the same purpose.
F