Skip to content

perrauo/datasmith-usd

Repository files navigation

Datasmith USD Plugin

THIS PLUGIN IS EXPERIMENTAL AND NOT WORKING IN ITS CURRENT STATE.

This project is a plugin for integrating Datasmith with USD (Universal Scene Description) using DirectLink. It allows for the translation of USD meshes and the synchronization of scenes between Datasmith and USD.

Features

  • DirectLink Integration: Enables real-time synchronization of scenes between Datasmith and USD.
  • USD Mesh Translation: Converts USD meshes to Datasmith meshes for further processing and export.

Installation

  1. Build Unreal Engine from source (5.4.2)
  2. Clone the repository in your Unreal Engine Datasmith directory
    • e.g. C:\repos\UnrealEngine\Engine\Source\Programs\Enterprise\Datasmith
  3. Ensure you have the required software and dependencies installed:
    • Twinmotion 2024
    • Pixar USD v24.05
    • Boost 1.78
    • Python 3.9
  4. Update the library paths in the build configuration files to match your system setup.
  5. Run GenerateProjectFiles.bat
  6. Build the newly generated DatasmithUsdtarget
  7. Add PluginPath to environment's PYTHONPATH in order for it to be discovered by UsdView
    • UsdView will locate plugInfo.json in specified python path
    • e.g. C:\repos\UnrealEngine\Engine\Binaries\Win64\DatasmithUsdPlugin

Usage

1. Start USD view

Start USD view with the following command and specifying the data you would like to open usdview usd_data\Kitchen_set\Kitchen_set.usd image

2. Start Twinmotion by specifying additional command line arguments

Additional command line arguments can be specified using the Unreal launcher image -OpenProject=prompt -DirectLink.SourceName=Kitchen_set

3. Enabling DirectLink

To enable DirectLink, use the EnableDirectLink method of the FModule class. This will initialize the DirectLink connection and set up the necessary endpoints. image image

4. Import the Direct Link Connection

image

5. Adding a USD Stage

To add a USD stage, use the AddStage method of the FModule class. This will load the USD stage and translate the meshes to Datasmith meshes.

Known Issues

  • Windows Only
  • Hardcoded Cache Folder Cache folder used to store intermediate .udatasmith and .udsmesh files is hardcoded at C:\DLCacheFolder
  • Hardcoded Library Paths: The current build configuration contains hardcoded library paths. Make sure to update these paths to match your system setup.
  • Missing datasmith elements: I have found that despite my best effort, the majority of the datasmith elements are not being transmitted correctly. Further investigation necessary.
  • image
  • Synchronizing the Scene To synchronize the scene, use the Sync method of the FModule class. This is intended to update the Datasmith scene with the latest changes from the USD stage.
  • Unnecessary headers I have failed to remove unnecessary headers
  • Custom USD header guards I have adapted USDIncludesStart.h and USDIncludesEnd.h due to undefined symbol errors when relying on Unreal's one.
  • Custom USD Installation While relying on custom USD installation provides more flexibility, it would be nice to instead rely on Unreal's USD Installation.
  • USDView Limitations: USDView is not meant for editing data, thus the Python plugin provided in this project is rather useless. However, the same mesh translation and DirectLink can be used with any more competent USD data editor such as Maya USD.

Acknowledgements

  • Epic Games for providing the Datasmith SDK.
  • Pixar for developing USD.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published