Is there a way to set the default keyframe to be linear when created?

I have a working version of my extension Camera Keys here

Below is the code for the set keys. I would like to set each frame to linear if it’s possible. Or to be consistent with the timeline, how do I create image option buttons like these and get the values, then set the value when the keyframes are set.

image

def SetKeys_Click():

omni.kit.commands.execute('SetAnimCurveKeys',
    paths=['/World/Camera.xformOp:translate|x'])
                
 omni.kit.commands.execute('SetAnimCurveKeys',
     paths=['/World/Camera.xformOp:translate|y'])
                
 omni.kit.commands.execute('SetAnimCurveKeys',
     paths=['/World/Camera.xformOp:translate|z'])
                
  omni.kit.commands.execute('SetAnimCurveKeys',
      paths=['/World/Camera.xformOp:rotateYXZ|x'])
                
  omni.kit.commands.execute('SetAnimCurveKeys',
      paths=['/World/Camera.xformOp:rotateYXZ|y'])
                
  omni.kit.commands.execute('SetAnimCurveKeys',
      paths=['/World/Camera.xformOp:rotateYXZ|z'])

timeline = omni.timeline.get_timeline_interface()
time = timeline.get_current_time()
fps = timeline.get_time_codes_per_seconds()
frame = time * fps
                
label.text = "6 Keys Were Set at frame " + str(frame)

Thanks for any tips.

Hi @DataJuggler! Congrats on the extension release! I see it on the Extension Manager.

If you search fot the SetAnimCurveKeys command from the Commands History Window, you can use it to look up all of the accepted parameters. Looks like you can set the tangents in/out:

Please ask your question about buttons with images in a new topic. I’d like to answer that one separately.

Thank you,

I thought you did answer the question about buttons. You showed me some example with parent.parent.parent is all I remember. It is on my to to list to add button images.

Here’s an example of setting a Button image via styles: kit-extension-sample-reticle/styles.py at 0a5de112e6d41f6b137cfd0dc632fd133c32588f · NVIDIA-Omniverse/kit-extension-sample-reticle · GitHub

I can ask it again if you are wanting to show an example of it.

No, I think that’s a good example. Feel free to create a new topic for an isolated example if you get stuck.

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