EntropyCanvas::UsdSyncService
EntropyCanvas::UsdSyncService
Section titled “EntropyCanvas::UsdSyncService”Service for USD scene serialization and synchronization. More…
#include <UsdSyncService.h>
Inherits from EntropyEngine::Core::EntropyService, EntropyEngine::Core::EntropyObject
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| ~UsdSyncService() override =default | |
| virtual void | unload() override |
| virtual EntropyEngine::Core::TypeSystem::TypeID | typeId() const override |
| void | syncWorldToStage(flecs::world & world, pxr::UsdStageRefPtr stage) Synchronize transforms from Flecs world to USD stage. |
| virtual void | stop() override |
| virtual void | start() override |
| virtual const char * | name() const override |
| virtual void | load() override |
| bool | importUsdIntoWorld(flecs::world & world, pxr::UsdStageRefPtr stage, const std::string & usdData) Import USD data into Flecs world. |
| virtual const char * | id() const override |
| std::string | exportWorldToUsd(flecs::world & world, pxr::UsdStageRefPtr stage) Export Flecs world to USD string format. |
| virtual std::vector< EntropyEngine::Core::TypeSystem::TypeID > | dependsOnTypes() const override |
| UsdSyncService() =default |
Additional inherited members
Section titled “Additional inherited members”Public Functions inherited from EntropyEngine::Core::EntropyService
| Name | |
|---|---|
| ~EntropyService() override =default | |
| virtual const char * | version() const |
| ServiceState | state() const |
| virtual std::vector< std::string > | dependsOn() const |
| virtual const char * | className() const override Runtime class name for diagnostics and reflection. |
Protected Functions inherited from EntropyEngine::Core::EntropyService
| Name | |
|---|---|
| void | setState(ServiceState s) |
Friends inherited from EntropyEngine::Core::EntropyService
| Name | |
|---|---|
| class | EntropyServiceRegistry |
Protected Classes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleCore Optional handle identity stamped by an owner/registry. |
Public Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| virtual | ~EntropyObject() =default |
| virtual const TypeSystem::TypeInfo * | typeInfo() const Optional richer type information; may be null. |
| bool | tryRetain() const Attempts to retain only if the object is still alive. |
| virtual std::string | toString() const Human-readable short string (class@ptr by default). |
| void | retain() const Increments the reference count. |
| void | release() const Decrements the reference count and deletes when it reaches zero. |
| uint32_t | refCount() const Current reference count (approximate under contention). |
| EntropyObject & | operator=(const EntropyObject & ) =delete |
| EntropyObject & | operator=(EntropyObject && ) =delete |
| bool | hasHandle() const |
| template <class OwnerT > OwnerT * | handleOwnerAs() const Returns the stamped owner pointer cast to the requested type. |
| const void * | handleOwner() const |
| uint32_t | handleIndex() const |
| uint64_t | handleId() const |
| uint32_t | handleGeneration() const |
| WeakControlBlock * | getWeakControlBlock() const Lazily retrieves or creates the weak control block. |
| virtual std::string | description() const Long-form description; defaults to toString(). |
| virtual std::string | debugString() const Debug-oriented string including refcount and handle when present. |
| virtual const char * | className() const Runtime class name for diagnostics and reflection. |
| virtual uint64_t | classHash() const Stable type hash for cross-language identification. |
| EntropyObject() =default | |
| EntropyObject(EntropyObject && ) =delete | |
| EntropyObject(const EntropyObject & ) =delete |
Protected Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| void | _setHandleIdentity(void * owner, uint32_t index, uint32_t generation) |
| void | _clearHandleIdentity() |
Protected Attributes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| std::atomic< WeakControlBlock * > | _weakBlock Lazily allocated control block for weak refs. |
| std::atomic< uint32_t > | _refCount Thread-safe retain/release counter. |
| struct EntropyEngine::Core::EntropyObject::HandleCore | _handle |
Friends inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleAccess |
Detailed Description
Section titled “Detailed Description”class EntropyCanvas::UsdSyncService;Service for USD scene serialization and synchronization.
UsdSyncService handles bidirectional conversion between Flecs entities and USD prims. It provides clean serialization for persistence without requiring direct stage access.
Responsibilities:
- Export Flecs world state to USD string format (USDA)
- Import USD data into Flecs world
- Synchronize entity transforms to USD XformOps
- Handle hierarchy preservation during import/export
NOT Responsibilities:
- Stage ownership (caller owns the USD stage)
- File I/O (caller handles disk operations)
- Encryption (caller handles that)
Public Functions Documentation
Section titled “Public Functions Documentation”function ~UsdSyncService
Section titled “function ~UsdSyncService”~UsdSyncService() override =defaultfunction unload
Section titled “function unload”virtual void unload() overrideReimplements: EntropyEngine::Core::EntropyService::unload
function typeId
Section titled “function typeId”virtual EntropyEngine::Core::TypeSystem::TypeID typeId() const overrideReimplements: EntropyEngine::Core::EntropyService::typeId
function syncWorldToStage
Section titled “function syncWorldToStage”void syncWorldToStage( flecs::world & world, pxr::UsdStageRefPtr stage)Synchronize transforms from Flecs world to USD stage.
Parameters:
- world Flecs world with entities
- stage USD stage to update
Updates USD prims to match current Flecs entity transforms.
function stop
Section titled “function stop”virtual void stop() overrideReimplements: EntropyEngine::Core::EntropyService::stop
function start
Section titled “function start”virtual void start() overrideReimplements: EntropyEngine::Core::EntropyService::start
function name
Section titled “function name”inline virtual const char * name() const overrideReimplements: EntropyEngine::Core::EntropyService::name
function load
Section titled “function load”virtual void load() overrideReimplements: EntropyEngine::Core::EntropyService::load
function importUsdIntoWorld
Section titled “function importUsdIntoWorld”bool importUsdIntoWorld( flecs::world & world, pxr::UsdStageRefPtr stage, const std::string & usdData)Import USD data into Flecs world.
Parameters:
- world Target Flecs world to populate
- stage USD stage containing the data
- usdData USD file content as string (USDA format)
Return: True if import succeeded, false otherwise
Creates entities from USD prims. Restores hierarchy and transforms. Must be called on main thread.
function id
Section titled “function id”inline virtual const char * id() const overrideReimplements: EntropyEngine::Core::EntropyService::id
function exportWorldToUsd
Section titled “function exportWorldToUsd”std::string exportWorldToUsd( flecs::world & world, pxr::UsdStageRefPtr stage)Export Flecs world to USD string format.
Parameters:
- world Flecs world to export
- stage USD stage to export to
Return: USD file content as string (USDA format), empty on failure
Serializes all entities with Transform components into USD prims. Preserves hierarchy via USD prim paths. Thread-safe (read-only operation).
function dependsOnTypes
Section titled “function dependsOnTypes”virtual std::vector< EntropyEngine::Core::TypeSystem::TypeID > dependsOnTypes() const overrideReimplements: EntropyEngine::Core::EntropyService::dependsOnTypes
function UsdSyncService
Section titled “function UsdSyncService”UsdSyncService() =defaultUpdated on 2026-01-26 at 17:14:35 -0500