diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-08 20:35:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-08 20:35:28 +0400 |
commit | 863291bc8e44eaed79946706b417944cdf9dfa4f (patch) | |
tree | 68f6b1b859f41871de053c953ebd7d6fdfdb43fd /source/blender/makesrna | |
parent | e73408f2474f7e6d9f1ff880f7f07c678f28e0ce (diff) |
Fix #33113: cycles not rendering motion blur correct with dying particles.
There were a bunch of other issues with dupli motion blur and syncing, the problem
being that there was no proper way to detect corresponding duplis between frames
or updates. As a solution, a persistent_id was added to the DupliObject. It's an
extension of the previous index value, with one index for each dupli level. This
can be used to reliably find matching dupli objects between frames. Works with
nested duplis, multiple particle systems, etc.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 82f27b953cf..d436e4719ea 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1419,6 +1419,12 @@ int rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) return ((Object *)value.id.data)->type == OB_CAMERA; } +int rna_DupliObject_index_get(PointerRNA *ptr) +{ + DupliObject *dob = (DupliObject *)ptr->data; + return dob->persistent_id[0]; +} + #else static int rna_matrix_dimsize_4x4[] = {4, 4}; @@ -2653,22 +2659,23 @@ static void rna_def_dupli_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Hide", "Don't show dupli object in viewport or render"); prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "index"); + RNA_def_property_int_funcs(prop, "rna_DupliObject_index_get", NULL, NULL); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "Index", "Index in the lowest-level dupli list"); - - prop = RNA_def_property(srna, "particle_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "particle_index"); + + prop = RNA_def_property(srna, "persistent_id", PROP_INT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Persistent ID", "Persistent identifier for inter-frame matching of objects with motion blur"); + + prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Particle Index", "Index in the lowest-level particle dupli list"); + RNA_def_property_ui_text(prop, "Particle System", "Particle system that this dupli object was instanced from"); prop = RNA_def_property(srna, "orco", PROP_FLOAT, PROP_TRANSLATION); - RNA_def_property_float_sdna(prop, NULL, "orco"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "Generated Coordinates", "Generated coordinates in parent object space"); prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "uv"); RNA_def_property_array(prop, 2); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "UV Coordinates", "UV coordinates in parent object space"); |