Hi there!
I just would like to share a common situation that we encounter in Gaffer and would like to check with you what would be the easiest and best approach to handle this.
On pipeline nodes, we have 'dynamic' information that involves a setup of plugs. Those setups can change, depending on a situation. As a concrete example, in our publishes, we have a 'context' information (not to be mixed up with a Gaffer.Context) that defines basically 'where' the publish takes place. Our 'contexts' can be of different types and each type has a collection of context levels. Another example is published files. One single publish can contain one or more files or file streams, e.g. different aovs for a single render. Each file or file stream has its basename and path.
To manage this information on reader and publisher nodes, we have pipeline tools that create/delete plugs depending on the publish.
Now, we have situations where we would like to drive things based on this 'dynamic' information by using direct links or expressions. The problem is, since the information is 'dynamic' a plug might appear or disappear which will break direct connections or expression setups.
I'm trying to figure out what we are doing wrong here and wondered if for such situations, we should better use custom plugs or encode dynamic information in json strings that can be put on a single string plug. I guess that former is the more elegant solution, but I'm not sure how much work this implies and if this needs to be done in C++ or if Python is enough. I'm also wondering if for the latter solution, we could still have a way to show the custom string plug in a more fancy way in the GUI, to be more readable for users.
We don't have this issue in Nuke or Houdini where we actually can check for a knob or parm existence inside expressions and deal with it.
Any input would be more than welcome!
Thanks,
Carlo