diff options
author | Matt Ebb <matt@mke3.net> | 2010-06-30 06:34:34 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-06-30 06:34:34 +0400 |
commit | f6dabd51c9e1603b939cf5bfeefef63b4f533dfb (patch) | |
tree | 79472651a3c5ef69168ab5c9891f6a7b90c8914f /source/blender/makesrna/intern/rna_object_force.c | |
parent | f7f44696ba964cb6466254c2471c93daeef93406 (diff) |
Fix for [#22667] Soft Body Aero on/off switch
Under guidance from Jens, converted the 'aero' property into a two-way switch,
which is what it actually represents.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 0069f3332e8..ec1f1bf164e 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -357,14 +357,19 @@ static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value) static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) { Object *data= (Object*)(ptr->id.data); - return (((data->softflag) & OB_SB_AERO_ANGLE) != 0); + if (data->softflag & OB_SB_AERO_ANGLE) + return 1; + else + return 0; } static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) { Object *data= (Object*)(ptr->id.data); - if(value) data->softflag |= OB_SB_AERO_ANGLE; - else data->softflag &= ~OB_SB_AERO_ANGLE; + if (value == 1) + data->softflag |= OB_SB_AERO_ANGLE; + else /* value == 0 */ + data->softflag &= ~OB_SB_AERO_ANGLE; } static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) @@ -1404,6 +1409,11 @@ static void rna_def_softbody(BlenderRNA *brna) {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"}, {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem aerodynamics_type[] = { + {0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"}, + {1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SoftBodySettings", NULL); RNA_def_struct_sdna(srna, "SoftBody"); @@ -1660,12 +1670,13 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); - RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning"); + RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, can be very slow"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); - RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)"); + prop= RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, aerodynamics_type); + RNA_def_property_enum_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set", NULL); + RNA_def_property_ui_text(prop, "Aerodynamics Type", "Method of calculating aerodynamic interaction"); RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); |