svn merge -r40295:40367 ^/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Wed, 21 Sep 2011 17:15:54 +0000 (17:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 21 Sep 2011 17:15:54 +0000 (17:15 +0000)
48 files changed:
1  2 
release/scripts/modules/bpy_types.py
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/blender.c
source/blender/blenlib/BLI_utildefines.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/curve/editcurve.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_parametrizer.c
source/blender/editors/uvedit/uvedit_unwrap_ops.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_mesh_api.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_pose_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/windowmanager/intern/wm_init_exit.c

Simple merge
index 0b25b25ac945d9dbeef452be3f8c051ecc072824,5411f01bee4f5aa5b545087640ced9752d6ecf55..a58c8d9bee953ceb2cb300c71dd70a18f63992fb
@@@ -413,15 -362,14 +413,15 @@@ static int drop_named_image_invoke(bCon
                RNA_string_get(op->ptr, "name", name);
                ima= (Image *)find_id("IM", name);
        }
 +
        
        if(!ima) {
-               BKE_report(op->reports, RPT_ERROR, "Not an Image.");
+               BKE_report(op->reports, RPT_ERROR, "Not an Image");
                return OPERATOR_CANCELLED;
        }
 +
        
 -      /* turn mesh in editmode */
 -      /* BKE_mesh_get/end_editmesh: ED_uvedit_assign_image also calls this */
 +      /* put mesh in editmode */
  
        obedit= base->object;
        me= obedit->data;
@@@ -468,10 -411,9 +468,10 @@@ void MESH_OT_drop_named_image(wmOperato
        
        /* flags */
        ot->flag= OPTYPE_UNDO;
 +
        
        /* properties */
-       RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
+       RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
        RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
  }
  
@@@ -804,8 -682,8 +804,8 @@@ static void mesh_add_polys(Mesh *mesh, 
  /*
  void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces)
  {
 -      if(mesh->edit_mesh) {
 +      if(mesh->edit_btmesh) {
-               BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode.");
+               BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode");
                return;
        }
  
  
  void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count)
  {
 -      if(mesh->edit_mesh) {
 +      if(mesh->edit_btmesh) {
-               BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode.");
+               BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode");
                return;
        }
  
  
  void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
  {
 -      if(mesh->edit_mesh) {
 +      if(mesh->edit_btmesh) {
-               BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode.");
+               BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode");
 -              return;
 +                      return;
        }
  
        mesh_add_edges(mesh, count);
  }
  
 +
  void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count)
  {
 -      if(mesh->edit_mesh) {
 +      if(mesh->edit_btmesh) {
-               BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode.");
+               BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode");
                return;
        }
  
index 8559611cad1d67e8fbdf7b573d05fdcb46cd3e0a,ce01bef34f66fd62c14025439eb6a7fbc1d91e6b..1be95ad1654c91e713a81aebd3546f9f024431fb
@@@ -307,7 -302,12 +307,13 @@@ static int object_hook_index_array(Scen
                case OB_MESH:
                {
                        Mesh *me= obedit->data;
-                       BMEditMesh *em = me->edit_btmesh;
 -                      EditMesh *em;
 -                      load_editMesh(scene, obedit);
 -                      make_editMesh(scene, obedit);
++                      BMEditMesh *em;
 -                      em = BKE_mesh_get_editmesh(me);
++                      EDBM_LoadEditBMesh(scene, obedit);
++                      EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
++
++                      em = me->edit_btmesh;
  
                        /* check selected vertices first */
                        if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
@@@ -740,6 -742,6 +746,7 @@@ void OBJECT_OT_hook_recenter(wmOperator
  
  static int object_hook_assign_exec(bContext *C, wmOperator *op)
  {
++      Scene *scene= CTX_data_scene(C);
        PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
        int num= RNA_enum_get(op->ptr, "modifier");
        Object *ob=NULL;
        
        /* assign functionality */
        
-       if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) {
 -      if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) {
++      if(!object_hook_index_array(scene, ob, &tot, &indexar, name, cent)) {
                BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
                return OPERATOR_CANCELLED;
        }
index 34496fa3f3a2138e1c5ddd22b19f1a353b8c0957,ec5aa19d3c05c8cb6b267479c2453b29cafa1811..77a1ee1047e1311909008c9526bce00160a8c2e6
@@@ -94,8 -93,9 +94,9 @@@
  #include "ED_curve.h"
  #include "ED_keyframing.h"
  #include "ED_object.h"
++#include "ED_mesh.h"
  #include "ED_screen.h"
  #include "ED_view3d.h"
 -#include "ED_mesh.h"
  
  #include "object_intern.h"
  
@@@ -124,10 -123,16 +125,15 @@@ static int vertex_parent_set_exec(bCont
        
        if(obedit->type==OB_MESH) {
                Mesh *me= obedit->data;
-               BMEditMesh *em = me->edit_btmesh;
 -              EditMesh *em;
++              BMEditMesh *em;
 -              load_editMesh(scene, obedit);
 -              make_editMesh(scene, obedit);
++              EDBM_LoadEditBMesh(scene, obedit);
++              EDBM_MakeEditBMesh(scene->toolsettings, scene, obedit);
 -              em = BKE_mesh_get_editmesh(me);
++              em= me->edit_btmesh;
  
 -              eve= em->verts.first;
 -              while(eve) {
 -                      if(eve->f & 1) {
 +              BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
 +                      if (BM_TestHFlag(eve, BM_SELECT)) {
                                if(v1==0) v1= nr;
                                else if(v2==0) v2= nr;
                                else if(v3==0) v3= nr;
index 3697d698cc9d3a808ff69ccf25e53b4fecdfa276,9a21305457c57a96c8c01ef6fb6e192757c30807..9374feb5e590b235d6b73f7fb4e56d0f55e8124e
@@@ -1662,8 -1433,8 +1662,8 @@@ static void UV_OT_stitch(wmOperatorTyp
        ot->poll= ED_operator_uvedit;
  
        /* properties */
-       RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance.");
+       RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance");
 -      RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates", -FLT_MAX, FLT_MAX);
 +      RNA_def_float(ot->srna, "limit", 20.0, 0.0f, FLT_MAX, "Limit", "Limit distance in image pixels.", -FLT_MAX, FLT_MAX);
  }
  
  /* ******************** (de)select all operator **************** */
@@@ -2115,9 -1868,9 +2115,9 @@@ static void UV_OT_select(wmOperatorTyp
  
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0,
-               "Extend", "Extend selection rather than clearing the existing selection.");
+               "Extend", "Extend selection rather than clearing the existing selection");
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
 -              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
 +              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
  }
  
  /* ******************** loop select operator **************** */
@@@ -2160,9 -1913,9 +2160,9 @@@ static void UV_OT_select_loop(wmOperato
  
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0,
-               "Extend", "Extend selection rather than clearing the existing selection.");
+               "Extend", "Extend selection rather than clearing the existing selection");
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
 -              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
 +              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
  }
  
  /* ******************** linked select operator **************** */
@@@ -2181,7 -1934,8 +2181,7 @@@ static int select_linked_internal(bCont
        NearestHit hit, *hit_p= NULL;
  
        if(ts->uv_flag & UV_SYNC_SELECTION) {
-               BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled.");
+               BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled");
 -              BKE_mesh_end_editmesh(obedit->data, em);
                return OPERATOR_CANCELLED;
        }
  
@@@ -2262,10 -2017,10 +2262,10 @@@ static void UV_OT_select_linked_pick(wm
  
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0,
-               "Extend", "Extend selection rather than clearing the existing selection.");
+               "Extend", "Extend selection rather than clearing the existing selection");
  
        RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
 -              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
 +              "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
  }
  
  /* ******************** unlink selection operator **************** */
@@@ -2276,15 -2031,13 +2276,15 @@@ static int unlink_selection_exec(bConte
        ToolSettings *ts= CTX_data_tool_settings(C);
        Object *obedit= CTX_data_edit_object(C);
        Image *ima= CTX_data_edit_image(C);
 -      EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 -      EditFace *efa;
 -      MTFace *tf;
 +      BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
 +      BMFace *efa;
 +      BMLoop *l;
 +      BMIter iter, liter;
 +      MTexPoly *tf;
 +      MLoopUV *luv;
  
        if(ts->uv_flag & UV_SYNC_SELECTION) {
-               BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled.");
+               BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled");
 -              BKE_mesh_end_editmesh(obedit->data, em);
                return OPERATOR_CANCELLED;
        }
        
index b1ce053fb8464a94bfebd422c42b08e859440115,d5666d135aa05bd726a22bfaac862404722f18d6..7a7a6395ecbf74c70e569adfbbf85b040bc67461
@@@ -527,9 -475,12 +527,9 @@@ void UV_OT_minimize_stretch(wmOperatorT
        ot->poll= ED_operator_uvedit;
  
        /* properties */
-       RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry.");
 -      RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes",
 -                      "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry");
 -      RNA_def_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend",
 -                           "Blend factor between stretch minimized and original", 0.0f, 1.0f);
 -      RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations",
 -                  "Number of iterations to run, 0 is unlimited when run interactively", 0, 100);
++      RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry");
 +      RNA_def_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend", "Blend factor between stretch minimized and original.", 0.0f, 1.0f);
 +      RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations", "Number of iterations to run, 0 is unlimited when run interactively.", 0, 100);
  }
  
  /* ******************** Pack Islands operator **************** */
@@@ -800,19 -758,19 +801,22 @@@ static void uv_transform_properties(wmO
                {0, NULL, 0, NULL, NULL}
        };
  
-       RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", "Direction of the sphere or cylinder.");
-       RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align", "How to determine rotation around the pole.");
+       RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction",
+                    "Direction of the sphere or cylinder");
+       RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align",
+                    "How to determine rotation around the pole");
        if(radius)
-               RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "Radius of the sphere or cylinder.", 0.0001f, 100.0f);
+               RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius",
 -                            "Radius of the sphere or cylinder", 0.0001f, 100.0f);
++                            "Radius of the sphere or cylinder.", 0.0001f, 100.0f);
  }
  
 -static void correct_uv_aspect(EditMesh *em)
 +static void correct_uv_aspect(BMEditMesh *em)
  {
 -      EditFace *efa= EM_get_actFace(em, 1);
 -      MTFace *tf;
 +      BMFace *efa= BM_get_actFace(em->bm, 1);
 +      BMLoop *l;
 +      BMIter iter, liter;
 +      MTexPoly *tf;
 +      MLoopUV *luv;
        float scale, aspx= 1.0f, aspy=1.0f;
        
        if(efa) {
  
  static void uv_map_clip_correct_properties(wmOperatorType *ot)
  {
-       RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", "Map UV's taking image aspect ratio into account.");
-       RNA_def_boolean(ot->srna, "clip_to_bounds", 0, "Clip to Bounds", "Clip UV coordinates to bounds after unwrapping.");
-       RNA_def_boolean(ot->srna, "scale_to_bounds", 0, "Scale to Bounds", "Scale UV coordinates to bounds after unwrapping.");
+       RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect",
+                       "Map UV's taking image aspect ratio into account");
+       RNA_def_boolean(ot->srna, "clip_to_bounds", 0, "Clip to Bounds",
+                       "Clip UV coordinates to bounds after unwrapping");
+       RNA_def_boolean(ot->srna, "scale_to_bounds", 0, "Scale to Bounds",
+                       "Scale UV coordinates to bounds after unwrapping");
  }
  
 -static void uv_map_clip_correct(EditMesh *em, wmOperator *op)
 +static void uv_map_clip_correct(BMEditMesh *em, wmOperator *op)
  {
 -      EditFace *efa;
 -      MTFace *tf;
 +      BMFace *efa;
 +      BMLoop *l;
 +      BMIter iter, liter;
 +      MLoopUV *luv;
        float dx, dy, min[2], max[2];
 -      int b, nverts;
        int correct_aspect= RNA_boolean_get(op->ptr, "correct_aspect");
        int clip_to_bounds= RNA_boolean_get(op->ptr, "clip_to_bounds");
        int scale_to_bounds= RNA_boolean_get(op->ptr, "scale_to_bounds");
index 690f872f84c7692f9e94026e05f45d12dbfd1fba,ef636d9a515674c5ae6731beae4cfd6204131e2c..3d82acc5a56983316a606cbfc6ab4386c122f804
@@@ -65,21 -57,15 +65,22 @@@ void RNA_api_mesh(StructRNA *srna
        RNA_def_property_flag(parm, PROP_REQUIRED);
  
        func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
-       RNA_def_function_ui_description(func, "Calculate vertex normals.");
+       RNA_def_function_ui_description(func, "Calculate vertex normals");
  
        func= RNA_def_function(srna, "update", "ED_mesh_update");
-       RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges.");
+       RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
        RNA_def_function_flag(func, FUNC_USE_CONTEXT);
  
 +      func= RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
 +      parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
 +      RNA_def_function_flag(func, FUNC_USE_CONTEXT);
 +      /* return value */
 +      parm= RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");
 +      RNA_def_function_return(func, parm);
 +
        func= RNA_def_function(srna, "validate", "BKE_mesh_validate");
-       RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had invalid geometry corrected/removed.");
+       RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had "
+                                             "invalid geometry corrected/removed");
        RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
        parm= RNA_def_boolean(func, "result", 0, "Result", "");
        RNA_def_function_return(func, parm);