Merge from trunk
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Wed, 14 May 2008 20:01:22 +0000 (20:01 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Wed, 14 May 2008 20:01:22 +0000 (20:01 +0000)
svn merge -r 14760:14843 https://svn.blender.org/svnroot/bf-blender/trunk/blender

1  2 
source/blender/blenkernel/intern/modifier.c
source/blender/src/buttons_editing.c

index 19b7ed194ebef823c887b29ed0dff4883c50a68d,a4ee0947056665d3136851417f6af8f9a492f7fa..c8a51e15049537fe455416aebf0695ec3f900c07
@@@ -97,7 -97,6 +97,7 @@@
  #include "BKE_utildefines.h"
  #include "depsgraph_private.h"
  #include "BKE_bmesh.h"
 +#include "BKE_shrinkwrap.h"
  
  #include "LOD_DependKludge.h"
  #include "LOD_decimation.h"
@@@ -5876,6 -5875,8 +5876,8 @@@ static void explodeModifier_copyData(Mo
  
        temd->facepa = 0;
        temd->flag = emd->flag;
+       temd->protect = emd->protect;
+       temd->vgroup = emd->vgroup;
  }
  static int explodeModifier_dependsOnTime(ModifierData *md) 
  {
@@@ -5996,20 -5997,29 +5998,29 @@@ static void explodeModifier_createFacep
        if(vertpa) MEM_freeN(vertpa);
        BLI_kdtree_free(tree);
  }
+ static int edgesplit_get(EdgeHash *edgehash, int v1, int v2)
+ {
+       return GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, v1, v2));
+ }
  static DerivedMesh * explodeModifier_splitEdges(ExplodeModifierData *emd, DerivedMesh *dm){
        DerivedMesh *splitdm;
        MFace *mf=0,*df1=0,*df2=0,*df3=0;
        MFace *mface=CDDM_get_faces(dm);
        MVert *dupve, *mv;
+       EdgeHash *edgehash;
+       EdgeHashIterator *ehi;
        int totvert=dm->getNumVerts(dm);
        int totface=dm->getNumFaces(dm);
  
-       int *edgesplit = MEM_callocN(sizeof(int)*totvert*totvert,"explode_edgesplit");
-       int *facesplit = MEM_callocN(sizeof(int)*totface,"explode_edgesplit");
+       int *facesplit = MEM_callocN(sizeof(int)*totface,"explode_facesplit");
        int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2");
        int *facepa = emd->facepa;
        int *fs, totesplit=0,totfsplit=0,totin=0,curdupvert=0,curdupface=0,curdupin=0;
-       int i,j,v1,v2,v3,v4;
+       int i,j,v1,v2,v3,v4,esplit;
+       edgehash= BLI_edgehash_new();
  
        /* recreate vertpa from facepa calculation */
        for (i=0,mf=mface; i<totface; i++,mf++) {
                        v4=vertpa[mf->v4];
  
                        if(v1!=v2){
-                               edgesplit[mf->v1*totvert+mf->v2]=edgesplit[mf->v2*totvert+mf->v1]=1;
+                               BLI_edgehash_insert(edgehash, mf->v1, mf->v2, NULL);
                                (*fs)++;
                        }
  
                        if(v2!=v3){
-                               edgesplit[mf->v2*totvert+mf->v3]=edgesplit[mf->v3*totvert+mf->v2]=1;
+                               BLI_edgehash_insert(edgehash, mf->v2, mf->v3, NULL);
                                (*fs)++;
                        }
  
                        if(v3!=v4){
-                               edgesplit[mf->v3*totvert+mf->v4]=edgesplit[mf->v4*totvert+mf->v3]=1;
+                               BLI_edgehash_insert(edgehash, mf->v3, mf->v4, NULL);
                                (*fs)++;
                        }
  
                        if(v1!=v4){
-                               edgesplit[mf->v1*totvert+mf->v4]=edgesplit[mf->v4*totvert+mf->v1]=1;
+                               BLI_edgehash_insert(edgehash, mf->v1, mf->v4, NULL);
                                (*fs)++;
                        }
  
                                        *fs=1;
                                else if(v1!=v2){
                                        if(v1!=v4)
-                                               edgesplit[mf->v2*totvert+mf->v3]=edgesplit[mf->v3*totvert+mf->v2]=1;
+                                               BLI_edgehash_insert(edgehash, mf->v2, mf->v3, NULL);
                                        else
-                                               edgesplit[mf->v3*totvert+mf->v4]=edgesplit[mf->v4*totvert+mf->v3]=1;
+                                               BLI_edgehash_insert(edgehash, mf->v3, mf->v4, NULL);
                                }
                                else{ 
                                        if(v1!=v4)
-                                               edgesplit[mf->v1*totvert+mf->v2]=edgesplit[mf->v2*totvert+mf->v1]=1;
+                                               BLI_edgehash_insert(edgehash, mf->v1, mf->v2, NULL);
                                        else
-                                               edgesplit[mf->v1*totvert+mf->v4]=edgesplit[mf->v4*totvert+mf->v1]=1;
+                                               BLI_edgehash_insert(edgehash, mf->v1, mf->v4, NULL);
                                }
                        }
                }
        }
  
        /* count splits & reindex */
+       ehi= BLI_edgehashIterator_new(edgehash);
        totesplit=totvert;
-       for(j=0; j<totvert; j++){
-               for(i=j+1; i<totvert; i++){
-                       if(edgesplit[j*totvert+i])
-                               edgesplit[j*totvert+i]=edgesplit[i*totvert+j]=totesplit++;
-               }
+       for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+               BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totesplit));
+               totesplit++;
        }
+       BLI_edgehashIterator_free(ehi);
        /* count new faces due to splitting */
        for(i=0,fs=facesplit; i<totface; i++,fs++){
                if(*fs==1)
  
        /* create new verts */
        curdupvert=totvert;
-       for(j=0; j<totvert; j++){
-               for(i=j+1; i<totvert; i++){
-                       if(edgesplit[j*totvert+i]){
-                               mv=CDDM_get_vert(splitdm,j);
-                               dupve=CDDM_get_vert(splitdm,edgesplit[j*totvert+i]);
+       ehi= BLI_edgehashIterator_new(edgehash);
+       for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
+               BLI_edgehashIterator_getKey(ehi, &i, &j);
+               esplit= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
+               mv=CDDM_get_vert(splitdm,j);
+               dupve=CDDM_get_vert(splitdm,esplit);
  
-                               DM_copy_vert_data(splitdm,splitdm,j,edgesplit[j*totvert+i],1);
+               DM_copy_vert_data(splitdm,splitdm,j,esplit,1);
  
-                               *dupve=*mv;
+               *dupve=*mv;
  
-                               mv=CDDM_get_vert(splitdm,i);
+               mv=CDDM_get_vert(splitdm,i);
  
-                               VECADD(dupve->co,dupve->co,mv->co);
-                               VecMulf(dupve->co,0.5);
-                       }
-               }
+               VECADD(dupve->co,dupve->co,mv->co);
+               VecMulf(dupve->co,0.5);
        }
+       BLI_edgehashIterator_free(ehi);
  
        /* create new faces */
        curdupface=totface;
                                curdupface++;
                                
                                if(v1==v2){
-                                       df1->v1=edgesplit[mf->v1*totvert+mf->v4];
-                                       df1->v2=edgesplit[mf->v2*totvert+mf->v3];
+                                       df1->v1=edgesplit_get(edgehash, mf->v1, mf->v4);
+                                       df1->v2=edgesplit_get(edgehash, mf->v2, mf->v3);
                                        mf->v3=df1->v2;
                                        mf->v4=df1->v1;
                                }
                                else{
-                                       df1->v1=edgesplit[mf->v1*totvert+mf->v2];
-                                       df1->v4=edgesplit[mf->v3*totvert+mf->v4];
+                                       df1->v1=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                       df1->v4=edgesplit_get(edgehash, mf->v3, mf->v4);
                                        mf->v2=df1->v1;
                                        mf->v3=df1->v4;
                                }
  
                                if(v1!=v2){
                                        if(v1!=v4){
-                                               df1->v1=edgesplit[mf->v1*totvert+mf->v4];
-                                               df1->v2=edgesplit[mf->v1*totvert+mf->v2];
+                                               df1->v1=edgesplit_get(edgehash, mf->v1, mf->v4);
+                                               df1->v2=edgesplit_get(edgehash, mf->v1, mf->v2);
                                                df2->v1=df1->v3=mf->v2;
                                                df2->v3=df1->v4=mf->v4;
                                                df2->v2=mf->v3;
                                                facepa[i]=v1;
                                        }
                                        else{
-                                               df1->v2=edgesplit[mf->v1*totvert+mf->v2];
-                                               df1->v3=edgesplit[mf->v2*totvert+mf->v3];
+                                               df1->v2=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                               df1->v3=edgesplit_get(edgehash, mf->v2, mf->v3);
                                                df1->v4=mf->v3;
                                                df2->v2=mf->v3;
                                                df2->v3=mf->v4;
                                }
                                else{
                                        if(v1!=v4){
-                                               df1->v3=edgesplit[mf->v3*totvert+mf->v4];
-                                               df1->v4=edgesplit[mf->v1*totvert+mf->v4];
+                                               df1->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
+                                               df1->v4=edgesplit_get(edgehash, mf->v1, mf->v4);
                                                df1->v2=mf->v3;
  
                                                mf->v1=df1->v4;
                                                facepa[i]=v4;
                                        }
                                        else{
-                                               df1->v3=edgesplit[mf->v2*totvert+mf->v3];
-                                               df1->v4=edgesplit[mf->v3*totvert+mf->v4];
+                                               df1->v3=edgesplit_get(edgehash, mf->v2, mf->v3);
+                                               df1->v4=edgesplit_get(edgehash, mf->v3, mf->v4);
                                                df1->v1=mf->v4;
                                                df1->v2=mf->v2;
                                                df2->v3=mf->v4;
                                curdupface++;
  
                                if(v1==v2){
-                                       df2->v1=df1->v1=edgesplit[mf->v1*totvert+mf->v4];
-                                       df3->v1=df1->v2=edgesplit[mf->v2*totvert+mf->v3];
-                                       df3->v3=df2->v2=df1->v3=edgesplit[mf->v3*totvert+mf->v4];
+                                       df2->v1=df1->v1=edgesplit_get(edgehash, mf->v1, mf->v4);
+                                       df3->v1=df1->v2=edgesplit_get(edgehash, mf->v2, mf->v3);
+                                       df3->v3=df2->v2=df1->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
                                        df3->v2=mf->v3;
                                        df2->v3=mf->v4;
                                        df1->v4=df2->v4=df3->v4=0;
                                        facepa[curdupface-2]=v4;
                                }
                                else if(v2==v3){
-                                       df3->v1=df2->v3=df1->v1=edgesplit[mf->v1*totvert+mf->v4];
-                                       df2->v2=df1->v2=edgesplit[mf->v1*totvert+mf->v2];
-                                       df3->v2=df1->v3=edgesplit[mf->v3*totvert+mf->v4];
+                                       df3->v1=df2->v3=df1->v1=edgesplit_get(edgehash, mf->v1, mf->v4);
+                                       df2->v2=df1->v2=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                       df3->v2=df1->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
  
                                        df3->v3=mf->v4;
                                        df2->v1=mf->v1;
                                        facepa[curdupface-2]=v1;
                                }
                                else if(v3==v4){
-                                       df3->v2=df2->v1=df1->v1=edgesplit[mf->v1*totvert+mf->v2];
-                                       df2->v3=df1->v2=edgesplit[mf->v2*totvert+mf->v3];
-                                       df3->v3=df1->v3=edgesplit[mf->v1*totvert+mf->v4];
+                                       df3->v2=df2->v1=df1->v1=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                       df2->v3=df1->v2=edgesplit_get(edgehash, mf->v2, mf->v3);
+                                       df3->v3=df1->v3=edgesplit_get(edgehash, mf->v1, mf->v4);
  
                                        df3->v1=mf->v1;
                                        df2->v2=mf->v2;
                                        facepa[curdupface-2]=v2;
                                }
                                else{
-                                       df3->v1=df1->v1=edgesplit[mf->v1*totvert+mf->v2];
-                                       df3->v3=df2->v1=df1->v2=edgesplit[mf->v2*totvert+mf->v3];
-                                       df2->v3=df1->v3=edgesplit[mf->v3*totvert+mf->v4];
+                                       df3->v1=df1->v1=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                       df3->v3=df2->v1=df1->v2=edgesplit_get(edgehash, mf->v2, mf->v3);
+                                       df2->v3=df1->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
  
                                        df3->v2=mf->v2;
                                        df2->v2=mf->v3;
                                        *df3=*mf;
                                        curdupface++;
  
-                                       df1->v1=edgesplit[mf->v1*totvert+mf->v2];
-                                       df3->v2=df1->v3=edgesplit[mf->v2*totvert+mf->v3];
+                                       df1->v1=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                       df3->v2=df1->v3=edgesplit_get(edgehash, mf->v2, mf->v3);
  
-                                       df2->v1=edgesplit[mf->v1*totvert+mf->v4];
-                                       df3->v4=df2->v3=edgesplit[mf->v3*totvert+mf->v4];
+                                       df2->v1=edgesplit_get(edgehash, mf->v1, mf->v4);
+                                       df3->v4=df2->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
  
                                        df3->v1=df2->v2=df1->v4=curdupin;
  
                                        curdupface++;
  
                                        if(v2==v3){
-                                               df1->v1=edgesplit[mf->v1*totvert+mf->v2];
-                                               df3->v1=df1->v2=df1->v3=edgesplit[mf->v2*totvert+mf->v3];
-                                               df2->v1=df1->v4=edgesplit[mf->v1*totvert+mf->v4];
+                                               df1->v1=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                               df3->v1=df1->v2=df1->v3=edgesplit_get(edgehash, mf->v2, mf->v3);
+                                               df2->v1=df1->v4=edgesplit_get(edgehash, mf->v1, mf->v4);
  
-                                               df3->v3=df2->v3=edgesplit[mf->v3*totvert+mf->v4];
+                                               df3->v3=df2->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
  
                                                df3->v2=mf->v3;
                                                df3->v4=0;
                                                facepa[curdupface-1]=v3;
                                        }
                                        else{
-                                               df3->v1=df2->v1=df1->v2=edgesplit[mf->v1*totvert+mf->v2];
-                                               df2->v4=df1->v3=edgesplit[mf->v3*totvert+mf->v4];
-                                               df1->v4=edgesplit[mf->v1*totvert+mf->v4];
+                                               df3->v1=df2->v1=df1->v2=edgesplit_get(edgehash, mf->v1, mf->v2);
+                                               df2->v4=df1->v3=edgesplit_get(edgehash, mf->v3, mf->v4);
+                                               df1->v4=edgesplit_get(edgehash, mf->v1, mf->v4);
  
-                                               df3->v3=df2->v2=edgesplit[mf->v2*totvert+mf->v3];
+                                               df3->v3=df2->v2=edgesplit_get(edgehash, mf->v2, mf->v3);
  
                                                df3->v4=0;
  
                }
        }
  
-       MEM_freeN(edgesplit);
+       BLI_edgehash_free(edgehash, NULL);
        MEM_freeN(facesplit);
        MEM_freeN(vertpa);
  
@@@ -6981,58 -6992,6 +6993,58 @@@ static void meshdeformModifier_deformVe
                dm->release(dm);
  }
  
 +
 +/* Shrinkwrap */
 +
 +static void shrinkwrapModifier_initData(ModifierData *md)
 +{
 +      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
 +      smd->shrinkType = MOD_SHRINKWRAP_NEAREST_SURFACE;
 +      smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL;
 +      smd->keptDist   = 0.0f;
 +}
 +
 +static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target)
 +{
 +      memcpy(target, md, sizeof(MeshDeformModifierData));
 +}
 +
 +CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md)
 +{
 +      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
 +      CustomDataMask dataMask = 0;
 +
 +      /* ask for vertexgroups if we need them */
 +      if(smd->vgroup_name[0]) dataMask |= (1 << CD_MDEFORMVERT);
 +
 +      return dataMask;
 +}
 +
 +static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData)
 +{
 +      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
 +
 +      walk(userData, ob, &smd->target);
 +}
 +
 +static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc)
 +{
 +      return shrinkwrapModifier_do((ShrinkwrapModifierData*)md,ob,derivedData,useRenderParams,isFinalCalc);
 +}
 +
 +static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *forest, Object *ob, DagNode *obNode)
 +{
 +      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
 +
 +      if (smd->target) {
 +              DagNode *curNode = dag_get_node(forest, smd->target);
 +
 +              dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA,
 +                      "Shrinkwrap Modifier");
 +      }
 +}
 +
 +
  /***/
  
  static ModifierTypeInfo typeArr[NUM_MODIFIER_TYPES];
@@@ -7353,16 -7312,6 +7365,16 @@@ ModifierTypeInfo *modifierType_getInfo(
                mti->requiredDataMask = explodeModifier_requiredDataMask;
                mti->applyModifier = explodeModifier_applyModifier;
  
 +              mti = INIT_TYPE(Shrinkwrap);
 +              mti->type = eModifierTypeType_Nonconstructive;
 +              mti->flags = eModifierTypeFlag_AcceptsMesh;
 +              mti->initData = shrinkwrapModifier_initData;
 +              mti->copyData = shrinkwrapModifier_copyData;
 +              mti->requiredDataMask = shrinkwrapModifier_requiredDataMask;
 +              mti->foreachObjectLink = shrinkwrapModifier_foreachObjectLink;
 +              mti->applyModifier = shrinkwrapModifier_applyModifier;
 +              mti->updateDepgraph = shrinkwrapModifier_updateDepgraph;
 +
                typeArrInit = 0;
  #undef INIT_TYPE
        }
index 41727cc387c17368606442c765c44571bfe3c3c9,2ffec207e84041534e873f375f2f523e9144bb35..e9e2117aa2f0f894fcb1d3527e3ac8b149029789
@@@ -1651,6 -1651,12 +1651,12 @@@ void modifiers_explodeFacepa(void *arg1
        emd->flag |= eExplodeFlag_CalcFaces;
  }
  
+ void modifiers_explodeDelVg(void *arg1, void *arg2)
+ {
+       ExplodeModifierData *emd=arg1;
+       emd->vgroup = 0;
+ }
  static int modifier_is_fluid_particles(ModifierData *md) {
        if(md->type == eModifierType_ParticleSystem) {
                if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
@@@ -1820,11 -1826,6 +1826,11 @@@ static void draw_modifier(uiBlock *bloc
                        height = 94;
                } else if (md->type==eModifierType_Explode) {
                        height = 94;
 +              } else if (md->type==eModifierType_Shrinkwrap) {
 +                      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
 +                      height = 86;
 +                      if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL)
 +                              height += 19*3;
                }
                                                        /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */
                uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); 
                        char *menustr= get_vertexgroup_menustr(ob);
                        int defCount=BLI_countlist(&ob->defbase);
                        if(defCount==0) emd->vgroup=0;
-                       but=uiDefButS(block, MENU, B_MODIFIER_RECALC, menustr,  lx, (cy-=19), buttonWidth/2,19, &emd->vgroup, 0, defCount, 0, 0, "Protect this vertex group");
+                       uiBlockBeginAlign(block);
+                       but=uiDefButS(block, MENU, B_MODIFIER_RECALC, menustr,  lx, (cy-=19), buttonWidth-20,19, &emd->vgroup, 0, defCount, 0, 0, "Protect this vertex group");
                        uiButSetFunc(but,modifiers_explodeFacepa,emd,0);
                        MEM_freeN(menustr);
+                       
+                       but=uiDefIconBut(block, BUT, B_MODIFIER_RECALC, ICON_X, (lx+buttonWidth)-20, cy, 20,19, 0, 0, 0, 0, 0, "Disable use of vertex group");
+                       uiButSetFunc(but, modifiers_explodeDelVg, (void *)emd, (void *)NULL);
+                       
  
-                       but=uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "",     lx+buttonWidth/2, cy, buttonWidth/2,19, &emd->protect, 0.0f, 1.0f, 0, 0, "Clean vertex group edges");
+                       but=uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "",     lx, (cy-=19), buttonWidth,19, &emd->protect, 0.0f, 1.0f, 0, 0, "Clean vertex group edges");
                        uiButSetFunc(but,modifiers_explodeFacepa,emd,0);
  
                        but=uiDefBut(block, BUT, B_MODIFIER_RECALC, "Refresh",  lx, (cy-=19), buttonWidth/2,19, 0, 0, 0, 0, 0, "Recalculate faces assigned to particles");
                        uiDefButBitS(block, TOG, eExplodeFlag_Unborn, B_MODIFIER_RECALC, "Unborn",      lx, (cy-=19), buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are unborn");
                        uiDefButBitS(block, TOG, eExplodeFlag_Alive, B_MODIFIER_RECALC, "Alive",        lx+buttonWidth/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are alive");
                        uiDefButBitS(block, TOG, eExplodeFlag_Dead, B_MODIFIER_RECALC, "Dead",  lx+buttonWidth*2/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are dead");
+                       uiBlockEndAlign(block);
 +              } else if (md->type==eModifierType_Shrinkwrap) {
 +                      ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md;
 +
 +                      char shrinktypemenu[]="Shrinkwrap type%t|nearest surface point %x0|normal projection %x1|nearest vertex %x2";
 +                      uiDefButS(block, MENU, B_MODIFIER_RECALC, shrinktypemenu, lx,(cy-=19),buttonWidth,19, &smd->shrinkType, 0, 0, 0, 0, "Selects type of shrinkwrap algorithm for target position.");
 +
 +                      if (smd->shrinkType == MOD_SHRINKWRAP_NORMAL){
 +                              uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL, B_MODIFIER_RECALC, "Default normal",      lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the normal direction");
 +                              uiDefButBitS(block, TOG, MOD_SHRINKWRAP_ALLOW_INVERTED_NORMAL, B_MODIFIER_RECALC, "Invert normal",      lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Allows vertices to move in the inverse direction of their normal");
 +                              uiDefButBitS(block, TOG, MOD_SHRINKWRAP_REMOVE_UNPROJECTED_FACES, B_MODIFIER_RECALC, "Remove faces",    lx,(cy-=19),buttonWidth,19, &smd->shrinkOpts, 0, 0, 0, 0, "Remove faces where all vertices haven't been projected");
 +                      }
 +
 +                      but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ",         lx, (cy-=19), buttonWidth,19, &smd->vgroup_name, 0.0, 31.0, 0, 0, "Vertex Group name");
 +                      uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob);
 +
 +                      uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &smd->target, "Target to shrink to");
 +                      uiDefButF(block, NUM, B_MODIFIER_RECALC, "Offset:",     lx,(cy-=19),buttonWidth,19, &smd->keptDist, 0.0f, 100.0f, 1.0f, 0, "Specify distance to kept from the target");
++                      uiBlockEndAlign(block);
                }
  
                uiBlockEndAlign(block);
@@@ -5344,7 -5333,7 +5356,7 @@@ static void editing_panel_links(Object 
                                uiDefBut(block, BUT, B_POSEGRP_ADD, "Add Group",        xco,110,140,20, 0, 21, 0, 0, 0, "Add a new Bone Group for the Pose");
                        uiBlockEndAlign(block);
                        
-                       /* colour set for 'active' group */
+                       /* color set for 'active' group */
                        if (pose->active_group && grp) {
                                uiBlockBeginAlign(block);
                                        menustr= build_colorsets_menustr();
                                                        memcpy(&grp->cs, col_set, sizeof(ThemeWireColor));
                                                }
                                                else {
-                                                       /* init custom colours with a generic multi-colour rgb set, if not initialised already */
+                                                       /* init custom colors with a generic multi-color rgb set, if not initialised already */
                                                        if (grp->cs.solid[0] == 0) {
                                                                /* define for setting colors in theme below */
                                                                #define SETCOL(col, r, g, b, a)  col[0]=r; col[1]=g; col[2]= b; col[3]= a;