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.
This commit is contained in:
Sergey Sharybin 2013-12-05 01:24:05 +06:00
parent b98754836e
commit c6f425c875

@ -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");