Merge pull request #2067 from abhihjoshi:documentation
PiperOrigin-RevId: 682364758 Change-Id: I3a5000a2851a560018ae0e04a2b7ad13415cb7c6
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# USD exporter module
|
||||
|
||||
Please see [documentation](https://mujoco.readthedocs.io/en/stable/python.html) for details.
|
||||
@@ -42,7 +42,7 @@ class USDExporter:
|
||||
height: int = 480,
|
||||
width: int = 480,
|
||||
max_geom: int = 10000,
|
||||
output_directory_name: str = "mujoco_usdpkg",
|
||||
output_directory: str = "mujoco_usdpkg",
|
||||
output_directory_root: str = "./",
|
||||
light_intensity: int = 10000,
|
||||
camera_names: Optional[List[str]] = None,
|
||||
@@ -59,7 +59,7 @@ class USDExporter:
|
||||
can be rendered in the same scene. If None this will be chosen
|
||||
automatically based on the estimated maximum number of renderable
|
||||
geoms in the model.
|
||||
output_directory_name: name of root directory to store outputted frames
|
||||
output_directory: name of root directory to store outputted frames
|
||||
and assets generated by the USD renderer.
|
||||
output_directory_root: path to root directory storing generated frames
|
||||
and assets by the USD renderer.
|
||||
@@ -95,7 +95,7 @@ class USDExporter:
|
||||
self.height = height
|
||||
self.width = width
|
||||
self.max_geom = max_geom
|
||||
self.output_directory_name = output_directory_name
|
||||
self.output_directory = output_directory
|
||||
self.output_directory_root = output_directory_root
|
||||
self.light_intensity = light_intensity
|
||||
self.camera_names = camera_names
|
||||
@@ -149,7 +149,7 @@ class USDExporter:
|
||||
def _initialize_output_directories(self):
|
||||
"""Initializes output directories to store frames and assets."""
|
||||
self.output_directory_path = os.path.join(
|
||||
self.output_directory_root, self.output_directory_name
|
||||
self.output_directory_root, self.output_directory
|
||||
)
|
||||
if not os.path.exists(self.output_directory_path):
|
||||
os.makedirs(self.output_directory_path)
|
||||
@@ -498,7 +498,7 @@ class USDExporter:
|
||||
geom_ref.update_visibility(False, geom_ref.last_visible_frame+1)
|
||||
|
||||
self.stage.Export(
|
||||
f"{self.output_directory_root}/{self.output_directory_name}/" +
|
||||
f"{self.output_directory_root}/{self.output_directory}/" +
|
||||
f"frames/frame_{self.frame_count}.{filetype}"
|
||||
)
|
||||
if self.verbose:
|
||||
|
||||
@@ -43,7 +43,7 @@ class ExporterTest(absltest.TestCase):
|
||||
data = mujoco.MjData(model)
|
||||
exporter = exporter_module.USDExporter(
|
||||
model,
|
||||
output_directory_name=output_dir_name,
|
||||
output_directory=output_dir_name,
|
||||
output_directory_root=output_dir_root,
|
||||
camera_names=["closeup"],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user