2.5
authorTon Roosendaal <ton@blender.org>
Sat, 21 Feb 2009 19:17:31 +0000 (19:17 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 21 Feb 2009 19:17:31 +0000 (19:17 +0000)
View3D: background image buttons back. Again nice
to use blend or size or other sliders for live
updates. :)

Note that 'load' doesnt work yet, the operator for
image load only does space-image now.

Also note that with a built-in 4-split option, we
can also encode a way to show 3 different pics.

source/blender/editors/include/ED_image.h
source/blender/editors/space_image/image_panels.c
source/blender/editors/space_view3d/view3d_buttons.c

index 99a8a02e7cf28bd2e480852852b26ae05d1e8d7a..566105109b25192fb2edd5aae1f94d6c788d57b8 100644 (file)
@@ -30,6 +30,9 @@
 
 struct SpaceImage;
 struct bContext;
+struct Image;
+struct ImageUser;
+struct uiBlock;
 
 /* space_image.c, exported for transform */
 struct Image *ED_space_image(struct SpaceImage *sima);
@@ -50,6 +53,9 @@ int ED_space_image_show_paint(struct SpaceImage *sima);
 int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
 int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit);
 
+void ED_image_uiblock_panel(const struct bContext *C, struct uiBlock *block, struct Image **ima_pp, 
+                                                       struct ImageUser *iuser, short redraw, short imagechanged);
+
 /* image_render.c, export for screen_ops.c, render operator */
 void ED_space_image_output(struct bContext *C);
 
index cfca3b04ff92fe5780c4fc8909c9d75710b502c1..c0fe8afd036dc28340ef38cd29cb6fbf30e543ac 100644 (file)
@@ -1229,7 +1229,7 @@ static void uiblock_layer_pass_arrow_buttons(uiBlock *block, RenderResult *rr, I
 static int packdummy=0;
 
 /* The general Image panel with the loadsa callbacks! */
-void uiblock_image_panel(const bContext *C, uiBlock *block, Image **ima_pp, ImageUser *iuser, 
+void ED_image_uiblock_panel(const bContext *C, uiBlock *block, Image **ima_pp, ImageUser *iuser, 
                                                 short redraw, short imagechanged)
 {
        Scene *scene= CTX_data_scene(C);
@@ -1410,7 +1410,7 @@ static void image_panel_properties(const bContext *C, ARegion *ar)
        uiBlockSetHandleFunc(block, do_image_panel_events, NULL);
 
        /* note, it draws no bottom half in facemode, for vertex buttons */
-       uiblock_image_panel(C, block, &sima->image, &sima->iuser, B_REDR, B_REDR);
+       ED_image_uiblock_panel(C, block, &sima->image, &sima->iuser, B_REDR, B_REDR);
        image_editvertex_buts(C, block);
        
        uiEndBlock(C, block);
index d449b0cc774e4861d98e3df18a66e09c136727b2..668e9bb748b4dce0c00cdc44e134af9ca20ad90a 100644 (file)
 
 #include "ED_armature.h"
 #include "ED_curve.h"
-#include "ED_particle.h"
+#include "ED_image.h"
 #include "ED_keyframing.h"
 #include "ED_mesh.h"
 #include "ED_object.h"
+#include "ED_particle.h"
 #include "ED_screen.h"
 #include "ED_types.h"
 #include "ED_util.h"
@@ -1303,6 +1304,7 @@ static void view3d_panel_background(const bContext *C, ARegion *ar, short cntrl)
 
        block= uiBeginBlock(C, ar, "view3d_panel_background", UI_EMBOSS, UI_HELV);
        if(uiNewPanel(C, ar, block, "Background Image", "View3d", 340, 10, 318, 204)==0) return;
+       uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
 
        if(v3d->flag & V3D_DISPBGPIC) {
                if(v3d->bgpic==NULL) {
@@ -1327,7 +1329,7 @@ static void view3d_panel_background(const bContext *C, ARegion *ar, short cntrl)
                uiDefButF(block, NUM, B_REDR, "X Offset:",      10, 205, 150, 20, &v3d->bgpic->xof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the horizontal offset of the background image");
                uiDefButF(block, NUM, B_REDR, "Y Offset:",      160, 205, 150, 20, &v3d->bgpic->yof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the vertical offset of the background image");
                
-// XXX         uiblock_image_panel(block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR);
+               ED_image_uiblock_panel(C, block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR);
                uiBlockEndAlign(block);
        }
        uiEndBlock(C, block);