< Referencing Layers Traversing a Stage >


Converting Between Layer Formats

This tutorial focuses on converting layer files between the different native USD file formats using the operators from the Shift_USD catalog.

The USD file used in this tutorial Sphere.usd can be found in the following path in the Shift installation folder: <path_to_the_shift_installation_folder>/shift/examples/USD/tutorials/tutorial_04_converting_layer_formats/.

Converting between .usda/.usdc and .usd

  1. Open Shift application. A new window instance of Shift should appear like the following one:
Shift UI.
Figure 1: Shift UI.
NOTE

Before creating the USD workflow, ensure that the USD nodes appear in the Node List widget. The catalogs combobox should show sUSD and sUSDTypes if USD is correctly loaded in Shift. If this is not the case, please check again the Shift_USD installation page.

  1. First, add a new UsdStageOpen node to the board and rename it as OpenUsdFile. Using the Inspector widget, set as the value for the filepath input plug a filepath pointing to a .usd file. For the purpose of this tutorial, the filepath will be: D:/USD_TUTORIALS/04/Sphere.usd. The board should look like the following:
Added 'OpenUsdFile' node to the board.
Figure 2: Added 'OpenUsdFile' node to the board.
  1. To save a .usda file, add a new UsdStageSave node to the board and rename it as SaveAsUsdaFile. Connect the stage output plug from the OpenUsdFile node to the stage input plug of the new node. Set as the value for the filepath input plug a valid filepath to a valid .usda file path, such as D:/USD_TUTORIALS/04/Sphere.usda. The board should look like the following:
Added 'SaveAsUsdaFile' node to the board connected to 'OpenUsdFile' node.
Figure 3: Added 'SaveAsUsdaFile' node to the board connected to 'OpenUsdFile' node.
  1. Execute the workflow, which will generate a new file with the .usda extension using the information from the .usd file. The board should look like the following:
Executed the workflow for creating the '.usda' file.
Figure 4: Executed the workflow for creating the '.usda' file.
  1. Add another new UsdStageOpen node to the board and rename it as OpenUsdaFile. Set the value for the filepath input plug of the current node to point to the file generated by the SaveAsUsdaFile node, meaning having in the current example the value: D:/USD_TUTORIALS/04/Sphere.usda. The board should look like the following:
Added 'OpenUsdaFile' node to the board.
Figure 5: Added 'OpenUsdaFile' node to the board.
  1. To save a .usdc file, add a new UsdStageSave node to the board and rename it as SaveAsUsdcFile. Connect the stage output plug from the OpenUsdaFile node to the stage input plug of the new node. Set as the value for the filepath input plug a valid filepath to a .usdc file, such as D:/USD_TUTORIALS/04/Sphere.usdc. The board should look like the following:
Added 'SaveAsUsdcFile' node to the board connected to 'OpenUsdaFile' node.
Figure 6: Added 'SaveAsUsdcFile' node to the board connected to 'OpenUsdaFile' node.
  1. Execute the workflow again. Now, the workflow will generate a new file with the .usdc extension will be generated using the information from the .usda file. The board should look like the following:
Executed the workflow for creating the '.usdc' file.
Figure 7: Executed the workflow for creating the '.usdc' file.

Run verifications

  1. To the verification and inspect the differences between the original Sphere.usd file and the generated file Sphere.usda, use the terminal and execute the usddiff tool shipped with USD. The terminal should show no differences:
Usddiff command executed between original 'Sphere.usd' file and generated 'Sphere.usda' file.
Figure 8: Usddiff command executed between original 'Sphere.usd' file and generated 'Sphere.usda' file.
  1. As previously done, to run the verification between the Sphere.usda file and the Sphere.usdc file, execute the usddiff tool in a terminal. The terminal should show no differences:
Usddiff command executed between 'Sphere.usda' and 'Sphere.usdc' files.
Figure 9: Usddiff command executed between 'Sphere.usda' and 'Sphere.usdc' files.

Workflow Resources

The workflow corresponding to this tutorial can be found in the following path in the Shift installation folder: <path_to_the_shift_installation_folder>/shift/examples/USD/tutorials/tutorial_04_converting_layer_formats/tutorial_04.sft


< Referencing Layers Traversing a Stage >


Inbibo Logo

consultancy, automation and digital creatures

65 Compton Street, London, United Kingdom, EC1V 0BN

info@inbibo.co.uk

Information

Products

© 2024 Inbibo LTD. - All rights reserved - Design & Development: def:studio