Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesTrainingCreative Cloud DebateFAQ

Odd behavior in random 3D grid expression in CS6

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Chris LoranceOdd behavior in random 3D grid expression in CS6
by on May 18, 2012 at 9:58:54 pm

So I've been trying out Dan Ebbert's "Random Motion grid in 3D" expression from http://www.motionscript.com/mastering-expressions/random-3.html. The expression works perfectly, except for one odd behavior.

When I create a new solid, and then throw trapcode Particular on it, the expression breaks.

"After Effects warning: Class 'global'has no property or method named 'start'
Expression disabled

Error occured at line 30."

The moment I delete particular, I can turn the expression back on and it works fine.

I'm trying to figure out why "start" is ending up being undefined by the simple act of having particular in the comp. I tested the exact same thing in CS5.5 and it works as it should. So I tried a couple different things back in CS6.

0. Expression on Light Works. Adding Particular to a solid = immediate fail, regardless of emitter settings.

1. Expression on Null Works. Add particular to another layer = still works. Use an expression to bind particulars source point to nulls position. = Immediate fail

2. Expression on Null. Bind light to null with parenting, or using expression to copy position. Works. Add particular = Immediate fail

Any ideas how this is happening and if there's a work around? I suppose I could always go back to 5.5, but the challenge demands solving!

Dan Ebberts awesome expresion below:

origin = [10,10,0]; //upper left hand corner of grid
dimX = 8; //number of columns
dimY = 6; //number of rows
dimZ = 6; //number of planes
gap = 255; // distance between cells (pixels)
gridRate = 250; //speed (pixels per second)
holdTime = .2; //(seconds)

end = 0;
j = 0;

while (time >= end){
seedRandom(j,true);
startX = Math.floor(random(dimX))*gap + origin[0];
startY = Math.floor(random(dimY))*gap + origin[1];
startZ = Math.floor(random(dimZ))*gap + origin[2];
j +=1;
seedRandom(j,true)
start = end;
endX = Math.floor(random(dimX))*gap + origin[0];
endY = Math.floor(random(dimY))*gap + origin[1];
endZ = Math.floor(random(dimZ))*gap + origin[2];
deltaX = Math.abs(endX - startX);
deltaY = Math.abs(endY - startY);
deltaZ = Math.abs(endZ - startZ);

end += (deltaX + deltaY + deltaZ)/gridRate + 3*holdTime;
}

p1 = start + deltaX/gridRate;
p2 = p1 + holdTime;
p3 = p2 + deltaY/gridRate;
p4 = p3 + holdTime;
p5 = p4 + deltaZ/gridRate;

if (time < p1){
ease(time,start,p1,[startX,startY,startZ],[endX,startY,startZ])
}else if (time < p2){
[endX,startY,startZ]
}else if (time < p3){
ease(time,p2,p3,[endX,startY,startZ],[endX,endY,startZ])
}else if (time < p4){
[endX,endY,startZ]
}else if (time < p5){
ease(time,p4,p5,[endX,endY,startZ],[endX,endY,endZ])
}else{
[endX,endY,endZ]
}


Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]