svn merge -r39286:39385 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Aug 2011 06:30:14 +0000 (06:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Aug 2011 06:30:14 +0000 (06:30 +0000)
50 files changed:
1  2 
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenlib/intern/BLI_ghash.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_transform.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_cast.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_multires.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_particlesystem.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_shapekey.c
source/blender/modifiers/intern/MOD_shrinkwrap.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_subsurf.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 0f8173ae4af69d6b786b384434e302be36f68624,38c1e24f27ee81cfe5c7b43ffa3efd2ca97c7bec..4a65c1ee2d04db00169260d5c49e48e53cca4f9f
@@@ -160,8 -161,8 +161,10 @@@ class INFO_MT_file_import(Menu)
          if hasattr(bpy.types, "WM_OT_collada_import"):
              self.layout.operator("wm.collada_import", text="COLLADA (.dae)")
  
++        self.layout.operator("export_mesh.wavefront", text="Wavefront (.obj), BMesh")
++
  
- class INFO_MT_file_export(bpy.types.Menu):
+ class INFO_MT_file_export(Menu):
      bl_idname = "INFO_MT_file_export"
      bl_label = "Export"
  
index c53cc458ccdaeb1306d02d8db338497f5dc88270,c84bcaabbd3257035811d3293aab3bc31d91b78e..c463e43eef864d87fb88ba8aaccac28baa2d6692
@@@ -2149,25 -2768,8 +2149,26 @@@ void DM_vertex_attributes_from_gpu(Deri
                                attribs->tface[a].array = tfdata->layers[layer].data;
                                attribs->tface[a].emOffset = tfdata->layers[layer].offset;
                                attribs->tface[a].glIndex = gattribs->layer[b].glindex;
 -                              attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
 -                      }
 +                      } /*else {
 +                              int player;
 +                              CustomData *pdata = dm->getFaceDataLayout(dm);
 +                              
 +                              if(gattribs->layer[b].name[0])
 +                                      player = CustomData_get_named_layer_index(pdata, CD_MTEXPOLY,
 +                                              gattribs->layer[b].name);
 +                              else
 +                                      player = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY);
 +                              
 +                              if (player != -1) {
 +                                      a = attribs->tottface++;
 +      
 +                                      attribs->tface[a].array = NULL;
 +                                      attribs->tface[a].emOffset = pdata->layers[layer].offset;
 +                                      attribs->tface[a].glIndex = gattribs->layer[b].glindex;
++                                      attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
 +                                      
 +                              }
 +                      }*/
                }
                else if(gattribs->layer[b].type == CD_MCOL) {
                        /* vertex colors */
index fef186fee9ae9cc9aeec21eab87e15e5fe57e459,12fb11c68b3050901a459f210ecde9182ce8f0dd..e517f4ae7b105ead0525efeef96a650ef6a1b551
@@@ -1026,6 -993,50 +1026,52 @@@ static void cdDM_drawMappedFacesTex(Der
        cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
  }
  
 -      
++
+ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int a, int index, int vert, int smoothnormal)
+ {
+       int b;
+       /* orco texture coordinates */
+       if(attribs->totorco) {
+               if(attribs->orco.glTexco)
+                       glTexCoord3fv(attribs->orco.array[index]);
+               else
+                       glVertexAttrib3fvARB(attribs->orco.glIndex, attribs->orco.array[index]);
+       }
+       /* uv texture coordinates */
+       for(b = 0; b < attribs->tottface; b++) {
+               MTFace *tf = &attribs->tface[b].array[a];
+               if(attribs->tface[b].glTexco)
+                       glTexCoord2fv(tf->uv[vert]);
+               else
+                       glVertexAttrib2fvARB(attribs->tface[b].glIndex, tf->uv[vert]);
+       }
+       /* vertex colors */
+       for(b = 0; b < attribs->totmcol; b++) {
+               MCol *cp = &attribs->mcol[b].array[a*4 + vert];
+               GLubyte col[4];
+               col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
+               glVertexAttrib4ubvARB(attribs->mcol[b].glIndex, col);
+       }
+       /* tangent for normal mapping */
+       if(attribs->tottang) {
+               float *tang = attribs->tang.array[a*4 + vert];
+               glVertexAttrib4fvARB(attribs->tang.glIndex, tang);
+       }
+       /* vertex normal */
+       if(smoothnormal)
+               glNormal3sv(mvert[index].no);
++
+       /* vertex coordinate */
+       glVertex3fv(mvert[index].co);
+ }
++
  static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData)
  {
        CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
                                }
                        }
  
- #define PASSVERT(index, vert) {                                                                                                       \
-               if(attribs.totorco)                                                                                                                     \
-                       glVertexAttrib3fvARB(attribs.orco.glIndex, attribs.orco.array[index]);  \
-               for(b = 0; b < attribs.tottface; b++) {                                                                         \
-                       MTFace *tf = &attribs.tface[b].array[a];                                                                \
-                       glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]);                   \
-               }                                                                                                                                                       \
-               for(b = 0; b < attribs.totmcol; b++) {                                                                          \
-                       MCol *cp = &attribs.mcol[b].array[a*4 + vert];                                                  \
-                       GLubyte col[4];                                                                                                                 \
-                       col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;                             \
-                       glVertexAttrib4ubvARB(attribs.mcol[b].glIndex, col);                                    \
-               }                                                                                                                                                       \
-               if(attribs.tottang) {                                                                                                           \
-                       float *tang = attribs.tang.array[a*4 + vert];                                                   \
-                       glVertexAttrib4fvARB(attribs.tang.glIndex, tang);                                               \
-               }                                                                                                                                                       \
-               if(smoothnormal)                                                                                                                        \
-                       glNormal3sv(mvert[index].no);                                                                                   \
-               glVertex3fv(mvert[index].co);                                                                                           \
-       }
-                       PASSVERT(mface->v1, 0);
-                       PASSVERT(mface->v2, 1);
-                       PASSVERT(mface->v3, 2);
+                       cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v1, 0, smoothnormal);
+                       cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v2, 1, smoothnormal);
+                       cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v3, 2, smoothnormal);
 -
                        if(mface->v4)
-                               PASSVERT(mface->v4, 3)
+                               cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v4, 3, smoothnormal);
                        else
-                               PASSVERT(mface->v3, 2)
+                               cddm_draw_attrib_vertex(&attribs, mvert, a, mface->v3, 2, smoothnormal);
 +
                }
                glEnd();
        }
index 351be1ca4c922f5ff5ce6c21ed81f3b170133255,71c8548324484ed04a502379ec119c6a0e86902c..9a6e14fcbad7ce4575505728e01e7e2f33428c2a
@@@ -694,8 -603,9 +630,9 @@@ void draw_mesh_textured(Scene *scene, V
        glColor4f(1.0f,1.0f,1.0f,1.0f);
  
        if(ob->mode & OB_MODE_EDIT) {
 -              dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, me->edit_mesh);
 +              dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, me->edit_btmesh);
-       } else if(faceselect) {
+       }
+       else if(faceselect) {
                if(ob->mode & OB_MODE_WEIGHT_PAINT)
                        dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1, GPU_enable_material);
                else
index 7d5c6c7aa7c071bdf341955668cc26ee3471c66a,afe6da8b38a602930194d468d6b0b9f43747b061..a7ebd2ed5759a1a73accd54dde494ad87a240a44
@@@ -226,12 -229,13 +226,14 @@@ static DerivedMesh *applyModifier(Modif
  
        int *edge_users= NULL;
        char *edge_order= NULL;
 -
 +      int *edge_origIndex;
 +      
        float (*vert_nors)[3]= NULL;
  
-       float const ofs_orig=                           - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
-       float const ofs_new= smd->offset        - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
+       const float ofs_orig=                           - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
+       const float ofs_new= smd->offset        - (((-smd->offset_fac + 1.0f) * 0.5f) * smd->offset);
+       const float offset_fac_vg= smd->offset_fac_vg;
+       const float offset_fac_vg_inv= 1.0f - smd->offset_fac_vg;
  
        /* weights */
        MDeformVert *dvert, *dv= NULL;