Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
User avatar
eddieyepez
Topic Author
Posts: 5
Joined: Tue Nov 29, 2016 10:58 am
Contact:

Camera Auto-Orientation Off

Tue Nov 29, 2016 12:34 pm

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:


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:


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: 75
Joined: Tue Nov 27, 2012 6:41 am

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 1:02 pm

Use the AutoOrient object:


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: 9
Joined: Fri Nov 04, 2016 3:18 pm
Contact:

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 1:06 pm

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

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 2:21 pm

beginUndoGroup wrote:
Use the AutoOrient object:


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
Topic Author
Posts: 5
Joined: Tue Nov 29, 2016 10:58 am
Contact:

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 2:22 pm

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: 9
Joined: Fri Nov 04, 2016 3:18 pm
Contact:

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 2:44 pm

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:

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
Topic Author
Posts: 5
Joined: Tue Nov 29, 2016 10:58 am
Contact:

Re: Camera Auto-Orientation Off

Tue Nov 29, 2016 2:55 pm

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:

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: 75
Joined: Tue Nov 27, 2012 6:41 am

Re: Camera Auto-Orientation Off

Wed Nov 30, 2016 2:13 am

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

Xavier
 
User avatar
eddieyepez
Topic Author
Posts: 5
Joined: Tue Nov 29, 2016 10:58 am
Contact:

Re: Camera Auto-Orientation Off

Wed Nov 30, 2016 8:28 am

Thank you Xavier, you guys have been very helpful.

Who is online

Users browsing this forum: No registered users and 4 guests