scene_synthesizer.exchange.export.export_usd

scene_synthesizer.exchange.export.export_usd(scene, fname, file_type='usd', folder=None, texture_dir='textures', export_materials=True, separate_assets=False, use_absolute_usd_paths=False, write_usd_object_files=True, include_light_nodes=False, ignore_layers=None, up_axis='Z', meters_per_unit=1.0, kilograms_per_unit=1.0, write_attribute_attached_state=False)

Export scene to USD file or return USD data.

Parameters:
  • scene (scene_synthesizer.Scene) – Scene description.

  • fname (str) – The USD filename or None. If None the USD stage is returned.

  • file_type (str, optional) – Either ‘usd’, ‘usda’, or ‘usdc’. Defaults to ‘usd’.

  • folder (str, optional) – Only used if fname is None. The folder in which to export the USD(s). Affects the location of textures. Defaults to None.

  • texture_dir (str, optional) – Directory where texture files will be written (relative to USD main file). Defaults to “textures”.

  • export_materials (bool, optional) – Whether to write out texture files. Defaults to True.

  • separate_assets (bool, optional) – If True, each asset in the scene will be exported to a separate USD file, named according to its object identifier. Defaults to False.

  • use_absolute_usd_paths (bool, optional) – If set to True will convert all referenced USD paths to absolute ones. Defaults to False.

  • write_usd_object_files (bool, optional) – Write USD files instead of referencing existing ones. Defaults to True.

  • include_light_nodes (bool, optional) – Whether to include a link for the light nodes. Defaults to False.

  • ignore_layers (bool, optional) – Whether to ignore scene layers. If None, scenes with one layer or less will ignore the layers. Defaults to None.

  • up_axis (str, optional) – Either ‘Y’ or ‘Z’. Defaults to “Z”.

  • meters_per_unit (float, optional) – Meters per unit. Defaults to 1.0.

  • kilograms_per_unit (float, optional) – Kilograms per unit. Defaults to 1.0.

  • write_attribute_attached_state (bool, optional) – Will write attribute ‘AttachedState’ for objects whose parent is not the world. Defaults to False.

Returns:

If fname is None, will return the USD stage (created in memory). dict[str, Usd.Stage] (optional): If fname=None and separate_assets=True will return the additional assets as USD stages in a dictionary.

Return type:

Usd.Stage (optional)