From 59562e5b259ccc1e02e4f943394ca9db5ac938c7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 4 Apr 2018 13:16:56 +0200 Subject: Fix Cycles particle info node not working. --- source/blender/makesrna/intern/rna_depsgraph.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index bb20fcb271f..04e7f64712e 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -81,6 +81,14 @@ static PointerRNA rna_DepsgraphIter_parent_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_Object, dupli_parent); } +static PointerRNA rna_DepsgraphIter_particle_system_get(PointerRNA *ptr) +{ + BLI_Iterator *iterator = ptr->data; + DEGObjectIterData *deg_iter = (DEGObjectIterData *)iterator->data; + return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, + deg_iter->dupli_object_current->particle_system); +} + static void rna_DepsgraphIter_persistent_id_get(PointerRNA *ptr, int *persistent_id) { BLI_Iterator *iterator = ptr->data; @@ -277,6 +285,12 @@ static void rna_def_depsgraph_iter(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_DepsgraphIter_parent_get", NULL, NULL, NULL); + prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ParticleSystem"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Particle System", "Particle system that this object was instanced from"); + RNA_def_property_pointer_funcs(prop, "rna_DepsgraphIter_particle_system_get", NULL, NULL, NULL); + prop = RNA_def_property(srna, "persistent_id", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Persistent ID", "Persistent identifier for inter-frame matching of objects with motion blur"); -- cgit v1.2.3