isaaclab.sim.usd_export#
Export an initialized scene environment as USD.
Exports one initialized environment as USD. The file keeps the scene’s USD, with assets as references to
their source files, and adds the physics values of the active backend that an import of that USD would not
reproduce. Use export_to_usd() or
export_usd_path. The file is meant for each backend’s own import:
Isaac Sim and OVPhysX open it, and Newton reads it with newton.ModelBuilder.add_usd(); see
Exporting an Environment to USD.
Factory for the USD exporter of the active physics backend. |
|
Export one environment of an initialized scene: its USD plus the values its engine holds. |
|
One value the exported USD must author so that an import reproduces the engine. |
Exporters#
- class isaaclab.sim.usd_export.UsdExporter[source]#
Bases:
FactoryBase,BaseUsdExporterFactory for the USD exporter of the active physics backend.
Methods:
__new__(cls, *args, **kwargs)Create the exporter of the active physics backend.
__init__(scene[, env_id])Initialize the exporter.
- static __new__(cls, *args, **kwargs) BaseUsdExporter[source]#
Create the exporter of the active physics backend.
- class isaaclab.sim.usd_export.BaseUsdExporter[source]#
Bases:
ABCExport one environment of an initialized scene: its USD plus the values its engine holds.
The exported layer is the scene’s root layer reduced to one environment, so assets stay references to their source files. A backend compares the engine with what an import of the layer gives (its base) and writes every value that differs, which is what Isaac Lab set.
Attributes:
Whether an import of the layer reproduces the scene's deformable objects.
Whether an import of the layer reproduces the scene's cable objects.
Methods:
__init__(scene[, env_id])Initialize the exporter.
export(path)Write the environment to a USD file.
compute_diff(stage)Return the engine values that
stagedoes not already state.Read what the engine loaded from the stage, before the scene's assets write their configuration.
open_stage(path)Open an exported USD file, downloading referenced remote assets as Isaac Lab does when spawning them.
- exports_deformables: ClassVar[bool] = False#
Whether an import of the layer reproduces the scene’s deformable objects.
- exports_cables: ClassVar[bool] = False#
Whether an import of the layer reproduces the scene’s cable objects.
- __init__(scene: InteractiveScene, env_id: int = 0)[source]#
Initialize the exporter.
- export(path: str) str[source]#
Write the environment to a USD file.
- Parameters:
path¶ – Destination USD file.
- Returns:
The destination path.
- abstractmethod compute_diff(stage: pxr.Usd.Stage) list[UsdEdit][source]#
Return the engine values that
stagedoes not already state.- Parameters:
stage¶ – The exported stage, reduced to the selected environment.
- read_engine_base() Any[source]#
Read what the engine loaded from the stage, before the scene’s assets write their configuration.
The scene calls this when its physics is ready, ahead of asset initialization, and keeps the result for
compute_diff(). Backends that compare against something else return None.- Returns:
The backend’s base values, or None.
- class isaaclab.sim.usd_export.UsdEdit[source]#
One value the exported USD must author so that an import reproduces the engine.
Attributes:
Prim path in the exported stage.
Attribute name;
_WORLD_POSEfor a world transform given as aGf.Matrix4d,_PHYSICS_MATERIALfor a new physics material bound to the prim, given as its path,_DEACTIVATEto deactivate the prim, or_DEFINE_PRIMfor a new prim given as aPrimDefinition.Value in USD units.
Value type used when the attribute does not exist yet.
Applied API schema the importer requires for the attribute, e.g.
"PhysicsDriveAPI:angular".Methods:
apply(stage)Author the edit on
stage, un-instancing the asset instance that contains the prim.__new__(_cls, path, attribute, value[, ...])Create new instance of UsdEdit(path, attribute, value, type_name, schema)
- attribute: str#
Attribute name;
_WORLD_POSEfor a world transform given as aGf.Matrix4d,_PHYSICS_MATERIALfor a new physics material bound to the prim, given as its path,_DEACTIVATEto deactivate the prim, or_DEFINE_PRIMfor a new prim given as aPrimDefinition.
- schema: str | None#
Applied API schema the importer requires for the attribute, e.g.
"PhysicsDriveAPI:angular".