Skip to content

Commit

Permalink
Fix the sequencer keyframe order
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-Duduf committed Jul 24, 2023
1 parent 68bfd90 commit dcc80e0
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
54 changes: 53 additions & 1 deletion src/inc/api/animation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1694,15 +1694,67 @@ Duik.Animation.sequenceKeys = function(duration, reverse, interpolation) {

// Get animations
var selectedKeys = [];
// To fix order, group by category
var contentKeys = [];
var maskKeys = [];
var effectKeys = [];
var transformKeys = [];
var geoKeys = [];
var matKeys = [];
var styleKeys = [];

var currentLayerIndex = propList.first().layer.index;

propList.do(function(prop) {

// New layer
if (currentLayerIndex != prop.layer.index) {
// Concat in the right order
selectedKeys = selectedKeys.concat(contentKeys);
selectedKeys = selectedKeys.concat(maskKeys);
selectedKeys = selectedKeys.concat(effectKeys);
selectedKeys = selectedKeys.concat(transformKeys);
selectedKeys = selectedKeys.concat(geoKeys);
selectedKeys = selectedKeys.concat(matKeys);
selectedKeys = selectedKeys.concat(styleKeys);

contentKeys = [];
maskKeys = [];
effectKeys = [];
transformKeys = [];
geoKeys = [];
matKeys = [];
styleKeys = [];

currentLayerIndex = prop.layer.index;
}

var keys = prop.selectedKeys();
if (keys.length == 0) return;
var p = {};
p.prop = prop;
p.anim = prop.animation(true);
selectedKeys.push(p);

var root = prop.rootPropertyGroup();
if (root.matchName == 'ADBE Root Vectors Group') contentKeys.push(p);
else if (root.matchName == 'ADBE Mask Parade') maskKeys.push(p);
else if (root.matchName == 'ADBE Effect Parade') effectKeys.push(p);
else if (root.matchName == 'ADBE Transform Group') transformKeys.push(p);
else if (root.matchName == 'ADBE Extrsn Options Group') geoKeys.push(p);
else if (root.matchName == 'ADBE Material Options Group') matKeys.push(p);
else if (root.matchName == 'ADBE Layer Styles') styleKeys.push(p);
else selectedKeys.push(p);
});

// Concat in the right order
selectedKeys = selectedKeys.concat(contentKeys);
selectedKeys = selectedKeys.concat(maskKeys);
selectedKeys = selectedKeys.concat(effectKeys);
selectedKeys = selectedKeys.concat(transformKeys);
selectedKeys = selectedKeys.concat(geoKeys);
selectedKeys = selectedKeys.concat(matKeys);
selectedKeys = selectedKeys.concat(styleKeys);

var n = selectedKeys.length;
var startTime = comp.time;
duration = duration * comp.frameDuration;
Expand Down
2 changes: 1 addition & 1 deletion tools/dev/dev-install.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off

:: Edit these variables with the correct paths on your system
SET aeVersion=2022
SET aeVersion=2023
SET "aePath=C:\Program Files\Adobe\Adobe After Effects %aeVersion%\Support Files\Scripts\ScriptUI Panels"
:: The repo is the current dir by default
SET repoPath=%~dp0..\..
Expand Down

0 comments on commit dcc80e0

Please sign in to comment.