Josh Johnson
Forum Replies Created
-
Thanks again Dan!
It totally worked. This is what I came up with.Totally useful for me. Buddy thought it was useful as well. Prolly gonna save this out as a preset and post it on my site. I will of course credit you for the help.
– Josh
//// LILSMOKIES PARENT SWAP /////* Should you wish to have an expression
before applying the parent expression
plug the result into the orgValue. */orgValue = position;
// method chooser
chkBox = effect("Select Relative to Original")("Checkbox");
if (chkBox==true) {
Sldr = effect("Select Relative")("Slider");
if (Sldr.numKeys > 0) {
ValueHOLD ();
main (index, orgValue);
} else {
position;
}
} else {
Sldr = effect("Select by Index")("Slider");
if (Sldr.numKeys > 0) {
ValueHOLD ();
main (0, orgValue);
} else {
position;
}
}function ValueHOLD () {
nearSldrKey = Sldr.nearestKey(time);
sldrSub = nearSldrKey.index-1;
if (nearSldrKey.time > time){
// catch weird error
if (sldrSub==0){
recentKey = Sldr.key(nearSldrKey.index);
} else {
recentKey = Sldr.key(sldrSub);
}
} else {
recentKey = Sldr.key(nearSldrKey.index);
}
return recentKey;
}function main(childINDX, posVALUE) {
// need to create a loop
// fix first pass//orgValue = valueAtTime(time);
newPos = posVALUE;
for (i=1;i<=recentKey.index;i++) {
sldrKey = Sldr.key(i);
if (i > 1) {
preSldrKey = Sldr.key(i-1);
prntEnd = thisComp.layer(childINDX+preSldrKey.value).transform.position.valueAtTime(sldrKey.time);
if (thisComp.layer(childINDX+preSldrKey.value).index == thisLayer.index) {
prntEnd = thisComp.layer(childINDX+preSldrKey.value).transform.position.valueAtTime(0);
}
newPos = posDiff+prntEnd;
// previous key first then current key
prntStart = thisComp.layer(childINDX+sldrKey.value).transform.position.valueAtTime(sldrKey.time);
if (thisComp.layer(childINDX+sldrKey.value).index == thisLayer.index) {
prntStart = thisComp.layer(childINDX+sldrKey.value).transform.position.valueAtTime(0);
}
posDiff = newPos-prntStart;
newPos = posDiff+prntStart;
} else if (thisComp.layer(childINDX+sldrKey.value).index == thisLayer.index) {
prntStart = thisComp.layer(childINDX+sldrKey.value).transform.position.valueAtTime(0);
var posDiff = newPos-prntStart;
newPos = posDiff+prntStart;
}else {
prntStart = thisComp.layer(childINDX+sldrKey.value).transform.position.valueAtTime(sldrKey.time);
var posDiff = newPos-prntStart;
newPos = posDiff+prntStart;}
}prntPos = thisComp.layer(childINDX+recentKey.value).transform.position;
if (thisComp.layer(childINDX+recentKey.value).index == thisLayer.index) {
prntPos = thisComp.layer(childINDX+recentKey.value).transform.position.valueAtTime(0);
}
activPos = posDiff+prntPos;if (position.value.length==3) {
return [activPos[0],activPos[1],activPos[2]]
//return [activPos[0],activPos[1],posDiff[0]]
} else {
return [activPos[0],activPos[1]]
}
} -
Thank You! This makes total sense.
But also, ugh. Ok brains here we go.
Thanks for looking at it. I will update as soon as I have something.
-
Hi there Dan,
I found this thread after a few failed attempts at making an expression that can switch the parent.
So I am messing around with this expression on the position property. I am wondering if this can even work.What I need is an expression that can hold the altered position value after the layer is “switched”.
I am using a slider with hold keyframes to jump through index of my layers.
Currently the “child layer” jumps when I keyframe to the next layer.I actually have several problems with the current expression but I feel if I can get past this hurdle I will be well on my way.
I hope you can help.
Thanks,
– Joshpicker = Math.round(effect("IndexSelector")("Slider"));nearSldrKey = effect("IndexSelector")("Slider").nearestKey(time);
sldrSub = nearSldrKey.index-1;
if (nearSldrKey.time >= time){
// catch weird error
if (sldrSub==0){
recentKey = effect("IndexSelector")("Slider").key(nearSldrKey.index);
} else {
recentKey = effect("IndexSelector")("Slider").key(sldrSub);
}
} else {
recentKey = effect("IndexSelector")("Slider").key(nearSldrKey.index);
}pos = thisComp.layer(picker).transform.position.valueAtTime(recentKey.time-0.001);
prntPos = thisComp.layer(picker).transform.position;
origionalPos = valueAtTime(recentKey.time);
posDiff = origionalPos-pos;
newPos = posDiff+prntPos;[newPos[0],newPos[1]]
-
This does not work.
-
Josh Johnson
December 21, 2011 at 4:21 pm in reply to: Multiple Illustrator paths to After Effects Solids with paths (or shape layers).Still looking for a solution to this.
Does anyone have ideas? -
Josh Johnson
December 19, 2011 at 7:23 pm in reply to: Multiple Illustrator paths to After Effects Solids with paths (or shape layers).HAHA!
That is dead on sir. -
Josh Johnson
December 16, 2011 at 11:36 pm in reply to: Multiple Illustrator paths to After Effects Solids with paths (or shape layers).I want to be able to animate all of the paths in After Effects.
-
*sob* I really need this black and white fake z-depth maker thing. Real bad!
-
I found that plugging a slider and the existing rotation of OBJ.a into a math add node and then taking the output of that back into the rotation of OBJ.a creates a nice loop that give you the ability to accelerate to a constant speed with a slider and decelerate to a stop.
-
I am also needing something like this.
But I have a little catch. I need to be able to speed it up and slow it down to a stop. Like a gas pedal.From what I see the time effector does not allow for this if you keyframe the rotation to 0 or the strength to 0 then instead of stopping it reverses the effect until it returns to its original rotation.
I am thinking the solution is in xpresso tho not with the multiply node.