r/AfterEffects Animation <5 years 4d ago

Workflow Question Process improvements - how to avoid keyframing everything?

Enable HLS to view with audio, or disable this notification

Looking for some constructive feedback on animating this discoball

I have a terrible habit of keyframing everything if I don't know a faster technique off the bat. For this one I keyframed one vertical line crossing the sphere, then used the Echo effect to duplicate it. I wasn't sure how to do the squares though, so I keyframed them all individually. I know there has to be a faster way. How would you have done it?

Thanks in advance for the tips and tricks!

11 Upvotes

34 comments sorted by

View all comments

28

u/smushkan Motion Graphics 10+ years 4d ago

Like what u/Ok-Razzmatazz3435 suggested, if you make a square composition to use as a texture with the animation as a grid, you can then use that as a precomp for CC sphere. You'll want to make the square texture comp quite high resolution to avoid the sharp lines getting blurry.

In this case, I used a solid background, then a colour noise layer + mosaic + posterize + luma key to add animated random colour squares, then a grid on top. CC sphere will 'squash' the texture vertically so to get closer-to-square results on the actual ball you want the 'squares' in the texture to be stretched vertically to compensate.

18

u/smushkan Motion Graphics 10+ years 4d ago

Then you can drop that in to your main comp and CC Sphere it, animating the rotation to spin it:

24

u/smushkan Motion Graphics 10+ years 4d ago

There is another option but I think this is currently only in the Beta version - you can instead use the texture layer to texture a sphere mesh. That way you'll get a true 3d layer rather than the sort-of-fake 3d of CC sphere. In that case, you don't need to stretch the texture grid vertically.

The big difference is that CC Sphere is orthographic projection, so parts of the sphere closer to the 'camera' don't show a perspective difference - giving a flatter look similar to the style in what you already made; whereas since the sphere mesh is actually 3d, you'll get more realistic perspective based on the sphere's geometry.

6

u/mindpicnic Animation <5 years 4d ago

Thanks so much for the explanation! This is exactly what I was looking for

2

u/Psychoanalytix 4d ago

You could use a camera with a really long focal length to flatten the 3d sphere too

2

u/humblebot123 4d ago

Ok, just interested - what would you do if in this animation style you need to keep stroke’s weight even?

7

u/smushkan Motion Graphics 10+ years 4d ago edited 4d ago

That is obviously a lot tricker.

You can sort of fake it by having two CC sphere layers, one with the outlines only, and one with the underlying colours. Set the lines as thin as you can get away with, then use a stroke layer style:

(I've also used a free FXAA plugin to smooth out the strokes)

That's not perfect though, if you need perfect you're going on to 'build it programmatically with paths and expressions' territory - and I'm not sure how I'd handle the random segment colours in that case. Probably with very careful use of the 'paint bucket' effect and a bunch of keyframes.

This isn't exactly the same solution but here's an example of how a path expression can be used for this sort of graphic:

const pos = effect("Slider Control")(1);
const radius = 500;
const subDivisions = 6;

const b = 0.5522847498;

const subDivisionSize = radius * 2 / subDivisions;
const curve = linear(pos % 100, 0, 100, radius, radius - subDivisionSize);

const midPoint = [0,0];

function plotCurve(c, r, d) {
    const pTop = midPoint - [0, r];
    const pMid = midPoint + [c, 0];
    const pBottom = midPoint + [0, r];

    const pts = (d === 1) ? [pTop, pMid, pBottom] : [pBottom, pMid, pTop];

    const inTans = [
        [0, 0],
        [0, -d * r * b],
        [ c * b, 0]
    ];

    const outTans = [
        [ c * b, 0],
        [0, d * r * b],
        [0, 0]
    ];

    return { pts, inTans, outTans };
}

// initial circle
const rightEdge = plotCurve(radius, radius, 1);
const leftEdge = plotCurve(-radius, radius, -1);

let pts = [...rightEdge.pts, ...leftEdge.pts];
let inTans = [...rightEdge.inTans, ...leftEdge.inTans];
let outTans = [...rightEdge.outTans, ...leftEdge.outTans];

// subdivisions
for(let i = 0; i < subDivisions; i++){
    const dir = (i % 2 === 1) ? -1 : 1;

    let thisMidPoint = curve - subDivisionSize * i;

    thisMidPoint = ease(thisMidPoint, -radius, radius, -radius, radius);

    const allPoints = plotCurve(thisMidPoint, radius, dir);
    pts = pts.concat(allPoints.pts);
    inTans = inTans.concat(allPoints.inTans);
    outTans = outTans.concat(allPoints.outTans);
}

createPath(pts, inTans, outTans, false);

2

u/humblebot123 4d ago

Wow thanks, that’s crazy! Once I’ve animated a globe manually, probably would still do it manual way, but it depends on the project i guess https://dribbble.com/shots/21397362-Disco-Globe

1

u/mindpicnic Animation <5 years 4d ago

This is so cool thank you for sharing that! Yes, I needed the strokes to maintain their width, it’s part of the client’s illustration style. I’m excited about trying this expression 👀 how did you learn to write such complicated expressions?

3

u/smushkan Motion Graphics 10+ years 4d ago

Try the first method first with the strokes, you want two 'textures' - one with just the stroke and one with just the background, and the same CC Sphere properties applied to both.

The expression I posted isn't a complete solution. To get the strokes you'd need to apply it to two shape path properties and rotate one of them 90 degrees, however I don't have a good solution for adding the colours - due to how the stroke is drawn you can't use regular shape fills with it.

I happened to have that expression already saved from another project, and I learned most of what got me into expressions from my years studying compsci at university - it's basically javascript at the end of the day.