From ab007e8d0fea426baa27a973f1864590dad2e14d Mon Sep 17 00:00:00 2001 From: Andriy Babak Date: Mon, 2 Sep 2019 19:21:16 +0300 Subject: [PATCH] Update the integrations sample code --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60b948e..091d4e5 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Linux: ~/maya/scripts ``` 3. Open Script Editor and paste the following code to Python tab: -``` +```python import maya2katana reload (maya2katana) maya2katana.copy() @@ -68,9 +68,24 @@ maya2katana.copy() ### Integrations To get the XML from shading network name: -``` +```python 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: + +```python +# 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_node = NodegraphAPI.CreateNode(node_name, NodegraphAPI.GetRootNode()) +# Bring the nodes to Katana scene +# and place them inside the newly created group +nodes = KatanaFile.Paste(resulting_xml, group_node) +```