ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: sampleImage + Trapcode Particular - If sample area is not a specific color, emit particles

COW Forums : Adobe After Effects Expressions

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


Filip Vandueren
Re: sampleImage + Trapcode Particular - If sample area is not a specific color, emit particles
on Oct 20, 2018 at 10:09:27 pm

Personally, I would leave the layer stationary and animate the Emitter's position, not the entire layer.

For some reason just comparing samplecolor to [0,0,0,0] doesn't work, hence the toSource and extra quotes. The spaces between the comma's matter too…

for troubleshooting or finding out the perfect color-numbers for your case:
plug a sampleImage() into the sourceText of a text-layer, that way you can see the actual values.

good luck.

l=thisComp.layer("target");
// first do some voodoo to get parented, scaled, or not precisely aligned layers to work seamlessly
p=l.fromComp(thisLayer.toComp(anchorPoint));

// sample th target layer
sampleColor = l.sampleImage(p , radius = [3, 3], postEffect = true, t = time);

if (sampleColor.toSource()=="[0, 0, 0, 0]") { // change this to your color value
0;
} else {
1000;
}




Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]