[Bf-blender-cvs] [4a1d90ade7b] sculpt-dev: commit_log.txt

Joseph Eagar noreply at git.blender.org
Sat Dec 11 09:20:42 CET 2021


Commit: 4a1d90ade7baea0ea150e4b34488ff8c63c8eb7d
Author: Joseph Eagar
Date:   Sat Dec 11 00:20:33 2021 -0800
Branches: sculpt-dev
https://developer.blender.org/rB4a1d90ade7baea0ea150e4b34488ff8c63c8eb7d

commit_log.txt

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

M	release/datafiles/startup.blend
M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/BKE_bassrelief.h
M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/bassrelief.cc
M	source/blender/blenkernel/intern/brush_channel_define.h
M	source/blender/blenkernel/intern/paint.c
D	source/blender/blenkernel/intern/shrinkwrap.cc
M	source/blender/blenlib/intern/BLI_kdopbvh.c
M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/bmesh/intern/bmesh_core.h
M	source/blender/bmesh/intern/bmesh_mesh_convert.c
M	source/blender/bmesh/intern/bmesh_polygon.c
M	source/blender/bmesh/intern/bmesh_polygon.h
M	source/blender/bmesh/operators/bmo_subdivide.c
M	source/blender/editors/mesh/mesh_data.c
M	source/blender/editors/mesh/mesh_intern.h
M	source/blender/editors/mesh/mesh_ops.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_smooth.c
M	source/blender/makesdna/DNA_modifier_defaults.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/intern/dna_defaults.c
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/MOD_modifiertypes.h
M	source/blender/modifiers/intern/MOD_bassrelief.c
M	source/blender/modifiers/intern/MOD_util.c
M	source/blender/modifiers/intern/MOD_util.h

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

diff --git a/release/datafiles/startup.blend b/release/datafiles/startup.blend
index fe142d7de7e..bf8b9386694 100644
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 5b33618d3e5..2426e97eb04 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -595,6 +595,8 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel):
         else:
             col.operator("mesh.customdata_custom_splitnormals_add", icon='ADD')
 
+        col.operator("mesh.customdata_ids_clear", icon='X')
+
         col = layout.column(heading="Store")
 
         col.enabled = obj is not None and obj.mode != 'EDIT'
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 7431cbbe4c5..aa03189da58 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -515,6 +515,9 @@ class VIEW3D_PT_tools_persistent_base_channels(Panel, View3DPaintPanel):
     @classmethod
     def poll(cls, context):
         settings = cls.paint_settings(context)
+        if not settings:
+            return False
+
         brush = settings.brush
 
         ch = UnifiedPaintPanel.get_channel(context, brush, "use_persistent")
diff --git a/source/blender/blenkernel/BKE_bassrelief.h b/source/blender/blenkernel/BKE_bassrelief.h
index 8b137891791..0e549e75a76 100644
--- a/source/blender/blenkernel/BKE_bassrelief.h
+++ b/source/blender/blenkernel/BKE_bassrelief.h
@@ -1 +1,89 @@
+/*
+ * 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) Blender Foundation.
+ * All rights reserved.
+ */
+#pragma once
 
+/** \file
+ * \ingroup bke
+ */
+
+#include "BKE_bvhutils.h"
+#include "BLI_bitmap.h"
+#include "BLI_math_matrix.h"
+
+struct Scene;
+struct Mesh;
+struct BassReliefModifierData;
+struct Object;
+struct MDeformVert;
+struct ModifierEvalContext;
+struct MPropCol;
+
+#define MAX_BASSRELIEF_DEBUG_COLORS 7
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Information about a mesh and BVH tree. */
+typedef struct BassReliefTreeData {
+  Mesh *mesh;
+
+  BVHTree *bvh;
+  BVHTreeFromMesh treeData;
+  struct SpaceTransform transform;
+  float keepDist;
+
+  float (*pnors)[3];
+  float (*clnors)[3];
+} BassReliefTreeData;
+
+void bassReliefModifier_deform(struct BassReliefModifierData *smd,
+                               const struct ModifierEvalContext *ctx,
+                               struct Scene *scene,
+                               struct Object *ob,
+                               struct Mesh *mesh,
+                               struct MDeformVert *dvert,
+                               const int defgrp_index,
+                               float (*vertexCos)[3],
+                               int numVerts,
+                               struct MPropCol *debugColors[MAX_BASSRELIEF_DEBUG_COLORS]);
+
+/*
+ * NULL initializes to local data
+ */
+#define NULL_BassReliefCalcData \
+  { \
+    NULL, \
+  }
+#define NULL_BVHTreeFromMesh \
+  { \
+    NULL, \
+  }
+#define NULL_BVHTreeRayHit \
+  { \
+    NULL, \
+  }
+#define NULL_BVHTreeNearest \
+  { \
+    0, \
+  }
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 6c9c5c7943c..c13d3b7daae 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -519,6 +519,7 @@ bool BKE_pbvh_bmesh_update_topology_nodes(PBVH *pbvh,
 /* Node Access */
 
 void BKE_pbvh_check_tri_areas(PBVH *pbvh, PBVHNode *node);
+void BKE_pbvh_face_areas_begin(PBVH *pbvh);
 
 // updates boundaries and valences for whole mesh
 void BKE_pbvh_bmesh_on_mesh_change(PBVH *pbvh);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 4b53c40c5c3..a3b2c81584e 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -63,6 +63,8 @@ set(INC_SYS
 
   # For `vfontdata_freetype.c`.
   ${FREETYPE_INCLUDE_DIRS}
+
+  ${EIGEN3_INCLUDE_DIRS}
 )
 
 set(SRC
@@ -95,6 +97,7 @@ set(SRC
   intern/attribute_access.cc
   intern/attribute_math.cc
   intern/autoexec.c
+  intern/bassrelief.cc
   intern/blender.c
   intern/blender_copybuffer.c
   intern/blender_undo.c
@@ -327,6 +330,7 @@ set(SRC
   BKE_attribute_access.hh
   BKE_attribute_math.hh
   BKE_autoexec.h
+  BKE_bassrelief.h
   BKE_blender.h
   BKE_blender_copybuffer.h
   BKE_blender_undo.h
diff --git a/source/blender/blenkernel/intern/bassrelief.cc b/source/blender/blenkernel/intern/bassrelief.cc
index 8b137891791..5bfbda72cbe 100644
--- a/source/blender/blenkernel/intern/bassrelief.cc
+++ b/source/blender/blenkernel/intern/bassrelief.cc
@@ -1 +1,2179 @@
+/*
+ * 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) Blender Foundation.
+ * All rights reserved.
+ */
 
+/** \file
+ * \ingroup bke
+ */
+
+#include <float.h>
+#include <math.h>
+#include <memory.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+
+#include "BLI_alloca.h"
+#include "BLI_array.hh"
+#include "BLI_float3.hh"
+#include "BLI_index_range.hh"
+#include "BLI_math.h"
+#include "BLI_math_solvers.h"
+#include "BLI_memarena.h"
+#include "BLI_span.hh"
+#include "BLI_task.h"
+#include "BLI_task.hh"
+#include "BLI_utildefines.h"
+
+#include "BKE_DerivedMesh.h"
+#include "BKE_bassrelief.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_collection.h"
+#include "BKE_context.h"
+#include "BKE_lattice.h"
+#include "BKE_lib_id.h"
+#include "BKE_modifier.h"
+#include "BKE_object.h"
+
+#include "BKE_deform.h"
+#include "BKE_editmesh.h"
+#include "BKE_mesh.h" /* for OMP limits. */
+#include "BKE_mesh_runtime.h"
+#include "BKE_mesh_wrapper.h"
+#include "BKE_subsurf.h"
+
+#include "DEG_depsgraph_query.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_strict_flags.h"
+
+#include <queue>
+
+using namespace blender::threading;
+using IndexRange = blender::IndexRange;
+
+static void bassrelief_snap_point_to_surface(const struct BassReliefTreeData *tree,
+                                             const struct SpaceTransform *transform,
+                                             int hit_idx,
+                                             const float hit_co[3],
+                                             const float hit_no[3],
+                                             float goal_dist,
+                                             const float point_co[3],
+                                             float r_point_co[3]);
+/* for timing... */
+#if 0
+#  include "PIL_time_utildefines.h"
+#else
+#  define TIMEIT_BENCH(expr, id) (expr)
+#endif
+
+/* Util macros */
+#define OUT_OF_MEMORY() ((void)printf("Shrinkwrap: Out of memory\n"))
+
+/*
+on factor;
+off period;
+
+load_package avector;
+
+*/
+
+enum { RV_HAS_HIT = 1 << 0, RV_VISIT = 1 << 1, RV_TAG = 1 << 2, RV_IS_BOUNDARY = 1 << 3 };
+
+// struct ReliefEdge {
+//} ReliefEdge;
+
+namespace blender {
+namespace bassrelief {
+
+/* this could stand to be more C++-afied */
+struct ReliefVertex {
+  float co[3], origco[3];
+  float no[3], origno[3];
+  int index;
+  float targetco[3];
+  float targetno[3];
+  float ray[3], ray_dist, origray[3], origray_dist;
+  float bound_dist, angle;
+  ReliefVertex *bound_vert;
+  int flag;
+  struct ReliefVertex **neighbors;
+  float *neighbor_restlens;
+  int totneighbor, i;
+
+  float tan[3], bin[3], disp[3], tnor[3];
+  float mat[3][3];
+
+  float smoothco[3], svel[3];
+
+  float tan_field;  // scalar field for parameterization
+  // tangents are redrived from this
+};
+
+struct ReliefOptimizer {
+  ReliefVertex *verts;
+  int totvert;
+  float compress_ratio;
+  struct MemArena *arena;
+  float rmindis, rmaxdis, rdis_scale;
+  float bmindis, bmaxdis, bdis_scale;
+  float tmindis, tmaxdis, tdis_scale;
+  MPropCol *debugColors[MAX_BASSRELIEF_DEBUG_COLORS];
+  MLoopTri *mlooptri;
+  int totlooptri;
+  const MLoop *mloop;
+  int boundSmoothSteps;
+  float normalScale, boundWidth;
+
+  ReliefOptimizer(const float (*cos)[3],
+                  const MVert *mvert,
+                  int totvert,
+                  MEdge *medge,
+                  int totedge,
+                  MPropCol *_debugColors[MAX_BASSRELIEF_DEBUG_COLORS],
+                  const MLoopTri *_mlooptri,
+                  int totlooptri,
+                  const MLoop *mloop,
+                  float optimizeNormalsScale,
+                  float boundSmoothScale,
+                  int boundSmoo

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list