ImageEngine/gaffer — pull request #695 by johnhaddon (2013-12-17 17:02:34+00:00)
Title: Fixed GafferScene.ScenePath.isValid().

The previous implementation attempted to call ScenePlug.bound() for the path and returned False if there was an Exception, but this wasn't a good approach in several cases. The problem was that many nodes don't do any sanity checking on the path during computation for the sake of speed. The Group node for instance doesn't check that the first element in the path is actually the name of the group - it just makes decisions based on the length of the path. Since efficiency is of major concern to us, the solution isn't to bog all the node implementations down in lots of unecessary input validation.

Instead, ScenePath.isValid() now traverses up the path from the root, ensuring that the next required path element is present in the child names at each point. This definition of validity doesn't affect node performance and is robust in all cases.

The most visible effect of this fix is that when a path chooser is opened for an invalid path, the path is automatically truncated until it is valid - this reduces confusion arising from renaming the hiearchy and then browsing for a previously set path.

Fixes #64.