[Bf-blender-cvs] [6450d89] blender-v2.75-release: Fix T45234: Stereo Parallel vs. Off-Axis
Dalai Felinto
noreply at git.blender.org
Mon Jun 29 16:18:49 CEST 2015
Commit: 6450d89592eaa933fcbad84b9051cb4db7e40fa6
Author: Dalai Felinto
Date: Mon Jun 29 10:24:25 2015 -0300
Branches: blender-v2.75-release
https://developer.blender.org/rB6450d89592eaa933fcbad84b9051cb4db7e40fa6
Fix T45234: Stereo Parallel vs. Off-Axis
Parallel rendering was not working.
The idea of having parallel convergence mode to render as parallel but
visualize as off-axis was good, but it was leading to some complications
in the code.
I think it's more clear to the user if parallel looks and render as
parallel, and if she wants to pre-visualize the converged planes, simply
temporarily set the camera to off-axis.
===================================================================
M release/scripts/startup/bl_ui/properties_data_camera.py
M source/blender/blenkernel/intern/camera.c
M source/blender/makesrna/intern/rna_camera.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index 24a67a2..92ec34e 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -153,10 +153,9 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
col = layout.column()
col.row().prop(st, "convergence_mode", expand=True)
- if st.convergence_mode == 'PARALLEL':
- col.prop(st, "viewport_convergence")
- else:
- col.prop(st, "convergence_distance")
+ sub = col.column()
+ sub.active = st.convergence_mode == 'OFFAXIS'
+ sub.prop(st, "convergence_distance")
col.prop(st, "interocular_distance")
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 87d81a9..b308dc7 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -908,6 +908,9 @@ static float camera_stereo3d_shift_x(Object *camera, const char *viewname)
convergence_mode = data->stereo.convergence_mode;
pivot = data->stereo.pivot;
+ if (convergence_mode != CAM_S3D_OFFAXIS)
+ return shift;
+
if (((pivot == CAM_S3D_PIVOT_LEFT) && is_left) ||
((pivot == CAM_S3D_PIVOT_RIGHT) && !is_left))
{
@@ -918,11 +921,7 @@ static float camera_stereo3d_shift_x(Object *camera, const char *viewname)
fac = 0.5f;
fac_signed = is_left ? fac : -fac;
-
- /* Note: in viewport, parallel renders as offaxis, but in render it does parallel */
- if (ELEM(convergence_mode, CAM_S3D_OFFAXIS, CAM_S3D_PARALLEL)) {
- shift += ((interocular_distance / data->sensor_x) * (data->lens / convergence_distance)) * fac_signed;
- }
+ shift += ((interocular_distance / data->sensor_x) * (data->lens / convergence_distance)) * fac_signed;
return shift;
}
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 16f74a0..9aec0ea 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -144,15 +144,6 @@ static void rna_def_camera_stereo_data(BlenderRNA *brna)
"The converge point for the stereo cameras "
"(often the distance between a projector and the projection screen)");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
-
- prop = RNA_def_property(srna, "viewport_convergence", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_float_sdna(prop, NULL, "convergence_distance");
- RNA_def_property_range(prop, 0.00001f, FLT_MAX);
- RNA_def_property_ui_range(prop, 0.0f, 15.f, 1, 2);
- RNA_def_property_ui_text(prop, "Viewport Convergence",
- "Preview convergence distance for the stereo effect in the viewport "
- "(it does not affect the render!)");
- RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
}
void RNA_def_camera(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list