svn merge ^/trunk/blender -r43482:43524
authorCampbell Barton <ideasman42@gmail.com>
Thu, 19 Jan 2012 11:31:31 +0000 (11:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 19 Jan 2012 11:31:31 +0000 (11:31 +0000)
15 files changed:
1  2 
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_bake.c
source/blender/editors/sculpt_paint/CMakeLists.txt
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/render/intern/source/render_texture.c

index a2aa1476c2b1167aaa9a7a6224301c33599775b1,b670a360a6abb2418b4eae4cfd0f6430d2a25b4e..63605c14f6cb3cb5567bb4f1fb4714eff2d2fadd
@@@ -2739,3 -2313,79 +2739,84 @@@ static DerivedMesh *navmesh_dm_createNa
  #endif /* WITH_GAMEENGINE */
  
  /* --- NAVMESH (end) --- */
 -              case DM_TYPE_EDITMESH: tstr = "DM_TYPE_EDITMESH";  break;
+ /* derivedmesh info printing function,
+  * to help track down differences DM output */
+ #ifndef NDEBUG
+ #include "BLI_dynstr.h"
+ static void dm_debug_info_layers(DynStr *dynstr, DerivedMesh *dm, void *(*getElemDataArray)(DerivedMesh *, int))
+ {
+       int type;
+       for (type = 0; type < CD_NUMTYPES; type++) {
+               /* note: doesnt account for multiple layers */
+               void *pt = getElemDataArray(dm, type);
+               if (pt) {
+                       const char *name = CustomData_layertype_name(type);
+                       const int size = CustomData_sizeof(type);
+                       const char *structname;
+                       int structnum;
+                       CustomData_file_write_info(type, &structname, &structnum);
+                       BLI_dynstr_appendf(dynstr,
+                                          "        dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n",
+                                                          name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size));
+               }
+       }
+ }
+ char *DM_debug_info(DerivedMesh *dm)
+ {
+       DynStr *dynstr= BLI_dynstr_new();
+       char *ret;
+       const char *tstr;
+       BLI_dynstr_appendf(dynstr, "{\n");
+       BLI_dynstr_appendf(dynstr, "    'ptr': '%p',\n", (void *)dm);
+       switch (dm->type) {
+               case DM_TYPE_CDDM:     tstr = "DM_TYPE_CDDM";     break;
 -      BLI_dynstr_appendf(dynstr, "    'numFaceData': %d,\n", dm->numFaceData);
++              case DM_TYPE_EDITBMESH: tstr = "DM_TYPE_EDITMESH";  break;
+               case DM_TYPE_CCGDM:    tstr = "DM_TYPE_CCGDM";     break;
+               default:               tstr = "UNKNOWN";           break;
+       }
+       BLI_dynstr_appendf(dynstr, "    'type': '%s',\n", tstr);
+       BLI_dynstr_appendf(dynstr, "    'numVertData': %d,\n", dm->numVertData);
+       BLI_dynstr_appendf(dynstr, "    'numEdgeData': %d,\n", dm->numEdgeData);
 -      BLI_dynstr_appendf(dynstr, "    'faceLayers': (\n");
 -      dm_debug_info_layers(dynstr, dm, dm->getFaceDataArray);
++      BLI_dynstr_appendf(dynstr, "    'numTessFaceData': %d,\n", dm->numTessFaceData);
++      BLI_dynstr_appendf(dynstr, "    'numPolyData': %d,\n", dm->numPolyData);
+       BLI_dynstr_appendf(dynstr, "    'deformedOnly': %d,\n", dm->deformedOnly);
+       BLI_dynstr_appendf(dynstr, "    'vertexLayers': (\n");
+       dm_debug_info_layers(dynstr, dm, dm->getVertDataArray);
+       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_appendf(dynstr, "    'edgeLayers': (\n");
+       dm_debug_info_layers(dynstr, dm, dm->getEdgeDataArray);
+       BLI_dynstr_appendf(dynstr, "    ),\n");
++      BLI_dynstr_appendf(dynstr, "    'tessFaceLayers': (\n");
++      dm_debug_info_layers(dynstr, dm, dm->getTessFaceDataArray);
++      BLI_dynstr_appendf(dynstr, "    ),\n");
++
++      BLI_dynstr_appendf(dynstr, "    'PolyLayers': (\n");
++      dm_debug_info_layers(dynstr, dm, DM_get_poly_data_layer);
+       BLI_dynstr_appendf(dynstr, "    ),\n");
+       BLI_dynstr_appendf(dynstr, "}\n");
+       ret = BLI_dynstr_get_cstring(dynstr);
+       BLI_dynstr_free(dynstr);
+       return ret;
+ }
+ void DM_debug_print(DerivedMesh *dm)
+ {
+       char *str = DM_debug_info(dm);
+       printf("%s", str);
+       fflush(stdout);
+       MEM_freeN(str);
+ }
+ #endif /* NDEBUG */