[Bf-blender-cvs] [cb9786b90e2] temp-trimesh-sculpt: Merge remote-tracking branch 'origin' into temp-trimesh-sculpt
Joseph Eagar
noreply at git.blender.org
Sat Oct 17 10:49:59 CEST 2020
Commit: cb9786b90e245faeb596ae102a7f15c0d9eba2b3
Author: Joseph Eagar
Date: Sat Oct 17 01:20:00 2020 -0700
Branches: temp-trimesh-sculpt
https://developer.blender.org/rBcb9786b90e245faeb596ae102a7f15c0d9eba2b3
Merge remote-tracking branch 'origin' into temp-trimesh-sculpt
===================================================================
===================================================================
diff --cc .clang-format
index 8a992fea3a9,8a992fea3a9..061137b6867
--- a/.clang-format
+++ b/.clang-format
@@@ -262,6 -262,6 +262,10 @@@ ForEachMacros
- SET_SLOT_PROBING_BEGIN
- MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN
++ - TMS_ITER
++ - TM_ITER_VERT_TRIS
++ - TM_ITER_VERT_TRIEDGES
++ - TM_ITER_MESH
# Use once we bump the minimum version to version 8.
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
diff --cc source/blender/blenkernel/BKE_multires.h
index fbdfc5b76a7,fbdfc5b76a7..d1e69e68b1e
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@@ -95,6 -95,6 +95,8 @@@ struct Mesh *BKE_multires_create_mesh(s
struct Object *object,
struct MultiresModifierData *mmd);
++void BKE_multires_bmesh_space_set(struct Object *ob, struct BMesh *bm, int mode);
++
/* Get coordinates of a deformed base mesh which is an input to the given multires modifier.
* NOTE: The modifiers will be re-evaluated. */
float (*BKE_multires_create_deformed_base_mesh_vert_coords(struct Depsgraph *depsgraph,
diff --cc source/blender/blenkernel/BKE_paint.h
index 248b53d3015,150d0d9b011..a35dc63d9bd
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -340,8 -341,8 +343,8 @@@ typedef struct SculptPersistentBase
} SculptPersistentBase;
typedef struct SculptVertexInfo {
- /* Idexed by vertex, stores and ID of its topologycally connected component. */
+ /* Indexed by vertex, stores and ID of its topologically connected component. */
- int *connected_component;
+ SculptIdx *connected_component;
/* Indexed by base mesh vertex index, stores if that vertex is a boundary. */
BLI_bitmap *boundary;
@@@ -428,9 -429,9 +431,8 @@@ typedef struct SculptFakeNeighbors
/* Max distance used to calculate neighborhood information. */
float current_max_distance;
- /* Idexed by vertex, stores the vertex index of its fake neighbor if available. */
+ /* Indexed by vertex, stores the vertex index of its fake neighbor if available. */
- int *fake_neighbor_index;
-
+ SculptIdx *fake_neighbor_index;
-
} SculptFakeNeighbors;
/* Session data (mode-specific) */
diff --cc source/blender/blenkernel/intern/CCGSubSurf.c
index ec2fb5f5bdb,d63c5fe12ab..0b8f87f47d3
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@@ -1039,6 -1039,6 +1039,7 @@@ CCGError ccgSubSurf_updateToFaces(CCGSu
* and vertices, for multires displacements */
CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF)
{
++ return eCCGError_None;
CCGVert **effectedV;
CCGEdge **effectedE;
int numEffectedV, numEffectedE, freeF;
diff --cc source/blender/blenkernel/intern/mesh_validate.cc
index 00000000000,16733729be0..d8ea760825d
mode 000000,100644..100644
--- a/source/blender/blenkernel/intern/mesh_validate.cc
+++ b/source/blender/blenkernel/intern/mesh_validate.cc
@@@ -1,0 -1,268 +1,270 @@@
+ /*
- * 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.
- */
++* 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.
++*/
+
+ /** \file
- * \ingroup bke
- */
++* \ingroup bke
++*/
++
++#define NOMINMAX
+
+ #include "DNA_mesh_types.h"
+ #include "DNA_meshdata_types.h"
+ #include "DNA_object_types.h"
+
+ #include "BLI_edgehash.h"
+ #include "BLI_map.hh"
+ #include "BLI_math_base.h"
+ #include "BLI_task.hh"
+ #include "BLI_threads.h"
+ #include "BLI_timeit.hh"
+
+ #include "BKE_customdata.h"
+ #include "BKE_mesh.h"
+
+ namespace blender::bke::calc_edges {
+
-/** This is used to uniquely identify edges in a hash map. */
-struct OrderedEdge {
- int v_low, v_high;
++ /** This is used to uniquely identify edges in a hash map. */
++ struct OrderedEdge {
++ int v_low, v_high;
+
- OrderedEdge(const int v1, const int v2)
- {
- if (v1 < v2) {
- v_low = v1;
- v_high = v2;
- }
- else {
- v_low = v2;
- v_high = v1;
++ OrderedEdge(const int v1, const int v2)
++ {
++ if (v1 < v2) {
++ v_low = v1;
++ v_high = v2;
++ }
++ else {
++ v_low = v2;
++ v_high = v1;
++ }
+ }
- }
+
- OrderedEdge(const uint v1, const uint v2)
++ OrderedEdge(const uint v1, const uint v2)
+ : OrderedEdge(static_cast<int>(v1), static_cast<int>(v2))
- {
- }
++ {
++ }
+
- uint64_t hash() const
- {
- return (this->v_low << 8) ^ this->v_high;
- }
++ uint64_t hash() const
++ {
++ return (this->v_low << 8) ^ this->v_high;
++ }
+
- /** Return a hash value that is likely to be different in the low bits from the normal `hash()`
- * function. This is necessary to avoid collisions in #BKE_mesh_calc_edges. */
- uint64_t hash2() const
- {
- return this->v_low;
- }
++ /** Return a hash value that is likely to be different in the low bits from the normal `hash()`
++ * function. This is necessary to avoid collisions in #BKE_mesh_calc_edges. */
++ uint64_t hash2() const
++ {
++ return this->v_low;
++ }
+
- friend bool operator==(const OrderedEdge &e1, const OrderedEdge &e2)
- {
- BLI_assert(e1.v_low < e1.v_high);
- BLI_assert(e2.v_low < e2.v_high);
- return e1.v_low == e2.v_low && e1.v_high == e2.v_high;
- }
-};
++ friend bool operator==(const OrderedEdge &e1, const OrderedEdge &e2)
++ {
++ BLI_assert(e1.v_low < e1.v_high);
++ BLI_assert(e2.v_low < e2.v_high);
++ return e1.v_low == e2.v_low && e1.v_high == e2.v_high;
++ }
++ };
+
-/* The map first contains an edge pointer and later an index. */
-typedef union OrigEdgeOrIndex {
- const MEdge *original_edge;
- int index;
-} OrigEdgeOrIndex;
-using EdgeMap = Map<OrderedEdge, OrigEdgeOrIndex>;
++ /* The map first contains an edge pointer and later an index. */
++ typedef union OrigEdgeOrIndex {
++ const MEdge *original_edge;
++ int index;
++ } OrigEdgeOrIndex;
++ using EdgeMap = Map<OrderedEdge, OrigEdgeOrIndex>;
+
-static void reserve_hash_maps(const Mesh *mesh,
- const bool keep_existing_edges,
- MutableSpan<EdgeMap> edge_maps)
-{
- const int totedge_guess = std::max(keep_existing_edges ? mesh->totedge : 0, mesh->totpoly * 2);
- parallel_for_each(
++ static void reserve_hash_maps(const Mesh *mesh,
++ const bool keep_existing_edges,
++ MutableSpan<EdgeMap> edge_maps)
++ {
++ const int totedge_guess = std::max(keep_existing_edges ? mesh->totedge : 0, mesh->totpoly * 2);
++ parallel_for_each(
+ edge_maps, [&](EdgeMap &edge_map) { edge_map.reserve(totedge_guess / edge_maps.size()); });
-}
++ }
+
-static void add_existing_edges_to_hash_maps(Mesh *mesh,
- MutableSpan<EdgeMap> edge_maps,
- uint32_t parallel_mask)
-{
- /* Assume existing edges are valid. */
- parallel_for_each(edge_maps, [&](EdgeMap &edge_map) {
- const int task_index = &edge_map - &edge_maps[0];
- for (const MEdge &edge : Span(mesh->medge, mesh->totedge)) {
- OrderedEdge ordered_edge{edge.v1, edge.v2};
- /* Only add the edge when it belongs into this map. */
- if (task_index == (parallel_mask & ordered_edge.hash2())) {
- edge_map.add_new(ordered_edge, {&edge});
++ static void add_existing_edges_to_hash_maps(Mesh *mesh,
++ MutableSpan<EdgeMap> edge_maps,
++ uint32_t parallel_mask)
++ {
++ /* Assume existing edges are valid. */
++ parallel_for_each(edge_maps, [&](EdgeMap &edge_map) {
++ const int task_index = &edge_map - &edge_maps[0];
++ for (const MEdge &edge : Span(mesh->medge, mesh->totedge)) {
++ OrderedEdge ordered_edge{edge.v1, edge.v2};
++ /* Only add the edge when it belongs into this map. */
++ if (task_index == (parallel_mask & ordered_edge.hash2())) {
++ edge_map.add_new(ordered_edge, {&edge});
++ }
+ }
- }
- });
-}
++ });
++ }
+
-static void add_polygon_edges_to_hash_maps(Mesh *mesh,
- MutableSpan<EdgeMap> edge_maps,
- uint32_t parallel_mask)
-{
- const Span<MLoop> loops{mesh->mloop, mesh->totloop};
- parallel_for_each(edge_maps, [&](EdgeMap &edge_map) {
- const int task_index = &edge_map - &edge_maps[0];
- for (const MPoly &poly : Span(mesh->mpoly, mesh->totpoly)) {
- Span<MLoop> poly_loops = loops.slice(poly.loopstart, poly.totloop);
- const MLoop *prev_loop = &poly_loops.last();
- for (const MLoop &next_loop : poly_loops) {
- /* Can only be the same when the mesh data is invalid. */
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list