svn merge ^/trunk/blender -r40720:40872
authorCampbell Barton <ideasman42@gmail.com>
Sun, 9 Oct 2011 07:31:15 +0000 (07:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 9 Oct 2011 07:31:15 +0000 (07:31 +0000)
42 files changed:
1  2 
CMakeLists.txt
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/curve/editfont.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/util/ed_util.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/mathutils/mathutils.c
source/blender/render/intern/source/convertblender.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt

diff --cc CMakeLists.txt
Simple merge
@@@ -383,10 -322,10 +382,10 @@@ static int wpaint_mirror_vgroup_ensure(
                }
        }
  
-       *vgroup_mirror= -1;
+       return -1;
  }
  
 -static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot)
 +static void copy_vpaint_prev(VPaint *vp, unsigned int *lcol, int tot)
  {
        if(vp->vpaint_prev) {
                MEM_freeN(vp->vpaint_prev);
@@@ -1192,33 -1110,36 +1191,35 @@@ static void do_weight_paint_auto_normal
                }
        }
  }
 -#endif
  
  /* the active group should be involved in auto normalize */
- static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *map, char do_auto_normalize)
+ static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const char *vgroup_validmap, char do_auto_normalize)
  {
- //    MDeformWeight *dw = dvert->dw;
-       float sum=0.0f, fac=0.0f;
-       int i, tot=0;
-       if (do_auto_normalize == FALSE)
+       if (do_auto_normalize == FALSE) {
                return;
+       }
+       else {
+               float sum= 0.0f, fac;
+               unsigned int i, tot=0;
+               MDeformWeight *dw;
+               for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+                       if (vgroup_validmap[dw->def_nr]) {
+                               tot++;
+                               sum += dw->weight;
+                       }
+               }
  
-       for (i=0; i<dvert->totweight; i++) {
-               if (map[dvert->dw[i].def_nr]) {
-                       tot += 1;
-                       sum += dvert->dw[i].weight;
+               if ((tot == 0) || (sum == 1.0f) || (sum == 0.0f)) {
+                       return;
                }
-       }
-       
-       if (!tot || sum == 1.0f)
-               return;
  
-       fac = sum;
-       fac = fac==0.0f ? 1.0f : 1.0f / fac;
+               fac= 1.0f / sum;
  
-       for (i=0; i<dvert->totweight; i++) {
-               if (map[dvert->dw[i].def_nr]) {
-                       dvert->dw[i].weight *= fac;
+               for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+                       if (vgroup_validmap[dw->def_nr]) {
+                               dw->weight *= fac;
+                       }
                }
        }
  }
Simple merge
@@@ -43,6 -43,6 +43,7 @@@
  #include "MEM_guardedalloc.h" // for MEM_freeN MEM_mallocN MEM_callocN
  
  #ifdef WITH_DNA_GHASH
++#  include "BLI_utildefines.h"
  #  include "BLI_ghash.h"
  #endif
  
Simple merge
@@@ -1187,7 -1227,8 +1187,7 @@@ static void rna_def_mvert(BlenderRNA *b
        RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
  
        prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
-       RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next",
 -                                        "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "VertexGroupElement");
        RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of");
  
@@@ -1453,10 -1402,12 +1453,10 @@@ static void rna_def_mtexpoly(BlenderRN
        prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "MeshTextureFace");
        RNA_def_property_ui_text(prop, "Data", "");
-       RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
 -                                              "rna_iterator_array_end", "rna_iterator_array_get",
 -                                              "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
  
        srna= RNA_def_struct(brna, "MeshTextureFace", NULL);
 -      RNA_def_struct_sdna(srna, "MTFace");
 +      RNA_def_struct_sdna(srna, "MTexPoly");
        RNA_def_struct_ui_text(srna, "Mesh Texture Face", "UV mapping, texturing and game engine data for a face");
        RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path");
        RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT);
@@@ -1542,7 -1516,9 +1542,7 @@@ static void rna_def_mloopcol(BlenderRN
        prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "MeshColor");
        RNA_def_property_ui_text(prop, "Data", "");
-       RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next",
 -                                        "rna_iterator_array_end", "rna_iterator_array_get",
 -                                        "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
  
        srna= RNA_def_struct(brna, "MeshColor", NULL);
        RNA_def_struct_sdna(srna, "MCol");
@@@ -1571,7 -1573,9 +1571,7 @@@ static void rna_def_mproperties(Blender
        prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "MeshFloatProperty");
        RNA_def_property_ui_text(prop, "Data", "");
-       RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next",
 -                                        "rna_iterator_array_end", "rna_iterator_array_get",
 -                                        "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
  
        srna= RNA_def_struct(brna, "MeshFloatProperty", NULL);
        RNA_def_struct_sdna(srna, "MFloatProperty");
        prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "MeshIntProperty");
        RNA_def_property_ui_text(prop, "Data", "");
-       RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next",
 -                                        "rna_iterator_array_end", "rna_iterator_array_get",
 -                                        "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
  
        srna= RNA_def_struct(brna, "MeshIntProperty", NULL);
        RNA_def_struct_sdna(srna, "MIntProperty");
        prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "MeshStringProperty");
        RNA_def_property_ui_text(prop, "Data", "");
-       RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", 0, 0);
 -      RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next",
 -                                        "rna_iterator_array_end", "rna_iterator_array_get",
 -                                        "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
++      RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
  
        srna= RNA_def_struct(brna, "MeshStringProperty", NULL);
        RNA_def_struct_sdna(srna, "MStringProperty");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
  }
  
 +void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
 +{
 +      PropertyRNA *prop;
 +
 +      /* texture space */
 +      prop= RNA_def_property(srna, "auto_texspace", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
 +      RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
 +
 +      prop= RNA_def_property(srna, "texspace_loc", PROP_FLOAT, PROP_TRANSLATION);
 +      RNA_def_property_float_sdna(prop, NULL, "loc");
 +      RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location");
 +      RNA_def_property_editable_func(prop, texspace_editable);
 +      RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 +
 +      prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
 +      RNA_def_property_float_sdna(prop, NULL, "size");
 +      RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
 +      RNA_def_property_editable_func(prop, texspace_editable);
 +      RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 +
 +      /* not supported yet
 +      prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
 +      RNA_def_property_float(prop, NULL, "rot");
 +      RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
 +      RNA_def_property_editable_func(prop, texspace_editable);
 +      RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
 +
 +      /* materials */
 +      prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
 +      RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
 +      RNA_def_property_struct_type(prop, "Material");
 +      RNA_def_property_ui_text(prop, "Materials", "");
 +      RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
++      RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
 +}
 +
 +
 +/* scene.objects */
  /* mesh.vertices */
  static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
  {
@@@ -1922,8 -1834,8 +1923,8 @@@ static void rna_def_mesh(BlenderRNA *br
  
        /* UV textures */
        prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 +      RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
-       RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0);
+       RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
        RNA_def_property_ui_text(prop, "UV Textures", "");
        rna_def_uv_textures(brna, prop);
        /* Vertex colors */
  
        prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 +      RNA_def_property_collection_sdna(prop, NULL, "ldata.layers", "ldata.totlayer");
-       RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0);
+       RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "MeshColorLayer");
        RNA_def_property_ui_text(prop, "Vertex Colors", "");
        rna_def_vertex_colors(brna, prop);
  
        prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 +      RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
-       RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0);
+       RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
        RNA_def_property_ui_text(prop, "Float Property Layers", "");
  
        prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 +      RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
-       RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0);
+       RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
        RNA_def_property_ui_text(prop, "Int Property Layers", "");
  
        prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
 +      RNA_def_property_collection_sdna(prop, NULL, "pdata.layers", "pdata.totlayer");
-       RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0);
+       RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL);
        RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
        RNA_def_property_ui_text(prop, "String Property Layers", "");
  
Simple merge