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.
- 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.
- Build Unreal Engine from source (5.4.2)
- Clone the repository in your Unreal Engine Datasmith directory
- e.g.
C:\repos\UnrealEngine\Engine\Source\Programs\Enterprise\Datasmith
- e.g.
- Ensure you have the required software and dependencies installed:
- Twinmotion 2024
- Pixar USD v24.05
- Boost 1.78
- Python 3.9
- Update the library paths in the build configuration files to match your system setup.
- Run
GenerateProjectFiles.bat
- Build the newly generated
DatasmithUsd
target - Add PluginPath to environment's
PYTHONPATH
in order for it to be discovered byUsdView
UsdView
will locateplugInfo.json
in specified python path- e.g.
C:\repos\UnrealEngine\Engine\Binaries\Win64\DatasmithUsdPlugin
Start USD view with the following command and specifying the data you would like to open
usdview usd_data\Kitchen_set\Kitchen_set.usd
Additional command line arguments can be specified using the Unreal launcher
-OpenProject=prompt -DirectLink.SourceName=Kitchen_set
To enable DirectLink, use the EnableDirectLink
method of the FModule
class. This will initialize the DirectLink connection and set up the necessary endpoints.
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.
- Windows Only
- Hardcoded Cache Folder Cache folder used to store intermediate
.udatasmith
and.udsmesh
files is hardcoded atC:\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.
- Synchronizing the Scene To synchronize the scene, use the
Sync
method of theFModule
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
andUSDIncludesEnd.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.
- Epic Games for providing the Datasmith SDK.
- Pixar for developing USD.