Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Undo group of actions

$
0
0

Hi guys.

There's a fictitious situation where I have UI with 2 buttons:

Button A creates a new layer and set's it position to XY, Button B Scales that layer by 10%


buttonA.onClick = function() {  

    createLayer();

}

buttonB.onClick = function() {  

    scaleLayer();

}

 

function createLayer(){

var myLayer = myComp.layers.addSolid([0, 0,0], "Layer", 100, 100, 1);

myLayer.property("ADBE Transform Group").property("ADBE Position").setValue([X, Y])

}

 

function scaleLayer(){

myLayer.property("ADBE Transform Group").property("ADBE Scale").setValue([WHATEVER])

}

 

 

 

Lets say user click ButtonA, Button B, Button B, Button B. While undoing, each step will undo every step (Button B, Button B, Button B, Button A). However, I was wondering if it's possible to "collet actions" and do a "bundle" undo at once, so it undos all button actions?

 

Cheers.


Viewing all articles
Browse latest Browse all 2143

Trending Articles



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