James Ronan
Forum Replies Created
-
Dan! Amazing!
This is working great! and if I change:
numImages = 5;to
numImages = thisLayer.source.numLayers;Then I don’t need to update every time I add a new image in.
Thanks for the speedy reply!
James
-
James Ronan
January 22, 2018 at 3:08 pm in reply to: Offset timing of 3rd and 4th Keyframe via sliderSOLVED!
After more searching I’ve found an old post with something that will work:
Instead, this uses a slider to hold the values between 2nd and 3rd keyframes…
holdTime = effect("Slider Control")("Slider");
k1 = 2; // 1st hold keyframe
k2 = 3; // 2nd hold keyframe
p = transform.position;
t1 = p.key(k1).time;
t2 = t1 + holdTime;
if (time < t1)
t = time
else if (time < t2)
t = linear(time,t1,t2,t1,p.key(k2).time)
else
t = p.key(k2).time + (time - t2);
valueAtTime(t)The old post for reference:
https://forums.creativecow.net/thread/227/18402 -
James Ronan
October 2, 2017 at 2:33 pm in reply to: Find the Master Composition from a precomp ( Extendscript )Hey Dan,
Thanks again for your previous help, alas I’ve another question relating to the usedIn attribute …
Using the attribute creates an array of what compositions an object is used in, but can it show you what the layer index is, of that item in that composition?
E.g. if I right click on an item in the Project panel, and click “Reveal in Composition”, it will show me the composition, the layer index, and the name of the layer.
Specifically, I’m looking for its index in that composition. So is the usedIn attribute still the way to go, or is there something else that could work?
Thanks!
James
-
James Ronan
July 6, 2017 at 3:27 pm in reply to: Find the Master Composition from a precomp ( Extendscript )Amazing!
That was just what I was looking for. Thanks, Dan!
-
Ah I see how it works now. Perfect!
Thanks a lot, Dan!!
-
James Ronan
June 23, 2017 at 8:51 am in reply to: How to find the index of a nested comp in it’s parent comp?Almost!
index = comp(“Parent Comp”).layer(“Child Comp”).index;
Replace Child Comp with whatever your precomp is named.
-
After trawling through the forums I’ve modified an expression that Dan Ebberts wrote a few years ago and it is ALMOST working!!
It now works on position and scale… just not for rotation.
This is my version of the expression:
//For Start Pin at the center top of the bounding box
L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width/2,rect.top])[0];
y = L.toComp([rect.top+rect.width/2,rect.top])[1];[x,y]
//For End Pin at the center top of the bounding box
L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width/2,rect.top+rect.height])[0];
y = L.toComp([rect.top+rect.width/2,rect.top+rect.height])[1];[x,y]
Any suggestions welcome 🙂
-
Thanks a lot Xavier! That’s exactly what I did.
There is probably a better way, but this is what I got working:
//Selects Layers
var myLayer = app.project.activeItem.selectedLayers;
var myLayerIndex = new Array();//Stores selected Layers in Array
for (i = 0; i < myLayer.length; i++) {
myLayerIndex.push(myLayer[i].index)
}//Selects Layers in comp
var selLayers = app.project.activeItem.layers;
//Loops through deselecting them
for (var j = 1; j <= selLayers.length; j++) {
selLayers[j].selected = false;
}//Selects targer layer from stored selection
var targetLayer = app.project.activeItem.layer(myLayerIndex[1]);targetLayer.selected = true;
//Applies command to selected layer
app.executeCommand(10310);
app.executeCommand(20);//updates targetLayer variable is now the newly created layer.
targetLayer = app.project.activeItem.layer(targetLayer.index - 1);//mattedLayer is original second selected layer
var mattedLayer = app.project.activeItem.layer(myLayerIndex[0] + 1);Thanks for your help!
James
-
James Ronan
January 13, 2017 at 8:25 pm in reply to: Wiggle ON/OFF automatically whenever the object moves?Do you mean it wiggles along X and Y only when your moving along the Y axis, or it only wiggles on Y regardless of what axis your moving in?
-
James Ronan
January 13, 2017 at 2:25 pm in reply to: Start Rotation Throw Expression at specific timeI would do it like this:
action = 3; // begin time for animation in secondsif (time>action){ // Spin (rotate at a constant speed without keyframes)
veloc = 360; //rotational velocity (degrees per second)
r = rotation + (time - inPoint) *veloc;
[r] } else{value};