Search found 319 matches

by Dan Ebberts
April 11th, 2012, 4:53 pm
Forum: Scripts Discussion
Topic: PC/Mac compatibility
Replies: 3
Views: 3793

Re: PC/Mac compatibility

Just a shot in the dark--on the Mac, do you have the preference set that allows scripts to access the network?

Dan
by Dan Ebberts
March 3rd, 2012, 10:56 pm
Forum: Expression Discussion
Topic: Avoid activeCamera errors by checking if activeCamera exist?
Replies: 2
Views: 4517

Re: Avoid activeCamera errors by checking if activeCamera ex

I think try/catch will work:

try{
thisComp.activeCamera;
(do stuff)
}catch (err){
(do different stuff)
}


Dan
by Dan Ebberts
January 6th, 2012, 12:00 pm
Forum: Expression Discussion
Topic: Evenly distribute layers while being aware of their alpha?
Replies: 2
Views: 5094

Re: Evenly distribute layers while being aware of their alph

This assumes that your letters are consecutive layers, with the leftmost layer being on top. Add a slider named "Width" to all the letters and add this expression to it: for (i = width; i >= 0; i--){ temp = sampleImage([i,thisComp.height/2],[0.5,thisComp.height/2],true,time); if (temp[3] > 0) break;...
by Dan Ebberts
January 3rd, 2012, 8:14 am
Forum: Expression Discussion
Topic: Animated Mask by music
Replies: 1
Views: 3828

Re: Animated Mask by music

One thing you could do is to keyframe the mask path (at its minimum size) at time zero, move down the timeline as many frames as the maximum amplitude of your audio and set the mask path there to its maximum height. Then add an expression like this to the Mask Path: s = thisComp.layer("Audio Amplitu...
by Dan Ebberts
December 13th, 2011, 6:53 pm
Forum: Scripts Discussion
Topic: Check if layer is a light
Replies: 2
Views: 3011

Re: Check if layer is a light

This should work:

if (myLayer instanceof LightLayer)


Dan
by Dan Ebberts
November 23rd, 2011, 6:58 pm
Forum: Expression Discussion
Topic: Trigger expressions by luminance of another layer?
Replies: 9
Views: 8914

Re: Trigger expressions by luminance of another layer?

My mistake. The calculation of P needs to include the time element as well: sampleSize = [10,10]; L = thisComp.layer("Your Black and White Layer"); t = inPoint; while (t < time){ P = L.fromComp(toComp(anchorPoint,t),t); lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,t))[2]; if (lum > .95) break; t...
by Dan Ebberts
November 23rd, 2011, 7:22 am
Forum: Expression Discussion
Topic: Trigger expressions by luminance of another layer?
Replies: 9
Views: 8914

Re: Trigger expressions by luminance of another layer?

It's pretty much the same issue. In this case, you'll have to start at the In Point and move forward, frame-by-frame, to find how long it has been since the first occurance of the luminance event you want to trigger the rotation. sampleImage() has a time parameter you can use for this. It will look ...
by Dan Ebberts
November 23rd, 2011, 12:57 am
Forum: Expression Discussion
Topic: Trigger expressions by luminance of another layer?
Replies: 9
Views: 8914

Re: Trigger expressions by luminance of another layer?

I assume that you would want the wiggle to match the amplitude it had right before it went off the edge. That wouldn't be simple, because I think you'd have to loop back frame-by-frame to find that event. Do-able, but not simple.

Dan
by Dan Ebberts
November 22nd, 2011, 8:50 pm
Forum: Expression Discussion
Topic: Trigger expressions by luminance of another layer?
Replies: 9
Views: 8914

Re: Trigger expressions by luminance of another layer?

This should work:

Code: Select all

freq = 1;
amp = 25;
sampleSize = [10,10];
L = thisComp.layer("Your Black and White Layer");
P = L.fromComp(toComp(anchorPoint));
lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time))[2];
wiggle(freq,amp*lum)

Dan
by Dan Ebberts
November 17th, 2011, 9:44 am
Forum: Script requests
Topic: Question on vectors and trigonometry
Replies: 2
Views: 4225

Re: Question on vectors and trigonometry

You just need to use layer space transforms to bind your puppet pins to your nulls. Like this:

fromWorld(thisComp.layer("Null 1").toWorld([0,0,0]))

That way your pins will stick to the world position of the nulls, even if the nulls have parents.

Dan
by Dan Ebberts
November 17th, 2011, 9:32 am
Forum: Expression Discussion
Topic: Angle Control
Replies: 2
Views: 4338

Re: Angle Control

Something like this should work:

a = effect("Angle Control")("Angle")%180;
a < 90 ? linear(a,0,90,0,100) : linear(a,90,180,100,0)


Dan
by Dan Ebberts
November 12th, 2011, 8:37 am
Forum: Expression Discussion
Topic: how to use a null as a "magnetized" constraint?
Replies: 4
Views: 5040

Re: how to use a null as a "magnetized" constraint?

Hi Lorelei,

Would it be possible for you to zip up your little demo project and send it to me? I think that's the only way I'll be able to figure out what's going on. You can contact me through the main page of my web site.

Dan
by Dan Ebberts
November 11th, 2011, 9:03 pm
Forum: Expression Discussion
Topic: how to use a null as a "magnetized" constraint?
Replies: 4
Views: 5040

Re: how to use a null as a "magnetized" constraint?

I assume you've seen this page: http://www.motionscript.com/design-guide/ik.html That's pretty much how it works-- if you move the torso, the effectors remain stationary and will act like tethers (unless you parent the effectors to the torso). If that's not what you're after, maybe you could post an...
by Dan Ebberts
November 6th, 2011, 2:34 pm
Forum: Scripts Discussion
Topic: looking for all keyframes
Replies: 4
Views: 4114

Re: looking for all keyframes

Any plugin can define custom data. The one that comes to mind is the Histogram parameter of the Levels effects. Any data of that type will have a propertyValueType of PropertyValueType.CUSTOM_VALUE.

Dan
by Dan Ebberts
November 6th, 2011, 12:11 pm
Forum: Scripts Discussion
Topic: looking for all keyframes
Replies: 4
Views: 4114

Re: looking for all keyframes

>... it's just a matter of traversing through the layer's properties (and properties of properties), looking for numKeys ...

That's pretty much it. Keep in mind that you won't be able to access the data for any property that has "custom" data.

Dan