diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-03-22 20:12:08 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-03-22 20:12:08 +0300 |
commit | 867cad85b7af1059b79b5ad70b046c3f68f17b69 (patch) | |
tree | b89f9250b2ea4d8f6c878f9674395dcb0478fe2c /source/blender/makesrna/intern/rna_sculpt_paint.c | |
parent | 113ea4368e8f0b8036c59354837afe5d68e0111a (diff) |
Fix for [#21103] Updating bugs in Particle Mode
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index c4830250aa8..aa85acbdfd8 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -34,6 +34,7 @@ #include "BKE_paint.h" +#include "WM_api.h" #include "WM_types.h" static EnumPropertyItem particle_edit_hair_brush_items[] = { @@ -128,7 +129,21 @@ static void rna_ParticleEdit_update(Main *bmain, Scene *scene, PointerRNA *ptr) if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } +static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value) +{ + ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; + + /* redraw hair completely if weight brush is/was used */ + if(pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) { + Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL; + if(ob) { + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL); + } + } + pset->brushtype = value; +} static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) { Scene *scene= CTX_data_scene(C); @@ -407,7 +422,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "brushtype"); RNA_def_property_enum_items(prop, particle_edit_hair_brush_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf"); + RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf"); RNA_def_property_ui_text(prop, "Tool", ""); prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE); @@ -504,11 +519,15 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_text(prop, "Size", "Brush size"); - prop= RNA_def_property(srna, "strength", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 1, INT_MAX); - RNA_def_property_ui_range(prop, 1, 100, 10, 3); + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.001, 1.0); RNA_def_property_ui_text(prop, "Strength", "Brush strength"); + prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 1, 1000); + RNA_def_property_ui_range(prop, 1, 100, 10, 3); + RNA_def_property_ui_text(prop, "Count", "Particle count"); + prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "step"); RNA_def_property_range(prop, 1, INT_MAX); |