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

* Also got undo working for it
This commit is contained in:
Joseph Eagar 2021-07-11 04:12:20 -04:00
parent 4b4ac93acd
commit e8b717ee42
4 changed files with 10 additions and 10 deletions

View File

@ -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,

View File

@ -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")),

View File

@ -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);

View File

@ -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) \