|
| baking camera for export - trouble with 3D rotations! |
 |
Sun, 24 Feb 2008 02:55:49 -080 |
baking the AE camera for export to 3D packages - trouble with 3D rotation
I'm trying to share my AE camera with a number of 3D packages. What often helps
is having a free camera that does not use a POI (target) or parenting before you
export. So I was trying to write an expression to convert all values to global
values to "unparent" my camera. The position so far works fine. I used
Dan Ebberts' 2D Auto Orientation script for the rotations as a starting
point...which works fine one at a time, but not when the the axes are combined.
Does it not work because of the rotation order? Anyone tackled this before?
The layer "c" is my keyframeless child camera layer controlled by a
parent null. Below are the expressions applied to the new free camera.
Position
L=thisComp.layer("c");L.toWorld(L.anchorPoint)
X Rotation
L = thisComp.layer("c");
u = L.toWorldVec([0,0,1]);
-radiansToDegrees(Math.atan2(u[1],u[2]))
Y Rotation
L = thisComp.layer("c");
u = L.toWorldVec([1,0,0]);
-radiansToDegrees(Math.atan2(u[2],u[0]))
Z Rotation
L = thisComp.layer("c");
u = L.toWorldVec([1,0,0]);
|
| Post Reply
|
| Re: baking camera for export - trouble with 3D rotations! |
 |
Sun, 24 Feb 2008 17:47:09 -080 |
Thanks to some direct help from Mr. Ebberts with the 3D rotations, I now have a
script that will bake the AE camera. It shouldn't matter what rotation methods
and parenting the original camera has, as it translates all of that into a free
camera with only position, rotation, and zoom parameters.
All you have to do is set your work area, highlight your camera, and it will
make a copy of it with all the keyframes baked.
There are a number of advantages. Sometimes there is a need to export an AE
camera to a 3D app, and baking the camera usually helps you avoid certain
problems before you export. Also, there is an advantage to seeing the camera
motion path on a free camera that's invisible on a parented one. And, this
script could easily be adapted to remove parenting or auto-orientation on any
layer.
<http://www.urbanspaceman.net/shared/AEscripts/AECameraBake.jsx>
|
| Post Reply
|
|
|
|
|
|
|
|
|
|