Revision: 42045
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42045
Author:   campbellbarton
Date:     2011-11-21 23:56:32 +0000 (Mon, 21 Nov 2011)
Log Message:
-----------
image save operator now shares settings and UI with render & image out node.

details:
- setting format options from python isnt possible anymore since this isnt 
exposed via op->properties, python should use image.save() function instead.
- image save UI now hides 'Relative' option when copy is selected since it has 
no effect.
- default image depth is set to 8 or more if the image has no float buffer, 
otherwise its set to 32 or less.

other fixes:
- image new was adding an image with a filepath set to "untitled", if this file 
happened to exist in the current directory a save on the generated image would 
overwrite it, now initialize to empty path.
- BKE_ftype_to_imtype was returning an invalid value if ftype==0.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_image.h
    trunk/blender/source/blender/blenkernel/BKE_writeavi.h
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/blenkernel/intern/writeavi.c
    trunk/blender/source/blender/editors/include/UI_interface.h
    trunk/blender/source/blender/editors/interface/interface_layout.c
    trunk/blender/source/blender/editors/interface/interface_utils.c
    trunk/blender/source/blender/editors/render/render_shading.c
    trunk/blender/source/blender/editors/sound/sound_ops.c
    trunk/blender/source/blender/editors/space_file/file_panels.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/render/extern/include/RE_pipeline.h
    trunk/blender/source/blender/render/intern/source/pipeline.c
    trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c

Modified: trunk/blender/source/blender/blenkernel/BKE_image.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_image.h 2011-11-21 20:47:19 UTC 
(rev 42044)
+++ trunk/blender/source/blender/blenkernel/BKE_image.h 2011-11-21 23:56:32 UTC 
(rev 42045)
@@ -53,17 +53,17 @@
 int            BKE_alphatest_ibuf(struct ImBuf *ibuf);
 int            BKE_write_ibuf_stamp(struct Scene *scene, struct Object 
*camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
 int            BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct 
ImageFormatData *imf);
-void   BKE_makepicstring(char *string, const char *base, const char *relbase, 
int frame, int imtype, const short use_ext, const short use_frames);
-int            BKE_add_image_extension(char *string, int imtype);
-int            BKE_ftype_to_imtype(int ftype);
-int            BKE_imtype_to_ftype(int imtype);
+void   BKE_makepicstring(char *string, const char *base, const char *relbase, 
int frame, char imtype, const short use_ext, const short use_frames);
+int            BKE_add_image_extension(char *string, const char imtype);
+char   BKE_ftype_to_imtype(const int ftype);
+int            BKE_imtype_to_ftype(char imtype);
 
-int            BKE_imtype_is_movie(int imtype);
-int            BKE_imtype_is_alpha_ok(int imtype);
-int            BKE_imtype_is_zbuf_ok(int imtype);
-int            BKE_imtype_is_compression_ok(int imtype);
-int            BKE_imtype_is_quality_ok(int imtype);
-int            BKE_imtype_is_depth_ok(int imtype);
+int            BKE_imtype_is_movie(const char imtype);
+int            BKE_imtype_is_alpha_ok(const char imtype);
+int            BKE_imtype_is_zbuf_ok(const char imtype);
+int            BKE_imtype_is_compression_ok(const char imtype);
+int            BKE_imtype_is_quality_ok(const char imtype);
+char   BKE_imtype_is_depth_ok(const char imtype);
 
 struct anim *openanim(const char *name, int flags, int streamindex);
 

Modified: trunk/blender/source/blender/blenkernel/BKE_writeavi.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_writeavi.h      2011-11-21 
20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/blenkernel/BKE_writeavi.h      2011-11-21 
23:56:32 UTC (rev 42045)
@@ -50,7 +50,7 @@
        void (*get_movie_path)(char *string, struct RenderData *rd); /* 
optional */
 } bMovieHandle;
 
-bMovieHandle *BKE_get_movie_handle(int imtype);
+bMovieHandle *BKE_get_movie_handle(const char imtype);
 void BKE_makeanimstring(char *string, struct RenderData *rd);
 
 #ifdef __cplusplus

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c      2011-11-21 
20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/blenkernel/intern/image.c      2011-11-21 
23:56:32 UTC (rev 42045)
@@ -556,13 +556,13 @@
        if (ima) {
                ImBuf *ibuf;
                
-               BLI_strncpy(ima->name, name, FILE_MAX);
+               /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* dont do this, 
this writes in ain invalid filepath! */
                ima->gen_x= width;
                ima->gen_y= height;
                ima->gen_type= uvtestgrid;
                ima->gen_flag |= (floatbuf ? IMA_GEN_FLOAT : 0);
                
-               ibuf= add_ibuf_size(width, height, name, depth, floatbuf, 
uvtestgrid, color);
+               ibuf= add_ibuf_size(width, height, ima->name, depth, floatbuf, 
uvtestgrid, color);
                image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
                
                ima->ok= IMA_OK_LOADED;
@@ -800,7 +800,7 @@
 
 /* *********** READ AND WRITE ************** */
 
-int BKE_imtype_to_ftype(int imtype)
+int BKE_imtype_to_ftype(const char imtype)
 {
        if(imtype==R_TARGA)
                return TGA;
@@ -840,10 +840,10 @@
                return JPG|90;
 }
 
-int BKE_ftype_to_imtype(int ftype)
+char BKE_ftype_to_imtype(const int ftype)
 {
        if(ftype==0)
-               return TGA;
+               return R_TARGA;
        else if(ftype == IMAGIC) 
                return R_IRIS;
 #ifdef WITH_HDR
@@ -883,7 +883,7 @@
 }
 
 
-int BKE_imtype_is_movie(int imtype)
+int BKE_imtype_is_movie(const char imtype)
 {
        switch(imtype) {
        case R_AVIRAW:
@@ -900,7 +900,7 @@
        return 0;
 }
 
-int BKE_imtype_is_alpha_ok(int imtype)
+int BKE_imtype_is_alpha_ok(const char imtype)
 {
        switch(imtype) {
        case R_TARGA:
@@ -918,7 +918,7 @@
        return 0;
 }
 
-int BKE_imtype_is_zbuf_ok(int imtype)
+int BKE_imtype_is_zbuf_ok(const char imtype)
 {
        switch(imtype) {
        case R_IRIZ:
@@ -928,7 +928,7 @@
        return 0;
 }
 
-int BKE_imtype_is_compression_ok(int imtype)
+int BKE_imtype_is_compression_ok(const char imtype)
 {
        switch(imtype) {
        case R_PNG:
@@ -937,7 +937,7 @@
        return 0;
 }
 
-int BKE_imtype_is_quality_ok(int imtype)
+int BKE_imtype_is_quality_ok(const char imtype)
 {
        switch(imtype) {
        case R_JPEG90:
@@ -947,7 +947,7 @@
        return 0;
 }
 
-int BKE_imtype_is_depth_ok(int imtype)
+char BKE_imtype_is_depth_ok(const char imtype)
 {
        switch (imtype) {
        case R_RADHDR:
@@ -970,7 +970,7 @@
        }
 }
 
-int BKE_add_image_extension(char *string, int imtype)
+int BKE_add_image_extension(char *string, const char imtype)
 {
        const char *extension= NULL;
        
@@ -1557,7 +1557,7 @@
 }
 
 
-void BKE_makepicstring(char *string, const char *base, const char *relbase, 
int frame, int imtype, const short use_ext, const short use_frames)
+void BKE_makepicstring(char *string, const char *base, const char *relbase, 
int frame, const char imtype, const short use_ext, const short use_frames)
 {
        if (string==NULL) return;
        BLI_strncpy(string, base, FILE_MAX - 10);       /* weak assumption */

Modified: trunk/blender/source/blender/blenkernel/intern/writeavi.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/writeavi.c   2011-11-21 
20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/blenkernel/intern/writeavi.c   2011-11-21 
23:56:32 UTC (rev 42045)
@@ -67,7 +67,7 @@
 
 #include "BKE_writeframeserver.h"
 
-bMovieHandle *BKE_get_movie_handle(int imtype)
+bMovieHandle *BKE_get_movie_handle(const char imtype)
 {
        static bMovieHandle mh;
        

Modified: trunk/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface.h 2011-11-21 
20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/editors/include/UI_interface.h 2011-11-21 
23:56:32 UTC (rev 42045)
@@ -515,7 +515,7 @@
 uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int 
maxlen, int x1, int y1, short x2, short y2, float a1, float a2, const char 
*tip);
 
 uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct 
PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int 
x2, int y2);
-int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int 
(*check_prop)(struct PropertyRNA *), const char label_align);
+int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int 
(*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char 
label_align);
 
 /* Links
  *
@@ -688,7 +688,7 @@
 void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void 
*argv);
 void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct 
PointerRNA *ptr);
 const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
-void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, 
struct wmOperator *op, int (*check_prop)(struct PropertyRNA *), const char 
label_align, const short flag);
+void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, 
struct wmOperator *op, int (*check_prop)(struct PointerRNA *, struct 
PropertyRNA *), const char label_align, const short flag);
 struct MenuType *uiButGetMenuType(uiBut *but);
 
 void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c   
2011-11-21 20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c   
2011-11-21 23:56:32 UTC (rev 42045)
@@ -2743,7 +2743,7 @@
 }
 
 /* this function does not initialize the layout, functions can be called on 
the layout before and after */
-void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator 
*op,int (*check_prop)(struct PropertyRNA *), const char label_align, const 
short flag)
+void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator 
*op,int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char 
label_align, const short flag)
 {
        if(!op->properties) {
                IDPropertyTemplate val = {0};

Modified: trunk/blender/source/blender/editors/interface/interface_utils.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_utils.c    
2011-11-21 20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/editors/interface/interface_utils.c    
2011-11-21 23:56:32 UTC (rev 42045)
@@ -130,7 +130,7 @@
        return but;
 }
 
-int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int 
(*check_prop)(PropertyRNA *), const char label_align)
+int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int 
(*check_prop)(PointerRNA *, PropertyRNA *), const char label_align)
 {
        uiLayout *split, *col;
        int flag;
@@ -141,7 +141,7 @@
 
        RNA_STRUCT_BEGIN(ptr, prop) {
                flag= RNA_property_flag(prop);
-               if(flag & PROP_HIDDEN || (check_prop && 
check_prop(prop)==FALSE))
+               if(flag & PROP_HIDDEN || (check_prop && check_prop(ptr, 
prop)==FALSE))
                        continue;
 
                if(label_align != '\0') {

Modified: trunk/blender/source/blender/editors/render/render_shading.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_shading.c        
2011-11-21 20:47:19 UTC (rev 42044)
+++ trunk/blender/source/blender/editors/render/render_shading.c        
2011-11-21 23:56:32 UTC (rev 42045)
@@ -658,7 +658,7 @@
 
 /********************** environment map operators *********************/
 
-static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *path, 
int imtype)
+static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *path, 
const char imtype)
 {
        float layout[12];
        if ( RNA_struct_find_property(op->ptr, "layout") )
@@ -680,7 +680,7 @@
        Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
        Scene *scene = CTX_data_scene(C);
        //int imtype = RNA_enum_get(op->ptr, "file_type");
-       int imtype = scene->r.im_format.imtype;
+       char imtype = scene->r.im_format.imtype;
        char path[FILE_MAX];
        

@@ 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