Stereoscopic rendering for addon

I’m interested in appleseed being able to use stereoscopic rendering. I’ve added the control panels and the 3D viewport works correctly however when I render it only renders the left image and then stops. This happens regardless of the camera or output settings. Am I missing some variable in the render operator or the export stage? The online docs don’t show anything.

I don’t think there’s any documentation for it, but the render engine is expected to fill in all the views in the render result.

If you set the active view in the engine, you can get the camera shift and matrices for that view.

Hey Brecht. I managed to retrieve the X-offset for the cameras but I’m not sure where to pull the matrices from for any rotations (none of the camera matrices change with a different view_set). I’m playing around with camera_model_matrix but I can’t get it to work, nor am I sure that’s even the right option.

camera_model_matrix is not working for me at all. Here’s what I’m feeding the addon for testing:

matrix = mathutils.Matrix()
self.camera_model_matrix(, False, matrix)

Here’s what I get:

<Matrix 4x4 (0.7077, -0.2579, 0.6578, 7.4811)
(0.7065, 0.2583, -0.6588, -6.5076)
(0.0000, 0.9310, 0.3650, 5.3437)
(0.0000, 0.0000, 0.0000, 1.0000)>
<Matrix 4x4 (1.0000, 0.0000, 0.0000, 0.0000)
(0.0000, 1.0000, 0.0000, 0.0000)
(0.0000, 0.0000, 1.0000, 0.0000)
(0.0000, 0.0000, 0.0000, 1.0000)>

So camera_model_matrix doesn’t do anything to the matrix I feed into it, even with stereoscopic off. Am I using it wrong or is it broken?

It seems to be broken indeed, I’ve committed a fix.

Now this should work:

def render(self, scene):
    for view in scene.render.views:        
        camera = self.camera_override if self.camera_override else
        shift_x = self.camera_shift_x(camera, False)
        matrix = self.camera_model_matrix(camera, False)


Thanks Brecht! I have to rebuild appleseed for python 3.6 before I can try it out but I’ll keep you posted.

Hi Brecht. I can retrieve the matrices now. Thank you for the fix!