Search found 320 matches
- April 20th, 2012, 2:46 pm
- Forum: Script requests
- Topic: Automatically create an elliptical mask
- Replies: 1
- Views: 12326
Re: Automatically create an elliptical mask
This should add an elliptical mask to the selected layer: myLayer = app.project.activeItem.selectedLayers[0]; ratio = .5523; h = myLayer.width/2; v = myLayer.height/2; th = h*ratio; tv = v*ratio; newMask = myLayer.Masks.addProperty("ADBE Mask Atom"); newMask.maskMode = MaskMode.ADD; myProp...
- April 11th, 2012, 4:53 pm
- Forum: Scripts Discussion
- Topic: PC/Mac compatibility
- Replies: 3
- Views: 9000
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
Dan
- March 3rd, 2012, 10:56 pm
- Forum: Expression Discussion
- Topic: Avoid activeCamera errors by checking if activeCamera exist?
- Replies: 2
- Views: 10089
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
try{
thisComp.activeCamera;
(do stuff)
}catch (err){
(do different stuff)
}
Dan
- January 6th, 2012, 12:00 pm
- Forum: Expression Discussion
- Topic: Evenly distribute layers while being aware of their alpha?
- Replies: 2
- Views: 10741
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] >...
- January 3rd, 2012, 8:14 am
- Forum: Expression Discussion
- Topic: Animated Mask by music
- Replies: 1
- Views: 8243
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 Am...
- December 13th, 2011, 6:53 pm
- Forum: Scripts Discussion
- Topic: Check if layer is a light
- Replies: 2
- Views: 7209
Re: Check if layer is a light
This should work:
if (myLayer instanceof LightLayer)
Dan
if (myLayer instanceof LightLayer)
Dan
- November 23rd, 2011, 6:58 pm
- Forum: Expression Discussion
- Topic: Trigger expressions by luminance of another layer?
- Replies: 9
- Views: 22322
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...
- November 23rd, 2011, 7:22 am
- Forum: Expression Discussion
- Topic: Trigger expressions by luminance of another layer?
- Replies: 9
- Views: 22322
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 ...
- November 23rd, 2011, 12:57 am
- Forum: Expression Discussion
- Topic: Trigger expressions by luminance of another layer?
- Replies: 9
- Views: 22322
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
Dan
- November 22nd, 2011, 8:50 pm
- Forum: Expression Discussion
- Topic: Trigger expressions by luminance of another layer?
- Replies: 9
- Views: 22322
Re: Trigger expressions by luminance of another layer?
This should work:
Dan
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
- November 17th, 2011, 9:44 am
- Forum: Script requests
- Topic: Question on vectors and trigonometry
- Replies: 2
- Views: 9655
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
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
- November 17th, 2011, 9:32 am
- Forum: Expression Discussion
- Topic: Angle Control
- Replies: 2
- Views: 9978
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
a = effect("Angle Control")("Angle")%180;
a < 90 ? linear(a,0,90,0,100) : linear(a,90,180,100,0)
Dan
- November 12th, 2011, 8:37 am
- Forum: Expression Discussion
- Topic: how to use a null as a "magnetized" constraint?
- Replies: 4
- Views: 11995
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
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
- November 11th, 2011, 9:03 pm
- Forum: Expression Discussion
- Topic: how to use a null as a "magnetized" constraint?
- Replies: 4
- Views: 11995
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...
- November 6th, 2011, 2:34 pm
- Forum: Scripts Discussion
- Topic: looking for all keyframes
- Replies: 4
- Views: 10270
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
Dan