[Bf-blender-cvs] [b62f226cac0] hair_object: Tool generator functions for hair edit mode.
Lukas Toenne
noreply at git.blender.org
Mon Dec 17 16:36:58 CET 2018
Commit: b62f226cac06431aa17eb692b47de0dd58cf68ad
Author: Lukas Toenne
Date: Mon Dec 17 15:36:40 2018 +0000
Branches: hair_object
https://developer.blender.org/rBb62f226cac06431aa17eb692b47de0dd58cf68ad
Tool generator functions for hair edit mode.
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 53b6a7d0956..a42ce495ec7 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -806,6 +806,18 @@ class _defs_particle:
)
+class _defs_hair:
+
+ @staticmethod
+ def generate_from_brushes(context):
+ return generate_from_enum_ex(
+ context,
+ icon_prefix="brush.hair.",
+ type=bpy.types.HairEditSettings,
+ attr="tool",
+ )
+
+
class _defs_sculpt:
@staticmethod
@@ -1456,6 +1468,10 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
*_tools_annotate,
None,
],
+ 'EDIT_HAIR': [
+ _defs_view3d_generic.cursor,
+ _defs_hair.generate_from_brushes,
+ ],
'PARTICLE': [
_defs_view3d_generic.cursor,
_defs_particle.generate_from_brushes,
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index e189164e841..1c2ddddc88c 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1216,6 +1216,11 @@ static void rna_def_hair_edit_settings(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static const EnumPropertyItem hair_brush_items[] = {
+ {HAIR_BRUSH_ADD, "ADD", 0, "Add", "Add hairs"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static const EnumPropertyItem select_mode_items[] = {
{HAIR_SELECT_FOLLICLES, "FOLLICLES", ICON_NONE, "Follicles", "Select hair follicles"},
{HAIR_SELECT_VERTICES, "VERTICES", ICON_NONE, "Vertices", "Select hair curve vertices"},
@@ -1235,6 +1240,11 @@ static void rna_def_hair_edit_settings(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_HairEditSettings_path");
RNA_def_struct_ui_text(srna, "Hair Edit", "Properties of hair editing mode");
+ prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "brushtype");
+ RNA_def_property_enum_items(prop, hair_brush_items);
+ RNA_def_property_ui_text(prop, "Tool", "");
+
prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "select_mode");
RNA_def_property_enum_items(prop, select_mode_items);
More information about the Bf-blender-cvs
mailing list