PDA

View Full Version : Bake Cameras script problem.... Help!


Genesis
02-12-2008, 02:41 AM
Hi Guys, I am trying to make a script to bake a camera motion from a 3 point camera to a normal camera.

Here is what I have,


$select = `ls -sl`;

bakeResults -simulation true -t "1:300" -hierarchy below -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys true -sparseAnimCurveBake false -controlPoints false -{$select};

copyKey;

camera;

pasteKey;



This however gives me an error, I am not sure why?

when I just use:

bakeResults -simulation true -t "1:300" -hierarchy below -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys true -sparseAnimCurveBake false -controlPoints false -shape true {"camera1"};

copyKey;

camera;

pasteKey;


it works, however when it try and make it work on 'selected' and not the defined camera it does not work.

Also, I am currently setting the frames to 300 because I am not sure how to get it to recognize the timeslider, any ideas?

Any help I could get would be awesome, it is rare that I script and I am sure most of this stuff is pretty simple.

Thanks again,

rxgeez
02-12-2008, 04:26 AM
The line should be:

bakeResults -simulation true -t "1:300" -hierarchy below -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys true -sparseAnimCurveBake false -controlPoints false $select[0];


To get the time you could do something like this:

$n = `playbackOptions -q -min`;
$x = `playbackOptions -q -max`;
string $time = ("\"" + $n + ":" + $x + "\"");

$select = `ls -sl`;
eval ("bakeResults -simulation true -t " + $time + " -hierarchy below -sampleBy 1 -disableImplicitControl true -preserveOutsideKeys true -sparseAnimCurveBake false -controlPoints false " + $select[0]);

copyKey;
camera;
pasteKey;

Hope this helps

-k

Genesis
02-12-2008, 09:19 PM
THANKS HEAPS!!!

That is awesome, I will have to work backwards and get my head around the changes.

Once again, thanks, you have saved me doing this manually over, and over, and over.... again :P

you rule.

CGTalk Moderation
02-12-2008, 09:19 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.