Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-04 18:36:06 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-04 18:36:06 +0400
commit4ea816837de646af124ffc82758cae37950a0a51 (patch)
tree771c7a0e084446080d6f6d12258585a479bf2887 /source/blender/editors/sculpt_paint
parent82dc05391cdda573f1523325bfd4c6a2a5233323 (diff)
Configurable sensor size:
- Added support of variable size sensor width and height. - Added presets for most common cameras, also new presets can be defined by user. - Added option to control which dimension (vertical or horizontal) of sensor size defines FOV. Old behavior of automatic FOV calculation is also kept. - Renderer, viewport, game engine and collada importer/exporter should deal fine with this changes. Other exporters would be updated soon.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d49ce0cf49a..92544b2309c 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -57,6 +57,7 @@
#include "IMB_imbuf_types.h"
#include "DNA_brush_types.h"
+#include "DNA_camera_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
@@ -3000,7 +3001,8 @@ static void project_paint_begin(ProjPaintState *ps)
Object *camera= ps->scene->camera;
/* dont actually use these */
- float _viewdx, _viewdy, _ycor, _lens=0.0f;
+ float _viewdx, _viewdy, _ycor, _lens=0.0f, _sensor_x=DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
+ short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
rctf _viewplane;
/* viewmat & viewinv */
@@ -3012,7 +3014,7 @@ static void project_paint_begin(ProjPaintState *ps)
object_camera_mode(&ps->scene->r, camera);
object_camera_matrix(&ps->scene->r, camera, ps->winx, ps->winy, 0,
winmat, &_viewplane, &ps->clipsta, &ps->clipend,
- &_lens, &_ycor, &_viewdx, &_viewdy);
+ &_lens, &_sensor_x, &_sensor_x, &_sensor_fit, &_ycor, &_viewdx, &_viewdy);
ps->is_ortho= (ps->scene->r.mode & R_ORTHO) ? 1 : 0;
}