[Bf-blender-cvs] [7834b595988] temp_bmesh_multires: Merge remote-tracking branch 'origin' into temp_bmesh_multires

Joseph Eagar noreply at git.blender.org
Tue Nov 3 09:48:34 CET 2020


Commit: 7834b5959886fa69c20068c02040bae784003ce9
Author: Joseph Eagar
Date:   Mon Nov 2 14:33:52 2020 -0800
Branches: temp_bmesh_multires
https://developer.blender.org/rB7834b5959886fa69c20068c02040bae784003ce9

Merge remote-tracking branch 'origin' into temp_bmesh_multires

===================================================================



===================================================================

diff --cc source/blender/blenkernel/BKE_multires.h
index ff4585b5823,5a668532033..a6dd69d4322
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@@ -219,7 -218,12 +219,13 @@@ BLI_INLINE void BKE_multires_construct_
                                                        const float dPdv[3],
                                                        const int corner);
  
 +void BKE_multires_bmesh_space_set(struct Object *ob, struct BMesh *bm, int mode);
+ /* Versioning. */
+ 
+ /* Convert displacement which is stored for simply-subdivided mesh to a Catmull-Clark
+  * subdivided mesh.  */
+ void multires_do_versions_simple_to_catmull_clark(struct Object *object,
+                                                   struct MultiresModifierData *mmd);
  
  #ifdef __cplusplus
  }
diff --cc source/blender/blenkernel/intern/paint.c
index 8a40bde0a7e,e46c91e4bf4..994616819e2
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@@ -1734,9 -1732,9 +1734,10 @@@ void BKE_sculpt_color_layer_create_if_n
    CustomData_add_layer(&orig_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert);
    BKE_mesh_update_customdata_pointers(orig_me, true);
    DEG_id_tag_update(&orig_me->id, ID_RECALC_GEOMETRY);
 +  SCULPT_dynamic_topology_sync_layers(object, orig_me);
  }
  
+ /** \warning Expects a fully evaluated depsgraph. */
  void BKE_sculpt_update_object_for_edit(
      Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors)
  {
diff --cc source/blender/modifiers/intern/MOD_boolean.c
index 3e36a4e4e84,1cf57669eb1..b08845a60ad
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@@ -1,21 -1,21 +1,21 @@@
--/*
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU General Public License
-- * as published by the Free Software Foundation; either version 2
-- * of the License, or (at your option) any later version.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software Foundation,
-- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-- *
-- * The Original Code is Copyright (C) 2005 by the Blender Foundation.
-- * All rights reserved.
-- */
++f /*
++   * This program is free software; you can redistribute it and/or
++   * modify it under the terms of the GNU General Public License
++   * as published by the Free Software Foundation; either version 2
++   * of the License, or (at your option) any later version.
++   *
++   * This program is distributed in the hope that it will be useful,
++   * but WITHOUT ANY WARRANTY; without even the implied warranty of
++   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   * GNU General Public License for more details.
++   *
++   * You should have received a copy of the GNU General Public License
++   * along with this program; if not, write to the Free Software Foundation,
++   * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++   *
++   * The Original Code is Copyright (C) 2005 by the Blender Foundation.
++   * All rights reserved.
++   */
  
  /** \file
   * \ingroup modifiers
@@@ -76,7 -76,7 +76,8 @@@
  #  include "PIL_time_utildefines.h"
  #endif
  
--static void initData(ModifierData *md)
++    static void
++    initData(ModifierData *md)
  {
    BooleanModifierData *bmd = (BooleanModifierData *)md;
  
@@@ -250,7 -250,7 +251,8 @@@ static BMesh *BMD_mesh_bm_create
                            .use_toolflags = false,
                        }));
  
-   BM_mesh_bm_from_me(NULL, bm,
 -  BM_mesh_bm_from_me(bm,
++  BM_mesh_bm_from_me(NULL,
++                     bm,
                       mesh_operand_ob,
                       &((struct BMeshFromMeshParams){
                           .calc_face_normal = true,
@@@ -265,7 -265,7 +267,8 @@@
      }
    }
  
-   BM_mesh_bm_from_me(NULL, bm,
 -  BM_mesh_bm_from_me(bm,
++  BM_mesh_bm_from_me(NULL,
++                     bm,
                       mesh,
                       &((struct BMeshFromMeshParams){
                           .calc_face_normal = true,
@@@ -457,7 -457,7 +460,8 @@@ static Mesh *collection_boolean_exact(B
      Mesh *me = meshes[i];
      Object *ob = objects[i];
      /* Need normals for triangulation. */
-     BM_mesh_bm_from_me(NULL, bm,
 -    BM_mesh_bm_from_me(bm,
++    BM_mesh_bm_from_me(NULL,
++                       bm,
                         me,
                         &((struct BMeshFromMeshParams){
                             .calc_face_normal = true,
@@@ -644,33 -644,22 +648,23 @@@ static Mesh *modifyMesh(ModifierData *m
              /* XXX This is utterly non-optimal, we may go from a bmesh to a mesh back to a bmesh!
               * But for 2.90 better not try to be smart here. */
              BKE_mesh_wrapper_ensure_mdata(mesh_operand_ob);
-             /* when one of objects is empty (has got no faces) we could speed up
-              * calculation a bit returning one of objects' derived meshes (or empty one)
-              * Returning mesh is depended on modifiers operation (sergey) */
-             result = get_quick_mesh(object, mesh, operand_ob, mesh_operand_ob, bmd->operation);
- 
-             if (result == NULL) {
-               bm = BMD_mesh_bm_create(mesh, object, mesh_operand_ob, operand_ob, &is_flip);
- 
-               BMD_mesh_intersection(bm, md, ctx, mesh_operand_ob, object, operand_ob, is_flip);
- 
-               /* Needed for multiple objects to work. */
-               BM_mesh_bm_to_me(NULL, NULL,
-                                bm,
-                                mesh,
-                                (&(struct BMeshToMeshParams){
-                                    .calc_object_remap = false,
-                                }));
- 
-               result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL, mesh);
-               BM_mesh_free(bm);
-               result->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
-             }
-             /* if new mesh returned, return it; otherwise there was
-              * an error, so delete the modifier object */
-             if (result == NULL) {
-               BKE_modifier_set_error(md, "Cannot execute boolean operation");
-             }
+ 
+             bm = BMD_mesh_bm_create(mesh, object, mesh_operand_ob, operand_ob, &is_flip);
+ 
+             BMD_mesh_intersection(bm, md, ctx, mesh_operand_ob, object, operand_ob, is_flip);
+ 
+             /* Needed for multiple objects to work. */
+             BM_mesh_bm_to_me(NULL,
++                             NULL,
+                              bm,
+                              mesh,
+                              (&(struct BMeshToMeshParams){
+                                  .calc_object_remap = false,
+                              }));
+ 
+             result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL, mesh);
+             BM_mesh_free(bm);
+             result->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
            }
          }
        }



More information about the Bf-blender-cvs mailing list