[Bf-blender-cvs] [babdb5a3605] hair_object: Draw mode for hair follicles in edit mode.
Lukas Tönne
noreply at git.blender.org
Sun Sep 23 10:31:37 CEST 2018
Commit: babdb5a3605fd6e04421ae8812719ef49fb35653
Author: Lukas Tönne
Date: Sun Sep 16 12:57:31 2018 +0100
Branches: hair_object
https://developer.blender.org/rBbabdb5a3605fd6e04421ae8812719ef49fb35653
Draw mode for hair follicles in edit mode.
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 2064c9870dc..d4ba7b44563 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -57,12 +57,13 @@ class VIEW3D_HT_header(Header):
# object_mode = obj.mode
# Particle edit
- if object_mode == 'EDIT' and obj.type == 'HAIR':
- row = layout.row()
- row.prop(tool_settings.hair_edit_settings, "mode", text="", expand=True)
- elif object_mode == 'PARTICLE_EDIT':
+ if object_mode == 'PARTICLE_EDIT':
row = layout.row()
row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True)
+ # Hair edit
+ if object_mode == 'EDIT' and obj.type == 'HAIR':
+ row = layout.row()
+ row.prop(tool_settings.hair_edit_settings, "follicle_draw_mode", text="")
# Occlude geometry
if (
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 1a1f2c8c18a..c136056649f 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -872,10 +872,21 @@ typedef struct ParticleEditSettings {
/* ------------------------------------------- */
/* Hair Edit */
+//typedef enum HairEditFlags {
+//} HairEditFlags;
+
+typedef enum HairEditFollicleDrawMode {
+ HAIR_FOLLICLE_DRAW_NONE,
+ HAIR_FOLLICLE_DRAW_POINT,
+ HAIR_FOLLICLE_DRAW_NORMAL,
+ HAIR_FOLLICLE_DRAW_AXES,
+} HairEditFollicleDrawMode;
+
/* Hair Edit Mode Settings */
typedef struct HairEditSettings {
- int pad;
- int pad2;
+ int flag;
+ short follicle_draw_mode;
+ short pad;
} HairEditSettings;
/* ------------------------------------------- */
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index d9ffe08c1c4..cbc5d09a024 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -1121,9 +1121,25 @@ static void rna_def_hair_edit_settings(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static const EnumPropertyItem follicle_draw_mode_items[] = {
+ {HAIR_FOLLICLE_DRAW_NONE, "NONE", ICON_NONE, "None", "Don't draw hair follicles"},
+ {HAIR_FOLLICLE_DRAW_POINT, "POINT", ICON_NONE, "Point", "Draw point on follicle location"},
+ {HAIR_FOLLICLE_DRAW_NORMAL, "NORMAL", ICON_NONE, "Normal", "Draw surface normal at follicle location"},
+ {HAIR_FOLLICLE_DRAW_AXES, "AXES", ICON_NONE, "Axes", "Draw local coordinate system at follicle location"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "HairEditSettings", NULL);
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, "follicle_draw_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "follicle_draw_mode");
+ RNA_def_property_enum_items(prop, follicle_draw_mode_items);
+ RNA_def_property_ui_text(prop, "Follicle Draw Mode", "Mode of drawing hair follicles");
+ RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_HairEditSettings_update");
}
static void rna_def_gpencil_sculpt(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list