[Bf-blender-cvs] [359bef03dff] hair_guides: RNA and UI scripts for the hair system and draw settings in groom objects.

Lukas Tönne noreply at git.blender.org
Tue Jan 2 13:55:03 CET 2018


Commit: 359bef03dffdc5fc6f92a96ed11bfa21654a8598
Author: Lukas Tönne
Date:   Tue Jan 2 12:54:36 2018 +0000
Branches: hair_guides
https://developer.blender.org/rB359bef03dffdc5fc6f92a96ed11bfa21654a8598

RNA and UI scripts for the hair system and draw settings in groom objects.

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

M	release/scripts/startup/bl_ui/properties_data_groom.py
M	source/blender/makesrna/intern/rna_groom.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_groom.py b/release/scripts/startup/bl_ui/properties_data_groom.py
index 388c034af26..41b0b8673f6 100644
--- a/release/scripts/startup/bl_ui/properties_data_groom.py
+++ b/release/scripts/startup/bl_ui/properties_data_groom.py
@@ -65,6 +65,20 @@ class DATA_PT_groom(DataButtonsPanel, Panel):
         col.prop(groom, "curve_resolution")
 
 
+class DATA_PT_groom_draw_settings(DataButtonsPanel, Panel):
+    bl_label = "Draw Settings"
+
+    def draw(self, context):
+        layout = self.layout
+        groom = context.groom
+        ds = groom.hair_draw_settings
+
+        split = layout.split()
+        col = split.column()
+        col.label("Follicles:")
+        col.prop(ds, "follicle_mode", expand=True)
+
+
 class DATA_PT_custom_props_groom(DataButtonsPanel, PropertyPanel, Panel):
     _context_path = "object.data"
     _property_type = bpy.types.Groom
@@ -73,6 +87,7 @@ class DATA_PT_custom_props_groom(DataButtonsPanel, PropertyPanel, Panel):
 classes = (
     DATA_PT_context_groom,
     DATA_PT_groom,
+    DATA_PT_groom_draw_settings,
     DATA_PT_custom_props_groom,
 )
 
diff --git a/source/blender/makesrna/intern/rna_groom.c b/source/blender/makesrna/intern/rna_groom.c
index 6d7d64afb5f..034509e1603 100644
--- a/source/blender/makesrna/intern/rna_groom.c
+++ b/source/blender/makesrna/intern/rna_groom.c
@@ -75,21 +75,29 @@ static void rna_def_groom(BlenderRNA *brna)
 {
 	StructRNA *srna;
 	PropertyRNA *prop;
-
+	
 	srna = RNA_def_struct(brna, "Groom", "ID");
 	RNA_def_struct_sdna(srna, "Groom");
 	RNA_def_struct_ui_text(srna, "Groom", "Guide curve geometry for hair");
 	RNA_def_struct_ui_icon(srna, ICON_NONE);
-
+	
+	/* Animation Data */
+	rna_def_animdata_common(srna);
+	
 	prop = RNA_def_property(srna, "curve_resolution", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "curve_res");
 	RNA_def_property_range(prop, 1, 1024);
 	RNA_def_property_ui_range(prop, 1, 64, 1, -1);
 	RNA_def_property_ui_text(prop, "Curve Resolution", "Curve subdivisions per segment");
 	RNA_def_property_update(prop, 0, "rna_Groom_update_data");
-
-	/* Animation Data */
-	rna_def_animdata_common(srna);
+	
+	prop = RNA_def_property(srna, "hair_system", PROP_POINTER, PROP_NONE);
+	RNA_def_property_ui_text(prop, "Hair", "Hair data");
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+	
+	prop = RNA_def_property(srna, "hair_draw_settings", PROP_POINTER, PROP_NONE);
+	RNA_def_property_ui_text(prop, "Hair Draw Settings", "Hair draw settings");
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 	
 	UNUSED_VARS(prop);
 }



More information about the Bf-blender-cvs mailing list