I am currently trying to modify the pose of a replicator camera using rep.modify.pose but it doesn’t appear to be changing. I am checking the pose using the get_world_transform_xform function described in this example. Below is a minimal version of my code to replicate this issue. Thank you for the help in advance!
def get_world_transform_xform(prim: Usd.Prim):
"""
Get the local transformation of a prim using Xformable.
See https://openusd.org/release/api/class_usd_geom_xformable.html
Args:
prim: The prim to calculate the world transformation.
Returns:
A tuple of:
- Translation vector.
- Rotation quaternion, i.e. 3d vector plus angle.
- Scale vector.
"""
xform = UsdGeom.Xformable(prim)
time = Usd.TimeCode.Default() # The time at which we compute the bounding box
world_transform: Gf.Matrix4d = xform.ComputeLocalToWorldTransform(time)
translation: Gf.Vec3d = world_transform.ExtractTranslation()
rotation: Gf.Rotation = world_transform.ExtractRotation()
scale: Gf.Vec3d = Gf.Vec3d(*(v.GetLength() for v in world_transform.ExtractRotationMatrix()))
return translation, rotation, scale
cam = rep.create.camera(
position=(10,10,10)
)
rp_cam = rep.create.render_product(cam, (640, 480))
cam_prim = cam.get_output_prims()["prims"][0]
print(get_world_transform_xform(cam_prim))
with cam:
rep.modify.pose(
position = (1,2,3)
)
print(get_world_transform_xform(cam_prim))