PDG - sort order within partition

   1854   1   0
User Avatar
Member
102 posts
Joined: May 2013
Offline
I'm trying to partition some image sequences by camera and frame number and having a problem maintaining the correct camera order.

I have a number of image sequences that are named very simply and logically in separate folders, like this :

path/to/seq/cam_1/cam_1_v001.$F4.exr
path/to/seq/cam_2/cam_2_v001.$F4.exr
path/to/seq/cam_3/cam_3_v001.$F4.exr
path/to/seq/cam_4/cam_4_v001.$F4.exr

I'm reading all of those in with a filepattern TOP set to recursive, using as my pattern :
path/to/seq/cam_*/

'Index from file sequence' is on and works fine, I have all the work items in the order i'd expect
cam_1 frame 1
cam_2 frame 1
cam_3 frame 1
cam_4 frame 1
cam_1 frame 2
etc…

now I just want to partition these by frame number AND maintain within the partition the camera order but however I try it doesn't want to do it.
The frame partitioning is no problem but I get the following orders within the partitions:
frame 1 : cam_1 cam_4, cam_2, cam_3
frame 2 : cam_1 cam_3, cam_2, cam_4
frame 3 : cam_3 cam_1, cam_4, cam_2

The goal is to use image magick TOP to combine these in a row to preview a multi-screen playback system but they need to stay in camera order otherwise it will jump around all over the place. Can anyone help?
Many thanks for reading…
User Avatar
Member
102 posts
Joined: May 2013
Offline
In case anyone else has a similar problem in future, I've managed to get round this by making two integer attributes - ‘cam’ and ‘frame’ then making a ‘seq_id’ attrib with this expression :

@cam + ((@frame - 1) * 4)

this gives me -

cam_1 frame 1 = seq_id 1
cam_2 frame 1 = seq_id 2
cam_3 frame 1 = seq_id 3
cam_4 frame 1 = seq_id 4
cam_1 frame 2 = seq_id 5
cam_2 frame 2 = seq_id 6

then I use this in the sort TOP and then partition by range, with range type set to fixed size = 4

It seems like a convoluted way around but it works at least.
  • Quick Links