ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Time-lapse animation of construction site? Scripting? Expressions?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Felix KleeTime-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 8:09:52 am

I have a 3D scene with a set of building blocks, all identical except for position (and later orientation). For every frame, I would like to have a different configuration of building blocks, according to some logical system. In the end the result is some kind of time-lapse animation of a construction site.

For example:
  • Frame 1: block at (0, 0, 0)
  • Frame 2: block at (0, 0, 0), block at (0, 0, 10)
  • Frame 3: block at (0, 0, 0), block at (0, 10, 0)
  • ...
As you see, in every frame blocks may be created, moved and also deleted.

How would you approach the problem? Expressions or scripting?

I am grateful for any advice or any pointers to more information. Note that I'm a seasoned JavaScript programmer. And FWIW I also have experience with ActionScript. However, I've never used After Effects before. That tool was chosen by an animation designer that I'm collaborating with.


Return to posts index

Dave LaRondeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 3:00:52 pm

It would probably be more time-consuming to create a script than it would to simply animate the cubes' position porperty via keyframes. I recommend using Hold Keyframes:

http://help.adobe.com/en_US/aftereffects/cs/using/WS3878526689cb91655866c11...

If your collaborator supplies you with Image sequences to use as a background -- your cubes won't interact well with 3D objects from a 3D application -- you should know that AE defaults to interpreting the frame rate as 30 fps. This can be changed to your delivery frame rate, which might very well be 29.97 fps, in the Interpret footage settings:

http://help.adobe.com/en_US/aftereffects/cs/using/WS3878526689cb91655866c11...

Look for the section, "Change frame rate for a footage item".

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

Felix KleeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 3:25:10 pm

Thanks, Dave, for your suggestions. My comments:

[Dave LaRonde] "It would probably be more time-consuming to create a script than it would to simply animate the cubes' position porperty via keyframes."

No, quite the opposite: There is some complex mathematical system that dictates how blocks may be positioned. And we may have to create hundreds of different configurations.

So some form of scripting is unavoidable.

"If your collaborator supplies you with Image sequences to use as a background"

He provided me with an AEP-file with a 3D scene, all generated with native After Effects CS4 functionality. I already figured out how to work with that.

"you should know that AE defaults to interpreting the frame rate as 30 fps"

Frame rate is no issue for us at all. In the end we will output every block configuration as a single JPEG image.


Return to posts index


Walter SoykaRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 3:43:35 pm

I'd probably approach this by using an expression to control time remapping [link] on your imported 3D image sequence.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Felix KleeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 3:53:23 pm

[Walter Soyka] "imported 3D image sequence"
Thanks for the suggestion. However, there is nothing imported. Everything is done 100% in After Effects CS4.


Return to posts index

Dave LaRondeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 3:45:28 pm

I'd say a visit to the COW's AE Expressioins forum would be very worthwhile:
http://forums.creativecow.net/adobe_after_effects_expressions

Since you're fluent in Javascript and you apparently know the algorithm to use, you may be able to solve the problem quickly.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index


Felix KleeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 4:01:50 pm

[Dave LaRonde] "I'd say a visit to the COW's AE Expressioins forum would be very worthwhile"

Thanks. I've seen these forums before. However, I posted here since probably After Effects scripting is what is needed, and not expressions. But as both are based on the same technology: Would it be possible to move this thread to the other forum?


Return to posts index

Walter SoykaRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 4:48:16 pm

Expressions and scripts are not at all the same. Expressions are code you can apply to any property in AE (position, opacity, etc.) that returns a value to that property, and is evaluated on every frame. Scripting actually controls the application itself, not the visual output. They have very different approaches.

With expressions, you'd have to manually add at least enough block elements to cover your worst-case (highest number of blocks) scenario, then apply the expressions to properties on those layers to control the animation (likely based on time, but perhaps markers, other keyframes, or expression control effects).

With scripting, you'd write a script that would generate and bake the layers, positioning, and keyframes for you.

Now that I understand what you're trying to do a little better, I think that Steve is on the right track. You could absolutely do this with expressions by building all the elements, then using logic and expressions to control how they appear, move, arrange, and disappear.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Felix KleeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 10:18:06 pm

[Walter Soyka] "Expressions and scripts are not at all the same. Expressions are code you can apply to any property in AE (position, opacity, etc.) that returns a value to that property, and is evaluated on every frame. Scripting actually controls the application itself, not the visual output. They have very different approaches."

I am aware of that difference. The reason I wrote that expressions and scripts are based on the same technology: They are both based on JavaScript, and probably they share a common set of After Effects specific functions. Therefore I assume that at least some of those who are experienced with expressions also know how to do scripting.

"Now that I understand what you're trying to do a little better, I think that Steve is on the right track. You could absolutely do this with expressions by building all the elements, then using logic and expressions to control how they appear, move, arrange, and disappear."

I was thinking about this method even before doing the original post. However, I assume that it is hard to do, due to the nature of the underlying mathematical system for building the block configurations. Will think about it again, though.

Note that we don't want to do a smooth animation: Every frame has a different block configuration. I.e. you don't see movement or rotation. Blocks just appear and disappear.


Return to posts index


Todd KoprivaRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 10, 2011 at 2:34:32 am

> ... and probably they share a common set of After Effects specific functions.



Not really. They serve such different purposes that there's not a lot of commonality beyond the facts that a) they're both based on early versions of JavaScript and b) they're related to After Effects.

---------------------------------------------------------------------------------------------------------
Todd Kopriva, Adobe Systems Incorporated
Technical Support for professional video software
After Effects Help & Support
Premiere Pro Help & Support
---------------------------------------------------------------------------------------------------------


Return to posts index

Steve RenardRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 10, 2011 at 3:09:08 pm

If every frame has a different configuration, how are those configurations being determined? I understand you have a mathematical formula for it, but is your real question how do you translate that formula into the particular configuration that appears in a particular frame? Or is it actually about making the boxes appear and disappear? The method I'm describing doesn't involve any smooth motion - the if/else statement makes it a simple on-off depending on where the nulls are in relation to the box - so maybe the way to do it is some sort of combination of methods where a script lays out the boxes and an expression determines whether they're on or off.

The description you've given, though, is too vague to give any better advice than any of has given, IMHO. Maybe post some screen shots?

Steve



Return to posts index

Felix KleeRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 11, 2011 at 10:36:28 am

[Steve Renard] "The method I'm describing doesn't involve any smooth motion - the if/else statement makes it a simple on-off depending on where the nulls are in relation to the box - so maybe the way to do it is some sort of combination of methods where a script lays out the boxes and an expression determines whether they're on or off."

As it looks, I will be using something like this in the end. :-)

Just figured out the following method, which I tested with 2D layer positions:
  • In a text layer, I have an expression with the precalculated positions depending on the frame number and the index of a layer. I use an expression here since that makes editing simpler, at least for me (After Effects noob).
    "var positions = [[[300, 10], [500, 80]], [[100, 10], [400, 200]], [[100, 40], [300, 200]]];" +
    "positions[timeToFrames()][index-1];"

  • For testing, I add two image layers with indexes 1 and 2. To each one I add a position expression:
    "eval(thisComp.layer("Position").text.sourceText.toString());"
Works fine. The next step is conversion to 3D and toggling the visibility of layers.

Concerning the algorithm for block configurations: It's a bit complicated and that's why I prefer to have the configurations be calculated outside of After Effects. Or perhaps I'll use a script for that.


Return to posts index


Steve RenardRe: Time-lapse animation of construction site? Scripting? Expressions?
by on Jun 9, 2011 at 4:16:20 pm

Perhaps I'm being a bit too literal or simple about this, but what's to prevent you from creating something like your own C4D MoGraph-style modifier?

I don't know if I could write the code for it, and it assumes you want the blocks to appear in some sort of linear sequence, but this is how I would start to break it down:

1. Establish the configuration of the blocks.
2. Create two null objects - one at one end of the space in which your blocks reside ("End Null"), and the other at the other end ("Start Null").
3. Add an expression to the blocks that measures the distance from that block to "End Null", compares it to the distance between "Start Null" and "End Null", and determines the opacity based on that comparison. Very roughly, I'd put this expression on the Opacity property:

blockToEnd = length(thisLayer.position, thisComp.layer("End Null"));
startToEnd = length(thisComp.layer("Start Null"), thisComp.layer("End Null"));
if(blockToEnd > startToEnd){transp = 100} else{transp = 0};
transp

I have not tested this yet, but that's where I'd start.

Good luck!

Steve



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]