James Ronan
Forum Replies Created
-
There is probably a better way but I’d do it like this:
x = thisComp.layer("Joep").content("Trim Paths 1").end;
linear(x,100,0,100,0); -
James Ronan
January 10, 2017 at 11:06 am in reply to: Wiggle ON/OFF automatically whenever the object moves?Something like this?
pos = transform.position;
frameRate = thisComp.frameDuration /1;if (pos.valueAtTime(time)[0] != pos.valueAtTime(time-frameRate)[0] || pos.valueAtTime(time)[1] != pos.valueAtTime(time-frameRate)[1] ){
wigVal = 10} else {
wigVal = 0;
}wiggle(wigVal,10);
Thanks
-
James Ronan
January 5, 2017 at 11:05 pm in reply to: “Triggering Animation with Markers” modification?Hey Dan!
Yesssss!! This worked great! Thank you so much!
I had to add back in the original line where we declare the ‘action’ variable, but it works!
Working code:
myMarker = thisComp.layer("Other Layer").marker;
action = comp("Other Comp").layer("action");n = 0;
if (myMarker.numKeys > 0){
n = myMarker.nearestKey(time).index;
if (myMarker.key(n).time > time){
n--;
}
}if (n == 0){
0
}else{
m = myMarker.key(n);
myComment = m.comment;
t = time - m.time;
try{
actMarker = action.marker.key(myComment);
if (action.marker.numKeys > actMarker.index){
tMax = action.marker.key(actMarker.index + 1).time - actMarker.time;
}else{
tMax = action.outPoint - actMarker.time;
}
t = Math.min(t, tMax);
actMarker.time + t;
}catch (err){
0
}
}Thanks again!
James
-
James Ronan
December 1, 2016 at 12:36 pm in reply to: Using markers to trigger animation without time-remappingHey
Following on from this… I’m wondering if it is possible to have a second marker in the comp, which does the complete opposite?
So it can get brought on and off again, or vice versa.
Thanks
James
-
Ah Thank you! So simple! This has helped greatly.
Thank you again! -
Ah Yes! that makes sense. Wow thank you so much!
Really helped, thanks a lot Dan
James
-
Hey thanks so much that works! What is the reason for the [0] after myLayers?
Really appreciate the help… but I have one more question (last I promise). After the solid has been moved to correct index, I wanted to change the myLayers (The layer originally selected) Track Matte to Alpha.
I’ve added:
myLayers.trackMatteType = TrackMatteType.ALPHA;However it doesn’t seem to work. I’ve tried a few different lines of code and I think the issue is coming from the .selectedLayers.
This works if I specify the layer:
app.project.activeItem.layer(7).trackMatteType = TrackMatteType.ALPHA;The complete code is now:
var myLayers = app.project.activeItem.selectedLayers;
var newSolid = app.project.activeItem.layers.addSolid([0,1,0], "My First Solid", 1920, 1080, 1.0, 10);if (myLayers.length > 0){
newSolid.moveBefore(myLayers[0]);
myLayers.trackMatteType = TrackMatteType.ALPHA;
}Thanks once again.
James
-
Also, when I said ‘one above’ I was thinking of the timeline and actually meant an index of -1
I’ve been trying to figure it out and I think that because once you add a new solid, the selected layer index is going to change +1
so far this what i’ve wrote but it isn’t working.
newSolid.index = (layerIndex[0].index - 1); -
Thanks a lot Dan! That works perfectly! One more Question…
when the button clicks I also have a variable that creates a new solid:
var newSolid = app.project.activeItem.layers.addSolid([0,1,0], "My First Solid", 1920, 1080, 1.0, 10);It automatically puts the solid at the top (Index 1) What I’d like it to do is add it one above the selected layer…
So far I’ve tried a few combinations but nothing is working.
Any suggestions?
Thank you again!!
James
-
James Ronan
February 3, 2016 at 4:45 pm in reply to: Math.ceil finding the highest value of a key framed property over entire composition?Wow! Yes, That is perfect!
This works brilliantly! Thank you so much!