[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23609] trunk/blender: Fixed [#19506] Missing buttons : Curve Guide.

Thomas Dinges dingto at gmx.de
Fri Oct 2 22:15:25 CEST 2009


Revision: 23609
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23609
Author:   dingto
Date:     2009-10-02 22:15:25 +0200 (Fri, 02 Oct 2009)

Log Message:
-----------
Fixed [#19506] Missing buttons : Curve Guide.

Jahka: please check on the Kink type and axis RNA Wrapping. 
Todo: Make Curve Guide Field only available for Curve Objects. 

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/buttons_physics_field.py
    trunk/blender/source/blender/makesrna/intern/rna_object_force.c

Modified: trunk/blender/release/scripts/ui/buttons_physics_field.py
===================================================================
--- trunk/blender/release/scripts/ui/buttons_physics_field.py	2009-10-02 15:51:25 UTC (rev 23608)
+++ trunk/blender/release/scripts/ui/buttons_physics_field.py	2009-10-02 20:15:25 UTC (rev 23609)
@@ -21,8 +21,6 @@
 		
 		ob = context.object
 		field = ob.field
-
-		#layout.active = field.enabled
 		
 		split = layout.split(percentage=0.2)
 		split.itemL(text="Type:")
@@ -39,7 +37,33 @@
 		if field.type == 'NONE':
 			return # nothing to draw
 		elif field.type == 'GUIDE':
-			layout.itemR(field, "guide_path_add")
+			col = split.column()
+			col.itemR(field, "guide_minimum")
+			col.itemR(field, "guide_free")
+			col.itemR(field, "falloff_power")
+			col.itemR(field, "guide_path_add")
+			
+			col = split.column()
+			col.itemL(text="Clumping:")
+			col.itemR(field, "guide_clump_amount")
+			col.itemR(field, "guide_clump_shape")
+			
+			row = layout.row()			
+			row.itemR(field, "use_max_distance")
+			sub = row.row()
+			sub.active = field.use_max_distance
+			sub.itemR(field, "maximum_distance")
+			
+			layout.itemS()
+
+			layout.itemR(field, "guide_kink_type")
+			if (field.guide_kink_type != "NONE"):
+				layout.itemR(field, "guide_kink_axis")
+				
+				flow = layout.column_flow()
+				flow.itemR(field, "guide_kink_frequency")
+				flow.itemR(field, "guide_kink_shape")
+				flow.itemR(field, "guide_kink_amplitude")
 		elif field.type == 'TEXTURE':
 			col = split.column()
 			col.itemR(field, "strength")
@@ -102,18 +126,7 @@
 				sub = col.column()
 				sub.active = field.use_radial_max
 				sub.itemR(field, "radial_maximum", text="Distance")
-				
-		#if ob.type in 'CURVE':
-			#if field.type == 'GUIDE':
-				#colsub = col.column(align=True)
-			
-		#if field.type != 'NONE':
-			#layout.itemR(field, "strength")
 
-		#if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"):
-			#if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'):
-				#layout.itemR(field, "surface")
-
 class PHYSICS_PT_collision(PhysicButtonsPanel):
 	__label__ = "Collision"
 	#__default_closed__ = True

Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object_force.c	2009-10-02 15:51:25 UTC (rev 23608)
+++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c	2009-10-02 20:15:25 UTC (rev 23609)
@@ -906,6 +906,22 @@
 		{PFIELD_Z_POS, "POSITIVE", 0, "+Z", ""},
 		{PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""},
 		{0, NULL, 0, NULL, NULL}};
+		
+	static EnumPropertyItem guide_kink_items[] = {
+		{0, "NONE", 0, "Nothing", ""},
+		{1, "CURL", 0, "Curl", ""},
+		{2, "RADIAL", 0, "Radial", ""},
+		{3, "WAVE", 0, "Wave", ""},
+		{4, "BRAID", 0, "Braid", ""},
+		{5, "ROTATION", 0, "Rotation", ""},
+		{6, "ROLL", 0, "Roll", ""},
+		{0, NULL, 0, NULL, NULL}};
+		
+	static EnumPropertyItem guide_kink_axis_items[] = {
+		{0, "X", 0, "X", ""},
+		{1, "Y", 0, "Y", ""},
+		{2, "Z", 0, "Z", ""},
+		{0, NULL, 0, NULL, NULL}};
 
 	srna= RNA_def_struct(brna, "FieldSettings", NULL);
 	RNA_def_struct_sdna(srna, "PartDeflect");
@@ -1067,11 +1083,6 @@
 	RNA_def_property_ui_text(prop, "Use Max", "Use a maximum radial distance for the field to work");
 	// "Use a maximum angle for the field to work"
 	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
-	
-	prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
-	RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
-	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
 
 	prop= RNA_def_property(srna, "use_coordinates", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_OBJECT);
@@ -1110,6 +1121,74 @@
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Texture", "Texture to use as force");
 	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	/********** Curve Guide Field Settings **********/
+	
+	prop= RNA_def_property(srna, "guide_minimum", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "f_strength");
+	RNA_def_property_range(prop, 0.0f, 1000.0f);
+	RNA_def_property_ui_text(prop, "Minimum Distance", "The distance from which particles are affected fully.");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+	prop= RNA_def_property(srna, "guide_free", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "free_end");
+	RNA_def_property_range(prop, 0.0f, 0.99f);
+	RNA_def_property_ui_text(prop, "Free", "Guide-free time from particle life's end");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+	prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD);
+	RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	/* Clump Settings */
+	
+	prop= RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "clump_fac");
+	RNA_def_property_range(prop, -1.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Amount", "Amount of clumpimg");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	prop= RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "clump_pow");
+	RNA_def_property_range(prop, -0.999f, 0.999f);
+	RNA_def_property_ui_text(prop, "Shape", "Shape of clumpimg");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	/* Kink Settings */
+	
+	prop= RNA_def_property(srna, "guide_kink_type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "kink");
+	RNA_def_property_enum_items(prop, guide_kink_items);
+	RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the curve");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	prop= RNA_def_property(srna, "guide_kink_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "kink_axis");
+	RNA_def_property_enum_items(prop, guide_kink_axis_items);
+	RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+	prop= RNA_def_property(srna, "guide_kink_frequency", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "kink_freq");
+	RNA_def_property_range(prop, 0.0f, 10.0f);
+	RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	prop= RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "kink_shape");
+	RNA_def_property_range(prop, -0.999f, 0.999f);
+	RNA_def_property_ui_text(prop, "Shape", "djust the offset to the beginning/end");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+	
+	prop= RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "kink_amp");
+	RNA_def_property_range(prop, 0.0f, 10.0f);
+	RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
+	RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
+
+	/* Variables used for Curve Guide, allready wrapped, used for other fields too */
+	// falloff_power, use_max_distance, maximum_distance
 }
 
 static void rna_def_game_softbody(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list