{"action":"created","comment":{"url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/comments/116281618","pull_request_review_id":37896216,"id":116281618,"diff_hunk":"@@ -73,6 +111,88 @@ PathMatcher getExpandedPaths( const Gaffer::Context *context )\n \treturn PathMatcher();\n }\n \n+void expand( Context *context, const PathMatcher &paths, bool expandAncestors )\n+{\n+\tPathMatcherData *expandedPaths = const_cast<PathMatcherData *>( context->get<PathMatcherData>( g_expandedPathsName, NULL ) );\n+\tif( !expandedPaths )\n+\t{\n+\t\texpandedPaths = new PathMatcherData();\n+\t\tcontext->set( g_expandedPathsName, expandedPaths );\n+\t}\n+\n+\tPathMatcher &expanded = expandedPaths->writable();\n+\n+\tbool needUpdate = false;\n+\tif( expandAncestors )\n+\t{\n+\t\tfor( PathMatcher::RawIterator it = paths.begin(), eIt = paths.end(); it != eIt; ++it )\n+\t\t{\n+\t\t\tneedUpdate |= expanded.addPath( *it );\n+\t\t}\n+\t}\n+\telse\n+\t{\n+\t\tfor( PathMatcher::Iterator it = paths.begin(), eIt = paths.end(); it != eIt; ++it )\n+\t\t{\n+\t\t\tneedUpdate |= expanded.addPath( *it );\n+\t\t}\n+\t}\n+\n+\tif( needUpdate )\n+\t{\n+\t\t// We modified the expanded paths in place to avoid unecessary copying,\n+\t\t// so the context doesn't know they've changed. So we emit the changed\n+\t\t// signal ourselves\n+\t\tcontext->changedSignal()( context, g_expandedPathsName );\n+\t}\n+}\n+\n+PathMatcher expandDescendants( Context *context, const PathMatcher &paths, const ScenePlug *scene, int depth )\n+{\n+\tContext::Scope scope( context );\n+\n+\tPathMatcherData *expandedPaths = const_cast<PathMatcherData *>( context->get<PathMatcherData>( g_expandedPathsName, NULL ) );\n+\tif( !expandedPaths )\n+\t{\n+\t\texpandedPaths = new PathMatcherData();\n+\t\tcontext->set( g_expandedPathsName, expandedPaths );\n+\t}\n+\n+\tPathMatcher &expanded = expandedPaths->writable();\n+\n+\tbool needUpdate = false;\n+\tPathMatcher leafPaths;\n+\n+\t// \\todo: parallelize the walk\n+\tfor( PathMatcher::Iterator it = paths.begin(), eIt = paths.end(); it != eIt; ++it )\n+\t{\n+\t\tneedUpdate |= expandWalk( *it, scene, depth + 1, expanded, leafPaths );\n+\t}\n+\n+\tif( needUpdate )\n+\t{\n+\t\t// We modified the expanded paths in place to avoid unecessary copying,\n+\t\t// so the context doesn't know they've changed. So we emit the changed\n+\t\t// signal ourselves\n+\t\tcontext->changedSignal()( context, g_expandedPathsName );\n+\t}\n+\n+\treturn leafPaths;\n+}\n+\n+void clearExpansion( Gaffer::Context *context )\n+{\n+\tif( PathMatcherData *expandedPaths = const_cast<PathMatcherData *>( context->get<PathMatcherData>( g_expandedPathsName, NULL ) ) )\n+\t{\n+\t\texpandedPaths->writable().clear();\n+\n+\t\t// We modified the expanded paths in place to avoid unecessary copying,","path":"src/GafferSceneUI/ContextAlgo.cpp","position":234,"original_position":131,"commit_id":"9ac50ae5c8cbcdc84418ae02f11797d1dee6cbc0","original_commit_id":"08923ed34af7133b88b0b87f2a8e8f8c61cec213","user":{"login":"andrewkaufman","id":3979682,"avatar_url":"https://avatars2.githubusercontent.com/u/3979682?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewkaufman","html_url":"https://github.com/andrewkaufman","followers_url":"https://api.github.com/users/andrewkaufman/followers","following_url":"https://api.github.com/users/andrewkaufman/following{/other_user}","gists_url":"https://api.github.com/users/andrewkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewkaufman/subscriptions","organizations_url":"https://api.github.com/users/andrewkaufman/orgs","repos_url":"https://api.github.com/users/andrewkaufman/repos","events_url":"https://api.github.com/users/andrewkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewkaufman/received_events","type":"User","site_admin":false},"body":"Just to clarify, does that apply to the top of `expandDescendants` as well where I fetch the existing paths rather than calling `getExpandedPaths` ? Should the `setExpandedPaths` call still be inside a `needsUpdate` test?","created_at":"2017-05-12T17:21:45Z","updated_at":"2017-05-12T17:21:45Z","html_url":"https://github.com/GafferHQ/gaffer/pull/2084#discussion_r116281618","pull_request_url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084","_links":{"self":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/comments/116281618"},"html":{"href":"https://github.com/GafferHQ/gaffer/pull/2084#discussion_r116281618"},"pull_request":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084"}}},"pull_request":{"url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084","id":120240941,"html_url":"https://github.com/GafferHQ/gaffer/pull/2084","diff_url":"https://github.com/GafferHQ/gaffer/pull/2084.diff","patch_url":"https://github.com/GafferHQ/gaffer/pull/2084.patch","issue_url":"https://api.github.com/repos/GafferHQ/gaffer/issues/2084","number":2084,"state":"open","locked":false,"title":"Screengrab Improvements","user":{"login":"andrewkaufman","id":3979682,"avatar_url":"https://avatars2.githubusercontent.com/u/3979682?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewkaufman","html_url":"https://github.com/andrewkaufman","followers_url":"https://api.github.com/users/andrewkaufman/followers","following_url":"https://api.github.com/users/andrewkaufman/following{/other_user}","gists_url":"https://api.github.com/users/andrewkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewkaufman/subscriptions","organizations_url":"https://api.github.com/users/andrewkaufman/orgs","repos_url":"https://api.github.com/users/andrewkaufman/repos","events_url":"https://api.github.com/users/andrewkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewkaufman/received_events","type":"User","site_admin":false},"body":"This started out as some small-ish improvements to the Screengrab App, but it's ended up as quite a lot more. I've tested as best I can, and verified that it does the things I need for my external documentaion project that started all of this. But I might as well point out some possible concerns:\r\n\r\n- `SceneView::frame()` (ed8a0c4)\r\n  - I've set a default direction based on the default from the Screengrab App. Not sure that's desirable, though it does give a decent framing for my external docs.\r\n  - The test is a bit odd, but I do think it proves the thing is working.\r\n- `ContextAlgo::clearExpansion()` (08923ed) : We didn't discuss this one offline, but I found it useful in the tests anyways, and I'm using it the Screengrab App too.\r\n- `ContextAlgo::collapse()` (e67cb04)\r\n  - We didn't discuss this either, but I needed it to re-implement `SceneView::collapseSelection()` (7fb2d9e). I've left these commits separate in case we want to drop them.\r\n  - I'm not sure I've got this one right either... I don't totally follow that pop parent stuff that's going on. The tests are passing though, and interactively I didn't notice anything odd.\r\n- Screengrab App expansion (4de04bf) : I think this is right, but I'm not getting the same SceneHierarchy expansion for the GettingStarted tutorial as we have in the docs from Gaffer 0.33.2.0 at IE. I'm not totally convinced they're deterministic in the first place, but I could have screwed something up here. Take a close look.\r\n- `CustomAttributesUI` (60b851b) : I couldn't figure out how to engage this menu interactively...\r\n- There are a handful of spots outside of `ContextAlgo` that are still referring to \"ui:scene:expandedPaths\" or \"ui:scene:selectedPaths\". I don't really like that they have to know about the context variable name, but I didn't see a way to change that other than providing some accessors like `ContextAlgo::expandedPathsName()` and that seemed a bit over the top maybe...","created_at":"2017-05-12T03:08:43Z","updated_at":"2017-05-12T17:21:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10625709c2f2a1cb4f0700ef580a0777aacaa5ce","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084/commits","review_comments_url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084/comments","review_comment_url":"https://api.github.com/repos/GafferHQ/gaffer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GafferHQ/gaffer/issues/2084/comments","statuses_url":"https://api.github.com/repos/GafferHQ/gaffer/statuses/9ac50ae5c8cbcdc84418ae02f11797d1dee6cbc0","head":{"label":"andrewkaufman:screengrabUtil","ref":"screengrabUtil","sha":"9ac50ae5c8cbcdc84418ae02f11797d1dee6cbc0","user":{"login":"andrewkaufman","id":3979682,"avatar_url":"https://avatars2.githubusercontent.com/u/3979682?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewkaufman","html_url":"https://github.com/andrewkaufman","followers_url":"https://api.github.com/users/andrewkaufman/followers","following_url":"https://api.github.com/users/andrewkaufman/following{/other_user}","gists_url":"https://api.github.com/users/andrewkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewkaufman/subscriptions","organizations_url":"https://api.github.com/users/andrewkaufman/orgs","repos_url":"https://api.github.com/users/andrewkaufman/repos","events_url":"https://api.github.com/users/andrewkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewkaufman/received_events","type":"User","site_admin":false},"repo":{"id":9043305,"name":"gaffer","full_name":"andrewkaufman/gaffer","owner":{"login":"andrewkaufman","id":3979682,"avatar_url":"https://avatars2.githubusercontent.com/u/3979682?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewkaufman","html_url":"https://github.com/andrewkaufman","followers_url":"https://api.github.com/users/andrewkaufman/followers","following_url":"https://api.github.com/users/andrewkaufman/following{/other_user}","gists_url":"https://api.github.com/users/andrewkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewkaufman/subscriptions","organizations_url":"https://api.github.com/users/andrewkaufman/orgs","repos_url":"https://api.github.com/users/andrewkaufman/repos","events_url":"https://api.github.com/users/andrewkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/andrewkaufman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewkaufman/gaffer","description":"My day-to-day development. See ImageEngine/gaffer for official code","fork":true,"url":"https://api.github.com/repos/andrewkaufman/gaffer","forks_url":"https://api.github.com/repos/andrewkaufman/gaffer/forks","keys_url":"https://api.github.com/repos/andrewkaufman/gaffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewkaufman/gaffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewkaufman/gaffer/teams","hooks_url":"https://api.github.com/repos/andrewkaufman/gaffer/hooks","issue_events_url":"https://api.github.com/repos/andrewkaufman/gaffer/issues/events{/number}","events_url":"https://api.github.com/repos/andrewkaufman/gaffer/events","assignees_url":"https://api.github.com/repos/andrewkaufman/gaffer/assignees{/user}","branches_url":"https://api.github.com/repos/andrewkaufman/gaffer/branches{/branch}","tags_url":"https://api.github.com/repos/andrewkaufman/gaffer/tags","blobs_url":"https://api.github.com/repos/andrewkaufman/gaffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewkaufman/gaffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewkaufman/gaffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewkaufman/gaffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewkaufman/gaffer/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewkaufman/gaffer/languages","stargazers_url":"https://api.github.com/repos/andrewkaufman/gaffer/stargazers","contributors_url":"https://api.github.com/repos/andrewkaufman/gaffer/contributors","subscribers_url":"https://api.github.com/repos/andrewkaufman/gaffer/subscribers","subscription_url":"https://api.github.com/repos/andrewkaufman/gaffer/subscription","commits_url":"https://api.github.com/repos/andrewkaufman/gaffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewkaufman/gaffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewkaufman/gaffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewkaufman/gaffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewkaufman/gaffer/contents/{+path}","compare_url":"https://api.github.com/repos/andrewkaufman/gaffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewkaufman/gaffer/merges","archive_url":"https://api.github.com/repos/andrewkaufman/gaffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewkaufman/gaffer/downloads","issues_url":"https://api.github.com/repos/andrewkaufman/gaffer/issues{/number}","pulls_url":"https://api.github.com/repos/andrewkaufman/gaffer/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewkaufman/gaffer/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewkaufman/gaffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewkaufman/gaffer/labels{/name}","releases_url":"https://api.github.com/repos/andrewkaufman/gaffer/releases{/id}","deployments_url":"https://api.github.com/repos/andrewkaufman/gaffer/deployments","created_at":"2013-03-27T00:19:17Z","updated_at":"2016-10-03T18:21:02Z","pushed_at":"2017-05-12T16:19:04Z","git_url":"git://github.com/andrewkaufman/gaffer.git","ssh_url":"git@github.com:andrewkaufman/gaffer.git","clone_url":"https://github.com/andrewkaufman/gaffer.git","svn_url":"https://github.com/andrewkaufman/gaffer","homepage":"","size":26337,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GafferHQ:master","ref":"master","sha":"56d95d45208418424573cbe277487ffbc1e7fb46","user":{"login":"GafferHQ","id":20556043,"avatar_url":"https://avatars2.githubusercontent.com/u/20556043?v=3","gravatar_id":"","url":"https://api.github.com/users/GafferHQ","html_url":"https://github.com/GafferHQ","followers_url":"https://api.github.com/users/GafferHQ/followers","following_url":"https://api.github.com/users/GafferHQ/following{/other_user}","gists_url":"https://api.github.com/users/GafferHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/GafferHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GafferHQ/subscriptions","organizations_url":"https://api.github.com/users/GafferHQ/orgs","repos_url":"https://api.github.com/users/GafferHQ/repos","events_url":"https://api.github.com/users/GafferHQ/events{/privacy}","received_events_url":"https://api.github.com/users/GafferHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":9043124,"name":"gaffer","full_name":"GafferHQ/gaffer","owner":{"login":"GafferHQ","id":20556043,"avatar_url":"https://avatars2.githubusercontent.com/u/20556043?v=3","gravatar_id":"","url":"https://api.github.com/users/GafferHQ","html_url":"https://github.com/GafferHQ","followers_url":"https://api.github.com/users/GafferHQ/followers","following_url":"https://api.github.com/users/GafferHQ/following{/other_user}","gists_url":"https://api.github.com/users/GafferHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/GafferHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GafferHQ/subscriptions","organizations_url":"https://api.github.com/users/GafferHQ/orgs","repos_url":"https://api.github.com/users/GafferHQ/repos","events_url":"https://api.github.com/users/GafferHQ/events{/privacy}","received_events_url":"https://api.github.com/users/GafferHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GafferHQ/gaffer","description":"Gaffer is an open source application framework designed specifically for creating tools for use in visual effects production.","fork":false,"url":"https://api.github.com/repos/GafferHQ/gaffer","forks_url":"https://api.github.com/repos/GafferHQ/gaffer/forks","keys_url":"https://api.github.com/repos/GafferHQ/gaffer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GafferHQ/gaffer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GafferHQ/gaffer/teams","hooks_url":"https://api.github.com/repos/GafferHQ/gaffer/hooks","issue_events_url":"https://api.github.com/repos/GafferHQ/gaffer/issues/events{/number}","events_url":"https://api.github.com/repos/GafferHQ/gaffer/events","assignees_url":"https://api.github.com/repos/GafferHQ/gaffer/assignees{/user}","branches_url":"https://api.github.com/repos/GafferHQ/gaffer/branches{/branch}","tags_url":"https://api.github.com/repos/GafferHQ/gaffer/tags","blobs_url":"https://api.github.com/repos/GafferHQ/gaffer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GafferHQ/gaffer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GafferHQ/gaffer/git/refs{/sha}","trees_url":"https://api.github.com/repos/GafferHQ/gaffer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GafferHQ/gaffer/statuses/{sha}","languages_url":"https://api.github.com/repos/GafferHQ/gaffer/languages","stargazers_url":"https://api.github.com/repos/GafferHQ/gaffer/stargazers","contributors_url":"https://api.github.com/repos/GafferHQ/gaffer/contributors","subscribers_url":"https://api.github.com/repos/GafferHQ/gaffer/subscribers","subscription_url":"https://api.github.com/repos/GafferHQ/gaffer/subscription","commits_url":"https://api.github.com/repos/GafferHQ/gaffer/commits{/sha}","git_commits_url":"https://api.github.com/repos/GafferHQ/gaffer/git/commits{/sha}","comments_url":"https://api.github.com/repos/GafferHQ/gaffer/comments{/number}","issue_comment_url":"https://api.github.com/repos/GafferHQ/gaffer/issues/comments{/number}","contents_url":"https://api.github.com/repos/GafferHQ/gaffer/contents/{+path}","compare_url":"https://api.github.com/repos/GafferHQ/gaffer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GafferHQ/gaffer/merges","archive_url":"https://api.github.com/repos/GafferHQ/gaffer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GafferHQ/gaffer/downloads","issues_url":"https://api.github.com/repos/GafferHQ/gaffer/issues{/number}","pulls_url":"https://api.github.com/repos/GafferHQ/gaffer/pulls{/number}","milestones_url":"https://api.github.com/repos/GafferHQ/gaffer/milestones{/number}","notifications_url":"https://api.github.com/repos/GafferHQ/gaffer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GafferHQ/gaffer/labels{/name}","releases_url":"https://api.github.com/repos/GafferHQ/gaffer/releases{/id}","deployments_url":"https://api.github.com/repos/GafferHQ/gaffer/deployments","created_at":"2013-03-27T00:04:53Z","updated_at":"2017-05-09T05:50:15Z","pushed_at":"2017-05-12T16:19:05Z","git_url":"git://github.com/GafferHQ/gaffer.git","ssh_url":"git@github.com:GafferHQ/gaffer.git","clone_url":"https://github.com/GafferHQ/gaffer.git","svn_url":"https://github.com/GafferHQ/gaffer","homepage":"http://www.gafferhq.org","size":26422,"stargazers_count":274,"watchers_count":274,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":195,"forks":107,"open_issues":195,"watchers":274,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084"},"html":{"href":"https://github.com/GafferHQ/gaffer/pull/2084"},"issue":{"href":"https://api.github.com/repos/GafferHQ/gaffer/issues/2084"},"comments":{"href":"https://api.github.com/repos/GafferHQ/gaffer/issues/2084/comments"},"review_comments":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084/comments"},"review_comment":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GafferHQ/gaffer/pulls/2084/commits"},"statuses":{"href":"https://api.github.com/repos/GafferHQ/gaffer/statuses/9ac50ae5c8cbcdc84418ae02f11797d1dee6cbc0"}}}}
{"actor":{"display_login":"andrewkaufman"}}