[Bf-blender-cvs] [7e220dc3f0e] sculpt-dev: Fix brush defaults bug
Joseph Eagar
noreply at git.blender.org
Thu Sep 23 04:05:43 CEST 2021
Commit: 7e220dc3f0ec545354e331805b46d5f7fbcef6c5
Author: Joseph Eagar
Date: Wed Sep 22 19:05:27 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB7e220dc3f0ec545354e331805b46d5f7fbcef6c5
Fix brush defaults bug
===================================================================
M release/scripts/startup/bl_ui/properties_paint_common.py
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/brush_channel_define.h
M source/blender/editors/sculpt_paint/sculpt.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index d4b61f70437..38a43f195e5 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -822,11 +822,31 @@ def brush_settings(layout, context, brush, popover=False):
)
box.prop(brush, "use_custom_topology_rake_spacing", text="Custom Spacing")
- if brush.use_custom_topology_rake_spacing:
- box.prop(brush, "topology_rake_spacing", text="Spacing")
- box.prop(brush, "topology_rake_projection")
+ if brush.channels.channels["topology_rake_use_spacing"].bool_value:
+ UnifiedPaintPanel.prop_unified(
+ box,
+ context,
+ brush,
+ "topology_rake_spacing",
+ slider=True,
+ text="Spacing"
+ )
+
+ UnifiedPaintPanel.prop_unified(
+ box,
+ context,
+ brush,
+ "topology_rake_projection",
+ slider=True
+ )
+ UnifiedPaintPanel.prop_unified(
+ box,
+ context,
+ brush,
+ "topology_rake_radius_scale",
+ slider=True
+ )
- box.prop(brush, "topology_rake_radius_factor", slider=True)
box.prop(brush, "use_curvature_rake")
box.prop(brush, "ignore_falloff_for_topology_rake")
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 60e9177cb9c..d65713f7389 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1799,17 +1799,18 @@ void BKE_brush_sculpt_reset(Brush *br)
* settings used by a brush: */
// BKE_brush_debug_print_state(br);
- BKE_brush_builtin_create(br, br->sculpt_tool);
-
- BrushChannel *ch;
+ if (br->channels) {
+ BrushChannel *ch;
- for (ch = (BrushChannel *)br->channels->channels.first; ch; ch = ch->next) {
- BrushChannelType *def = ch->def;
+ for (ch = (BrushChannel *)br->channels->channels.first; ch; ch = ch->next) {
+ BrushChannelType *def = ch->def;
- BKE_brush_channel_free_data(ch);
- BKE_brush_channel_init(ch, def);
+ BKE_brush_channel_free_data(ch);
+ BKE_brush_channel_init(ch, def);
+ }
}
+ BKE_brush_builtin_create(br, br->sculpt_tool);
BKE_brush_channelset_ui_init(br, br->sculpt_tool);
brush_defaults(br);
diff --git a/source/blender/blenkernel/intern/brush_channel_define.h b/source/blender/blenkernel/intern/brush_channel_define.h
index aad818adaf6..1dd58279db0 100644
--- a/source/blender/blenkernel/intern/brush_channel_define.h
+++ b/source/blender/blenkernel/intern/brush_channel_define.h
@@ -113,7 +113,7 @@ places in rna_engine_codebase are relevent:
"used for DynTopo", 1.0f, 0.001f, 5.0f, 0.01f, 2.0f, false)
MAKE_FLOAT_EX(projection, "Projection", "Amount of volume preserving projection", 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, false)
MAKE_FLOAT_EX(autosmooth_projection, "Projection", "Amount of volume preserving projection", 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, false)
- MAKE_FLOAT_EX(topology_rake_projection, "Projection", "Amount of volume preserving projection", 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, false)
+ MAKE_FLOAT_EX(topology_rake_projection, "Projection", "Amount of volume preserving projection", 0.975f, 0.0f, 1.0f, 0.0f, 1.0f, false)
MAKE_FLOAT(fset_slide, "Face Set Projection", "Stick face set boundaries to surface of mesh", 1.0f, 0.0f, 1.0f)
MAKE_FLOAT(boundary_smooth, "Boundary Smooth", "Smooth hard boundaries", 0.0f, 0.0f, 1.0f)
MAKE_BOOL(topology_rake_use_spacing, "Use Spacing", "Use custom spacing for topology rake", false)
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 3c74d8e4365..45742eb1142 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -8462,6 +8462,7 @@ void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings
SCULPT_TOOL_CREASE,
SCULPT_TOOL_CLOTH,
SCULPT_TOOL_SIMPLIFY,
+ SCULPT_TOOL_SNAKE_HOOK,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR)) {
More information about the Bf-blender-cvs
mailing list