[Bf-blender-cvs] [4163c63def9] master: Curves sculptmode: fix missing mode and tool in Brush Specials

Philipp Oeser noreply at git.blender.org
Wed Oct 19 08:56:26 CEST 2022


Commit: 4163c63def98b46fe7ddba82ade997c818ab2b96
Author: Philipp Oeser
Date:   Tue Oct 18 15:40:54 2022 +0200
Branches: master
https://developer.blender.org/rB4163c63def98b46fe7ddba82ade997c818ab2b96

Curves sculptmode: fix missing mode and tool in Brush Specials

For consistency with other brush based (paint) systems we should add
these entries in the brushes context menu.
For this, expose the brushes `ob_mode` to RNA and show this (along with
the tool choice) to the appropriate menus.

Differential Revision: https://developer.blender.org/D16287

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

M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index ea257498e11..39684aaf161 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3018,6 +3018,7 @@ class VIEW3D_MT_brush_paint_modes(Menu):
         layout.prop(brush, "use_paint_vertex", text="Vertex Paint")
         layout.prop(brush, "use_paint_weight", text="Weight Paint")
         layout.prop(brush, "use_paint_image", text="Texture Paint")
+        layout.prop(brush, "use_paint_sculpt_curves", text="Sculpt Curves")
 
 
 class VIEW3D_MT_paint_vertex(Menu):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index a28e93c34d1..fec156580cf 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -52,6 +52,8 @@ class VIEW3D_MT_brush_context_menu(Menu):
         elif context.sculpt_object:
             layout.prop_menu_enum(brush, "sculpt_tool")
             layout.operator("brush.reset")
+        elif context.tool_settings.curves_sculpt:
+            layout.prop_menu_enum(brush, "curves_sculpt_tool")
 
 
 class VIEW3D_MT_brush_gpencil_context_menu(Menu):
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 35e01be366b..137020ce3f8 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -3616,6 +3616,10 @@ static void rna_def_brush(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Use Vertex", "Use this brush in grease pencil vertex color mode");
 
+  prop = RNA_def_property(srna, "use_paint_sculpt_curves", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT_CURVES);
+  RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt curves mode");
+
   /* texture */
   prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
   RNA_def_property_struct_type(prop, "BrushTextureSlot");



More information about the Bf-blender-cvs mailing list