Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all 47983 articles
Browse latest View live

toComp is not working correctly for Particular and Element 3d (pics included to demonstrate problem)

$
0
0

So, Im using AE CS6. The two plugins concerned are Element 3d and Trapcode Particular.

Im going to include alot of information since I'm not sure what would come in handy to know to solve this.

 

The final goal is to have the particle emitter follow the left wing of the object when the object is moved using the null named 'Scythe'. (See first photo)

'Scythe' is the brownish null at the center of the object.

 

I have used the follwing expression line on the Particles X,Y emitter:

thisComp.layer("Element Position 2").toComp([0,0,0]);

 

'Element Position 2' is the green Null you see in this picture, and is also the proper position for the particle emitter.

 

http://i.imgur.com/qtucKAx.png

http://imgur.com/qtucKAx

 

However, when this expression is applied it moves the emitter location. As shown in the following picture.

 

http://i.imgur.com/uSezbYY.png

http://imgur.com/uSezbYY

 

The emitter is only in the proper location on the first frame (first pic), on the second frame (second pic) and every frame afterwards, it is elavated to another position.

 

Can someone help me correct the new position without manually adjusting the ([0,0,0]) value in the expression line?


Source Text slider apparition

$
0
0

Hi,

 

I would like to use a slider to display a text (when the slider value is 0, the source text display nothing, when it is 10, the source text display the 10 first letters etc...). Like the Typewriter animation effect (but I need it with a Source Text expression)

 

 

I created a slider named "TextSlicer"

Wrote a text layer

And this expression in Source Text :

 

try

{

text.sourceText.split("")[Math.round(effect("TextSlicer")("Slider"))] 

}

catch(err)

{text.sourceText }

 

 

With this expression, I can display one letter at time.

 

My goal would be to display N letters, based on the slider value :

text.sourceText.split("")[0] + text.sourceText.split("")[1] + text.sourceText.split("")[2] + text.sourceText.split("")[n] ............

 

 

 

 

 

Thanks !

Parsing number text string to numeric value

$
0
0

If I have the number "5" as a text layer, how can I get another text layer to read that number, and then add another number to it?

 

This gives me "56". I want "11".

 

temp = thisComp.layer("5").text.sourceText.value;

(temp + 6)

Expression for image replacement depending on text layer text.

$
0
0

Hello, i wanted to ask is it possible to replace image in composition depending on text layer text. I.E. text layer contains code ##34 and expression tells what kind of image should be placed depending on if conditions in image expression.

Sincerely, Deimantas

Smooth my wiggle!

$
0
0
Hey all!

I am wiggling a Null position as an emitter for Particular. However, the resulting wiggle is pretty jaggy.

I found Dan's smoothing function:
temp = thisComp.layer("Null 11").transform.position.smooth(1);
[temp[0], temp[1]]

But it only make my streaks smaller, not smoother. They are just as angular as before.

Photobucket

Numbers expression - add letter "B" for billions

$
0
0

I have a question for Dan Ebberts.   Dan, the expression you have for a text layer for  numbers (see below)  I wanted to see if it's possible to add a letter at the end of the expression such as the letter B to represent Billions so that the final number count would be $1.7B.  I appreciate any help you can provide

 

Best Regards

 

Ira

 

numDecimals = 1;

commas = true;

dollarSign = true;

beginCount = 0;

endCount = 1.7;

dur = .5;

 

t = time - inPoint;

s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

 

prefix = "";

if (s[0] == "-"){

  prefix = "-";

  s = s.substr(1);

}

if(dollarSign) prefix += "$";

 

if (commas){

  decimals = "";

  if (numDecimals > 0){

    decimals = s.substr(-(numDecimals + 0));

    s = s.substr(0,s.length - (numDecimals + 0));

  }

  outStr = s.substr(-s.length, (s.length-1)%3 +1);

  for (i = Math.floor((s.length-1)/3); i > 0; i--){

    outStr += "," + s.substr(-i*3,3);

  }

  prefix + outStr + decimals;

}else{

  prefix + s;

}

Can I link a path vertex to a position property via an expression?

$
0
0

I want to have curves and lines draw across or between points in a video clip that has hand held camera moves in it.

 

I've motion tracked the points I want to use and assigned the tracking data to a null at each point. Ideally I'd like to then link a vertex in a shape path to a null so I can have a stroke animate in and join up the tracked points and then the vertices can "stick" with the video as it draws on.

 

It's not possible to stabilise the shot animate then "de-stabilise" the shape layer as there's some parallax as the camera turns through a small angle.

 

There's a couple of Tuts that suggest work arounds, such as using the Beam or Path Text (dots and dashes) effects on a solid layer as they have vertexes that can be pickwhipped to position properties. I then have to use multiple layers and timings to create the illusion of a single line moving through the space.

 

There's also a RotAE script that I've come across:

http://www.fxfx.org/index.php/2011/03/27/how-to-attach-a-mask-point-to-a-layer-in-after-ef fects/

 

However I wanted to check if it's actually impossible and these workarounds are the only options?

Varying Speed Of Fractal Noise Ocean Waves With Expressions

$
0
0

Hi,

 

Possible Noob question:

 

I've been following:

  http://allbetsareoff.com/2009/06/ocean-water-effect/

 

The video results are here: http://vimeo.com/5384704

 

He uses the Fractal Noise plug-in to make the water and the sky. Starting at 9:45 or so he talks about using an Expression in the 'Offset Turbulence' to create a certain 'speed' of the water.

 

Programming variables I understand, but I am a total noob when it comes to AE expression variables. The expression he uses is:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time*190]

 

So it seems like varying the number 190 increases or decreases the speed of the waves.

 

What I would like to do is have the speed -accelerate- over time. The entire video is going to be prox. 3:25. I was hoping there was something akin to keyframes I could use to make it -very- slow in the beginning, then at a certain point, quicken, then at another point -really- speed up and then finally, slow down again... independent of the sky.

 

If this is not easily done, I suppose I can render the sky and water separately and use keyframes in Premiere to speed up/slow down, but I figured I'd use this as a learning opportunity.

 

SO: Is there a way to assign a variable to that 'constant' value (190) which is based on the time position? Pseudo Code:

 

X = effect("Fractal Noise")("Offset Turbulence")[0];

[X, time* if(CurrentPositionInSeconds<200) ? 190 : 60]

 

Ideas?

 

TIA,

 

---JC


zoomable map like Google maps

$
0
0

Hi everybody,

 

I started a discussion a few weeks days about the zoom of vector based elements – some things worked but there's one main problem left.


In my current project I need to find out how create a zoom like in this example of a map.

Here the continent is scaling while the typography has a consistent size at any zoom factor.

 

In my last discussion you helped me a lot with an expression but it's not working for this case. I have an example uploaded here that shows what I mean. The "pipe" outline keeps its size with the help of an expression although the camera is moving towards it. That works great.
For the "object" I cannot use the expression because it has different attributes. But it also should have the same size at any time. At the moment it's scaling The expression doesn't seem to work for vector based elements, could it be?

 

Can you please help me out? Would be so great!

 

Thanks for any help!

Expression to create even distances

$
0
0

Hi,

i want to add a control value (220) to the x-pos of my layer.

i want to define the x-positions of my layers automatically.

My master layer, containing the initioal x-pos, has its x-pos at 320.

Now for the next layers, with an expression, i each want to use the x-pos of the preceeding layer + add a control value of 220. So they distribute in x-pos by 220 distance between each other.

How is this to be done ?

 

http://files.2he.com/uploads2/2014_02_14_12_56_08.jpg

 

Regards,

Frank

Nested comp targeting element in a layer present in the containing comp..?

$
0
0

I am wanting to source the text for a Text layer with the following (as used by the pickwip)

 

thisComp.layer("Name of Layer")

 

However I would like to make a text style-template (as a comp, so I can use it in other comps) and then have custom text in those main comps which the template would use for the text in those instances.

 

So how do I target a layer in the main comp (maybe with a predefined name)?

 

Or is there a better way to do this?

 

Thanks

Adding wiggle a property that already has expression?

$
0
0

I have a pretty simple expression that connects a layer's X scale to a slider.

 

temp = thisComp.layer("Tag4").effect("Slider Control")("Slider");

[temp, value[1]]

 

How would I add a wiggle to this?

 

I tried this:

 

temp = thisComp.layer("Tag4").effect("Slider Control")("Slider");

wig = wiggle(1,10)

s = temp + wig

[s, value[1]]

 

But got an error (I guess because wiggle contains an array?)

 

I'd appreciate some suggestions.

Random Frame Time Remap Expression

$
0
0

I work with a lot of hand-drawn loops and I'm curious about expressions that can randomize the frame playback of image sequences using the time-remapping property. 

 

For example, in traditional hand-drawn animation when you wanted to hold a pose without the animation looking static you would create what's called a traceback, which means you would physically trace at least 8 frames of the same drawing and then shoot them over and over again in a random order for however long you needed to hold the pose.  That way you don't get the exact same pattern of frames cycling over and over like you would if you just looped it.

 

Of course you can manually reorder frames in After Effects, but it's very time-consuming and I'm wondering if an expression could be written that could easily be modified for different sequences at different timings and different lengths.  For instance, I found this expression by Filip Vandueren on the Creative Cow website http://forums.creativecow.net/thread/227/12413  It was intended to randomize a 5 frame sequence, however the sequence and the comp have to be at the same frame-rate in order for it to work.  Therefore, I have to work at a 12fps sequence in a 12fps comp if I want the animation to look like it was shot on 2s.  Usually a 12fps sequence with no time remap expressions will play back on 2s if it's in a 24fps comp and as far as I can tell using time stretch or posterize time doesn't work.  Time stretch does nothing and posterize time crashes after effects when I add it to the image squence with the expression applied to the time-remapping property.  This probably has something to do with an expressions conflict that happens once time remapping is applied to the image sequence.  Anyhow, I'm asking if there's a way to modify this expression so that I could put my footage into a comp at another frame rate and use the expression itself to tell it to play at either 8fps, 12fps or any other frame rate.

 

This is Filip Vandueren's expression

 

seedRandom(1,true);

var t=timeToFrames();

var r1=-3;

var r2=-2;

var r3=-1;

for (var i=0;t>=i; i++) {

   var r3=Math.floor(random(5));

   if (r1==r3 || r2==r3) {

      t++;

      continue;

   }

   r1=r2;

   r2=r3;

}

framesToTime(r3);


This is an expression based on Vandueren's that I tried to modify for an 8 frame image sequence.  It sort of worked but it didn't really achieve what I was looking for.

 

timeRemap

seedRandom(2,true);

var t=timeToFrames();

var r1=-6;

var r2=-5;

var r3=-4;

var r4=-3;

var r5=-2;

var r6=-1;

for (var i=0;t>=i; i++) {

   var r3=Math.floor(random(8));

   if (r1==r3 || r2==r3) {

      t++;

      continue;

   }

   r1=r2;

   r2=r3;

}

framesToTime(r3);

 

The image sequence played all 8 frames randomly without duplicating them, but I still couldn't figure out how to make it play at 8fps or 12fps without conforming the comp frame rate to the frame rate of the image sequence.  Ideally I'd like the expression to determine the frame rate so that I can have it in a comp with other frame rates and not have to worry about disturbing the expression.

 

Reordering random frames is a common thing for 2D animators to do so I'll also file a feature request asking After Effects to add this feature to an existing plug-in or create a standalone plug-in.

List of all expression keyword not included in official documentation

$
0
0

Hi everyone,

 

I came accross a tutorial by Harry Frank of Gray Machine. In this old post he give a tutorial on having dynamic text with an external text file... He is using a keyword wich is often use un C like programming to import classes, which is #include... What surprises me is that the official documentation does not state that keyword. So I was wondering, where could we find a complete reference on the keyword available in the expression engine of After Effect. And is it possible to combine AE Script with Expression? One example would be to find the OS and changing the file system path depending on MAC or PC...

 

Thanks all for your help!

Sway 3D object on Z-axis using slider?

$
0
0

Hi there,

I have multiple objects (side by side) which I would like to sway on the z-axis as if the wind is blowing them.  I already have their anchor points at the top of each object.  I have a few issues:

  1. I have multiple objest which I would like to have random movement on.  I don't want ALL objest to sway to the left, then ALL sway to the right.  Rather I would like them to be somewhat random/organic.
  2. I need to be able to control all of them with a slider...  I would like to be able to turn the sway up and down and ultimately have them all come to rest at a still position (with 0 z-rotation).
  3. A slider would be ideal as I would like them to gradually stop swaying, not just "on" and "off"
  4. There are about 15 objects to sway.  If there is no way to randomize them I would be happy even to make multiple slider controls so that object 1, 4, 6, etc. would be controlled (and have identical movement) by 1 slider, then objects 2,5,7 etc. would be controlled by another, and so on.  I suppose this would simulate randomeness but would not be ideal.  I would like the slider conrol to be dead simple.

Any thoughts?

Thank you very much!

-Stephen


using ActionScript to specify settings in the Hue/Saturation Effect

$
0
0

Hi there,

 

 

I have been trying to write a little action script that sets up a bunch of defaults in the Hue Saturation plug-in but can only get so far.

 

The syntax either falls over or I am missing something here because the same code will work when in After Affects but if I try to run a script from the script UI directory. I get a "property undefined" returned. Uusally you just call the property by name and all is well. In this particularl case though. The only way to access say the "Red channel Saturation" is to have the plug-in in the Red channel pop-up. Ok so it works but not when running an external script.

 

The following does work from within AE but not from the UI scripts directory via the Window menu.

 

currProj = app.project(index).layer(index):

currEffect = currProj.Effects.addProperty("Hue/Saturation");

currEffectProp = currProj.effect("Hue/Saturation");

currEffectProp.masterSaturation.setValue(20);//this call works

currEffectProp.channelControl.setValue(2);//this call works changing the plug-in pane to the Red Channel

 

currEffectProp.redSaturation.setValue(-5); //this returns: "TypeError: undefined is not an object" – yet when run within AE as an expression it works fine???

 

 

Any help would be great – thank you

Expressions from AE CS6 not working in AE CC

$
0
0

We have used some expressions in an AE CS6 project to fill text from an external file. Here's an example:

 

try{

/* "mypath" must be absolute to data file */

myPath = "file:////nynfile1/Production/Egg/Marque/data.txt";

$.evalFile(myPath);

/* Use [0,1,2] for array offset value(Name, Date, Time)*/

eval(thisComp.name)[0];

}catch(err){

/* Display if data error found*/

"text not found";

}

 

 

It works fine in CS6. When we open the file in AE CC, the expressions can't find the data.txt file to pull text from. All we get is the "text not found" error. We stepped through debug and the data.txt file doesn't open/isn't found.

 

What up with that?

AE expression for "length of text layer" for lower thirds nameplate

$
0
0
Hello everyone,

Is there a way to measure the total width (and height) of a text layer, to automatically update the length (and height) of a shape layer? I produce web news segments with 7-15 lower thirds displays for each video. I'm looking for a more efficient way to re-size each nameplate. Currently I manually re-size each shape layer to fit the name. Is there an expression that will update the shape layer, based on the length (in pixels) of the text layer?

See an example video of what I'm talking about:
http://dallasvoice.com/dvtv_track.php?s=345
(look for the nameplates that animate in at the beginning of each interview)

I've read everything I can get my hands on, but nothing has helped. Any help would be appreciated!
-RY

Can`t access to gradient colors in shape.

$
0
0

Hi.

Trying to access to gradient colors using expression.

I thought that I can access to them using array, something like this:

 

thisComp.layer("Cubes").content("Group 1").content("Rectangle 1").content("Gradient Stroke 1").colors[0]

 

But it work only for colors[0], rest of them (color[1]. color[2]) doesn`t work at all.

 

Maybe there is another option how to access them?

 

Thanks.

3D WARP/3DBEND: geometry expression no show?

$
0
0

"3D warp" as seen on tv.adobe "What's New", does not seem to be available on my version of CS6 AE (from disk). I'm not getting the geometry option even though,I have the 3D box checked and it is a pixel based layer. I do get the other expression options such as transform and material options. Can anyone help me bend stuff?

Viewing all 47983 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>