diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 5b553469bc8..9b3100c733b 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -241,6 +241,25 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_MaterialSlot, ob->mat+ob->actcol); } +static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + *min= 1; + *max= BLI_countlist(&ob->particlesystem); +} + +static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return psys_get_current_num(ob) + 1; +} + +static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + psys_set_current_num(ob, value); +} + #if 0 static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) { @@ -929,6 +948,10 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); + RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot."); + /* restrict */ prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE); |