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

After Effects Universal Expressions

$
0
0

1. What are universal expressions?

  • I want examples of applications of universal expressions and how to identify non-universal expressions.


  • When my project use non-universal expressions, I can use a plugin called "ExpressionUniversalizer 2" to support all languages.

2. But there's another way to get the result of transforming the non-universal expressions in universal without use the plugin?

 

Please provide me all possible details.

 

I need to create a template that uses expressions and need that the template supports all languages.

 

Thanks!


Expression Evaluation Issue in CC 2015

$
0
0

Hi,

 

I have a script that applies the sampleImage expression to a layer in order to find its boundaries. In all previous versions of After Effects, this script could evaluate a layer in less then a second. In AE CC 2015, the script was failing completely. I found the problem was that the value of the applied script was not being updated fast enough.

 

In order to get things working i have to add a half second delay each time the expression is changed, so a function that used to take half a second now takes almost 2 minutes.

 

Has anyone came accross any similar issues or have any ideas for fixing the problem without hurting the performance so much?

 

Thanks,

Jesse

Problem with sampleImage in After Effects CC 2015 (Extendscript / Expressions)

$
0
0

I'm having a weird problem with a script that adds and utilises an expression containing sampleImage.

 

The script is meant to add a 'Color Control' to the selected layer, sample a particular pixel RGBA value, and use that value.

 

I'm testing this with a pure red solid.

 

Here is the script in a basic form:

 

var myComp = app.project.activeItem;

var selectedLayer = myComp.selectedLayers[0];

 

var addColorControl = selectedLayer.Effects.addProperty("Color Control");

 

var expr = "sampleImage([0,0], [0.5,0.5], true, (time+0));";

addColorControl.property(1).expressionEnabled = true;

addColorControl.property(1).expression = expr;

 

var res = addColorControl(1).value;

$.writeln(addColorControl(1).value);

 

In After Effects 2014, this writes the following to the console:

 

1,0,0,1

 

Which is correct for the red solid.

 

But in After Effects 2015, the exact same script and circumstances (red solid), gives this response:

 

0,0,0,0

 

However, if after I have run the above script I then run this:

 

var myComp = app.project.activeItem;

var selectedLayer = myComp.selectedLayers[0];  

 

var getColorControl = selectedLayer.Effects.property(1);

 

$.writeln(getColorControl(1).value);

 

It prints the correct response to the console:

 

1,0,0,1

 

As I said, it works fine in the previous version of AE (2014), but not in the current version. This not working has just crippled a couple of large scripts I'm using, and it would nice to be able to use them in the latest version.

 

Anyone have any ideas about this?

How to get the footage's current frame number in expression?

$
0
0

There are 2 layers.One is text layer,one is sequence layer.

Footage has begun from the 20th frame.

Therefore, the number of composition's current frame number and footage's frame number has shifted.

 

I want to show footage's frame number in text layer . not composition's frame number.

How to get the footage's current frame number in expression?

 

 

Tatsuya

Track nested child layer's position

$
0
0

Hi,

 

I have a Main Comp with a layer named 'Controller'.I have several 2d layers parented to this controller.

Now,i need to precompose two of them.let's say this precomposition of these two layers is named 'precomp 1'.

How can i parent these two layers in the 'precomp1' to the 'Controller' in the Main Comp again via Expression?

 

Dan,any ideas?

Access property of a subcomp through expressions.

$
0
0

I got a main composition. It got a subcomposition and a null-object(with a control checkbox).

How can I access a layers opacity in the subcomposition throught an expression in the main composition?

The goal would be to reuse the subcomp. Once with a layer visible and another time without.

 

So far I wrote this in the control checkbox:

if(value == 1)

{

comp("subcomp").layer("xy").opacity =100 ;

 

}

else

{

comp("subcomp").layer("xy").opacity =0 ;

}

 

 

I tried also to write an expression directly in the going to be hidden layers opacity:

 

var control  = comp("maincomp").layer("control");

100*control.effect(1).param("SliderControl").valueAtTime(control.time);

 

This actually worked when I toggled the control checkbox manually, but as soon I keyed it, it didnt work anymore.

It was kind of a time conversion problem: It takes the time of the parent but applies it to the subcomp……

 

Thanks for help

Full auto-orient via expression

$
0
0

Hi!

 

I'd like a 3D Null to get the orientation of 3D a layer. (without parenting, it would be too easy )

 

I've tried a lot of solutions, through orientation, rotations, both combined... some results are close, but never perfect.

 

If I'm right, orientation is computed before rotations...

I think the simplest way would be with auto-orientation, or the lookAt() expression on orientation, wich gives me correct X and Y orientations, and then get an expression on zRotation to get a "full" orientation.

 

But what would it be?

How can I get the Z orientation in layer space?

 

Any idea will be appreciated!

 

François

Font Size Expression

$
0
0

I need an expression that would automatically change the font size based on how many characters are typed in.

 

The goal is to fit multi-line text into a bounding box as it's read from the external text file.

 

Does anyone know whether it's possible through an expression, or SDK by writing a plugin?  So far I was unable to find any info on this topic.

 

Thanks for any ideas.


Making the wheels of a car roll right

$
0
0

I have a photo of a car with the wheels separated, and I want to find an expression or something that will help make the wheels look like they are rotating at the right speed.  Any suggestions?

 

I have used AE for a while but expressions are still pretty foreign to me.

 

Thanks for any help!

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.

Expressions which were working fine are now crashing AE CC every single time.

$
0
0

Hi,

 

Last week I was working on a showreel template for my company and I incorporated a few expressions and sliders to try and minimise the amount of work required to add new content.

 

These expressions were working perfectly together and now after the weekend the file seems to be broken. Every time the file crashes I get this message:


"A copy of your project was saved at: XXX.aep

Last log message was: <140735177282320> <ae.blitpipe> <2> Making New Context

Generating crash log, which may take a few minutes."

 

It crashes on startup with the original file. The duplicate that AE created only crashes when I re-enable 1 of 2 of the expressions which it automatically disabled. The expression that seems to be the problem is:

 

startX = transform.anchorPoint[0];

startY = transform.anchorPoint[1];

endX = transform.xPosition;

endY = transform.yPosition;

differenceX = startX - endX;

differenceY = startY - endY;

sliderVal = thisComp.layer("Guide").effect("Blackout, Blur etc")("Slider");

currentValX = startX - differenceX*(sliderVal/100);

currentValY = startY - differenceY*(sliderVal/100);

[currentValX, currentValY, 0]

 

I hate to just copy and paste everything in here but I am completely baffled by this and After Effects offers no clue as to what the problem is. If anyone can shed some light on what the issue may be it would be much appreciated.

 

Thanks,

 

Liam

 

---------

 

Hardware Overview:

 

  Model Name: MacBook Pro

  Model Identifier: MacBookPro11,3

  Processor Name: Intel Core i7

  Processor Speed: 2.5 GHz

  Number of Processors: 1

  Total Number of Cores: 4

  L2 Cache (per Core): 256 KB

  L3 Cache: 6 MB

  Memory: 16 GB

  Boot ROM Version: MBP112.0138.B07

  SMC Version (system): 2.19f7

  Serial Number (system): C02N6C3GG3QD

  Hardware UUID: 241E1179-D911-50CA-96DB-618E6F815FEE

 

 

System Software Overview:

 

  System Version: OS X 10.9.4 (13E28)

  Kernel Version: Darwin 13.3.0

  Boot Volume: Macintosh HD

  Boot Mode: Normal

  Computer Name: Liam’s MacBook Pro

  User Name: Liam Owen (liam)

  Secure Virtual Memory: Enabled

  Time since boot: 5 minutes

After Effects CS4 audio levels expression problem

$
0
0

Basically what I have is a layer with a checkbox. There is also an audio layer which has its audio levels linked to the checkbox by this expression:

 

if(thisComp.layer("White Solid 1").effect("Checkbox Control")("Checkbox")==true)
[5,5]
else
[-20,-20]

 

No matter if the checkbox is checked or not, when previewing the audio is played as if it had Audio Levels set to 0. When there is no expression, the audio levels can be controlled normally. But when the expression is applied, the Audio Levels is stuck at 0dB. This problem seem to be apparent only when previewing. After the audio is rendered, the file plays as it would be expected. Could anyone please help me with this?

 

EDIT: Also, the waveform seems to react normally to the checkbox.

expressions problem

$
0
0

i write two expressions in a layer,(loopOut(type = "cycle", numKeyframes = 0);  [z,y,x]),only one expression can work,([z,y,x]for exchange x and z value),i want those expressions can work,what should i do?

Question about expressions inside AE

$
0
0

I don't even know what to search for on google to find the answer. So after an hour trial and error inside AE and failure in google search, I'm coming here to seek help.

 

I have a plugin (RedGiant Sound Keys) that is giving values as keyframes for every frame. And the values go like: 0, 4, 7, 3, 5, 0, 0, 5, 6 ....

In other words, they fluctuate between zero and, say, 10.

 

I want another layer to get this value, but add it to itself every frame. I used to do QBasic programming and it was very simple there. Just something like x = x + (value from the Sound Key plugin)

 

But I don't know how to do this in AE.

 

Right now I have this:

 

x = (thisComp.layer("sound").effect("Sound Keys")("Output 1") * 0.5);

x;

 

What I really want is:

 

x = x + (thisComp.layer("sound").effect("Sound Keys")("Output 1") * 0.5);

x;

 

But it doesn't work.

 

Can someone help me please?

Change expression editor font

$
0
0

It's sometimes tricky (on windows, anyway) to accurately select text in the expressions editor. I end up using an external editor and copy/pasting most of the time.

 

Is it at least possible to change the expression editor font to a monospaced one (using some sort of preferences hack, maybe?)

 

Thanks


walk cycle: how to avoid slipping legs?

$
0
0

hi

 

I wonder if there's an expression which would allow me to synchronize walking character's steps with its horizontal position? I animate two-legged character's legs for walk cycle, but when i animate the whole character's X axis position it's very hard to avoid its legs from skidding across the surface. any free or non-free plugin/expression for this?

Can I connect a particle emitter to the position of a 3D null?

$
0
0

I'm trying to connect a particle emitter to a 3D null instead of lights. The reason is that when I connect Particular to a light it no longer seems to have any directional control. So I can't rotate it and make all the particles shoot in one direction, for example. All the rotate functions are disabled.

 

I'm trying to make a plane in in Video Copilots Element 3D look like it's firing bullets. I have a light attached to the muzzle of the gun but I had the directional problems I just outlined. So now I'm trying to attach the emitter to a 3D null object that will replace the light.

 

I'm not great at coding so if there's a way to control the direction of light emitters, or attach an emitter to a 3D null... or even a better way altogether I'd much appreciate the help.

 

Many thanks.

 

SJ.

puppet pins moving in opposite directions

$
0
0

Hello,

I'm new to AE.  I want to create a controller for two puppet pins.  One pin that follows the controller, and the other that follows the y position of the controller but moves in the opposite direction of the x position.  I used the Duik plugin to create bones for the puppet pins and linked their position expressions to a null (controller).  I can get the pins to follow the y position, and the one pin to follow the x.  How do I get the other x pin to move away (in the opposite direction) of the null.  When I try putting a negative, the pin shoots off the screen.

Thanks for your help!

Expression target multiple layers

$
0
0

hi,

I have several layers, all with the same expression (linked to expression controls)

I wondered if it's possible to have one instance of the expression script to target multiple layers?

Rather than pasting he same expression code on each layer..

Thanks

wiggle between parameters

$
0
0

I want to wiggle between 2 values. So that my glow stays bright enough to see and still flickers.

 

why would this not work?

 

x= (50-75)

wiggle(4,x)

Viewing all 47983 articles
Browse latest View live


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