Good afternoon
I am developing a custom node translator in Maya and have some questions about exporting maya shader trees from a C++ mtoa translator.
Let me give you some context before the question. The node i am developing does not have to be a shape, because i am drawing in maya viewport using a SubSceneOverride as i do not want the user to have access to the geometry itself, so this custom node is neither connected with its shaders via a Shading Engine (SG)
Looking at the code in Arnold translator examples or Xgen examples, the only way of exporting shader nodes automatically is via that connections to the Shading Engine (SG). I am looking for a way of exporting shader graphs manually, through the SG or main Shader node.
The temporal solution i found out is to generate a custom shape implementing the most simple case, with no component access, only a node which can be connected to a SG, and export the material that way.
What i am looking for is the way of exporting several shading trees manually and assign them to a shape in a per polygon basis. Is that possible??
Thank you so much in advance
You can just use the arnoldExportAss command (that's what the Arnold > Shader > Export menu does)
cmds.arnoldExportAss(filename = ret[0], selected=True, exportAllShadingGroups=True, mask = ai.AI_NODE_SHADER)
Hi Stephen, thank you for the answer. Unfortunately its not exactly what i'm looking for. I am developing my translator in C++ because i need to pass C++ data from from Maya to the Translator in order to create my custom shapes.
I have edited my first message to be more specific 😉
So, my mtoa plugin has been instantiated and called to export an specific custom maya shape. I am inside the C++ code called from mtoa. I am not sure how to use that command. I understand that i could export them to a file, but how could i use them then in my current context? I would need to retrieve them and apply them to the shape i am exporting.