Page 1 of 1

Camera Auto-Orientation Off

Posted: November 29th, 2016, 12:34 pm
by eddieyepez
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

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 1:02 pm
by beginUndoGroup
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

 

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 1:06 pm
by runegan
You can use the AutoOrientType object, see the docs for more info: http://docs.aenhancers.com/avlayer/#avlayer-autoorient

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 2:21 pm
by eddieyepez
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?

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 2:22 pm
by eddieyepez
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?

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 2:44 pm
by runegan
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.

Re: Camera Auto-Orientation Off

Posted: November 29th, 2016, 2:55 pm
by eddieyepez
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.

Re: Camera Auto-Orientation Off

Posted: November 30th, 2016, 2:13 am
by beginUndoGroup
Humm, sorry.
I misstyped the first and copied/pasted endlessly the same mistake.

Xavier

Re: Camera Auto-Orientation Off

Posted: November 30th, 2016, 8:28 am
by eddieyepez
Thank you Xavier, you guys have been very helpful.