Notifications
Clear all

[Closed] addNewKey not working

Hey there.

I created a “Key All” button in a UI that iterates through a bunch of controllers to set keys on position & rotation. addNewKey seems to be what I should use, but it just isn’t working.

My rotation is a rotation_list, with three euler_xyz underneath it.
I want to key the third euler_xyz track on the current frame.

So, here’s what I tried:

indirect method –
addNewKey $objectName.rotation.controller[3] currentTime

explicit method –
addNewKey $objectName.rotation.controller.ThirdRot.controller currentTime

Neither works. What happens is that once I addNewKey and then rotate the control, the values of the existing keys become the values of the control’s current position.

I’ve looked into “on animate” but that doesn’t seem to be what I want.

Any hints on what could be causing this behavior?

Thanks,

Alec

2 Replies

nevermind. it seems Set Key has to be active for this to work.
Unfortunately, there doesn’t seem to be a way to determine whether or not Set Key is active or not…there’s just a way to toggle it with “max set key mode”.

Answers one question and suggests another…

Not sure what you mean here, could you elaborate on this?

Bare in mind that when using addNewKey on compound controllers (such as euler_xyz) the method does not return a reference to the created key. Simply because in this case it automatically creates multiple individual keys (for the x,y and z tracks).

Martijn