Python command for setting number of keyframes

I’m trying to script setting the number of keyframes. I’m using Record State to show me the command. However, when I change the number of keyframes, I don’t see an associated command in the recorded state. Anyone know the command offhand?


Hi Dave,

Could you give a little more detail on what you are doing? I’m assuming you are talking about camera keyframes, but I could be wrong. In Python, CameraKeyFrame() creates a keyframe object. You create any number of these then set them on the camera animation track with

camTrack = GetCameraTrack(view=GetActiveView())
camTrack.KeyFrames = [keyframe1, keyframe2, keyframe3,...]

If I’ve missed the mark, a bulleted list of what you are doing in the GUI would be me zero in on your request.