Dynamic Parenting Expression for After Effects

Опубликовано: 13 Март 2026
на канале: Daniel Gies
16,865
462

Expression script at the bottom of description!

I hate it when I can't get my After Effects characters to hang onto multiple objects things without a tonne of fuss and bother and wrestling with key-frames.

In this video I will show you how to use a pretty basic expression
written by Colion Harvie and some expression controllers to setup smooth, weight blended Dynamic Parenting for your characters.

After Effects Example Scene:
https://drive.google.com/drive/folder...

Expression Script:
var fadeCtrlLyr = effect("Fade Control Layer")(1);
var total = 0, totalWeight = 0, remWeight = 0;

function addTarget(name){
var lyr = effect("Target "+name)(1), pos = lyr.toComp(lyr.anchorPoint);
var fade = fadeCtrlLyr.effect("Fade "+name)(1);
if (hasParent) pos = parent.fromComp(pos);
total+=fade*pos;
totalWeight+=fade;
remWeight = 1-totalWeight;

}

addTarget("A");
addTarget("B");
addTarget("C");
addTarget("D");
addTarget("E");

totalWeight==0 ? value : linear(remWeight,total/totalWeight,value);