TeslasuitDocumentation
APIs

TsAssetManager

teslasuit_sdk.ts_asset_manager.TsAssetManager

Provides loading, type inspection, and unloading of TESLASUIT assets.

Assets are binary files (effects, animations, materials, etc.) consumed by device subsystems such as the haptic player.

Methods#

__init__#

def __init__(lib):

Initialize the asset manager with the C API library.

Parameters

lib

Loaded TESLASUIT C API library object (CDLL or WinDLL).


load_asset_from_path#

def load_asset_from_path(path: str) -> int:

Load a TESLASUIT asset from a file path.

Parameters

path: str

Absolute or relative path to the asset file.

Returns: int

Handle to the loaded asset.


load_asset_from_data#

def load_asset_from_data(data: bytes, size: int) -> None:

Load a TESLASUIT asset from binary data in memory.

Parameters

data: bytes

Raw binary content of the asset.

size: int

Size of the binary data in bytes.


get_asset_type#

def get_asset_type(asset_handle: int) -> int:

Retrieve the type of a previously loaded asset.

Parameters

asset_handle: int

Handle to the asset, as returned by a load method.

Returns: int

Type identifier of the asset.


unload_asset#

def unload_asset(asset_handle: int) -> None:

Release a previously loaded asset and free its resources.

Parameters

asset_handle: int

Handle to the asset to unload.


Enumerations#

ts_asset_manager.TsAssetType#

Enumeration of TESLASUIT asset types.

  • Undefined (0): Unknown asset type.
  • Spline (1): Spline animation asset.
  • HapticEffect (2): Haptic effect asset.
  • Material (3): Haptic material asset.
  • TouchSequence (4): Touch sequence asset.
  • PresetAnimation (5): Preset animation asset.
  • SceneAnimation (6): Scene animation asset.

Members

Undefined 0 Spline 1 HapticEffect 2 Material 3 TouchSequence 4 PresetAnimation 5 SceneAnimation 6