Easily copy shading nodes from Maya to Katana
-
Supported nodes: aiAmbientOcclusion, aiImage, aiNoise, aiStandard, aiUserDataColor, aiUserDataFloat, aiVolumeCollector, alCellNoise, alCombineColor, alCombineFloat, alCurvature, alFlake, alFlowNoise, alFractal, alHair, alInputScalar, alInputVector, alJitterColor, alLayer, alLayerColor, alLayerFloat, alRemapColor, alRemapFloat, alSurface, alSwitchColor, alSwitchFloat, alTriplanar, blendColors, bump2d, clamp, luminance, ramp, samplerInfo
-
Supported nodes: aaOceanPrmanShader, PxrAdjustNormal, PxrAovLight, PxrAttribute, PxrBackgroundDisplayFilter, PxrBackgroundSampleFilter, PxrBakePointCloud, PxrBakeTexture, PxrBarnLightFilter, PxrBlack, PxrBlackBody, PxrBlend, PxrBlockerLightFilter, PxrBump, PxrBumpManifold2D, PxrCamera, PxrChecker, PxrClamp, PxrColorCorrect, PxrCombinerLightFilter, PxrConstant, PxrCookieLightFilter, PxrCopyAOVDisplayFilter, PxrCopyAOVSampleFilter, PxrCross, PxrCryptomatte, PxrCurvature, PxrDebugShadingContext, PxrDefault, PxrDiffuse, PxrDirectLighting, PxrDirt, PxrDiskLight, PxrDisney, PxrDisplace, PxrDispScalarLayer, PxrDispTransform, PxrDispVectorLayer, PxrDisplayFilterCombiner, PxrDistantLight, PxrDomeLight, PxrDot, PxrEdgeDetect, PxrEnvDayLight, PxrExposure, PxrFacingRatio, PxrFilmicTonemapperDisplayFilter, PxrFilmicTonemapperSampleFilter, PxrFlakes, PxrFractal, PxrFractalize, PxrGamma, PxrGeometricAOVs, PxrGlass, PxrGoboLightFilter, PxrGradeDisplayFilter, PxrGradeSampleFilter, PxrHSL, PxrHair, PxrHairColor, PxrHalfBufferErrorFilter, PxrImageDisplayFilter, PxrImagePlaneFilter, PxrIntMultLightFilter, PxrInvert, PxrLMDiffuse, PxrLMGlass, PxrLMLayer, PxrLMMetal, PxrLMMixer, PxrLMPlastic, PxrLMSubsurface, PxrLayer, PxrLayerMixer, PxrLayerSurface, PxrLayeredBlend, PxrLayeredTexture, PxrLightEmission, PxrLightProbe, PxrLightSaturation, PxrManifold2D, PxrManifold3D, PxrManifold3DN, PxrMarschnerHair, PxrMatteID, PxrMeshLight, PxrMix, PxrMultiTexture, PxrNormalMap, PxrOcclusion, PxrPathTracer, PxrPortalLight, PxrPrimvar, PxrProjectionLayer, PxrProjectionStack, PxrProjector, PxrPtexture, PxrRamp, PxrRampLightFilter, PxrRandomTextureManifold, PxrRectLight, PxrRemap, PxrRodLightFilter, PxrRollingShutter, PxrRoundCube, PxrSeExpr, PxrShadedSide, PxrShadowDisplayFilter, PxrShadowFilter, PxrSkin, PxrSphereLight, PxrSurface, PxrTangentField, PxrTee, PxrTexture, PxrThinFilm, PxrThreshold, PxrTileManifold, PxrToFloat, PxrToFloat3, PxrVariable, PxrVary, PxrVolume, PxrVoronoise, PxrWhitePointDisplayFilter, PxrWhitePointSampleFilter, PxrWorley
-
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)