Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-12-04 23:24:05 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-12-04 23:24:05 +0400
commitc6f425c8758d0c674f5e59075dbb3fef418af29a (patch)
tree3be0d424cf413af7223fe34bfea71fbc3f272502 /source/blender/makesrna/intern/rna_object_force.c
parentb98754836e96e1ffa1733e18b2ffbf4337d37d1c (diff)
Fix T37189: Inconsistent icons for Force field
There's still an issue with Curve Guide force field which you can not so easily change type from/to. This i would consider TODO for later.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 2a93925a8e5..b8cf7a13b74 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -523,6 +523,18 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
}
}
+static void rna_FieldSettings_type_set(PointerRNA *ptr, int value)
+{
+ Object *ob = (Object *)ptr->id.data;
+ ob->pd->forcefield = value;
+ if (ELEM(value, PFIELD_WIND, PFIELD_VORTEX)) {
+ ob->empty_drawtype = OB_SINGLE_ARROW;
+ }
+ else {
+ ob->empty_drawtype = OB_PLAINAXES;
+ }
+}
+
static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if (particle_id_check(ptr)) {
@@ -1159,6 +1171,7 @@ static void rna_def_field(BlenderRNA *brna)
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "forcefield");
RNA_def_property_enum_items(prop, field_type_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_FieldSettings_type_set", NULL);
RNA_def_property_ui_text(prop, "Type", "Type of field");
RNA_def_property_update(prop, 0, "rna_FieldSettings_dependency_update");