[Bf-blender-cvs] [e8b717ee428] temp_bmesh_multires: Sculpt dyntopo: Exposed UV smooth bruth in experimental features prefs.

Joseph Eagar noreply at git.blender.org
Sun Jul 11 10:12:55 CEST 2021


Commit: e8b717ee4283c89a7ed4c8b1ce25789925d67273
Author: Joseph Eagar
Date:   Sun Jul 11 04:12:20 2021 -0400
Branches: temp_bmesh_multires
https://developer.blender.org/rBe8b717ee4283c89a7ed4c8b1ce25789925d67273

Sculpt dyntopo: Exposed UV smooth bruth in experimental features prefs.

* Also got undo working for it

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

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/sculpt_paint/sculpt_dyntopo.c
M	source/blender/makesdna/DNA_brush_enums.h

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

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index ea48c2ff0d4..a9640e8e5c0 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1287,7 +1287,7 @@ class _defs_sculpt:
         if not prefs.experimental.use_sculpt_vertex_colors:
             exclude_filter = {'PAINT', 'SMEAR'}
         if not prefs.experimental.use_sculpt_uvsmooth:
-            exclude_filter.add('UV_SMOOTH')
+            exclude_filter['UV_SMOOTH'] = True
 
         return generate_from_enum_ex(
             context,
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index f9359a8b4a0..3502b58e23b 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2258,6 +2258,7 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
         self._draw_items(
             context, (
                 ({"property": "use_sculpt_vertex_colors"}, "T71947"),
+                ({"property": "use_sculpt_uvsmooth"}, ""),
                 ({"property": "use_sculpt_tools_tilt"}, "T82877"),
                 ({"property": "use_asset_browser"}, ("project/profile/124/", "Milestone 1")),
                 ({"property": "use_override_templates"}, ("T73318", "Milestone 4")),
diff --git a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
index 88227339b5e..cb5cf3d131e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c
@@ -948,6 +948,8 @@ typedef struct UVSolver {
   double strength;
 } UVSolver;
 
+/*that that currently this tool is *not* threaded*/
+
 typedef struct SculptUVThreadData {
   SculptThreadedTaskData data;
   UVSolver *solver;
@@ -1500,7 +1502,9 @@ static void sculpt_uv_brush_cb(void *__restrict userdata,
       continue;
     }
 
+    BM_log_face_modified(ss->bm_log, f);
     uvsolver_ensure_face(data1->solver, f);
+
 #if 0
     do {
       if (!sculpt_brush_test_sq_fn(&test, l->v->co)) {
@@ -1540,18 +1544,12 @@ void SCULPT_uv_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
   const int cd_uv = CustomData_get_offset(&ss->bm->ldata, CD_MLOOPUV);
   if (cd_uv < 0) {
-    return;  // no uv layer
+    return;  // no uv layer?
   }
 
-  /* Offset with as much as possible factored in already. */
-  float effective_normal[3];
-  SCULPT_tilt_effective_normal_get(ss, brush, effective_normal);
-  mul_v3_v3fl(offset, effective_normal, ss->cache->radius);
-  mul_v3_v3(offset, ss->cache->scale);
-  mul_v3_fl(offset, bstrength);
+  // add undo log subentry
+  BM_log_entry_add_ex(ss->bm, ss->bm_log, true);
 
-  /* XXX - this shouldn't be necessary, but sculpting crashes in blender2.8 otherwise
-   * initialize before threads so they can do curve mapping. */
   BKE_curvemapping_init(brush->curve);
 
   UVSolver *solver = uvsolver_new(cd_uv);
diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h
index 58b462bf26a..43a2e9eb0c3 100644
--- a/source/blender/makesdna/DNA_brush_enums.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -519,6 +519,7 @@ typedef enum eBrushUVSculptTool {
         /* These brushes could handle dynamic topology, \ \
          * but user feedback indicates it's better not to */ \
         SCULPT_TOOL_VCOL_BOUNDARY, \
+        SCULPT_TOOL_UV_SMOOTH, \
         SCULPT_TOOL_MASK) == 0)
 
 #define SCULPT_TOOL_HAS_TOPOLOGY_RAKE(t) \



More information about the Bf-blender-cvs mailing list