Adjusting Keyframed Animation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  01 January 2013
Adjusting Keyframed Animation

I need to alter the initial transform/rotation of an animated object. Consider a bouncing ball - how does one move that object to a different starting location, keeping the animation intact, without editing every single keyframe individually?

The actual purpose is to fix a very long character animation. One bone is out of alignment throughout the animation, and must be rotated +20 degrees. I would rather not cycle through every keyframe adding +20 Z.

Thanks for your time.
  01 January 2013
There are a number of ways to fix this, probably the simplest is to select the rotation curve in the graph editor, select all the keys on it and in the value field (the second one beside 'Stats') type:
and hit enter.
That will add 20 to all selected keys.

Other options are to add an animation layer and just add one key of 20 degrees to it. Option one is cleaner though IMO.

  01 January 2013
Group it, move the group, ungroup it.
Demo Reel 2012-13!
  01 January 2013
When you ungroup it and the animation updates the objects will jump back to their original position/orientation I guess you could leave it grouped but that's a little untidy IMO compared to just adjusting the animation.

  01 January 2013
I recently wrote a little script to make this process more dynamic.

// update keys to reflect position change on current frame
// Usage:
// - Run this script. The current tool will be set to 'move'
// - Move your object around (if there are multiple objects selected, only first on selectionList will be affected)
// - Switch to any other tool when you are done
// Note: the script will only update keys once you are done using the move tool, which is registered by 
// switching to any other tool.

global proc psStoreCurrentPosition() {
	global float $psCurrentPosition[];
	string $selection[] = `ls -sl -o`;
	$moveCurrentPosition = `xform -q -ws -t $selection[0]`;

global proc psUpdateKeyValues() {
	global float $moveCurrentPosition[];
	string $selection[] = `ls -sl -o`;
	string $object = $selection[0];
	float $moveNewPosition[] = `xform -q -ws -t $object`;
	float $deltaX = $moveNewPosition[0] - $moveCurrentPosition[0];
	float $deltaY = $moveNewPosition[1] - $moveCurrentPosition[1];
	float $deltaZ = $moveNewPosition[2] - $moveCurrentPosition[2];
	int $updateStartTime = `currentTime -q` + 1;
	keyframe -time ($updateStartTime + ":") -at "translateX" -r -vc $deltaX $object;
	keyframe -time ($updateStartTime + ":") -at "translateY" -r -vc $deltaY $object;
	keyframe -time ($updateStartTime + ":") -at "translateZ" -r -vc $deltaZ $object;

	string $ctx = `manipMoveContext -prc "psStoreCurrentPosition" -psc "psUpdateKeyValues"`;
	setToolTo $ctx;

The user it was written for actually needed this to adjust the position, not the rotation. To use the script above with rotation, you'll have to change the following lines the code:
Replace "-t" flags with "-r" and replace "-translateX" "-translateY" and "-translateZ" with "rotateX" (-Y, -Z)
  01 January 2013
Good point, forgot that it goes back when you ungroup. Maybe less tidy, but you won't have to adjust every transform individually. It's not a big deal for a simple object, but if it's a character or something like that, it's definitely useful to have it in a group or parented to something that will allow you to move everything as a whole.
Demo Reel 2012-13!
  02 February 2013
I don't you only need to add 20 to one bone (controler) on one axis? that's what animation curves are for isn't it..grab your whole animation on the graph editor not the keys but the curve itself and move it up 20 unit..done. takes 10seconds.

but maybe I didn't understand what you're after.

  02 February 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:16 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.