View Full Version : Automatic keyframe
03-03-2009, 03:07 PM
Ok so, here's the thing. I have an IK and a FK spine. The FK spine is driven by the IK spine but you can offset it any way you want (animator's request). Now what I would like to do is everytime I add a key frame to one of the IK controllers, it automatically adds a keyframe to every bones on the FK spine. Why do you ask? Simply to save time for the animators.
I tried to search in the maxscript reference if there was anything that could help me on that, but I didn't find anything substantial. Where I'm having problems is, how the heck do I detect when a keyframe is added automatically without having to do any manual interaction?
I thought about using on $spineik_cntrl addnewkey do (addnewkey $spinefk01) but it doesn't work.
Anyone has an idea?
03-03-2009, 05:39 PM
might just make it a button that they would -have- to press, but if that's not an option, I think you'd be stuck abusing some other callback (trackbar key filter, perhaps) to get a similar effect (and enumerate the keys on the IK yourself to determine what keys were added / copy them to the FK rig).
03-03-2009, 05:47 PM
Almost every animator on my team uses autokey, so a button is not an option.
What I understand from you suggestions would require some user interaction,which is what I want to avoid. Maybe I'm not getting it right though. If I'm not feel free to explain a little bit more.
03-03-2009, 07:21 PM
it wouldn't require user interaction, actually..
The trackbar filter callback, change handlers, etc. all run automatically. The only problem is that none of them are specific to a user adding a key / removing a key; so on triggering of the callback, you would have to manually check the controller(s) of the object(s) and check whether keys were added/removed from last time.
03-03-2009, 08:39 PM
Hmm, interesting. But how do you trigger those callbacks without user interaction?
03-04-2009, 04:10 AM
'you' don't.. max calls them for you whenever certain events happen.
try this code..
fn test ev nd = (
format "ev % :: nd %\n" ev nd
temp = nodeEventCallback all:test
-- temp = undefined; gc() -- to remove this callback
then manipulate your objects as you / your artists would, and check which callbacks are triggered.
Then set up just that callback ( to save on callback overhead ) and in the callback function you would check the property of the node you're interested in and check whether there's any keys that aren't on the FK rig and, if there are, create them. That's manual work on your end, but on the user's end - provided a callback triggers for what you need - it'd just be a startup function that they wouldn't ever get to see (short of you building an UI for it, of course).
03-04-2009, 01:05 PM
Ok I'll try this. Thanks for your help!
would this suffice?
when transform $spine_control changes do
if animbuttonState = true do
addKey $fkbone.pos slidertime
you could also use a callback to detect #animateOn
03-19-2009, 03:28 PM
Interesting. Unfortunatly, that project is on hold right now. But I'll try that at home tonight.
Thanks a lot man, I'll owe you a second beer if this works­.
03-19-2009, 03:28 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.