Easily copy shading nodes from Maya to Katana
-
Supported nodes: aiStandardSurface, aiStandardHair, aiNormalMap, aiColorCorrect, aiBump2d, aiImage, aiMultiply, aiDivide, aiPow, aiLayerShader, aiSpaceTransform, aiClamp, file, ramp, bump2d, multiplyDivide, blendColors, clamp
Arnold 5 (bate)
-
Quit Maya
-
Clone maya2katana repository (or download zip, extract and rename directory from "maya2katana-master" to "maya2katana") and place it to:
Windows: \Users\<username>\Documents\maya\scripts
Linux: ~/maya/scripts
- Open Script Editor and paste the following code to Python tab:
import maya2katana
reload (maya2katana)
maya2katana.copy()
- To create a shelf button select the code and middle-mouse-drag it to your shelf
-
Select a shading network or a single shadingEngine (Shading Group) node
-
Press the button you've created earlier or execute a script (see installation step)
To get the XML from shading network name:
import maya2katana
reload (maya2katana)
node_name = 'materialSG'
# Get the xml as string
resulting_xml = maya2katana.generate_xml(node_name)
You can save the resulting XML to file and bring it into Katana:
# Now create the Katana shading network
# Suppose the XML (string) is already loaded
# to 'resulting_xml' string variable
from Katana import NodegraphAPI, KatanaFile
# Create a group for shading network
group_name = 'materialSG'
group_node = NodegraphAPI.CreateNode(group_name, NodegraphAPI.GetRootNode())
# Bring the nodes to Katana scene
# and place them inside the newly created group
nodes = KatanaFile.Paste(resulting_xml, group_node)
Description currently: (当前说明)
- The texture path will be converted to a ".tx" path (纹理路径将转换为".tx"路径)
- Maya File to aiImage (Maya文件转为aiImage) Supported attributes (支持的属性): Image Name, Color Space, Color Gain, Color Offset
- aiImage add Color Space support
- Maya Ramp to Arnold Ramp_RGB (Maya渐变转为阿诺德渐变)
- Maya BlendColors to Arnold Mix_RGBA (Maya颜色混合转为阿诺德混合颜色)