Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Crop and Overscan in IECoreArnoldPreview #1744

Closed
danieldresser opened this issue May 27, 2016 · 0 comments
Closed

Support Crop and Overscan in IECoreArnoldPreview #1744

danieldresser opened this issue May 27, 2016 · 0 comments

Comments

@danieldresser
Copy link
Collaborator

danieldresser commented May 27, 2016

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?

I got as far as supporting crop, but not overscan, in the old API, which was really easy, and looked like this:

+++ b/contrib/IECoreArnold/src/IECoreArnold/RendererImplementation.cpp
@@ -234,6 +234,15 @@ void IECoreArnold::RendererImplementation::camera( const std::string &name, cons
        AiNodeSetInt( options, "xres", resolution->readable().x );
        AiNodeSetInt( options, "yres", resolution->readable().y );

+       const Box2fData *crop = cortexCamera->parametersData()->member<Box2fData>( "cropWindow" );
+       if( crop )
+       {
+               AiNodeSetInt( options, "region_min_x", resolution->readable().x * crop->readable().min.x );
+               AiNodeSetInt( options, "region_min_y", resolution->readable().y * crop->readable().min.y );
+               AiNodeSetInt( options, "region_max_x", resolution->readable().x * crop->readable().max.x );
+               AiNodeSetInt( options, "region_max_y", resolution->readable().y * crop->readable().max.y );
+       }
+
johnhaddon added a commit to johnhaddon/gaffer that referenced this issue Jun 2, 2016
johnhaddon added a commit to johnhaddon/gaffer that referenced this issue Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant