[Bf-blender-cvs] [f929c03] gooseberry: Merge branch 'master' into gooseberry
Bastien Montagne
noreply at git.blender.org
Mon Jan 5 12:01:27 CET 2015
Commit: f929c03791300eb330b0b50e4ac2ab6a4368213a
Author: Bastien Montagne
Date: Mon Jan 5 11:56:50 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBf929c03791300eb330b0b50e4ac2ab6a4368213a
Merge branch 'master' into gooseberry
Conflicts:
source/blender/blenkernel/intern/camera.c
source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_camera.h
index 52fbc73,26d4986..db4e3bc
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@@ -119,10 -118,10 +119,12 @@@ void BKE_camera_view_frame_ex(struct Sc
void BKE_camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
bool BKE_camera_view_frame_fit_to_scene(struct Scene *scene, struct View3D *v3d, struct Object *camera_ob,
- float r_co[3]);
+ float r_co[3], float *r_scale);
+ bool BKE_camera_view_frame_fit_to_coords(struct Scene *scene, float (*cos)[3], int num_cos,
+ struct Object *camera_ob, float r_co[3], float *r_scale);
+void BKE_GPU_dof_from_camera(struct Object *camera, struct GPUFXOptions *options);
+
#ifdef __cplusplus
}
#endif
diff --cc source/blender/blenkernel/intern/camera.c
index 7f1c72b,d0470ba..a85195b
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@@ -591,21 -640,45 +640,60 @@@ static bool camera_frame_fit_calc_from_
return true;
}
}
+
+ return false;
+ }
+
+ /* don't move the camera, just yield the fit location */
+ /* r_scale only valid/useful for ortho cameras */
+ bool BKE_camera_view_frame_fit_to_scene(
+ Scene *scene, struct View3D *v3d, Object *camera_ob, float r_co[3], float *r_scale)
+ {
+ CameraParams params;
+ CameraViewFrameData data_cb;
+
+ /* just in case */
+ *r_scale = 1.0f;
+
+ camera_frame_fit_data_init(scene, camera_ob, ¶ms, &data_cb);
+
+ /* run callback on all visible points */
+ BKE_scene_foreach_display_point(scene, v3d, BA_SELECT, camera_to_frame_view_cb, &data_cb);
+
+ return camera_frame_fit_calc_from_data(¶ms, &data_cb, r_co, r_scale);
+ }
+
+ bool BKE_camera_view_frame_fit_to_coords(
+ Scene *scene, float (*cos)[3], int num_cos, Object *camera_ob, float r_co[3], float *r_scale)
+ {
+ CameraParams params;
+ CameraViewFrameData data_cb;
+
+ /* just in case */
+ *r_scale = 1.0f;
+
+ camera_frame_fit_data_init(scene, camera_ob, ¶ms, &data_cb);
+
+ /* run callback on all given coordinates */
+ while (num_cos--) {
+ camera_to_frame_view_cb(cos[num_cos], &data_cb);
+ }
+
+ return camera_frame_fit_calc_from_data(¶ms, &data_cb, r_co, r_scale);
}
+void BKE_GPU_dof_from_camera(struct Object *camera, struct GPUFXOptions *options)
+{
+ if (camera->type == OB_CAMERA) {
+ Camera *cam = camera->data;
+ options->dof_options = &cam->gpu_dof;
+ if (cam->dof_ob) {
+ float vec[3];
+ sub_v3_v3v3(vec, cam->dof_ob->obmat[3], camera->obmat[3]);
+ options->dof_options->dof_focus_distance = len_v3(vec);
+ }
+ else {
+ options->dof_options->dof_focus_distance = cam->YF_dofdist;
+ }
+ }
+}
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index a16cbb5,65721d5..24bdbca
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -3026,12 -3010,11 +3026,13 @@@ static void view3d_main_area_clear(Scen
*/
void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy,
float viewmat[4][4], float winmat[4][4],
- bool do_bgpic, bool do_sky)
+ bool do_bgpic, bool do_sky, GPUFX *fx, bool is_persp, GPUOffScreen *ofs, GPUFXOptions *fxoptions, int fxflags)
{
+ struct bThemeState theme_state;
int bwinx, bwiny;
rcti brect;
+ bool do_compositing = false;
+ RegionView3D *rv3d = ar->regiondata;
glPushMatrix();
diff --cc source/blender/editors/space_view3d/view3d_edit.c
index df3edc7,aab307b..7b403bf
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@@ -4373,10 -4373,10 +4373,10 @@@ void VIEW3D_OT_background_image_add(wmO
/* flags */
ot->flag = 0;
-
+
/* properties */
RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME - 2, "Name", "Image name to assign");
- WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE,
+ WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_IMAGE | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
}
More information about the Bf-blender-cvs
mailing list