Hey there
So i am trying to implement a preview inside my Script. I'm using a technique where i'm updating .pngs in the script UI to create a video.
Unfortunatly it doesn't work that well in AE. I guess there is a problem with the $.sleep() Command in AE. There might be a better & faster way.
If you guys have any ideas I would really appreciate it!
Here is what I've got so far:
ImagePreview();
function ImagePreview (){
var dir = "/g/test/!!_RENDER/";
var imageArray = ['0.png','1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','10.png','11.png','12.png','13.png','14.png','15.png','16.png','17.png','18.png','19.png','20.png','21.png','22.png','23.png','24.png','25.png','26.png','27.png','28.png','29.png','30.png','31.png','32.png','33.png','34.png','35.png','36.png','37.png','38.png','39.png','40.png','41.png','42.png','43.png','44.png','45.png','46.png','47.png','48.png','49.png','50.png'];
var counter = 0;
var images = File(dir+imageArray[counter])
var thumb = File(dir+imageArray[0])
var w = new Window("dialog","ImagePreview");
var ImageGroup = w.add("image",[10,10,281,158],thumb)
var panel = w.add("panel",undefined,"")
var PLAY = panel.add("button",undefined,"play")
var STOP = panel.add("button",undefined,"stop")
panel.orientation = "row";
PLAY.onClick = function(PLAY) {
for(counter = 0; counter<51; counter++){ $.sleep(25) updateImage(); }
}
function updateImage(){
ImageGroup.image = ScriptUI.newImage(File(dir+imageArray[counter]))
}
w.center();
w.show();
}