Composer 2023.1.1 Error - omni.usd has no attribute 'utils'

In this short video, I show something that used to work in composer (Create), and still works in Code, but does not work in Composer.

I am asking this here because this affects my extension DataJuggler.CameraKeys, and I am curious was this depreciated or renamed or something?

The error apears to occur on this line

pose = omni.usd.utils.get_world_transform_matrix(camera, current_frame)

Is there a newer way of getting the world transform for an object?

Thank you

Just posting the difference between the way the Left, Forward, Back and Right buttons all use this:

stage = omni.usd.get_context().get_stage()
camera = stage.GetPrimAtPath("/World/Camera")
xform = UsdGeom.Xformable(camera)
local_transformation: Gf.Matrix4d = xform.GetLocalTransformation()
decomposed_Transform = decompose_matrix(local_transform)

# local_rotate = get_local_rot(camera)
rotationX = round(decomposed_Transform[1][0], 1)
rotationY = round(decomposed_Transform[1][1], 1)
rotationZ = round(decomposed_Transform[1][2], 1)

It looks like xform.GetLocalTransformation() does something similar to the way this code gets the transform values.

pose = omni.usd.utils.get_world_transform_matrix(camera, current_frame)
transform = pose.ExtractTranslation()
transformX = transform[0]
transformY = transform[1]
transformZ = transform[2] 

I will try switching the other buttons to work with the new way and see if everything works.

I don’t think omni.usd.utils is a public module. It’s not listed in the omni.usd docs. You can still access that function like this: omni.usd.get_world_transform_matrix()

Thanks, I will look at this again soon.

Thanks for answering all my questions.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.