4
$\begingroup$

Working on integrating the stereoscopic camera into a render addon (appleseed). Thanks to Brecht I figured out how to set the proper view and retrieve the X offset for the camera lens when off-axis mode is used, but I can't figure out how to get the matrices for the two views. None of the camera matrices (world, local) change when the view is changed in the render engine. Is there a matrix that I'm missing or do I have to do the math manually (which would suck)?

$\endgroup$
2
$\begingroup$

Thanks to Brecht (and some bug fixes to Blender), here's the workflow for using stereoscopic rendering in a render addon:

There are three main commands needed, all are part of the RenderEngine:

active_view_set: this is used to set the view to one of the stereo cameras. Use the same name as the view, i.e. if the view is called 'left' the command would be active_view_set(view='left')

The camera matrix of this view is retrieved by using camera_model_matrix.

If you use the offset orientation then there is also an x-axis lens shift in one or both cameras. That is retrieved with camera_shift_x.

For feeding render results into Blender, you need to add the view name to the begin_results call. Blender expects the render engine to manage the logic of rendering the image twice from the different cameras and feeding the results to the correct view in the render results.

Note: Due to a bug that was fixed after the release of Blender 2.79b, camera_model_matrix only works correctly if a recent buildbot build of Blender is used.

$\endgroup$
  • $\begingroup$ Good addition byob $\endgroup$ – jdent Aug 28 '18 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.