ImageEngine/gaffer — pull request #831 by johnhaddon (2014-05-09 15:30:44+00:00)
Title: Sets groundwork

This lays some of the groundwork for #92. It defines the concept of a user defined set in Gaffer - this is specified using a Set node, which accepts a list of paths (with optional wildcards) in the same way that the PathFilter does. This is used to construct PathMatcherData which is stored in a new "gaffer:sets" globals entry, which maps from set name to PathMatcherData.

The old "gaffer:forwardDeclarations" mechanism for tracking the location of lights has been replaced entirely by simply making an "__lights" set with the locations of lights within it. All the code for tracking the names of lights as they were modified by the various hierarchy nodes is now refactored to operate on sets in general, meaning that users can expect their sets to change accordingly as they flow through the scene.

This pull request doesn't include any ability to actually use the sets - a SetFilter class in a future pull request will implement that, but there are some fiddly details to figure out first. It also uses the PatchMatcher class as-is, although I've sprinkled the code liberally with comments stating that we could perform set remapping much more efficiently with an improved implementation. For now though, I think having the "gaffer:forwardDeclarations" mechanism generalised nicely is a good step forward, and it's worth making incremental merges as this work progresses rather than dropping a months worth of work in one giant pull request at the end...