Apply materials on Maya special duplicate instances #1954
-
I try to convert a maya scene into a USD file. In my scene, I have objects that are instances (duplicate special). On these instances is apply the same material. When I export the scene using the mayaUsd plugin, I see that my instances are converted to Xform with instanceable=true and references to an over prim in the same file (/MayaExportedInstanceSources/myGroup/myMesh). But it seems there is no way to link a material to 'myMesh', I guess that is why material on instances are not managed by default. But How can I do it by keeping all the data inside a single usd file ? Am I obliged to export my instances with their material into another usd file and to reference that other usd file from my main one ? Thank you very much, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It seems to all be in choosing the right locations for the materials. MayaUSD does not do that correctly at the moment. Materials in instance prototypes can not be declared outside the prototype or at the root of the prototype. This means it needs to appear at minimum one level down in the prototype. This complicates things and will require reworking the material export code to do a better job of finding where to put these materials and even duplicate them if they are shared with primitives outside of the prototype. I have attached a very primitive scene (I'm a dev...) that showcases materials on instances. The default is a red coat, but the last two were turned to blue using Collection-based and regular assignment overrides. These overrides do not seem to be able to peek inside instances, as I can not find a way to only make the arms blue. That would probably require asking for support on the USD-interest mailing list. Can you please open an issue so we can track the missing instanced materials? |
Beta Was this translation helpful? Give feedback.
It seems to all be in choosing the right locations for the materials. MayaUSD does not do that correctly at the moment.
Materials in instance prototypes can not be declared outside the prototype or at the root of the prototype. This means it needs to appear at minimum one level down in the prototype.
This complicates things and will require reworking the material export code to do a better job of finding where to put these materials and even duplicate them if they are shared with primitives outside of the prototype.
I have attached a very primitive scene (I'm a dev...) that showcases materials on instances. The default is a red coat, but the last two were turned to blue using Collection-b…