diff --git a/workflows/simbox/core/cameras/custom_camera.py b/workflows/simbox/core/cameras/custom_camera.py index e427431..2b139d0 100644 --- a/workflows/simbox/core/cameras/custom_camera.py +++ b/workflows/simbox/core/cameras/custom_camera.py @@ -32,7 +32,7 @@ class CustomCamera(Camera): reference_path: Reference prim path for camera mounting name: Camera name """ - # ===== Pre-compute camera parameters ===== + # ===== From cfg ===== pixel_size = cfg["params"].get("pixel_size") f_number = cfg["params"].get("f_number") focus_distance = cfg["params"].get("focus_distance") @@ -47,18 +47,9 @@ class CustomCamera(Camera): focal_length_y = fy * pixel_size * 1e-3 focal_length = (focal_length_x + focal_length_y) / 2 / 10.0 - # Pre-set aperture on USD prim before Camera.__init__ to avoid mismatch warnings - from pxr import UsdGeom - import omni.usd - stage = omni.usd.get_context().get_stage() - cam_prim = stage.GetPrimAtPath(prim_path) - if cam_prim.IsValid(): - cam = UsdGeom.Camera(cam_prim) - cam.GetHorizontalApertureAttr().Set(horizontal_aperture * 10.0) # USD uses mm - cam.GetVerticalApertureAttr().Set(vertical_aperture * 10.0) - cam.GetFocalLengthAttr().Set(focal_length * 10.0) - # ===== Initialize camera ===== + # Note: Camera.__init__ triggers aperture consistency warnings with default USD values. + # These are cosmetic — IS auto-corrects, and we override with correct values below. super().__init__( prim_path=prim_path, name=name,