Commit: c0d8ed55e44cdd47a3366295e0b221cddecc7099
Author: Antony Riakiotakis
Date: Tue Nov 25 14:25:27 2014 +0100
Branches: gooseberry
https://developer.blender.org/rBc0d8ed55e44cdd47a3366295e0b221cddecc7099
Merge branch 'master' into gooseberry
Conflicts:
release/scripts/startup/bl_ui/space_sequencer.py
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_preview.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_space.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/CMakeLists.txt
index c68de35,fb717b1..5ded71e
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -36,8 -36,8 +36,9 @@@ set(IN
../bmesh
../modifiers
../nodes
+ ../physics
../render/extern/include
+ ../../../intern/ghost
../../../intern/guardedalloc
../../../intern/glew-mx
../../../intern/iksolver/extern
diff --cc source/blender/editors/interface/view2d.c
index 599c2f3,f42e359..339df223
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@@ -1055,8 -1055,8 +1055,8 @@@ static void view2d_map_cur_using_mask(V
}
}
-/* Set view matrices to use 'cur' rect as viewing frame for View2D drawing */
+/* Set view matrices to use 'cur' rect as viewing frame for View2D drawing,
return y/x aspect ratio */
- float UI_view2d_view_ortho(View2D *v2d)
+ void UI_view2d_view_ortho(View2D *v2d)
{
rctf curmasked;
const int sizex = BLI_rcti_size_x(&v2d->mask);
diff --cc source/blender/editors/space_sequencer/sequencer_edit.c
index 9324a4f,8c8b7c5..d568c6b
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@@ -1236,45 -1236,6 +1236,7 @@@ void SEQUENCER_OT_snap(struct wmOperato
RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame
where selected strips will be snapped", INT_MIN, INT_MAX);
}
- static int sequencer_parent_exec(bContext *C, wmOperator *UNUSED(op))
- {
- Scene *scene = CTX_data_scene(C);
-
- if (scene) {
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq, *active_seq = ed->act_seq;
-
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if (seq == active_seq)
- continue;
-
- if (seq->flag & SELECT) {
- seq->parent = active_seq;
- }
- }
- }
-
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-
- return OPERATOR_FINISHED;
- }
-
- void SEQUENCER_OT_parent(struct wmOperatorType *ot)
- {
- /* identifiers */
- ot->name = "Parent Strips";
- ot->idname = "SEQUENCER_OT_parent";
- ot->description = "";
-
- /* api callbacks */
- ot->exec = sequencer_parent_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- }
-
+
typedef struct SlipData {
int init_mouse[2];
float init_mouseloc[2];
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index d11ef89,d4a0c01..55d8dc2
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -2855,27 -3010,20 +3028,26 @@@ void ED_view3d_draw_offscreen(Scene *sc
GPU_free_images_anim();
}
+ /* setup view matrices before fx or unbinding the offscreen buffers
will cause issues */
+ view3d_main_area_setup_view(scene, v3d, ar, viewmat, winmat);
+
+ /* framebuffer fx needed, we need to draw offscreen first */
+ if (v3d->shader_fx && fx) {
+ do_compositing = GPU_initialize_fx_passes(fx, &ar->winrct,
NULL, fxflags, fxoptions);
+ }
+
/* clear opengl buffers */
if (do_sky) {
- float sky_color[3];
-
- ED_view3d_offscreen_sky_color_get(scene, sky_color);
- glClearColor(sky_color[0], sky_color[1], sky_color[2], 1.0f);
+ view3d_main_area_clear(scene, v3d, ar, true);
}
else {
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
+ /* setup view matrices */
+ view3d_main_area_setup_view(scene, v3d, ar, viewmat, winmat);
-
/* main drawing call */
view3d_draw_objects(NULL, scene, v3d, ar, NULL, do_bgpic, true);
@@@ -3237,209 -3374,6 +3409,7 @@@ static void view3d_main_area_draw_engin
ED_region_info_draw(ar, rv3d->render_engine->text, 1, fill_color);
}
- /*
- * Function to clear the view
- */
- static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar)
- {
- const bool is_wire_color = V3D_IS_WIRECOLOR(scene, v3d);
-
- /* clear background */
- if (scene->world && (v3d->flag2 & V3D_RENDER_OVERRIDE)) { /* clear
with solid color */
- if (scene->world->skytype & WO_SKYBLEND) { /* blend sky */
- int x, y;
- float col_hor[3];
- float col_zen[3];
-
- #define VIEWGRAD_RES_X 16
- #define VIEWGRAD_RES_Y 16
-
- GLubyte grid_col[VIEWGRAD_RES_X][VIEWGRAD_RES_Y][4];
- static float
grid_pos[VIEWGRAD_RES_X][VIEWGRAD_RES_Y][3];
- static GLushort indices[VIEWGRAD_RES_X -
1][VIEWGRAD_RES_X - 1][4];
- static bool buf_calculated = false;
-
- IMB_colormanagement_pixel_to_display_space_v3(col_hor,
&scene->world->horr, &scene->view_settings,
-
&scene->display_settings);
- IMB_colormanagement_pixel_to_display_space_v3(col_zen,
&scene->world->zenr, &scene->view_settings,
-
&scene->display_settings);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- glShadeModel(GL_SMOOTH);
-
- /* calculate buffers the first time only */
- if (!buf_calculated) {
- for (x = 0; x < VIEWGRAD_RES_X; x++) {
- for (y = 0; y < VIEWGRAD_RES_Y; y++) {
- const float xf = (float)x /
(float)(VIEWGRAD_RES_X - 1);
- const float yf = (float)y /
(float)(VIEWGRAD_RES_Y - 1);
-
- /* -1..1 range */
- grid_pos[x][y][0] = (xf - 0.5f)
* 2.0f;
- grid_pos[x][y][1] = (yf - 0.5f)
* 2.0f;
- grid_pos[x][y][2] = 1.0;
- }
- }
-
- for (x = 0; x < VIEWGRAD_RES_X - 1; x++) {
- for (y = 0; y < VIEWGRAD_RES_Y - 1;
y++) {
- indices[x][y][0] = x *
VIEWGRAD_RES_X + y;
- indices[x][y][1] = x *
VIEWGRAD_RES_X + y + 1;
- indices[x][y][2] = (x + 1) *
VIEWGRAD_RES_X + y + 1;
- indices[x][y][3] = (x + 1) *
VIEWGRAD_RES_X + y;
- }
- }
-
- buf_calculated = true;
- }
-
- for (x = 0; x < VIEWGRAD_RES_X; x++) {
- for (y = 0; y < VIEWGRAD_RES_Y; y++) {
- const float xf = (float)x /
(float)(VIEWGRAD_RES_X - 1);
- const float yf = (float)y /
(float)(VIEWGRAD_RES_Y - 1);
- const float mval[2] = {xf *
(float)ar->winx, yf * ar->winy};
- const float z_up[3] = {0.0f, 0.0f,
1.0f};
- float out[3];
- GLubyte *col_ub = grid_col[x][y];
-
- float col_fac;
- float col_fl[3];
-
- ED_view3d_win_to_vector(ar, mval, out);
-
- if (scene->world->skytype &
WO_SKYPAPER) {
- if (scene->world->skytype &
WO_SKYREAL) {
- col_fac =
fabsf(((float)y / (float)VIEWGRAD_RES_Y) - 0.5f) * 2.0f;
- }
- else {
- col_fac = (float)y /
(float)VIEWGRAD_RES_Y;
- }
- }
- else {
- if (scene->world->skytype &
WO_SKYREAL) {
- col_fac =
fabsf((angle_normalized_v3v3(z_up, out) / (float)M_PI) - 0.5f) * 2.0f;
- }
- else {
- col_fac = 1.0f -
(angle_normalized_v3v3(z_up, out) / (float)M_PI);
- }
- }
-
- interp_v3_v3v3(col_fl, col_hor,
col_zen, col_fac);
-
- rgb_float_to_uchar(col_ub, col_fl);
- col_ub[3] = 0;
- }
- }
-
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_ALWAYS);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, grid_pos);
- glColorPointer(4, GL_UNSIGNED_BYTE, 0, grid_col);
-
- glDrawElements(GL_QUADS, (VIEWGRAD_RES_X - 1) *
(VIEWGRAD_RES_Y - 1) * 4, GL_UNSIGNED_SHORT, indices);
-
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
-
- glDepthFunc(GL_LEQUAL);
- glDisable(GL_DEPTH_TEST);
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- glShadeModel(GL_FLAT);
-
- #undef VIEWGRAD_RES_X
- #undef VIEWGRAD_RES_Y
-
- if (is_wire_color) {
- float col_mid[3];
- mid_v3_v3v3(col_mid, col_hor, col_zen);
- draw_object_bg_wire_color_set(col_mid);
- }
- }
- else { /* solid sky */
- float col_hor[3];
- IMB_colormanagement_pixel_to_display_space_v3(col_hor,
&scene->world->horr, &scene->view_settings,
-
&scene->display_settings);
-
- glClearColor(col_hor[0], col_hor[1], col_hor[2], 0.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- if (is_wire_color) {
- draw_object_bg_wire_color_set(col_hor);
- }
- }
- }
- else {
- if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) {
- float col_low[3], col_high[3];
-
- UI_GetThemeColor3fv(TH_HIGH_GRAD, col_high);
- UI_GetThemeColor3fv(TH_LOW_GRAD, col_low);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_ALWAYS);
- glShadeModel(GL_SMOOTH);
- glBegin(GL_QUADS);
- glColor3fv(col_low);
- glVertex3f(-1.0, -1.0, 1.0);
- glVertex3f(1.0, -1.0, 1.0);
- glColor3fv(col_high);
- glVertex3f(1.0, 1.0, 1.0);
- glVertex3f(-1.0, 1.0, 1.0);
- glEnd();
- glShadeModel(GL_FLAT);
-
- glDepthFunc(GL_LEQUAL);
- glDisable(GL_DEPTH_TEST);
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
-
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- if (is_wire_color) {
- float col_mid[3];
- mid_v3_v3v3(col_mid, col_low, col_high);
- draw_object_bg_wire_color_set(col_mid);
- }
- }
- else {
- float col[3];
-
- UI_GetThemeColor3fv(TH_HIGH_GRAD, col);
-
- glClearColor(col[0], col[1], col[2], 0.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- if (is_wire_color) {
- draw_object_bg_wire_color_set(col);
- }
- }
- }
- }
-
+
#ifdef WITH_GAMEENGINE
static void update_lods(Scene *scene, float camera_pos[3])
{
@@@ -3486,22 -3418,8 +3456,22 @@@ static void view3d_main_area_draw_objec
}
#endif
+ /* framebuffer fx needed, we need to draw offscreen first */
+ if (v3d->shader_fx) {
+ GPUFXOptions options;
+ BKE_screen_view3d_ensure_FX(v3d);
+ options = *v3d->fxoptions;
+ if (!rv3d->compositor)
+ rv3d->compositor = GPU_crea
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs