simulariumio.usd package¶
Submodules¶
simulariumio.usd.usd_converter module¶
- class simulariumio.usd.usd_converter.UsdConverter(input_data: UsdData, progress_callback: Callable[[float], None] | None = None, callback_interval: float = 10)[source]¶
Bases:
TrajectoryConverterThis object reads simulation trajectory outputs from USD (Universal Scene Description) files and writes them in the format used by the Simularium viewer
- Parameters:
- input_dataUsdData
An object containing info for reading USD simulation trajectory outputs
- progress_callbackCallable [[float], None] (optional)
Callback function that accepts 1 float argument and returns None which will be called at a given progress interval, determined by callback_interval requested, providing the current percent progress Default: None
- callback_intervalfloat (optional)
If a progress_callback was provided, the period between updates to be sent to the callback, in seconds Default: 10
- save(output_path: str, binary: bool = True, validate_ids: bool = True) None[source]¶
Save the trajectory as a .simularium file and write any OBJ geometry files alongside it.
- Parameters:
- output_path: str
where to save the file (without extension)
- binary: bool (optional)
save in binary format? otherwise use JSON Default: True
- validate_ids: bool
additional validation to check agent ID size? Default = True
simulariumio.usd.usd_data module¶
- class simulariumio.usd.usd_data.UsdData(usd_file_path: str, meta_data: MetaData | None = None, display_data: Dict[str, DisplayData] | None = None, time_units: UnitData | None = None, spatial_units: UnitData | None = None, plots: List[Dict[str, Any]] | None = None, center: bool = True, trim_to_animation: bool = True)[source]¶
Bases:
objectThis object holds simulation trajectory outputs from USD (Universal Scene Description) files
- Parameters:
- usd_file_path: str
Path to the .usd, .usda, or .usdc file. Must be a file path (not contents) because the USD library requires file-based access.
- meta_dataMetaData (optional)
An object containing metadata for the trajectory including box size, scale factor, and camera defaults
- display_data: Dict[str, DisplayData] (optional)
The mesh prim name from USD data mapped to display names and rendering info for that type. Default: auto-detect from USD mesh and material data
- time_units: UnitData (optional)
multiplier and unit name for time values Default: 1.0 second
- spatial_units: UnitData (optional)
multiplier and unit name for spatial values Default: 1.0 meter
- plotsList[Dict[str, Any]] (optional)
An object containing plot data already in Simularium format
- centerbool (optional)
If true, the spatial values of the data are centered around the origin (0, 0, 0) during conversion Default: True
- trim_to_animationbool (optional)
If true, trim the frame range to only include frames that have actual keyframe data, ignoring any held/static tail beyond the last animated frame. Default: True
- center: bool¶
- display_data: Dict[str, DisplayData]¶
- plots: List[Dict[str, Any]]¶
- trim_to_animation: bool¶
- usd_file_path: str¶