Camera Auto-Orientation Off

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
eddieyepez
Posts: 5
Joined: November 29th, 2016, 10:58 am
Contact:

Hi,
I'm trying to create a camera with a script, but I need the camera Auto-Orientation property to be off. So far the only way I found is this:

Code: Select all

var myCamera = app.project.activeItem.layers.addCamera("theCamera", [0,0]);
myCamera.autoOrient=3612;
The problem is the ID number 3612 is not the same in all version of After Effects.
In CS6 it is 3612 but in CC2015 I believe is 4012.

Is there a better way to create a camera with Auto-Orientation off?

If not, could you tell me the ID number in your version of After Effects? Just select a camera and run this code:

Code: Select all

var myCameraOrient = app.project.activeItem.selectedLayers[0].autoOrient;
alert(myCameraOrient);
In CS6 I get:

3612 : Off
3613 : Orient along Path
3614 : Orient Towards point of interest

Thank you for your help!

Eddie
beginUndoGroup
Posts: 81
Joined: November 27th, 2012, 6:41 am

Use the AutoOrient object:

Code: Select all

myCamera.autoOrient = AutoOrient.NO_AUTO_ORIENT;


Other possibilities are :
AutoOrient.ALONG_PATH;
AutoOrient.CAMERA_OR_POINT_OF_INTEREST;
AutoOrient.CHARACTERS_TOWARDS_CAMERA;

(the last one is only for per-character-3D text layers).

Xavier

 
runegan
Posts: 22
Joined: November 4th, 2016, 3:18 pm
Contact:

You can use the AutoOrientType object, see the docs for more info: http://docs.aenhancers.com/avlayer/#avlayer-autoorient
User avatar
eddieyepez
Posts: 5
Joined: November 29th, 2016, 10:58 am
Contact:

beginUndoGroup wrote:Use the AutoOrient object:

Code: Select all

myCamera.autoOrient = AutoOrient.NO_AUTO_ORIENT;


Other possibilities are :
AutoOrient.ALONG_PATH;
AutoOrient.CAMERA_OR_POINT_OF_INTEREST;
AutoOrient.CHARACTERS_TOWARDS_CAMERA;

(the last one is only for per-character-3D text layers).

Xavier

 
Thank you but I get: AutoOrient is undefined. Any other idea?
User avatar
eddieyepez
Posts: 5
Joined: November 29th, 2016, 10:58 am
Contact:

runegan wrote:You can use the AutoOrientType object, see the docs for more info: http://docs.aenhancers.com/avlayer/#avlayer-autoorient
Thank you Runegan, i did see it in the documentation but either I don't understand how to use it or it doesn't work with cameras, just AV layers.
Would you mind write an example?
runegan
Posts: 22
Joined: November 4th, 2016, 3:18 pm
Contact:

The AutoOrientType object stores the ID for every type of value you can assign to autoOrient. Here is an example of how to use it:

Code: Select all

var myCamera = app.project.activeItem.layers.addCamera("theCamera", [0,0]);
myCamera.autoOrient = AutoOrientType.NO_AUTO_ORIENT;
This will set the autoOrient type to off and will work for every version of AE.
User avatar
eddieyepez
Posts: 5
Joined: November 29th, 2016, 10:58 am
Contact:

runegan wrote:The AutoOrientType object stores the ID for every type of value you can assign to autoOrient. Here is an example of how to use it:

Code: Select all

var myCamera = app.project.activeItem.layers.addCamera("theCamera", [0,0]);
myCamera.autoOrient = AutoOrientType.NO_AUTO_ORIENT;
This will set the autoOrient type to off and will work for every version of AE.
Thank you so much! You really make my day.
beginUndoGroup
Posts: 81
Joined: November 27th, 2012, 6:41 am

Humm, sorry.
I misstyped the first and copied/pasted endlessly the same mistake.

Xavier
User avatar
eddieyepez
Posts: 5
Joined: November 29th, 2016, 10:58 am
Contact:

Thank you Xavier, you guys have been very helpful.
Post Reply