diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-28 15:29:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-29 15:53:02 +0300 |
commit | a59df21ad8282c20f33a216ba9e3ba739881577d (patch) | |
tree | a38ea5e89859a27068051f6920129e6add62b384 /source/blender/makesrna | |
parent | ece72c9ec0c706f137ba0bc80af732786ca9990f (diff) |
Fix T55645: broken particle Use Count option for instancing objects.
There is now a manual refresh button on the panel to update the list
of objects in case it changes, and it also gets refreshed when changing
the collection or toggling the use count option.
This is a bit more manual but the previous code of refreshing the
list while evaluating the depsgraph was unreliable.
This also fixes it to take properly take into account visibility, and
to work with linked collections for which index writing was missing.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 08bc373b690..b33bf9a47b7 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -607,6 +607,14 @@ static void rna_Particle_redo_dependency(Main *bmain, Scene *scene, PointerRNA * rna_Particle_redo(bmain, scene, ptr); } +static void rna_Particle_redo_count(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + ParticleSettings *part = (ParticleSettings *)ptr->data; + DEG_relations_tag_update(bmain); + psys_check_group_weights(part); + particle_recalc(bmain, scene, ptr, PSYS_RECALC_REDO); +} + static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET); @@ -2320,8 +2328,8 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COUNT_GR); - RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same group"); - RNA_def_property_update(prop, 0, "rna_Particle_redo"); + RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same collecton"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_count"); prop = RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB); @@ -3085,7 +3093,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Collection"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Collection", "Show Objects in this collection in place of particles"); - RNA_def_property_update(prop, 0, "rna_Particle_redo_dependency"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_count"); prop = RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "dupliweights", NULL); |