Filtering highest file / folder version
3029 7 3- mrtonks
- Member
- 54 posts
- Joined: 8月 2010
- Offline
Hey,
Painfully close on this but wondering what the intended workflow would be for processing highest values only.
As an example, i'm using a file pattern glob so that given a number of shots i can get all the hip files per shot - that gives me lots of useful info including an index based on file versions!
I'd like to then go forward with just the highest index. If it was geo i'd do an attrib promote to get the max and filter anything less - would the same logic but with a python script make most sense? or is there a more elegant solution i'm missing?
~Craig
Painfully close on this but wondering what the intended workflow would be for processing highest values only.
As an example, i'm using a file pattern glob so that given a number of shots i can get all the hip files per shot - that gives me lots of useful info including an index based on file versions!
I'd like to then go forward with just the highest index. If it was geo i'd do an attrib promote to get the max and filter anything less - would the same logic but with a python script make most sense? or is there a more elegant solution i'm missing?
~Craig
~ Craig Tonks | CG Supervisor | Outpost VFX
- kenxu
- Member
- 544 posts
- Joined: 9月 2012
- Offline
- mrtonks
- Member
- 54 posts
- Joined: 8月 2010
- Offline
Thanks Ken!
Theres two problems with that though:
1. I wont always know the largest index, so i need some attribute promote style way of finding the max. Which is possible for all work items at once, but…
2. the work items belong to different folders. So i need the threshold for each group / partition of items
Essentially looking at Partition by folder attribute, loop over all items in that group and get the max - then do filter by expression. I just havnt got my head around the python code to do it and pass everything back out correctly
Attribute promote on work items or by partitioned items would be a great addition in the future!
Theres two problems with that though:
1. I wont always know the largest index, so i need some attribute promote style way of finding the max. Which is possible for all work items at once, but…
2. the work items belong to different folders. So i need the threshold for each group / partition of items
Essentially looking at Partition by folder attribute, loop over all items in that group and get the max - then do filter by expression. I just havnt got my head around the python code to do it and pass everything back out correctly
Attribute promote on work items or by partitioned items would be a great addition in the future!
~ Craig Tonks | CG Supervisor | Outpost VFX
- chrisgreb
- Member
- 603 posts
- Joined: 9月 2016
- Offline
- mrtonks
- Member
- 54 posts
- Joined: 8月 2010
- Offline
- mrtonks
- Member
- 54 posts
- Joined: 8月 2010
- Offline
This is a great start Chris! So what i'm trying to do is that, butttt combined with partitioning by shot.
I've re-attached the file and added in a basic example of the work items having a “shot” string attribute - so we've hypothetically found all versions in these shots and want to chuck out all but the highest
I've re-attached the file and added in a basic example of the work items having a “shot” string attribute - so we've hypothetically found all versions in these shots and want to chuck out all but the highest
~ Craig Tonks | CG Supervisor | Outpost VFX
- chrisgreb
- Member
- 603 posts
- Joined: 9月 2016
- Offline
- tpetrick
- スタッフ
- 586 posts
- Joined: 5月 2014
- Offline
We've implemented some additional options on the partitioner nodes and work item expand so you no longer need a Python processor.
The partitioner can now sort its contents by Attribute, and can sort in either acsending or descending order. I've changed the Partition by Attribute in your file to sort by “version” in descending order, so the max version shot is the first element of the partition.
Additionally, the Work Item Expand now has a mode to clone the first N or last N items from an upstream partition. Rather than using a Python Processor, its now possible to use the work item expand to select the max version (first) work item from the partition by attribute.
I attached the updated file, which will work in the latest daily build of 17.5.
The partitioner can now sort its contents by Attribute, and can sort in either acsending or descending order. I've changed the Partition by Attribute in your file to sort by “version” in descending order, so the max version shot is the first element of the partition.
Additionally, the Work Item Expand now has a mode to clone the first N or last N items from an upstream partition. Rather than using a Python Processor, its now possible to use the work item expand to select the max version (first) work item from the partition by attribute.
I attached the updated file, which will work in the latest daily build of 17.5.
Edited by tpetrick - 2019年5月30日 12:28:01
-
- Quick Links