Commit: 82a4d19a6bcd86977a9d93ad020c3ad773aa5db0
Author: Julian Eisel
Date:   Wed Apr 8 16:29:36 2015 +0200
Branches: gooseberry
https://developer.blender.org/rB82a4d19a6bcd86977a9d93ad020c3ad773aa5db0

Merge branch 'wiggly-widgets' into gooseberry

Conflicts:
        source/blender/blenloader/intern/versioning_270.c
        source/blender/editors/include/ED_transform.h
        source/blender/windowmanager/intern/wm_operators.c

===================================================================

M       source/blender/blenloader/intern/readfile.c
M       source/blender/blenloader/intern/versioning_270.c
M       source/blender/blenloader/intern/writefile.c
M       source/blender/editors/include/BIF_glutil.h
M       source/blender/editors/include/ED_screen.h
M       source/blender/editors/include/ED_transform.h
M       source/blender/editors/interface/interface_draw.c
M       source/blender/editors/render/render_internal.c
M       source/blender/editors/screen/area.c
M       source/blender/editors/screen/glutil.c
M       source/blender/editors/space_clip/clip_draw.c
M       source/blender/editors/space_graph/graph_buttons.c
M       source/blender/editors/space_graph/graph_edit.c
M       source/blender/editors/space_graph/graph_intern.h
M       source/blender/editors/space_graph/graph_ops.c
M       source/blender/editors/space_graph/space_graph.c
M       source/blender/editors/space_image/image_draw.c
M       source/blender/editors/space_node/drawnode.c
M       source/blender/editors/space_sequencer/sequencer_draw.c
M       source/blender/editors/space_sequencer/sequencer_intern.h
M       source/blender/editors/space_sequencer/sequencer_ops.c
M       source/blender/editors/space_sequencer/sequencer_view.c
M       source/blender/editors/space_sequencer/space_sequencer.c
M       source/blender/editors/space_view3d/view3d_ops.c
M       source/blender/makesdna/DNA_space_types.h
M       source/blender/makesrna/intern/rna_space.c
M       source/blender/windowmanager/WM_api.h
M       source/blender/windowmanager/intern/wm_generic_widgets.c
M       source/blender/windowmanager/intern/wm_widgets.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 1e83511..4b395c3 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6036,6 +6036,7 @@ static void lib_link_screen(FileData *fd, Main *main)
                                                        ads->source = 
newlibadr(fd, sc->id.lib, ads->source);
                                                        ads->filter_grp = 
newlibadr(fd, sc->id.lib, ads->filter_grp);
                                                }
+                                               sipo->backdrop_camera = 
newlibadr(fd, sc->id.lib, sipo->backdrop_camera);
                                        }
                                        else if (sl->spacetype == SPACE_BUTS) {
                                                SpaceButs *sbuts = (SpaceButs 
*)sl;
@@ -6360,6 +6361,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen 
*curscreen, Scene *cursc
                                                if (ads->filter_grp)
                                                        ads->filter_grp = 
restore_pointer_by_name(newmain, (ID *)ads->filter_grp, USER_IGNORE);
                                        }
+                                       sipo->backdrop_camera = 
restore_pointer_by_name(newmain, (ID *)sipo->backdrop_camera, USER_IGNORE);
                                        
                                        /* force recalc of list of channels 
(i.e. includes calculating F-Curve colors)
                                         * thus preventing the "black curves" 
problem post-undo
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 1ab1154..154eea4 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -986,4 +986,20 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
                        }
                }
        }
+       if (!DNA_struct_elem_find(fd->filesdna, "SpaceIpo", "float", 
"backdrop_zoom")) {
+               bScreen *sc;
+               for (sc = main->screen.first; sc; sc = sc->id.next) {
+                       ScrArea *sa;
+                       for (sa = sc->areabase.first; sa; sa = sa->next) {
+                               SpaceLink *sl;
+                               for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
+                                       if (sl->spacetype == SPACE_IPO) {
+                                               SpaceIpo *sipo = (SpaceIpo *)sl;
+                                               sipo->backdrop_zoom = 1.0f;
+                                               sipo->backdrop_opacity = 0.7f;
+                                       }
+                               }
+                       }
+               }
+       }
 }
diff --git a/source/blender/blenloader/intern/writefile.c 
b/source/blender/blenloader/intern/writefile.c
index ef5ed5e..087146c 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2740,7 +2740,10 @@ static void write_screens(WriteData *wd, ListBase 
*scrbase)
                                        
                                        writestruct(wd, DATA, "SpaceIpo", 1, 
sl);
                                        if (sipo->ads) writestruct(wd, DATA, 
"bDopeSheet", 1, sipo->ads);
-                                       
+
+                                       if (sipo->backdrop_camera)
+                                               writestruct(wd, DATA, "Object", 
1, sipo->backdrop_camera);
+
                                        /* reenable ghost curves */
                                        sipo->ghostCurves= tmpGhosts;
                                }
diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index 4dc3968..ae253fe 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -155,7 +155,8 @@ void glaDrawPixelsTex(float x, float y, int img_w, int 
img_h, int format, int ty
  * only RGBA
  * needs glaDefine2DArea to be set.
  */
-void glaDrawPixelsAuto(float x, float y, int img_w, int img_h, int format, int 
type, int zoomfilter, void *rect);
+void glaDrawPixelsAuto(float x, float y, int img_w, int img_h, int format,
+                       int type, int zoomfilter, float alpha, void *rect);
 
 
 void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int 
format, int type, int zoomfilter, void *rect, float scaleX, float scaleY);
@@ -217,12 +218,12 @@ void bgl_get_mats(bglMats *mats);
 /* **** Color management helper functions for GLSL display/transform ***** */
 
 /* Draw imbuf on a screen, preferably using GLSL display transform */
-void glaDrawImBuf_glsl(struct ImBuf *ibuf, float x, float y, int zoomfilter,
+void glaDrawImBuf_glsl(struct ImBuf *ibuf, float x, float y, int zoomfilter, 
float alpha,
                        struct ColorManagedViewSettings *view_settings,
                        struct ColorManagedDisplaySettings *display_settings);
 
 /* Draw imbuf on a screen, preferably using GLSL display transform */
-void glaDrawImBuf_glsl_ctx(const struct bContext *C, struct ImBuf *ibuf, float 
x, float y, int zoomfilter);
+void glaDrawImBuf_glsl_ctx(const struct bContext *C, struct ImBuf *ibuf, float 
x, float y, int zoomfilter, float alpha);
 
 void glaDrawBorderCorners(const struct rcti *border, float zoomx, float zoomy);
 
diff --git a/source/blender/editors/include/ED_screen.h 
b/source/blender/editors/include/ED_screen.h
index 90b0b35..e23f155 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -67,6 +67,9 @@ void    ED_region_header(const struct bContext *C, struct 
ARegion *ar);
 void    ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar);
 void    ED_region_info_draw(struct ARegion *ar, const char *text, int block, 
float fill_color[4]);
 void    ED_region_grid_draw(struct ARegion *ar, float zoomx, float zoomy);
+void    ED_region_draw_backdrop_view3d(const struct bContext *C, struct Object 
*camera, const float alpha,
+                                       const float width, const float height, 
const float x, const float y,
+                                       const float zoomx, const float zoomy, 
const bool draw_background);
 float  ED_region_blend_factor(struct ARegion *ar);
 void   ED_region_visible_rect(struct ARegion *ar, struct rcti *rect);
 
diff --git a/source/blender/editors/include/ED_transform.h 
b/source/blender/editors/include/ED_transform.h
index 36d9417..8382428 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -35,15 +35,18 @@
 /* ******************* Registration Function ********************** */
 
 struct ARegion;
+struct EnumPropertyItem;
 struct ListBase;
 struct Object;
 struct View3D;
 struct bContext;
+struct uiLayout;
 struct wmEvent;
 struct wmKeyConfig;
 struct wmKeyMap;
 struct wmOperatorType;
-/*struct PointerRNA;*/  /* view3d manipulators */
+struct wmWindowManager;
+struct PointerRNA;
 
 void transform_keymap_for_space(struct wmKeyConfig *keyconf, struct wmKeyMap 
*keymap, int spaceid);
 void transform_operatortypes(void);
@@ -107,6 +110,7 @@ enum TfmMode {
 bool calculateTransformCenter(struct bContext *C, int centerMode, float 
cent3d[3], float cent2d[2]);
 
 struct TransInfo;
+struct ScrArea;
 struct Base;
 struct Scene;
 struct Object;
diff --git a/source/blender/editors/interface/interface_draw.c 
b/source/blender/editors/interface/interface_draw.c
index 414903f..f4bf133 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -436,7 +436,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, 
uiWidgetColors *UNUSED(w
                float facy = (float)h / (float)ibuf->y;
                glPixelZoom(facx, facy);
        }
-       glaDrawPixelsAuto((float)rect->xmin, (float)rect->ymin, ibuf->x, 
ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, ibuf->rect);
+       glaDrawPixelsAuto((float)rect->xmin, (float)rect->ymin, ibuf->x, 
ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, 1.0f, ibuf->rect);
        
        glPixelZoom(1.0f, 1.0f);
        
diff --git a/source/blender/editors/render/render_internal.c 
b/source/blender/editors/render/render_internal.c
index f76f7ca..c0f7c52 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -1548,8 +1548,8 @@ void render_view3d_draw(RenderEngine *engine, const 
bContext *C)
                        glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
                        glPixelZoom(scale_x, scale_y);
                        glaDrawPixelsAuto(xof, yof, rres.rectx, rres.recty,
-                                         GL_RGBA, GL_UNSIGNED_BYTE,
-                                         GL_NEAREST, display_buffer);
+                                         GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST,
+                                         1.0f, display_buffer);
                        glPixelZoom(1.0f, 1.0f);
                        glDisable(GL_BLEND);
 
diff --git a/source/blender/editors/screen/area.c 
b/source/blender/editors/screen/area.c
index 455d280..82a1cca 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -34,6 +34,7 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "DNA_object_types.h"
 #include "DNA_userdef_types.h"
 
 #include "BLI_blenlib.h"
@@ -44,6 +45,8 @@
 
 #include "BKE_context.h"
 #include "BKE_global.h"
+#include "BKE_main.h"
+#include "BKE_scene.h"
 #include "BKE_screen.h"
 
 #include "RNA_access.h"
@@ -56,6 +59,7 @@
 #include "ED_screen.h"
 #include "ED_screen_types.h"
 #include "ED_space_api.h"
+#include "ED_view3d.h"
 
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
@@ -66,6 +70,9 @@
 #include "UI_resources.h"
 #include "UI_view2d.h"
 
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
 #include "screen_intern.h"
 
 extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float 
x3, float y3); /* xxx temp */
@@ -2088,6 +2095,47 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float 
zoomy)
        glEnd();
 }
 
+/* uses the viewplane from the given camera and draws it as a backdrop */
+void ED_region_draw_backdrop_view3d(const bContext *C, struct Object *camera, 
const float alpha,
+                                    const float width, const float height, 
const float x, const float y,
+                                    const float zoomx, const float zoomy, 
const bool draw_background)
+{
+       Main *bmain = CTX_data_main(C);
+       Scene *scene = CTX_data_scene(C);
+       char err_out[256] = "unknown";
+       struct ImBuf *ibuf;
+
+       BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene, 
scene->lay);
+       ibuf = ED_view3d_draw_offscreen_imbuf_simple(scene, camera, width, 
height, IB_rect,
+                                                    OB_SOLID, false, false, 
false,
+                                                    R_ADDSKY, NULL, err_out);
+
+       if (ibuf == NULL)
+               return;
+
+       glEnable(GL_BLEND);
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+       glPushMatrix();
+       glScalef(zoomx, zoomy, 0.0f);
+       glTranslatef(x, y, 0.0f);
+
+       /* draw background */
+       if (draw_background) {
+               char col[4];
+
+               UI_GetThemeColorType4ubv(TH_HIGH_GRAD, SPACE_VIEW3D, col);
+               glColor4ub(UNPACK3(col), alpha * 255);
+               glRectf(0, 0, width, height);
+       }
+       /* draw the imbuf itself */
+       glaDrawImBuf_glsl_ctx(C, ibuf, 0.0f, 0.0f, GL_NEAREST, alpha);
+
+       glPopMatrix();
+       glDisable(GL_BLEND);
+
+       IMB_free

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to