Merge branch 'master' into blender2.8
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 17 Jan 2018 23:58:54 +0000 (00:58 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 18 Jan 2018 00:01:17 +0000 (01:01 +0100)
46 files changed:
1  2 
source/blender/blenkernel/BKE_main.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_evaluate.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/particle.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/depsgraph/intern/builder/deg_builder_relations_impl.h
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/intern/dna_genfile.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_collision.c
source/blender/modifiers/intern/MOD_correctivesmooth.c
source/blender/modifiers/intern/MOD_decimate.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_laplaciandeform.c
source/blender/modifiers/intern/MOD_laplaciansmooth.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_meshcache.c
source/blender/modifiers/intern/MOD_meshdeform.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_normal_edit.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_screw.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/modifiers/intern/MOD_smooth.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/modifiers/intern/MOD_surface.c
source/blender/modifiers/intern/MOD_surfacedeform.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_wave.c
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/modifiers/intern/MOD_weightvgmix.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

Simple merge
index 01340b97807f450bbb1c8712097ffe0724aece38,48edf55d76e5002e6008b51ff390698b095d53b9..cfeca50a751a4185498eb7e427d8f3c229c68a46
@@@ -634,10 -632,10 +634,10 @@@ void DM_generate_tangent_tessface_data(
                for (int j = 0; j < ldata->totlayer; j++) {
                        if (ldata->layers[j].type == CD_TANGENT) {
                                CustomData_add_layer_named(fdata, CD_TANGENT, CD_CALLOC, NULL, totface, ldata->layers[j].name);
 -                              CustomData_bmesh_update_active_layers(fdata, pdata, ldata);
 +                              CustomData_bmesh_update_active_layers(fdata, ldata);
  
                                if (!loopindex) {
-                                       loopindex = MEM_mallocN(sizeof(*loopindex) * totface, __func__);
+                                       loopindex = MEM_malloc_arrayN(totface, sizeof(*loopindex), __func__);
                                        for (mf_idx = 0, mf = mface; mf_idx < totface; mf_idx++, mf++) {
                                                const int mf_len = mf->v4 ? 4 : 3;
                                                unsigned int *ml_idx = loopindex[mf_idx];
index b6e3d048f0b456d29abfa5236cad51178f4c8be7,9c8fc9bfd0c01a0e5ba9ae8ba9d9fb14264ebece..55f11604710413bc4bdb86cdec419a68ba7686cf
@@@ -438,12 -438,12 +438,12 @@@ int multiresModifier_reshapeFromDeformM
                return 0;
  
        /* Create DerivedMesh for deformation modifier */
 -      dm = get_multires_dm(scene, mmd, ob);
 +      dm = get_multires_dm(eval_ctx, scene, mmd, ob);
        numVerts = dm->getNumVerts(dm);
-       deformedVerts = MEM_mallocN(sizeof(float[3]) * numVerts, "multiresReshape_deformVerts");
+       deformedVerts = MEM_malloc_arrayN(numVerts, sizeof(float[3]), "multiresReshape_deformVerts");
  
        dm->getVertCos(dm, deformedVerts);
 -      mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0);
 +      mti->deformVerts(md, eval_ctx, ob, dm, deformedVerts, numVerts, 0);
  
        ndm = CDDM_copy(dm);
        CDDM_apply_vert_coords(ndm, deformedVerts);
@@@ -2296,13 -2300,13 +2300,13 @@@ static void multires_apply_smat(const s
        high_mmd.lvl = high_mmd.totlvl;
  
        /* unscaled multires with applied displacement */
 -      subdm = get_multires_dm(scene, &high_mmd, ob);
 +      subdm = get_multires_dm(eval_ctx, scene, &high_mmd, ob);
  
        /* prepare scaled CDDM to create ccgDN */
 -      cddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
 +      cddm = mesh_get_derived_deform(eval_ctx, scene, ob, CD_MASK_BAREMESH);
  
        totvert = cddm->getNumVerts(cddm);
-       vertCos = MEM_mallocN(sizeof(*vertCos) * totvert, "multiresScale vertCos");
+       vertCos = MEM_malloc_arrayN(totvert, sizeof(*vertCos), "multiresScale vertCos");
        cddm->getVertCos(cddm, vertCos);
        for (i = 0; i < totvert; i++)
                mul_m3_v3(smat, vertCos[i]);
index d55f00ae7e4f4d90879f89b07c363fbf9115aaac,b7dd05517cfffbb50062162969732bb8fa842dfd..485586e844f754a2da77a1b576d90eb05b095160
@@@ -213,7 -213,7 +213,7 @@@ bool DepsgraphRelationBuilder::is_same_
                return false;
        }
        /* Check if this is actually a shape key datablock. */
--      if (GS(op_from->owner->owner->id->name) != ID_KE) {
++      if (GS(op_from->owner->owner->id_orig->name) != ID_KE) {
                return false;
        }
        /* Different key data blocks. */
index 3ab56f2ebcbcc25c6f9ce9ca27e1f2ae5fcfd881,5d4f6242e4f90d5781ba08fc7e3ff730669ea3a8..793e5609d31b9a2d18e9b662b54682d8ab3eb72b
@@@ -762,10 -740,18 +762,18 @@@ static int loopcut_modal(bContext *C, w
                                handled = true;
                                break;
                        case MOUSEMOVE:  /* mouse moved somewhere to select another loop */
-                               if (!has_numinput) {
+                               /* This is normally disabled for all modal operators.
+                                * This is an exception since mouse movement doesn't relate to numeric input.
+                                *
+                                * If numeric input changes we'll need to add this back see: D2973 */
+ #if 0
+                               if (!has_numinput)
+ #endif
+                               {
                                        lcd->vc.mval[0] = event->mval[0];
                                        lcd->vc.mval[1] = event->mval[1];
 -                                      loopcut_mouse_move(lcd, (int)lcd->cuts);
 +                                      loopcut_mouse_move(&eval_ctx, lcd, (int)lcd->cuts);
  
                                        ED_region_tag_redraw(lcd->ar);
                                        handled = true;
index 222a335d758b1dd1b8e841bf5469e47c642df875,83fb5f9df0e274880f74cdee1514afe0b8bdfc95..3bc2481a608dbc33dd0ba35741c899b2a1b40986
@@@ -6115,10 -5207,10 +6115,10 @@@ static void draw_new_particle_system
                                        create_cdata = 1;
                                break;
                        case PART_DRAW_LINE:
-                               tot_vec_size *= 2;
+                               partsize *= 2;
                                break;
                        case PART_DRAW_BB:
-                               tot_vec_size *= 6;  /* New OGL only understands tris, no choice here. */
 -                              partsize *= 4;
++                              partsize *= 6;  /* New OGL only understands tris, no choice here. */
                                create_ndata = 1;
                                break;
                }
@@@ -6625,10 -5760,13 +6626,10 @@@ static void draw_ptcache_edit(Scene *sc
        UI_GetThemeColor3fv(TH_VERTEX, nosel_col);
  
        /* draw paths */
 -      totkeys = (*edit->pathcache)->segments + 1;
 +      const int totkeys = (*edit->pathcache)->segments + 1;
  
        glEnable(GL_BLEND);
-       float *pathcol = MEM_callocN(totkeys * 4 * sizeof(float), "particle path color data");
 -      pathcol = MEM_calloc_arrayN(totkeys, 4 * sizeof(float), "particle path color data");
 -
 -      glEnableClientState(GL_VERTEX_ARRAY);
 -      glEnableClientState(GL_COLOR_ARRAY);
++      float *pathcol = MEM_calloc_arrayN(totkeys, 4 * sizeof(float), "particle path color data");
  
        if (pset->brushtype == PE_BRUSH_WEIGHT)
                glLineWidth(2.0f);
index c9a842621b61fbc15186a110e2866c1f5dd08479,89ce50d076a8682b5f5807cae371fbebf92fd9e1..498dd2486f404c6989359bd67bc1b6e1d3e2b6bd
@@@ -224,9 -245,13 +224,9 @@@ static DerivedMesh *uvprojectModifier_d
        mloop_uv = CustomData_duplicate_referenced_layer_named(&dm->loopData,
                                                               CD_MLOOPUV, uvname, numLoops);
  
 -      /* can be NULL */
 -      mt = mtexpoly = CustomData_duplicate_referenced_layer_named(&dm->polyData,
 -                                                                  CD_MTEXPOLY, uvname, numPolys);
 -
        numVerts = dm->getNumVerts(dm);
  
-       coords = MEM_mallocN(sizeof(*coords) * numVerts,
+       coords = MEM_malloc_arrayN(numVerts, sizeof(*coords),
                             "uvprojectModifier_do coords");
        dm->getVertCos(dm, coords);