I am working on a special transformation that depends on the current camera state.
This special transformation is implemented as a new
xfromOp. It requires the view matrix and the projection matrix of the active camera to compute the local transformation.
Is it possible to access the current camera state from within the
It looks like the current camera transformation is computed in the HdCamera (i.e. in the Hydra layer). I did not find codes that store the camera transformation to the USD layer.
The problem is that the current camera is a property of the renderer’s state, not a property of the scene’s state.
There’s no concept of a “render time camera wildcard transform op” to take advantage of, and I don’t think I’ve heard it suggested before.
One solution might be to store a separate transform for the camera and apply it to the camera and your objects.
Another might be to intercept the objects in Hydra code and apply the camera transform there. If you have many possible cameras, intercepting on the Hydra side might be the only way to go.