I created a Camera extension called Camera Key, that sets all 3 transform keys and all 3 rotation keys at the current keyframe with one button click, which makes it easy to create camera fly throughs (if there is a built in way to do this already, tell me how please).
It works pretty well, except there are times Omniverse won’t let you scroll forward past a certain point and you can’t select a prop forward in the scene because of windows or walls in the way (without hiding).
def on_click():
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:translate|x'])
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:translate|y'])
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:translate|z'])
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:rotateYXZ|x'])
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:rotateYXZ|y'])
omni.kit.commands.execute('SetAnimCurveKeys',
paths=['/Root/Camera.xformOp:rotateYXZ|z'])
label.text = "6 Keys Set"
ui.Button(“Set Keys”, clicked_fn=on_click)
The first part of the question is how to get the current transform of the Camera object?
The part I don’t know and maybe there is some built in math functions to figure out what forward is, meaning the direction the camera is facing? Then how do you go 3 meters forward, for example?
Thanks for any advice.