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

Scrollable group problem: Not all content in group with scroll function shows up?

$
0
0

Helloooow wise scripting peoplez.

 

I've been gnawing my fingernails over this problem the past couple of days, and still haven't found a solution. Here goes:

I've tried to make a window(or actually panel, because in the end it should be run from AE>Window>scriptname.jsx ), with a scrollbar, that can scroll through content in a group next to it. I can get the group to scroll and all that, but the problem, right now is, that after x items in the group, the last ones get clipped off. Like this (there's supposed to be 500 buttons):

Screen Shot 2015-10-13 at 21.40.05.png

The only way I've been able to get the "inner" group to get bigger is by not using any of the align properties and set the .size manually. I know the content is there because the last item shows up, when I'm moving the last items location[1] upwards until it reaches the top of the group. I tried making the layout refresh (layout.layout(true);layout.resize()) at every call of the onChanging() function of the slider, but w/o success. Reading lots of lovely forum posts and discussion by @Marc Autret  and other long time scriptUI/extendscript users has this far been without luck.

 

 

TL;DR:  I'm trying to make a group with lots of content that I can scroll through with a scrollbar.

 

here's the code snippet, hopefully well enough commented :

{
//scroller test
// uncomment the temp path (replace with some image file path) and the lines inside the populateGrid() function to reproduce my problem better
// I'm ussing an image 512x288 pixels


//var tempPath = "/Volumes/Verbinski/02_SCRIPTING/After_Effects/stockholm/ROOT/EXPLOSIONS/Fireball_side_01/Thumbs/Fireball_Side_01_024.jpg";


// create window
var mWin = new Window('palette');
  mWin.size = [500,500];  mWin.orientation = 'row';


// If you like it, then you better put a scroller on it.
var scroller = mWin.add('ScrollBar');
  scroller.size = [20,mWin.size[1]-40]  scroller.minvalue = -5;  scroller.value = scroller.minvalue;  scroller.maxvalue = 10000; // tried changing this to all sorts of interesting numbers.


//This should move the group, created further down.
scroller.onChanging = function(){
  grid.location = [grid.location[0],-scroller.value];
}


// "Boundary" for grid (see below)
var gridArea = mWin.add('panel',undefined,'gridArea');
  gridArea.size = [mWin.size[0]-40,mWin.size[1]-40];


// The grid... a digital fronteer... and also container of stuff
var grid = gridArea.add('panel',undefined,'grid');
  grid.size = [gridArea.size[0]-20,9000000000] // no matter how high I put this, it doesn't change a thing


// Just an array for all the images to go
var clips = [];
// Total height gets calculated in the populateGrid function.
var totalHeight = 0;


function populateGrid(rows){
  var img;  for(i=0;i<rows;i++){  // img = grid.add('image',undefined,tempPath);  // clips.push(img);  grid.add('button',undefined,i);  }  for(i in clips){  clips[i].location = [0,(clips[i].image.size[1]*i)]  }  // totalHeight = (img.image.size[1]+grid.spacing)*rows;  // grid.size = [grid.size[0],totalHeight]  // scroller.maxvalue = totalHeight/2;


}


// put x number of buttons/images into the grid
populateGrid(500);


// shwo to window
mWin.show();
mWin.center();
}

 

Reaally hope someone in here sees this and can help me out.

Cheers, Fynn.

 

//my system settings:

iMac 5K retina, 4 GHz Intel Core i7

32GB RAM, 512GB solid state HDD

OSX Yosemite: 10.10.4

AE: CS6 ||  CC 2014: 13.1.1.3


Viewing all articles
Browse latest Browse all 2143

Trending Articles



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