Nice catch. qb.genchunks is useful when you know how big the chunksize is, and you don't care how many chunks you get.
There is also a qb.genpartitions()
call, which is useful when you want to specify the number of chunks, and don't care how big the chunksize is. Usually used when you want to do something like: "I'd like to render these 723 frames across 14 machines, and I want to only send 1 chunk to each machine".
qb.genpartitions(14, '1-723') returns:
['1-52', '53-104', '105-156', '157-208', '209-260', '261-312', '313-364', '365-416', '417-468', '469-520', '521-572', '573-624', '625-676', '677-723']
genpartitions(numPartitions, range, *extraRanges, **kwargs)
Generate a work agenda (individual Work items) based upon range list splitting frame range into <n> partitions.
[b]Parameters[/b]:
numPartitions (int) - number of partitions to split the range into
range (str) - Frame range string (additional ranges can be specified)
n1 (ie. 1)
n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
n1-n2 -- n1 through n2 (i.e. 1-10)
n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySort (bool) - perform a binary sort (first, last, middle) on the resulting order (default=False)
[b]Returns[/b]:
list of Work instances. ([Work])
See Also:
rangesplit, rangechunk, rangepartition, genframes, genchunks, genpartitions
Examples:
qb.genpartitions(2, '1-10') - returns ['1-5, '6-10']
qb.genpartitions(2, '-10--1') - retruns ['-10--6', '-5--1']