diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-11-08 16:02:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-11-08 16:02:59 +0300 |
commit | 40f871c07f7d6f2bd5696ea0585380a30beb8161 (patch) | |
tree | 6c708fb864625ba7c3d79be5edb2bb59c68ce492 /source | |
parent | 0100ebe2302d5ed36c4f4258e779e81a7e7bec66 (diff) |
* new stamp option to stamp forground sequence strip name.
* made stamp filename optional
* renamed weightpaint "Filter" to "Blur"
* made the defailt weightpaint opacity 1.0 rather then 0.2 so when you select 1.0 weight you can paint it with without multiple clicks.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/bad_level_call_stubs/stubs.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 48 | ||||
-rw-r--r-- | source/blender/include/BIF_editseq.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_editing.c | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_scene.c | 43 | ||||
-rw-r--r-- | source/blender/src/editcurve.c | 4 | ||||
-rw-r--r-- | source/blender/src/editseq.c | 21 | ||||
-rw-r--r-- | source/blender/src/vpaint.c | 2 |
9 files changed, 93 insertions, 35 deletions
diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 63bc23a71bf..d1700fe49dd 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -332,6 +332,9 @@ void BIF_filelist_freelib(struct FileList* filelist) {}; /* edittime.c stub */ TimeMarker *get_frame_marker(int frame){return 0;}; +/* editseq.c */ +Sequence *get_forground_frame_seq(int frame){return 0;}; + /* modifier.c stub */ void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd, float (*vertexcos)[3], int totvert, float cagemat[][4]) {} diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 17a4dfd3db9..ef9f2362be0 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -71,6 +71,8 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" +#include "BIF_editseq.h" + #include "PIL_time.h" #include "RE_pipeline.h" @@ -777,7 +779,7 @@ void BKE_add_image_extension(char *string, int imtype) strcat(string, extension); } -/* could allow access externally */ +/* could allow access externally - 512 is for long names, 64 is for id names */ typedef struct StampData { char file[512]; char note[512]; @@ -785,8 +787,9 @@ typedef struct StampData { char marker[512]; char time[512]; char frame[512]; - char camera[512]; - char scene[512]; + char camera[64]; + char scene[64]; + char strip[64]; } StampData; static void stampdata(StampData *stamp_data, int do_prefix) @@ -800,8 +803,13 @@ static void stampdata(StampData *stamp_data, int do_prefix) char sdate[9]; #endif /* WIN32 */ - if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce); - else sprintf(stamp_data->file, "%s", G.sce); + if (G.scene->r.stamp & R_STAMP_FILENAME) { + if (do_prefix) sprintf(stamp_data->file, "File %s", G.sce); + else sprintf(stamp_data->file, "%s", G.sce); + stamp_data->note[0] = '\0'; + } else { + stamp_data->file[0] = '\0'; + } if (G.scene->r.stamp & R_STAMP_NOTE) { if (do_prefix) sprintf(stamp_data->note, "Note %s", G.scene->r.stamp_udata); @@ -886,6 +894,18 @@ static void stampdata(StampData *stamp_data, int do_prefix) } else { stamp_data->scene[0] = '\0'; } + + if (G.scene->r.stamp & R_STAMP_SEQSTRIP) { + Sequence *seq = get_forground_frame_seq(CFRA); + + if (seq) strcpy(text, seq->name+2); + else strcpy(text, "<none>"); + + if (do_prefix) sprintf(stamp_data->strip, "Strip %s", text); + else sprintf(stamp_data->strip, "%s", text); + } else { + stamp_data->strip[0] = '\0'; + } } void BKE_stamp_buf(unsigned char *rect, float *rectf, int width, int height) @@ -929,11 +949,11 @@ void BKE_stamp_buf(unsigned char *rect, float *rectf, int width, int height) above and below as padding against their backing rectangles */ text_pad = BMF_GetStringWidth(font, " "); - + x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */ + y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */ + if (stamp_data.file[0]) { /* Top left corner */ - x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */ - y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */ text_width = BMF_GetStringWidth(font, stamp_data.file); buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); BMF_DrawStringBuf(font, stamp_data.file, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height); @@ -1000,9 +1020,18 @@ void BKE_stamp_buf(unsigned char *rect, float *rectf, int width, int height) buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); BMF_DrawStringBuf(font, stamp_data.scene, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height); } + + if (stamp_data.strip[0]) { + text_width = BMF_GetStringWidth(font, stamp_data.strip); + /* Top right corner */ + x = width - (text_width+1+text_pad); + y = height - font_height - 1; + buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); + BMF_DrawStringBuf(font, stamp_data.strip, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height); + } + } - void BKE_stamp_info(struct ImBuf *ibuf) { struct StampData stamp_data; @@ -1020,6 +1049,7 @@ void BKE_stamp_info(struct ImBuf *ibuf) if (stamp_data.frame[0]) IMB_imginfo_change_field (ibuf, "Frame", stamp_data.frame); if (stamp_data.camera[0]) IMB_imginfo_change_field (ibuf, "Camera", stamp_data.camera); if (stamp_data.scene[0]) IMB_imginfo_change_field (ibuf, "Scene", stamp_data.scene); + if (stamp_data.strip[0]) IMB_imginfo_change_field (ibuf, "Strip", stamp_data.strip); } int BKE_write_ibuf(ImBuf *ibuf, char *name, int imtype, int subimtype, int quality) diff --git a/source/blender/include/BIF_editseq.h b/source/blender/include/BIF_editseq.h index 74baf12c11a..13cb059d885 100644 --- a/source/blender/include/BIF_editseq.h +++ b/source/blender/include/BIF_editseq.h @@ -44,6 +44,7 @@ void reload_sequence(void); void update_seq_ipo_rect(struct Sequence * seq); void update_seq_icu_rects(struct Sequence * seq); struct Sequence* get_last_seq(); +struct Sequence* get_forground_frame_seq( int frame ); void set_last_seq(struct Sequence * seq); void clear_last_seq(); void del_seq(void); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 031a88c517a..1b8314996f0 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -540,6 +540,8 @@ typedef struct Scene { #define R_STAMP_NOTE 0x0020 #define R_STAMP_DRAW 0x0040 /* draw in the image */ #define R_STAMP_MARKER 0x0080 +#define R_STAMP_FILENAME 0x0100 +#define R_STAMP_SEQSTRIP 0x0200 /* alphamode */ #define R_ADDSKY 0 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index faa4ae4c445..fccfe2e98a6 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -5195,7 +5195,7 @@ void weight_paint_buttons(uiBlock *block) uiDefButS(block, ROW, B_DIFF, "Add", 250,152,60,17, &Gwp.mode, 1.0, 1.0, 0, 0, "Add the vertex colors"); uiDefButS(block, ROW, B_DIFF, "Sub", 250,134,60,17, &Gwp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color"); uiDefButS(block, ROW, B_DIFF, "Mul", 250,116,60,17, &Gwp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Filter", 250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Mix the colors with an alpha factor"); + uiDefButS(block, ROW, B_DIFF, "Blur", 250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values"); uiDefButS(block, ROW, B_DIFF, "Lighter", 250, 80,60,17, &Gwp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only"); uiDefButS(block, ROW, B_DIFF, "Darker", 250, 62,60,17, &Gwp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only"); uiBlockEndAlign(block); @@ -5260,7 +5260,7 @@ static void editing_panel_mesh_paint(void) uiDefButS(block, ROW, B_DIFF, "Add", 1212,152,63,17, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex color"); uiDefButS(block, ROW, B_DIFF, "Sub", 1212, 134,63,17, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color"); uiDefButS(block, ROW, B_DIFF, "Mul", 1212, 116,63,17, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Filter", 1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colors with an alpha factor"); + uiDefButS(block, ROW, B_DIFF, "Blur", 1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Blur the color with surrounding values"); uiDefButS(block, ROW, B_DIFF, "Lighter", 1212, 80,63,17, &Gvp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only"); uiDefButS(block, ROW, B_DIFF, "Darker", 1212, 62,63,17, &Gvp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only"); uiBlockEndAlign(block); diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index c734eac0735..2cc24c643cb 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1540,54 +1540,55 @@ static void render_panel_stamp(void) if (G.scene->r.scemode & R_STAMP_INFO) { uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data"); - uiDefBut(block, TEX, B_NOP, "", xofs+100, yofs, 200, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note"); + uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data"); + uiDefBut(block, TEX, B_NOP, "", xofs+120, yofs, 180, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note"); uiBlockEndAlign(block); yofs += 30; /* gap */ - yofs += 100; - // Order is important for alligning ... grr + yofs += 80; + /* Order is important for alligning ... grr */ uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name"); + uiDefButBitI(block, TOG, R_STAMP_FILENAME, B_REDR, "Filename", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp blend filename"); yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name"); + uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name"); + uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name"); yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date"); + uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)"); + uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date"); yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)"); + uiDefButBitI(block, TOG, R_STAMP_FRAME, B_REDR, "Frame", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp frame number"); + uiDefButBitI(block, TOG, R_STAMP_MARKER, B_REDR, "Marker", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the last marker"); yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_FRAME, B_REDR, "Frame", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp frame number"); - yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_MARKER, B_REDR, "Marker", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the last marker"); + uiDefButBitI(block, TOG, R_STAMP_SEQSTRIP, B_REDR, "Sequence Strip", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the forground sequence strip name"); uiBlockEndAlign(block); - yofs += 100; + yofs += 80; /* draw font selector */ if (G.scene->r.stamp & R_STAMP_DRAW) { uiDefButS(block, MENU, B_REDR, "Stamp Font Size%t|Tiny Text%x1|Small Text%x2|Medium Text%x3|Large Text%x0|Extra Large Text%x4|", - xofs+110, yofs, 190, 19, &G.scene->r.stamp_font_id, 0, 0, 0, 0, "Choose stamp text size"); + xofs+130, yofs, 170, 19, &G.scene->r.stamp_font_id, 0, 0, 0, 0, "Choose stamp text size"); /* draw fg/bg next to the scene */ yofs -= 25; - uiDefBut(block, LABEL, B_NOP, "Text Color", xofs+110, yofs, 80, 19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, B_NOP, "Background", xofs+205, yofs, 80, 19, 0, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, B_NOP, "Text Color", xofs+130, yofs, 70, 19, 0, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, B_NOP, "Background", xofs+215, yofs, 70, 19, 0, 0, 0, 0, 0, ""); yofs -= 20; - uiDefButF(block, COL, B_NOP, "", xofs+110, yofs, 90, 19, G.scene->r.fg_stamp, 0, 0, 0, 0, "Foreground text color"); - uiDefButF(block, COL, B_NOP, "", xofs+210, yofs, 90, 19, G.scene->r.bg_stamp, 0, 0, 0, 0, "Background color"); + uiDefButF(block, COL, B_NOP, "", xofs+130, yofs, 80, 19, G.scene->r.fg_stamp, 0, 0, 0, 0, "Foreground text color"); + uiDefButF(block, COL, B_NOP, "", xofs+220, yofs, 80, 19, G.scene->r.bg_stamp, 0, 0, 0, 0, "Background color"); yofs -= 30; - uiDefButF(block, NUMSLI, B_NOP, "A ", xofs+110, yofs, 190, 19, &G.scene->r.bg_stamp[3], 0, 1.0, 0, 0, "Alpha for text background"); + uiDefButF(block, NUMSLI, B_NOP, "A ", xofs+130, yofs, 170, 19, &G.scene->r.bg_stamp[3], 0, 1.0, 0, 0, "Alpha for text background"); yofs += 105; } else { yofs += 30; } - uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, yofs, 100, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Disable stamp info in images metadata"); - uiDefButBitI(block, TOG, R_STAMP_DRAW, B_REDR, "Draw Stamp", xofs+110, yofs, 190, 20, &G.scene->r.stamp, 0, 0, 0, 0, "Draw the stamp info into each frame"); + uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, yofs, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Disable stamp info in images metadata"); + uiDefButBitI(block, TOG, R_STAMP_DRAW, B_REDR, "Draw Stamp", xofs+130, yofs, 170, 20, &G.scene->r.stamp, 0, 0, 0, 0, "Draw the stamp info into each frame"); yofs += 20; } else { - uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, 142, 100, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Enable stamp info to image metadata"); + uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, 142, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Enable stamp info to image metadata"); yofs += 20; uiDefBut(block, LABEL, 0, "", xofs, yofs, 300, 19, 0, 0, 0, 0, 0, ""); } diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index 9d86f88b377..358e6332d6d 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -1212,7 +1212,7 @@ void smoothradiusNurb( void ) end_rad = (nu->bezt+end_sel+1)->radius; } - /* Now Blend between the 2 points */ + /* Now Blend between the points */ range = (float)(end_sel - start_sel) + 2.0f; for(bezt=nu->bezt+start_sel, a=start_sel; a<=end_sel; a++, bezt++) { fac = (float)(1+a-start_sel) / range; @@ -1274,7 +1274,7 @@ void smoothradiusNurb( void ) end_rad = (nu->bp+end_sel+1)->radius; } - /* Now Blend between the 2 points */ + /* Now Blend between the points */ range = (float)(end_sel - start_sel) + 2.0f; for(bp=nu->bp+start_sel, a=start_sel; a<=end_sel; a++, bp++) { fac = (float)(1+a-start_sel) / range; diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index eed3145284c..737e7e1a4bf 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -145,6 +145,27 @@ void clear_last_seq(Sequence *seq) _last_seq_init = 0; } +Sequence *get_forground_frame_seq(int frame) +{ + Editing *ed; + Sequence *seq, *best_seq=NULL; + int best_machine = -1; + ed= G.scene->ed; + if(!ed) return NULL; + + for (seq=ed->seqbasep->first; seq; seq= seq->next) { + if(seq->startdisp > frame || seq->enddisp <= frame) + continue; + /* only use elements you can see - not */ + if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) { + if (seq->machine > best_machine) { + best_seq = seq; + best_machine = seq->machine; + } + } + } + return best_seq; +} /* seq funcs's for transforming internally notice the difference between start/end and left/right. diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 2f82cd2e2b2..93bf0edc455 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -110,7 +110,7 @@ #define MAXINDEX 512000 VPaint Gvp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT+VP_SPRAY, 0}; -VPaint Gwp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, 0}; +VPaint Gwp= {1.0, 1.0, 1.0, 1.0, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, 0}; static int *get_indexarray(void) { |