Search Tips

Search is based on keyword.

`Ex: "Procedures"`

Do not search with natural language

`Ex: "How do I write a new procedure?"`

Give Feedback Support Portal

# Native USD Layer Export

Katana USD Layer Export enables you to export Native USD data to a USD layer. This allows the export of entire layers and stages including geometry, cameras, materials, assignments, and lights.

To export a specific set of nodes from your node graph, there are two ways you can do this:

• Use UsdLayerDefine + UsdLayerExport to define the selection

• Use UsdLayerExportGroup to export as a group

In both of these cases, the same underlying nodes and workflows are used.

Or, to export all upstream changes:

• Simply use UsdLayerExport. In this case, you can use the following guide and skip steps 1 and 2.

# Using UsdLayerDefine + UsdLayer Export nodes

| 1. | Set up a UsdLayerDefine node: Add this node to act as a start point for the exported layer. The UsdLayerExport node then captures the changes made between this start point and its second input. This node is required if you are exporting from a point where nodes exist above. If there are no nodes above your start point then this node is not required.

| 2. | Specify USD layer in the asset parameter:

• If no layer is specified, then the changes will be exported as overs so that the exported layer only contains the edits made and does not replace other layers.

• If a layer is specified, then the exported layer will combine the specified layer with the changes made with the purpose of replacing the specified layer.

| 3. | Add UsdLayerExport node: Connect this node to export Native USD data to a USD layer.

Note: Only changes using native USD nodes will be baked.

You can load in the exported USD layer by using the useExported toggle. This is particularly helpful for performance improvements or comparing against an exported layer. This will effectively bring the baked layer in as a sublayer. When multiple UsdLayerExport nodes exist in a scene, you can use the shelf tools - Disable all 'useExported'… and Enable all ‘useExported’… - to enable or disable the option across all nodes.

Multiple export options can be found, such as export methods (Keep Composition Arcs, Flatten Sublayers and Flatten All) to tailor the USD layer file to your needs, as well as other parameters including the ability to choose a desired file type, time related settings, export options and several options for setting up layer metadata.

Note: You can right-click UsdLayerExport nodes to bake without having to open the parameters.

| 4. | Select Export to create the export with the options you have chosen.

# Using the UsdLayerExportGroup node

Using the UsdLayerExportGroup node, you can also select multiple nodes and add them to the Group ready for export without having to do the set up manually:

| 1. | To do this, select the nodes and go to Edit > Collapse Selected Nodes to UsdLayerExportGroup

| 2. | The Parameters for both the UsdLayerDefine and UsdLayerExport nodes are now available on the UsdLayerExportGroup’s parameters, where you can adjust export options.

| 3. | Select Export to create the export with the options you have chosen. Refer to the steps above for guidance on how to populate these parameters

# Modifying using the UsdLayerExporter Plug-in

You can also use the UsdLayerExporter Plug-in to access the USD layer prior to exporting. This can be used for modification, validation, or performing any action on the layer in memory before exporting. More information is available in the developer guide under Usd Processing Engine > UsdLayerExport, with examples in: <INSTALL_DIRECTORY>/plugins and available through a new KATANA_EXAMPLES subfolder, /UsdLayerExporterPlugins.

# USD Export - Practical example

Here we have a basic example scene consisting of a cube, a sphere and a cone. We’ve moved them around in space and assigned a red color to the sphere using a UsdAttributeSet node.

Let’s export this to a .usda file. Click through the steps below.

1 START

Start by adding a UsdLayerExport node and connecting it to the ‘in’ input downstream of the UsdAttributeSet node.

2

Set the parameter flag on the UsdLayerExport node by double clicking the node.

3

In the Parameters tab, specify a path as to where to save the USD file and set the usdFileFormat to usda. This will write the USD file in an ASCII format so we can open it in an external code editor. Since we don’t have any animation or time sensitive data in our scene, we can keep the time options at default, meaning only the current frame will be exported.

4

Click the Export button to write your USD stage to a .usda file. Depending on the size of your scene, a pop up might show, indicating the export is ongoing.

5

With the export finished, we can use the useExported parameter to load in the file we just saved out (similar to a UsdSublayerAdd node). This can be particularly useful for performance reasons.

6

We can now look at our freshly exported .usda file with Katana’s USD Text View tab with its mode set to Full Stage at Selected Node.

# UsdLayerExportGroup - Practical example

This example displays how you can quickly group USD nodes in a UsdLayerExportGroup, which automatically connects them to a UsdLayerDefine node and a UsdLayerExport node. The parameters of these nodes are promoted so they can be accessed from the UsdLayerExportGroup node’s parameter tab.