Search found 461 matches

by lloydalvarez
May 6th, 2010, 7:01 am
Forum: Scripts Discussion
Topic: localizing variables in script UI
Replies: 4
Views: 9981

Re: localizing variables in script UI

Hey Mike, You can do exactly what you describe by doing what I was saying. Just declare the object in the main body of the script and it will be a global variable to your script. No need to pass it explicitly to your functions. Of course it will be a global variable across all scriptUI scripts like ...
by lloydalvarez
May 5th, 2010, 2:53 pm
Forum: Scripts Discussion
Topic: localizing variables in script UI
Replies: 4
Views: 9981

Re: localizing variables in script UI

Hey Mike

What I do on advice from Jeff Almasol when I asked the same question was to create an object to store global variables and make the object name unique to each script.

Code: Select all

var myScript_Data = new Object ();

myScript_Data.version = 1.0;
myScript_Data.scriptName = "myScript";
Lloyd
by lloydalvarez
May 5th, 2010, 2:39 pm
Forum: Expression Discussion
Topic: color offset and expressions
Replies: 2
Views: 9008

Re: color offset and expressions

Colors are stored in RGB so if you want to adjust the saturation you need to convert the color to HSL first, adjust the saturation then convert it back to RGB. There's built in functions to do both of this convertions.

Lloyd
by lloydalvarez
May 5th, 2010, 5:48 am
Forum: Scripts Discussion
Topic: app.executeCommand for New Comp Problem
Replies: 1
Views: 5989

Re: app.executeCommand for New Comp Problem

Hey Philip app.executeCommand is an unsupported function, or a "private api" as Apple calls them so it's best to avoid using it as there is no guarantee that it will work. I use it only when there is not other option. In the case of New Comp from selection, it is very easy to do that throu...
by lloydalvarez
May 5th, 2010, 5:39 am
Forum: Scripts Discussion
Topic: Copying a file from a remote or server location
Replies: 2
Views: 6968

Re: Copying a file from a remote or server location

Hi Adam,

You can use my Batch Search and Replace Paths script to see how AE sees a path. Import the file you would like to know the path of into AE and run the script in Test mode with the XML option off. This will generate a text log file which will show you the path the way AE sees it.

Lloyd
by lloydalvarez
April 22nd, 2010, 1:19 pm
Forum: Script requests
Topic: Split Video Automatically Based on Criteria
Replies: 7
Views: 16538

Re: Split Video Automatically Based on Criteria

Expressions are evaluated on a per-frame basis so there is no easy way for it to know the result of the previous frame. You would need to keep the black frame count in the script which requires a bit more involved code. If you want me to do this for you please contact me directly. You can get my ema...
by lloydalvarez
April 21st, 2010, 1:20 pm
Forum: Script requests
Topic: Split Video Automatically Based on Criteria
Replies: 7
Views: 16538

Re: Split Video Automatically Based on Criteria

It's a much simple expression just to detect a black frame: myExpEffect.property("Slider").expression = "p=[width/2,height/2];\n " + "s=sampleImage(p, radius = [width,height], postEffect = true, t = time); \n"+ "c=0; "+ "if ((s[0]+s[1]+s[2]) == 0) { c= 1}...
by lloydalvarez
April 20th, 2010, 11:42 am
Forum: Script requests
Topic: Split Video Automatically Based on Criteria
Replies: 7
Views: 16538

Re: Split Video Automatically Based on Criteria

Hey Adam, Very easy to adapt Magnum to do that. Magnum uses sampleImage() to get an average color for the frame and then compares to the following frame and if it is beyond the threshold different then it creates a cut so you can change that code to look and store 3 frames and compare. The black fra...
by lloydalvarez
April 16th, 2010, 2:59 pm
Forum: Expression Discussion
Topic: Choosing active camera of precomp?
Replies: 3
Views: 12787

Re: Choosing active camera of precomp?

Not sure I follow your question 100% but you can trim your camera layers to change which camera is the active camera in the comp.

-Lloyd
by lloydalvarez
April 16th, 2010, 12:38 pm
Forum: Expression Discussion
Topic: Choosing active camera of precomp?
Replies: 3
Views: 12787

Re: Choosing active camera of precomp?

Code: Select all

thisComp.activeCamera
by lloydalvarez
April 16th, 2010, 12:35 pm
Forum: Expression Discussion
Topic: Coverting timecode to t value
Replies: 3
Views: 11281

Re: Coverting timecode to t value

Code: Select all

currentFormatToTime(formattedTime, fps, isDuration)
On page 16 of the CS3 scripting guide.

-Lloyd
by lloydalvarez
April 16th, 2010, 12:13 pm
Forum: Scripts Discussion
Topic: Very Important CS5 scripting notice!!
Replies: 0
Views: 5296

Very Important CS5 scripting notice!!

If you use osascript in your scripts they will cause a hard crash in CS5 and OSX 10.6.2

To fix the problem you need to prefix it with arch -i386:

Code: Select all

arch -i386 osascript
I strongly urge everyone to update their scripts now before CS5 becomes widespread

-Lloyd