From c6f425c8758d0c674f5e59075dbb3fef418af29a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 5 Dec 2013 01:24:05 +0600 Subject: 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. --- source/blender/makesrna/intern/rna_object_force.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source') 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"); -- cgit v1.2.3