{"action":"opened","issue":{"url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1744","repository_url":"https://api.github.com/repos/ImageEngine/gaffer","labels_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1744/labels{/name}","comments_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1744/comments","events_url":"https://api.github.com/repos/ImageEngine/gaffer/issues/1744/events","html_url":"https://github.com/ImageEngine/gaffer/issues/1744","id":157301622,"number":1744,"title":"Support Crop and Overscan in IECoreArnoldPreview","user":{"login":"danieldresser","id":4043098,"avatar_url":"https://avatars.githubusercontent.com/u/4043098?v=3","gravatar_id":"","url":"https://api.github.com/users/danieldresser","html_url":"https://github.com/danieldresser","followers_url":"https://api.github.com/users/danieldresser/followers","following_url":"https://api.github.com/users/danieldresser/following{/other_user}","gists_url":"https://api.github.com/users/danieldresser/gists{/gist_id}","starred_url":"https://api.github.com/users/danieldresser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieldresser/subscriptions","organizations_url":"https://api.github.com/users/danieldresser/orgs","repos_url":"https://api.github.com/users/danieldresser/repos","events_url":"https://api.github.com/users/danieldresser/events{/privacy}","received_events_url":"https://api.github.com/users/danieldresser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-27T22:30:36Z","updated_at":"2016-05-27T22:30:36Z","closed_at":null,"body":"I started thinking of just throwing this into IECoreArnold myself real quick, but I'd forgotten that the current IECoreArnold is being deprecated.  In the new IECoreArnold, it's less obvious how to deal with render options that depend on each other ... it looks like the Arnold region_min_* parameters should depend on resolution, crop window, and overscan, and updating any of the 3 would need to update the region?\r\n\r\nI got as far as supporting crop, but not overscan, in the old API, which was really easy, and looked like this:\r\n\r\n+++ b/contrib/IECoreArnold/src/IECoreArnold/RendererImplementation.cpp\r\n@@ -234,6 +234,15 @@ void IECoreArnold::RendererImplementation::camera( const std::string &name, cons\r\n        AiNodeSetInt( options, \"xres\", resolution->readable().x );\r\n        AiNodeSetInt( options, \"yres\", resolution->readable().y );\r\n \r\n+       const Box2fData *crop = cortexCamera->parametersData()->member<Box2fData>( \"cropWindow\" );\r\n+       if( crop )\r\n+       {\r\n+               AiNodeSetInt( options, \"region_min_x\", resolution->readable().x * crop->readable().min.x );\r\n+               AiNodeSetInt( options, \"region_min_y\", resolution->readable().y * crop->readable().min.y );\r\n+               AiNodeSetInt( options, \"region_max_x\", resolution->readable().x * crop->readable().max.x );\r\n+               AiNodeSetInt( options, \"region_max_y\", resolution->readable().y * crop->readable().max.y );\r\n+       }\r\n+\r\n\r\n"}}
{"actor":{"display_login":"danieldresser"}}