diff options
author | Ben Batt <benbatt@gmail.com> | 2007-04-29 20:15:50 +0400 |
---|---|---|
committer | Ben Batt <benbatt@gmail.com> | 2007-04-29 20:15:50 +0400 |
commit | d0ac7ef08742b439187837064da2ad2abcefb831 (patch) | |
tree | beb99b6cede9817ca0d0ac38b7f7b2a39c6d50a9 /source/blender/src | |
parent | 7d47189518371af754a0c3b93476cd62a6a449eb (diff) |
Patch #6584 - Texture functionality in the wave modifier
This patch allows the user to use a texture to modulate the wave modifier's
amplitude.
Thanks to Michael Fox (mfoxdoggg) for the patch!
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_editing.c | 36 | ||||
-rw-r--r-- | source/blender/src/editface.c | 2 | ||||
-rw-r--r-- | source/blender/src/unwrapper.c | 1 | ||||
-rw-r--r-- | source/blender/src/vpaint.c | 2 |
4 files changed, 36 insertions, 5 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index d113179bbe2..c20b52b35b8 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -1602,7 +1602,11 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco } else if (md->type==eModifierType_Decimate) { height = 48; } else if (md->type==eModifierType_Wave) { - height = 248; + WaveModifierData *wmd = (WaveModifierData *)md; + height = 280; + if(wmd->texmapping == MOD_WAV_MAP_OBJECT || + wmd->texmapping == MOD_WAV_MAP_UV) + height += 19; } else if (md->type==eModifierType_Armature) { height = 67; } else if (md->type==eModifierType_Hook) { @@ -1837,6 +1841,36 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta x:", lx,(cy-=19),113,19, &wmd->startx, -100.0, 100.0, 100, 0, "Starting position for the X axis"); uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta y:", lx+115,cy,105,19, &wmd->starty, -100.0, 100.0, 100, 0, "Starting position for the Y axis"); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MODIFIER_RECALC, "Ob: ", lx, (cy-=19), 220,19, &wmd->objectcenter, "Object to use as Starting Position (leave blank to disable)"); + uiDefIDPoinBut(block, modifier_testTexture, ID_TE, B_CHANGEDEP,"Texture: ", lx, (cy -= 19), 220, 19, &wmd->texture,"Texture with which to modulate wave"); + sprintf(str, "Texture Coordinates%%t" + "|Local%%x%d|Global%%x%d|Object%%x%d|UV%%x%d", + MOD_WAV_MAP_LOCAL, MOD_WAV_MAP_GLOBAL, + MOD_WAV_MAP_OBJECT, MOD_WAV_MAP_UV); + uiDefButI(block, MENU, B_MODIFIER_RECALC, str, + lx, (cy -= 19), 220, 19, &wmd->texmapping, + 0.0, 1.0, 0, 0, + "Texture coordinates used for modulation input"); + if (wmd->texmapping == MOD_WAV_MAP_UV) { + char *strtmp; + int i; + CustomData *fdata = G.obedit ? &G.editMesh->fdata + : &((Mesh*)ob->data)->fdata; + build_uvlayer_menu_vars(fdata, &strtmp, &wmd->uvlayer_tmp, + wmd->uvlayer_name); + but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp, + lx, (cy -= 19), 220, 19, &wmd->uvlayer_tmp, + 0.0, 1.0, 0, 0, "Set the UV layer to use"); + MEM_freeN(strtmp); + i = CustomData_get_layer_index(fdata, CD_MTFACE); + uiButSetFunc(but, set_displace_uvlayer, wmd, + &fdata->layers[i]); + } + if(wmd->texmapping == MOD_DISP_MAP_OBJECT) { + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, + "Ob: ", lx, (cy -= 19), 220, 19, + &wmd->map_object, + "Object to get texture coordinates from"); + } cy -= 19; uiBlockBeginAlign(block); uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Speed:", lx,(cy-=19),220,19, &wmd->speed, -2.0, 2.0, 0, 0, "Specify the wave speed"); diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index c45d742301e..2e89242c038 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -555,7 +555,7 @@ MTFace *get_active_tface(MCol **mcol) { Mesh *me; MTFace *tf; - MTFace *mf; + MFace *mf; int a; if(OBACT==NULL || OBACT->type!=OB_MESH) diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c index 5a93c2b3077..bb4c58acd03 100644 --- a/source/blender/src/unwrapper.c +++ b/source/blender/src/unwrapper.c @@ -82,7 +82,6 @@ static void hash_add_face(EdgeHash *ehash, MFace *mf) void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index) { - MTFace *tf; MFace *mf; int a, doit=1, mark=0; char *linkflag; diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index a53c1508f0a..7a9e6a5475e 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -1082,7 +1082,6 @@ void weight_paint(void) Object *ob; Mesh *me; MFace *mface; - MTFace *tface; float mat[4][4], imat[4][4], paintweight, *vertexcosnos; float vpimat[3][3]; int *indexar, index, totindex, alpha, totw; @@ -1356,7 +1355,6 @@ void vertex_paint() Object *ob; Mesh *me; MFace *mface; - MTFace *tface; float mat[4][4], imat[4][4], *vertexcosnos; float vpimat[3][3]; unsigned int paintcol=0, *mcol, *mcolorig, fcol1, fcol2; |