I'm quite new to the "stage" stuff in Houdini so forgive me if this is obvious.
How would I get/set the values of a camera in the usd/stage context (vop?) at specific times? The below snippet seems to work to get the matrix, but the "time" parameter of ComputeLocalToWorldTransform does not seem to do anything. Do I need to get an "animated" stage first somehow? And what about setting values at specific times for camera?
Drop down a Cache LOP before using your script and make it cache desired frame range, or the whole timeline. Edit: On second thought, no, simply set the "Frame Range/Subframes" tab on your camera to "Sample Frame Range" instead.
After making that one change your code started working for me.
Not exactly the solution I expected, but hey, if it works it works From what I understand, the stage of nodes is locked most of the time. It is unlocked and editable under certain conditions, like when using Python Script lop on itself with stage=hou.pwd().editableStage().
If you happened to end up with an editable stage somehow, here's how you could set those attributes:
prim=stage.GetPrimAtPath(primpath)focal_len=prim.GetAttribute("focalLength")focal_len.Set(2.0,10)# sets 2.0 at time sample 10focal_len.Set(5.0,30)# sets 5.0 at time sample 30