(
world: Any,
*,
stage: Any,
root_prim_path: str,
warmup_frames: int,
step_physics: bool,
physics_steps_per_render: int,
cameras: Mapping[str, Any],
)
| 1199 | |
| 1200 | |
| 1201 | def _force_renderer_flush( |
| 1202 | world: Any, |
| 1203 | *, |
| 1204 | stage: Any, |
| 1205 | root_prim_path: str, |
| 1206 | warmup_frames: int, |
| 1207 | step_physics: bool, |
| 1208 | physics_steps_per_render: int, |
| 1209 | cameras: Mapping[str, Any], |
| 1210 | ) -> None: |
| 1211 | import carb.settings |
| 1212 | from pxr import UsdGeom |
| 1213 | |
| 1214 | settings = carb.settings.get_settings() |
| 1215 | settings.set("/rtx/resetPtAccum", True) |
| 1216 | |
| 1217 | root_prim = stage.GetPrimAtPath(root_prim_path) |
| 1218 | if root_prim is not None and (not hasattr(root_prim, "IsValid") or root_prim.IsValid()): |
| 1219 | imageable = UsdGeom.Imageable(root_prim) |
| 1220 | visibility_attr = imageable.CreateVisibilityAttr() |
| 1221 | previous = visibility_attr.Get() or "inherited" |
| 1222 | visibility_attr.Set("invisible") |
| 1223 | _render_frame( |
| 1224 | world, |
| 1225 | step_physics=bool(step_physics), |
| 1226 | physics_steps_per_render=int(physics_steps_per_render), |
| 1227 | ) |
| 1228 | _prime_camera_buffers(cameras) |
| 1229 | visibility_attr.Set(previous) |
| 1230 | _render_frame( |
| 1231 | world, |
| 1232 | step_physics=bool(step_physics), |
| 1233 | physics_steps_per_render=int(physics_steps_per_render), |
| 1234 | ) |
| 1235 | _prime_camera_buffers(cameras) |
| 1236 | |
| 1237 | settings.set("/rtx/resetPtAccum", True) |
| 1238 | for _ in range(max(0, int(warmup_frames))): |
| 1239 | _render_frame( |
| 1240 | world, |
| 1241 | step_physics=bool(step_physics), |
| 1242 | physics_steps_per_render=int(physics_steps_per_render), |
| 1243 | ) |
| 1244 | _prime_camera_buffers(cameras) |
| 1245 | |
| 1246 | |
| 1247 | def _prime_camera_buffers(cameras: Mapping[str, Any]) -> None: |
no test coverage detected