[Bf-blender-cvs] [7dbb4c9b2da] temp_bmesh_multires: Fix issues with last commit. Also, simplify brush now uses dyntopo local overrides to always enable collapse instead of being hardcoded.
Joseph Eagar
noreply at git.blender.org
Sun Apr 11 21:27:42 CEST 2021
Commit: 7dbb4c9b2dadba447c1ef835cd1c4a964f1b6872
Author: Joseph Eagar
Date: Sun Apr 11 12:27:02 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rB7dbb4c9b2dadba447c1ef835cd1c4a964f1b6872
Fix issues with last commit. Also, simplify brush now
uses dyntopo local overrides to always enable collapse instead
of being hardcoded.
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/blenkernel/intern/brush.c
M source/blender/editors/sculpt_paint/sculpt.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 286b44a18db..108758f0eea 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -780,21 +780,25 @@ class VIEW3D_PT_sculpt_dyntopo_advanced(Panel, View3DPaintPanel):
brush = settings.brush
col = layout.column()
- print(dir(col))
col.label(text="Local Brush Settings")
+
+ row = col.row()
+ row.prop(brush.dyntopo, "disabled", text="Disable Dyntopo")
+
+ col.label(text="Overrides")
inherit_all = "ALL" in brush.dyntopo.inherit
- col.prop_enum(brush.dyntopo, "inherit", value="ALL", text="All Scene Defaults", icon="LOCKED" if inherit_all else "UNLOCKED");
+ col.prop_enum(brush.dyntopo, "inherit", value="ALL", text="Use All Defaults", icon="LOCKED" if inherit_all else "UNLOCKED")
def do_prop(key):
row = col.row()
if key.upper() in brush.dyntopo.inherit:
- icon = "LOCKED"
- else:
icon = "UNLOCKED"
+ else:
+ icon = "LOCKED"
- row.prop_enum(brush.dyntopo, "inherit", value=key.upper(), icon=icon, text="");
+ row.prop_enum(brush.dyntopo, "inherit", value=key.upper(), icon=icon, text="")
row2 = row.row()
row2.prop(brush.dyntopo, key)
@@ -806,12 +810,12 @@ class VIEW3D_PT_sculpt_dyntopo_advanced(Panel, View3DPaintPanel):
row.enabled = False
col = layout.column()
- do_prop("subdivide");
- do_prop("collapse");
- do_prop("spacing");
- do_prop("detail_range");
- do_prop("detail_percent");
- do_prop("constant_detail");
+ do_prop("subdivide")
+ do_prop("collapse")
+ do_prop("spacing")
+ do_prop("detail_range")
+ do_prop("detail_percent")
+ do_prop("constant_detail")
do_prop("mode")
# TODO, move to space_view3d.py
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 5ec26825b54..6ab546fff68 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1950,8 +1950,10 @@ void BKE_brush_sculpt_reset(Brush *br)
br->sub_col[2] = 0.005f;
break;
- case SCULPT_TOOL_VCOL_BOUNDARY:
case SCULPT_TOOL_SIMPLIFY:
+ br->dyntopo.inherit = ((1<<17)-1) & ~(DYNTOPO_INHERIT_ALL|DYNTOPO_SUBDIVIDE|DYNTOPO_COLLAPSE);
+ br->dyntopo.flag |= DYNTOPO_COLLAPSE|DYNTOPO_SUBDIVIDE;
+ case SCULPT_TOOL_VCOL_BOUNDARY:
case SCULPT_TOOL_PAINT:
case SCULPT_TOOL_MASK:
case SCULPT_TOOL_DRAW_FACE_SETS:
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 6fc69544fc8..3b0f58ef65c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -6345,12 +6345,13 @@ static void sculpt_topology_update(Sculpt *sd,
PBVHTopologyUpdateMode mode = 0;
float location[3];
- if (!(sd->flags & SCULPT_DYNTOPO_DETAIL_MANUAL)) {
- if (sd->flags & SCULPT_DYNTOPO_SUBDIVIDE) {
+ if (brush->cached_dyntopo.mode != DYNTOPO_DETAIL_MANUAL) {
+ if (brush->cached_dyntopo.flag & DYNTOPO_SUBDIVIDE) {
mode |= PBVH_Subdivide;
}
- if ((sd->flags & SCULPT_DYNTOPO_COLLAPSE) || (brush->sculpt_tool == SCULPT_TOOL_SIMPLIFY)) {
+ if ((brush->cached_dyntopo.flag & DYNTOPO_COLLAPSE)
+ /*||(brush->sculpt_tool == SCULPT_TOOL_SIMPLIFY)*/) {
mode |= PBVH_Collapse;
}
}
More information about the Bf-blender-cvs
mailing list