Filtering highest file / folder version

   100   3   2
User Avatar
Member
44 posts
Joined: Aug. 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
User Avatar
Staff
468 posts
Joined: Sept. 2012
Offline
Maybe try the “Filter by Expression” node, with an expression like @pdg_index < threshold ? That will get rid of workitems with index below that threshold. If it's some other attribute and not index, it would be just @whatever_attrname
- Ken Xu
User Avatar
Member
44 posts
Joined: Aug. 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!
User Avatar
Staff
285 posts
Joined: Sept. 2016
Offline
mrtonks
Attribute promote on work items or by partitioned items would be a great addition in the future!

Thanks for bringing it up, it's come up before and we certainly need to add something like that.
In the meantime I've attached a hip showing 2 ways to do it now with python.

Attachments:
attributepromote.hip (250.2 KB)

  • Quick Links