diff options
author | Hamed Zaghaghi <hamed.zaghaghi@gmail.com> | 2007-11-06 15:16:12 +0300 |
---|---|---|
committer | Hamed Zaghaghi <hamed.zaghaghi@gmail.com> | 2007-11-06 15:16:12 +0300 |
commit | af169b41fda5fe05d62655b782674eda2bc565e7 (patch) | |
tree | f70303d83032dffdeca399e97659cfa91fcc5d0a /source/blender | |
parent | aa774427f64916ef5713c01c5d23657b61a80003 (diff) |
2d Filters updated, now you can use custom filter and write your own GLSL shader program to filter rendering result.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_actuator_types.h | 34 | ||||
-rw-r--r-- | source/blender/src/buttons_logic.c | 19 |
3 files changed, 37 insertions, 19 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b5cad264177..4b588c690e0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2820,7 +2820,8 @@ static void lib_link_object(FileData *fd, Main *main) ma->toObject= newlibadr(fd, ob->id.lib, ma->toObject); } else if(act->type==ACT_2DFILTER){ - /* bTwoDFilterActuator *_2dfa = act->data; */ + bTwoDFilterActuator *_2dfa = act->data; + _2dfa->text= newlibadr(fd, ob->id.lib, _2dfa->text); } act= act->next; } diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index bc847958fdf..0d324b7d5d3 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -38,6 +38,7 @@ struct Object; struct Mesh; struct Scene; struct Group; +struct Text; /* ****************** ACTUATORS ********************* */ @@ -192,14 +193,16 @@ typedef struct bVisibilityActuator { } bVisibilityActuator; typedef struct bTwoDFilterActuator{ + char pad[4]; /* Tells what type of 2D Filter*/ short type; /* (flag == 0) means 2D filter is activate and (flag != 0) means 2D filter is inactive*/ short flag; + int int_arg; /* a float argument */ float float_arg; - int int_arg; + struct Text *text; }bTwoDFilterActuator; typedef struct bActuator { @@ -404,19 +407,22 @@ typedef struct FreeCamera { #define ACT_VISIBILITY_INVISIBLE (1 << 0) /* twodfilter->type */ -#define ACT_2DFILTER_NOFILTER -1 -#define ACT_2DFILTER_MOTIONBLUR 0 -#define ACT_2DFILTER_BLUR 1 -#define ACT_2DFILTER_SHARPEN 2 -#define ACT_2DFILTER_DILATION 3 -#define ACT_2DFILTER_EROSION 4 -#define ACT_2DFILTER_LAPLACIAN 5 -#define ACT_2DFILTER_SOBEL 6 -#define ACT_2DFILTER_PREWITT 7 -#define ACT_2DFILTER_GRAYSCALE 8 -#define ACT_2DFILTER_SEPIA 9 -#define ACT_2DFILTER_INVERT 10 -#define ACT_2DFILTER_NUMBER_OF_FILTERS 11 +#define ACT_2DFILTER_ENABLED -2 +#define ACT_2DFILTER_DISABLED -1 +#define ACT_2DFILTER_NOFILTER 0 +#define ACT_2DFILTER_MOTIONBLUR 1 +#define ACT_2DFILTER_BLUR 2 +#define ACT_2DFILTER_SHARPEN 3 +#define ACT_2DFILTER_DILATION 4 +#define ACT_2DFILTER_EROSION 5 +#define ACT_2DFILTER_LAPLACIAN 6 +#define ACT_2DFILTER_SOBEL 7 +#define ACT_2DFILTER_PREWITT 8 +#define ACT_2DFILTER_GRAYSCALE 9 +#define ACT_2DFILTER_SEPIA 10 +#define ACT_2DFILTER_INVERT 11 +#define ACT_2DFILTER_CUSTOMFILTER 12 +#define ACT_2DFILTER_NUMBER_OF_FILTERS 13 #endif diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index e457e44bd63..819f7bbaa24 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -2178,7 +2178,11 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho case ACT_2DFILTER: tdfa = act->data; - ysize= 50; + ysize = 50; + if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER) + { + ysize +=20; + } glRects( xco, yco-ysize, xco+width, yco ); uiEmboss( (float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1 ); @@ -2206,12 +2210,19 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho case ACT_2DFILTER_SEPIA: case ACT_2DFILTER_INVERT: case ACT_2DFILTER_NOFILTER: - uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,-1.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); + case ACT_2DFILTER_DISABLED: + case ACT_2DFILTER_ENABLED: + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); + break; + case ACT_2DFILTER_CUSTOMFILTER: + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, ""); break; } - str= "2D Filter %t|Motion Blur %x0|Blur %x1|Sharpen %x2|Dilation %x3|Erosion %x4|" - "Laplacian %x5|Sobel %x6|Prewitt %x7|Gray Scale %x8|Sepia %x9|Invert %x10|No Filter %x-1|"; + str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|" + "Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|" + "Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|"; uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type"); yco -= ysize; |