4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
30 #include "RNA_define.h"
32 #include "rna_internal.h"
34 #include "DNA_modifier_types.h"
35 #include "DNA_cloth_types.h"
36 #include "DNA_particle_types.h"
37 #include "DNA_object_force.h"
38 #include "DNA_object_types.h"
39 #include "DNA_scene_types.h"
40 #include "DNA_boid_types.h"
45 EnumPropertyItem part_from_items[] = {
46 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
47 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
48 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
49 {0, NULL, 0, NULL, NULL}
52 EnumPropertyItem part_reactor_from_items[] = {
53 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
54 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
55 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
56 {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""},
57 {0, NULL, 0, NULL, NULL}
60 EnumPropertyItem part_draw_as_items[] = {
61 {PART_DRAW_NOT, "NONE", 0, "None", ""},
62 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
63 {PART_DRAW_DOT, "DOT", 0, "Point", ""},
64 {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""},
65 {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""},
66 {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""},
67 {0, NULL, 0, NULL, NULL}
70 EnumPropertyItem part_hair_draw_as_items[] = {
71 {PART_DRAW_NOT, "NONE", 0, "None", ""},
72 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
73 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
74 {0, NULL, 0, NULL, NULL}
77 EnumPropertyItem part_ren_as_items[] = {
78 {PART_DRAW_NOT, "NONE", 0, "None", ""},
79 {PART_DRAW_HALO, "HALO", 0, "Halo", ""},
80 {PART_DRAW_LINE, "LINE", 0, "Line", ""},
81 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
82 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
83 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
84 {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""},
85 {0, NULL, 0, NULL, NULL}
88 EnumPropertyItem part_hair_ren_as_items[] = {
89 {PART_DRAW_NOT, "NONE", 0, "None", ""},
90 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
91 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
92 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
93 {0, NULL, 0, NULL, NULL}
98 #include "BKE_context.h"
99 #include "BKE_cloth.h"
100 #include "BKE_deform.h"
101 #include "BKE_depsgraph.h"
102 #include "BKE_effect.h"
103 #include "BKE_modifier.h"
104 #include "BKE_particle.h"
105 #include "BKE_pointcache.h"
107 #include "BLI_math.h"
108 #include "BLI_listbase.h"
110 /* use for object space hair get/set */
111 static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSystemModifierData **psmd_pt, ParticleData **pa_pt)
113 HairKey *hkey= (HairKey *)ptr->data;
114 Object *ob = (Object *)ptr->id.data;
116 ParticleSystemModifierData *psmd=NULL;
117 ParticleSystem *psys;
124 /* weak, what about multiple particle systems? */
125 for (md = ob->modifiers.first; md; md=md->next) {
126 if (md->type == eModifierType_ParticleSystem)
127 psmd= (ParticleSystemModifierData*) md;
130 if (!psmd || !psmd->dm || !psmd->psys) {
136 /* not a very efficient way of getting hair key location data,
137 * but it's the best we've got at the present */
139 /* find the particle that corresponds with this HairKey */
140 for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
142 /* hairkeys are stored sequentially in memory, so we can find if
143 * it's the same particle by comparing pointers, without having
144 * to iterate over them all */
145 if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey))
153 static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values)
155 HairKey *hkey= (HairKey *)ptr->data;
156 Object *ob = (Object *)ptr->id.data;
157 ParticleSystemModifierData *psmd;
160 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
164 psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
165 copy_v3_v3(values, hkey->co);
166 mul_m4_v3(hairmat, values);
173 static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float *values)
175 HairKey *hkey= (HairKey *)ptr->data;
176 Object *ob = (Object *)ptr->id.data;
177 ParticleSystemModifierData *psmd;
180 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
186 psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
187 invert_m4_m4(imat, hairmat);
188 copy_v3_v3(hkey->co, values);
189 mul_m4_v3(imat, hkey->co);
196 /* property update functions */
197 static void particle_recalc(Main *bmain, Scene *scene, PointerRNA *ptr, short flag)
199 if(ptr->type==&RNA_ParticleSystem) {
200 ParticleSystem *psys = (ParticleSystem*)ptr->data;
204 DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
207 DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
209 WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
211 static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
213 particle_recalc(bmain, scene, ptr, PSYS_RECALC_REDO);
216 static void rna_Particle_redo_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
218 DAG_scene_sort(bmain, scene);
219 rna_Particle_redo(bmain, scene, ptr);
222 static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
224 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET);
227 static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr)
229 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
232 static void rna_Particle_change_physics(Main *bmain, Scene *scene, PointerRNA *ptr)
234 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
237 static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr)
239 particle_recalc(bmain, scene, ptr, PSYS_RECALC_CHILD);
242 static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget *target)
244 ParticleSystem *psys;
247 for(psys=ob->particlesystem.first; psys; psys=psys->next)
248 for(pt=psys->targets.first; pt; pt=pt->next)
255 static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
257 if(ptr->type==&RNA_ParticleTarget) {
258 Object *ob = (Object*)ptr->id.data;
259 ParticleTarget *pt = (ParticleTarget*)ptr->data;
260 ParticleSystem *kpsys=NULL, *psys=rna_particle_system_for_target(ob, pt);
262 if(pt->ob==ob || pt->ob==NULL) {
263 kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1);
266 pt->flag |= PTARGET_VALID;
268 pt->flag &= ~PTARGET_VALID;
272 kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
275 pt->flag |= PTARGET_VALID;
277 pt->flag &= ~PTARGET_VALID;
280 psys->recalc = PSYS_RECALC_RESET;
282 DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
283 DAG_scene_sort(bmain, scene);
286 WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
289 static void rna_Particle_target_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
291 if(ptr->type==&RNA_ParticleTarget) {
292 Object *ob = (Object*)ptr->id.data;
293 ParticleTarget *pt = (ParticleTarget*)ptr->data;
294 ParticleSystem *psys = rna_particle_system_for_target(ob, pt);
296 psys->recalc = PSYS_RECALC_REDO;
298 DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
299 WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
303 static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *ptr)
305 ParticleSystem *psys = (ParticleSystem*)ptr->data;
307 if(psys && !psys->clmd) {
308 psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth);
309 psys->clmd->sim_parms->goalspring = 0.0f;
310 psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
311 psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF;
312 rna_Particle_redo(bmain, scene, ptr);
315 WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
317 static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
319 ParticleSystem *psys= (ParticleSystem*)ptr->data;
320 ParticleSettings *part = psys->part;
322 return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
325 static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
327 ParticleSystem *psys= (ParticleSystem*)ptr->data;
332 old_type = psys->part->type;
336 psys->part = (ParticleSettings *)value.data;
340 psys_check_boid_data(psys);
341 if(old_type != psys->part->type)
342 psys->recalc |= PSYS_RECALC_TYPE;
345 static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr)
347 ParticleSettings *settings = (ParticleSettings*)ptr->data;
348 float delta = settings->end + settings->lifetime - settings->sta;
349 if(settings->draw & PART_ABS_PATH_TIME) {
350 settings->path_start = settings->sta + settings->path_start * delta;
351 settings->path_end = settings->sta + settings->path_end * delta;
354 settings->path_start = (settings->path_start - settings->sta)/delta;
355 settings->path_end = (settings->path_end - settings->sta)/delta;
357 rna_Particle_redo(bmain, scene, ptr);
359 static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
361 ParticleSettings *settings = (ParticleSettings*)ptr->data;
363 /* check for clipping */
364 if(value > settings->end)
365 value = settings->end;
367 //if(settings->type==PART_REACTOR && value < 1.0)
370 if (value < MINAFRAMEF)
373 settings->sta = value;
376 static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
378 ParticleSettings *settings = (ParticleSettings*)ptr->data;
380 /* check for clipping */
381 if(value < settings->sta)
382 value = settings->sta;
384 settings->end = value;
387 static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value)
389 ParticleSettings *settings = (ParticleSettings*)ptr->data;
390 settings->draw_line[0] = value;
393 static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
395 ParticleSettings *settings = (ParticleSettings*)ptr->data;
396 return settings->draw_line[0];
398 static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max)
400 ParticleSettings *settings = (ParticleSettings*)ptr->data;
402 if(settings->type==PART_HAIR) {
404 *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0;
407 *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f;
408 *max= (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f;
411 static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
413 ParticleSettings *settings = (ParticleSettings*)ptr->data;
414 settings->draw_line[1] = value;
417 static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
419 ParticleSettings *settings = (ParticleSettings*)ptr->data;
420 return settings->draw_line[1];
423 static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
425 ParticleSystem *psys= (ParticleSystem*)ptr->data;
426 ParticleTarget *pt = psys->targets.first;
428 for(; pt; pt=pt->next) {
429 if(pt->flag & PTARGET_CURRENT)
430 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, pt);
432 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
434 static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max)
436 ParticleSystem *psys= (ParticleSystem*)ptr->data;
438 *max= BLI_countlist(&psys->targets)-1;
442 static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
444 ParticleSystem *psys= (ParticleSystem*)ptr->data;
445 ParticleTarget *pt = psys->targets.first;
448 for(; pt; pt=pt->next, i++)
449 if(pt->flag & PTARGET_CURRENT)
455 static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value)
457 ParticleSystem *psys= (ParticleSystem*)ptr->data;
458 ParticleTarget *pt = psys->targets.first;
461 for(; pt; pt=pt->next, i++) {
463 pt->flag |= PTARGET_CURRENT;
465 pt->flag &= ~PTARGET_CURRENT;
468 static int rna_ParticleTarget_name_length(PointerRNA *ptr)
470 ParticleTarget *pt= ptr->data;
472 if(pt->flag & PTARGET_VALID) {
473 ParticleSystem *psys = NULL;
476 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
478 Object *ob = (Object*) ptr->id.data;
479 psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
484 return strlen(pt->ob->id.name+2) + 2 + strlen(psys->name);
486 return strlen(psys->name);
495 static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
497 ParticleTarget *pt= ptr->data;
499 if(pt->flag & PTARGET_VALID) {
500 ParticleSystem *psys = NULL;
503 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
505 Object *ob = (Object*) ptr->id.data;
506 psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
511 sprintf(str, "%s: %s", pt->ob->id.name+2, psys->name);
513 strcpy(str, psys->name);
516 strcpy(str, "Invalid target!");
519 strcpy(str, "Invalid target!");
521 static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr)
523 ParticleSystem *psys= (ParticleSystem*)ptr->data;
525 return (psys->ptcaches.first != psys->ptcaches.last);
527 static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
529 ParticleSystem *psys= (ParticleSystem*)ptr->data;
531 return psys_check_edited(psys);
533 static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
535 ParticleSystem *psys= (ParticleSystem*)ptr->data;
537 if(psys->part && psys->part->type==PART_HAIR)
538 return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited));
540 return (psys->pointcache->edit && psys->pointcache->edit->edited);
542 static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
544 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
545 ParticleDupliWeight *dw = part->dupliweights.first;
547 for(; dw; dw=dw->next) {
548 if(dw->flag & PART_DUPLIW_CURRENT)
549 return rna_pointer_inherit_refine(ptr, &RNA_ParticleDupliWeight, dw);
551 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
553 static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max)
555 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
557 *max= BLI_countlist(&part->dupliweights)-1;
561 static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
563 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
564 ParticleDupliWeight *dw = part->dupliweights.first;
567 for(; dw; dw=dw->next, i++)
568 if(dw->flag & PART_DUPLIW_CURRENT)
574 static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value)
576 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
577 ParticleDupliWeight *dw = part->dupliweights.first;
580 for(; dw; dw=dw->next, i++) {
582 dw->flag |= PART_DUPLIW_CURRENT;
584 dw->flag &= ~PART_DUPLIW_CURRENT;
588 static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
590 ParticleDupliWeight *dw= ptr->data;
593 return strlen(dw->ob->id.name+2) + 7;
598 static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
600 ParticleDupliWeight *dw= ptr->data;
603 sprintf(str, "%s: %i", dw->ob->id.name+2, dw->count);
605 strcpy(str, "No object");
608 static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free)
610 //if(part->type==PART_REACTOR)
611 // return part_reactor_from_items;
613 return part_from_items;
616 static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *C, PointerRNA *ptr, int *free)
618 ParticleSettings *part = ptr->id.data;
620 if(part->type==PART_HAIR)
621 return part_hair_draw_as_items;
623 return part_draw_as_items;
626 static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr, int *free)
628 ParticleSettings *part = ptr->id.data;
630 if(part->type==PART_HAIR)
631 return part_hair_ren_as_items;
633 return part_ren_as_items;
636 static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
638 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
642 part->pd= object_add_collision_fields(0);
644 return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd);
647 static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
649 ParticleSettings *part= (ParticleSettings*)ptr->id.data;
653 part->pd2= object_add_collision_fields(0);
655 return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2);
658 static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index)
660 Object *ob= ptr->id.data;
661 ParticleSystem *psys= (ParticleSystem*)ptr->data;
663 if(psys->vgroup[index] > 0) {
664 bDeformGroup *defGroup= BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
667 strcpy(value, defGroup->name);
674 static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
676 Object *ob= ptr->id.data;
677 ParticleSystem *psys= (ParticleSystem*)ptr->data;
679 if(psys->vgroup[index] > 0) {
680 bDeformGroup *defGroup= BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
683 return strlen(defGroup->name);
688 static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index)
690 Object *ob= ptr->id.data;
691 ParticleSystem *psys= (ParticleSystem*)ptr->data;
694 psys->vgroup[index]= 0;
697 int vgroup_num = defgroup_name_index(ob, (char*)value);
702 psys->vgroup[index]= vgroup_num + 1;
706 /* irritating string functions for each index :/ */
707 static void rna_ParticleVGroup_name_get_0(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 0); }
708 static void rna_ParticleVGroup_name_get_1(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 1); }
709 static void rna_ParticleVGroup_name_get_2(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 2); }
710 static void rna_ParticleVGroup_name_get_3(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 3); }
711 static void rna_ParticleVGroup_name_get_4(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 4); }
712 static void rna_ParticleVGroup_name_get_5(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 5); }
713 static void rna_ParticleVGroup_name_get_6(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 6); }
714 static void rna_ParticleVGroup_name_get_7(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 7); }
715 static void rna_ParticleVGroup_name_get_8(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 8); }
716 static void rna_ParticleVGroup_name_get_9(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 9); }
717 static void rna_ParticleVGroup_name_get_10(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 10); }
718 static void rna_ParticleVGroup_name_get_11(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 11); }
720 static int rna_ParticleVGroup_name_len_0(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 0); }
721 static int rna_ParticleVGroup_name_len_1(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 1); }
722 static int rna_ParticleVGroup_name_len_2(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 2); }
723 static int rna_ParticleVGroup_name_len_3(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 3); }
724 static int rna_ParticleVGroup_name_len_4(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 4); }
725 static int rna_ParticleVGroup_name_len_5(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 5); }
726 static int rna_ParticleVGroup_name_len_6(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 6); }
727 static int rna_ParticleVGroup_name_len_7(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 7); }
728 static int rna_ParticleVGroup_name_len_8(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 8); }
729 static int rna_ParticleVGroup_name_len_9(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 9); }
730 static int rna_ParticleVGroup_name_len_10(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 10); }
731 static int rna_ParticleVGroup_name_len_11(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 11); }
733 static void rna_ParticleVGroup_name_set_0(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 0); }
734 static void rna_ParticleVGroup_name_set_1(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 1); }
735 static void rna_ParticleVGroup_name_set_2(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 2); }
736 static void rna_ParticleVGroup_name_set_3(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 3); }
737 static void rna_ParticleVGroup_name_set_4(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 4); }
738 static void rna_ParticleVGroup_name_set_5(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 5); }
739 static void rna_ParticleVGroup_name_set_6(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 6); }
740 static void rna_ParticleVGroup_name_set_7(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 7); }
741 static void rna_ParticleVGroup_name_set_8(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 8); }
742 static void rna_ParticleVGroup_name_set_9(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 9); }
743 static void rna_ParticleVGroup_name_set_10(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 10); }
744 static void rna_ParticleVGroup_name_set_11(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 11); }
749 static void rna_def_particle_hair_key(BlenderRNA *brna)
754 srna = RNA_def_struct(brna, "ParticleHairKey", NULL);
755 RNA_def_struct_sdna(srna, "HairKey");
756 RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system");
758 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
759 RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length");
761 prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
762 RNA_def_property_range(prop, 0.0, 1.0);
763 RNA_def_property_ui_text(prop, "Weight", "Weight for cloth simulation");
765 prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
766 RNA_def_property_array(prop, 3);
767 RNA_def_property_ui_text(prop, "Location (Object Space)", "Location of the hair key in object space");
768 RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get", "rna_ParticleHairKey_location_object_set", NULL);
770 prop= RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
771 RNA_def_property_float_sdna(prop, NULL, "co");
772 RNA_def_property_ui_text(prop, "Location", "Location of the hair key in its internal coordinate system, relative to the emitting face");
775 static void rna_def_particle_key(BlenderRNA *brna)
780 srna = RNA_def_struct(brna, "ParticleKey", NULL);
781 RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time");
783 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
784 RNA_def_property_float_sdna(prop, NULL, "co");
785 RNA_def_property_ui_text(prop, "Location", "Key location");
787 prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
788 RNA_def_property_float_sdna(prop, NULL, "vel");
789 RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
791 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
792 RNA_def_property_float_sdna(prop, NULL, "rot");
793 RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaterion");
795 prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
796 RNA_def_property_float_sdna(prop, NULL, "ave");
797 RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity");
799 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
800 RNA_def_property_ui_text(prop, "Time", "Time of key over the simulation");
803 static void rna_def_child_particle(BlenderRNA *brna)
808 srna = RNA_def_struct(brna, "ChildParticle", NULL);
809 RNA_def_struct_ui_text(srna, "Child Particle", "Child particle interpolated from simulated or edited particles");
811 // int num, parent; /* num is face index on the final derived mesh */
813 // int pa[4]; /* nearest particles to the child, used for the interpolation */
814 // float w[4]; /* interpolation weights for the above particles */
815 // float fuv[4], foffset; /* face vertex weights and offset */
819 static void rna_def_particle(BlenderRNA *brna)
824 static EnumPropertyItem alive_items[] = {
825 //{PARS_KILLED, "KILLED", 0, "Killed", ""},
826 {PARS_DEAD, "DEAD", 0, "Dead", ""},
827 {PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
828 {PARS_ALIVE, "ALIVE", 0, "Alive", ""},
829 {PARS_DYING, "DYING", 0, "Dying", ""},
830 {0, NULL, 0, NULL, NULL}
833 srna = RNA_def_struct(brna, "Particle", NULL);
834 RNA_def_struct_sdna(srna, "ParticleData");
835 RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system");
837 /* Particle State & Previous State */
838 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
839 RNA_def_property_float_sdna(prop, NULL, "state.co");
840 RNA_def_property_ui_text(prop, "Particle Location", "");
842 prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
843 RNA_def_property_float_sdna(prop, NULL, "state.vel");
844 RNA_def_property_ui_text(prop, "Particle Velocity", "");
846 prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
847 RNA_def_property_float_sdna(prop, NULL, "state.ave");
848 RNA_def_property_ui_text(prop, "Angular Velocity", "");
850 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
851 RNA_def_property_float_sdna(prop, NULL, "state.rot");
852 RNA_def_property_ui_text(prop, "Rotation", "");
854 prop= RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
855 RNA_def_property_float_sdna(prop, NULL, "prev_state.co");
856 RNA_def_property_ui_text(prop, "Previous Particle Location", "");
858 prop= RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
859 RNA_def_property_float_sdna(prop, NULL, "prev_state.vel");
860 RNA_def_property_ui_text(prop, "Previous Particle Velocity", "");
862 prop= RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
863 RNA_def_property_float_sdna(prop, NULL, "prev_state.ave");
864 RNA_def_property_ui_text(prop, "Previous Angular Velocity", "");
866 prop= RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
867 RNA_def_property_float_sdna(prop, NULL, "prev_state.rot");
868 RNA_def_property_ui_text(prop, "Previous Rotation", "");
870 /* Hair & Keyed Keys */
872 prop= RNA_def_property(srna, "is_hair", PROP_COLLECTION, PROP_NONE);
873 RNA_def_property_collection_sdna(prop, NULL, "hair", "totkey");
874 RNA_def_property_struct_type(prop, "ParticleHairKey");
875 RNA_def_property_ui_text(prop, "Hair", "");
877 prop= RNA_def_property(srna, "keys", PROP_COLLECTION, PROP_NONE);
878 RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey");
879 RNA_def_property_struct_type(prop, "ParticleKey");
880 RNA_def_property_ui_text(prop, "Keyed States", "");
882 // float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
883 // /* face normal for volume emission */
885 prop= RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
886 RNA_def_property_float_sdna(prop, NULL, "time");
887 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
888 RNA_def_property_ui_text(prop, "Birth Time", "");
890 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
891 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
892 RNA_def_property_ui_text(prop, "Lifetime", "");
894 prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
895 RNA_def_property_float_sdna(prop, NULL, "dietime");
896 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
897 RNA_def_property_ui_text(prop, "Die Time", "");
899 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
900 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
901 RNA_def_property_ui_text(prop, "Size", "");
904 // int num; /* index to vert/edge/face */
905 // int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
911 prop= RNA_def_property(srna, "is_exist", PROP_BOOLEAN, PROP_NONE);
912 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_UNEXIST);
913 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
914 RNA_def_property_ui_text(prop, "Exists", "");
916 prop= RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
917 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_NO_DISP);
918 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
919 RNA_def_property_ui_text(prop, "Visible", "");
921 prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
922 RNA_def_property_enum_sdna(prop, NULL, "alive");
923 RNA_def_property_enum_items(prop, alive_items);
924 RNA_def_property_ui_text(prop, "Alive State", "");
929 static void rna_def_particle_dupliweight(BlenderRNA *brna)
934 srna = RNA_def_struct(brna, "ParticleDupliWeight", NULL);
935 RNA_def_struct_ui_text(srna, "Particle Dupliobject Weight", "Weight of a particle dupliobject in a group");
936 RNA_def_struct_sdna(srna, "ParticleDupliWeight");
938 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
939 RNA_def_property_string_funcs(prop, "rna_ParticleDupliWeight_name_get", "rna_ParticleDupliWeight_name_length", NULL);
940 RNA_def_property_ui_text(prop, "Name", "Particle dupliobject name");
941 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
942 RNA_def_struct_name_property(srna, prop);
944 prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
945 RNA_def_property_range(prop, 0, SHRT_MAX);
946 RNA_def_property_ui_text(prop, "Count", "The number of times this object is repeated with respect to other objects");
947 RNA_def_property_update(prop, 0, "rna_Particle_redo");
950 static void rna_def_fluid_settings(BlenderRNA *brna)
955 srna = RNA_def_struct(brna, "SPHFluidSettings", NULL);
956 RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics");
959 prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
960 RNA_def_property_float_sdna(prop, NULL, "spring_k");
961 RNA_def_property_range(prop, 0.0f, 1.0f);
962 RNA_def_property_ui_text(prop, "Spring", "Spring force constant");
963 RNA_def_property_update(prop, 0, "rna_Particle_reset");
965 prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
966 RNA_def_property_float_sdna(prop, NULL, "radius");
967 RNA_def_property_range(prop, 0.0f, 2.0f);
968 RNA_def_property_ui_text(prop, "Radius", "Fluid interaction Radius");
969 RNA_def_property_update(prop, 0, "rna_Particle_reset");
971 prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
972 RNA_def_property_float_sdna(prop, NULL, "rest_length");
973 RNA_def_property_range(prop, 0.0f, 1.0f);
974 RNA_def_property_ui_text(prop, "Rest Length", "The Spring Rest Length (factor of interaction radius)");
975 RNA_def_property_update(prop, 0, "rna_Particle_reset");
978 prop= RNA_def_property(srna, "viscosity_omega", PROP_FLOAT, PROP_NONE);
979 RNA_def_property_float_sdna(prop, NULL, "viscosity_omega");
980 RNA_def_property_range(prop, 0.0f, 100.0f);
981 RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity");
982 RNA_def_property_update(prop, 0, "rna_Particle_reset");
984 prop= RNA_def_property(srna, "viscosity_beta", PROP_FLOAT, PROP_NONE);
985 RNA_def_property_float_sdna(prop, NULL, "viscosity_beta");
986 RNA_def_property_range(prop, 0.0f, 100.0f);
987 RNA_def_property_ui_text(prop, "Square viscosity", "Square viscosity factor");
988 RNA_def_property_update(prop, 0, "rna_Particle_reset");
990 /* Double density relaxation */
991 prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
992 RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
993 RNA_def_property_range(prop, 0.0f, 100.0f);
994 RNA_def_property_ui_text(prop, "Stiffness ", "Constant K - Stiffness");
995 RNA_def_property_update(prop, 0, "rna_Particle_reset");
997 prop= RNA_def_property(srna, "stiffness_near", PROP_FLOAT, PROP_NONE);
998 RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
999 RNA_def_property_range(prop, 0.0f, 100.0f);
1000 RNA_def_property_ui_text(prop, "Repulsion", "Repulsion factor: stiffness_knear");
1001 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1003 prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
1004 RNA_def_property_float_sdna(prop, NULL, "rest_density");
1005 RNA_def_property_range(prop, 0.0f, 100.0f);
1006 RNA_def_property_ui_text(prop, "Rest Density", "Density");
1007 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1010 prop= RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE);
1011 RNA_def_property_float_sdna(prop, NULL, "buoyancy");
1012 RNA_def_property_range(prop, 0.0f, 1.0f);
1013 RNA_def_property_ui_text(prop, "Buoyancy", "");
1014 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1018 static void rna_def_particle_settings(BlenderRNA *brna)
1023 static EnumPropertyItem type_items[] = {
1024 {PART_EMITTER, "EMITTER", 0, "Emitter", ""},
1025 //{PART_REACTOR, "REACTOR", 0, "Reactor", ""},
1026 {PART_HAIR, "HAIR", 0, "Hair", ""},
1027 {0, NULL, 0, NULL, NULL}
1030 static EnumPropertyItem dist_items[] = {
1031 {PART_DISTR_JIT, "JIT", 0, "Jittered", ""},
1032 {PART_DISTR_RAND, "RAND", 0, "Random", ""},
1033 {PART_DISTR_GRID, "GRID", 0, "Grid", ""},
1034 {0, NULL, 0, NULL, NULL}
1037 static EnumPropertyItem phys_type_items[] = {
1038 {PART_PHYS_NO, "NO", 0, "No", ""},
1039 {PART_PHYS_NEWTON, "NEWTON", 0, "Newtonian", ""},
1040 {PART_PHYS_KEYED, "KEYED", 0, "Keyed", ""},
1041 {PART_PHYS_BOIDS, "BOIDS", 0, "Boids", ""},
1042 {PART_PHYS_FLUID, "FLUID", 0, "Fluid", ""},
1043 {0, NULL, 0, NULL, NULL}
1046 static EnumPropertyItem rot_mode_items[] = {
1047 {0, "NONE", 0, "None", ""},
1048 {PART_ROT_NOR, "NOR", 0, "Normal", ""},
1049 {PART_ROT_VEL, "VEL", 0, "Velocity", ""},
1050 {PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""},
1051 {PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""},
1052 {PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""},
1053 {PART_ROT_OB_X, "OB_X", 0, "Object X", ""},
1054 {PART_ROT_OB_Y, "OB_Y", 0, "Object Y", ""},
1055 {PART_ROT_OB_Z, "OB_Z", 0, "Object Z", ""},
1056 {0, NULL, 0, NULL, NULL}
1059 static EnumPropertyItem ave_mode_items[] = {
1060 {0, "NONE", 0, "None", ""},
1061 {PART_AVE_SPIN, "SPIN", 0, "Spin", ""},
1062 {PART_AVE_RAND, "RAND", 0, "Random", ""} ,
1063 {0, NULL, 0, NULL, NULL}
1066 static EnumPropertyItem react_event_items[] = {
1067 {PART_EVENT_DEATH, "DEATH", 0, "Death", ""},
1068 {PART_EVENT_COLLIDE, "COLLIDE", 0, "Collision", ""},
1069 {PART_EVENT_NEAR, "NEAR", 0, "Near", ""},
1070 {0, NULL, 0, NULL, NULL}
1073 static EnumPropertyItem child_type_items[] = {
1074 {0, "NONE", 0, "None", ""},
1075 {PART_CHILD_PARTICLES, "PARTICLES", 0, "Particles", ""},
1076 {PART_CHILD_FACES, "FACES", 0, "Faces", ""},
1077 {0, NULL, 0, NULL, NULL}
1080 //TODO: names, tooltips
1082 static EnumPropertyItem rot_from_items[] = {
1083 {PART_ROT_KEYS, "KEYS", 0, "keys", ""},
1084 {PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""},
1085 {PART_ROT_IINCR, "IINCR", 0, "iincr", ""},
1086 {0, NULL, 0, NULL, NULL}
1089 static EnumPropertyItem integrator_type_items[] = {
1090 {PART_INT_EULER, "EULER", 0, "Euler", ""},
1091 {PART_INT_VERLET, "VERLET", 0, "Verlet", ""},
1092 {PART_INT_MIDPOINT, "MIDPOINT", 0, "Midpoint", ""},
1093 {PART_INT_RK4, "RK4", 0, "RK4", ""},
1094 {0, NULL, 0, NULL, NULL}
1097 static EnumPropertyItem kink_type_items[] = {
1098 {PART_KINK_NO, "NO", 0, "Nothing", ""},
1099 {PART_KINK_CURL, "CURL", 0, "Curl", ""},
1100 {PART_KINK_RADIAL, "RADIAL", 0, "Radial", ""},
1101 {PART_KINK_WAVE, "WAVE", 0, "Wave", ""},
1102 {PART_KINK_BRAID, "BRAID", 0, "Braid", ""},
1103 {0, NULL, 0, NULL, NULL}
1106 static EnumPropertyItem kink_axis_items[] = {
1107 {0, "X", 0, "X", ""},
1108 {1, "Y", 0, "Y", ""},
1109 {2, "Z", 0, "Z", ""},
1110 {0, NULL, 0, NULL, NULL}
1113 static EnumPropertyItem bb_align_items[] = {
1114 {PART_BB_X, "X", 0, "X", ""},
1115 {PART_BB_Y, "Y", 0, "Y", ""},
1116 {PART_BB_Z, "Z", 0, "Z", ""},
1117 {PART_BB_VIEW, "VIEW", 0, "View", ""},
1118 {PART_BB_VEL, "VEL", 0, "Velocity", ""},
1119 {0, NULL, 0, NULL, NULL}
1122 static EnumPropertyItem bb_anim_items[] = {
1123 {PART_BB_ANIM_NONE, "NONE", 0, "None", ""},
1124 {PART_BB_ANIM_TIME, "TIME", 0, "Time", ""},
1125 {PART_BB_ANIM_ANGLE, "ANGLE", 0, "Angle", ""},
1126 //{PART_BB_ANIM_OFF_TIME, "OFF_TIME", 0, "off_time", ""},
1127 //{PART_BB_ANIM_OFF_ANGLE, "OFF_ANGLE", 0, "off_angle", ""},
1128 {0, NULL, 0, NULL, NULL}
1131 static EnumPropertyItem bb_split_offset_items[] = {
1132 {PART_BB_OFF_NONE, "NONE", 0, "None", ""},
1133 {PART_BB_OFF_LINEAR, "LINEAR", 0, "Linear", ""},
1134 {PART_BB_OFF_RANDOM, "RANDOM", 0, "Random", ""},
1135 {0, NULL, 0, NULL, NULL}
1138 srna= RNA_def_struct(brna, "ParticleSettings", "ID");
1139 RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems");
1140 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
1143 prop= RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
1144 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
1145 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1146 RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually");
1147 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1149 prop= RNA_def_property(srna, "use_react_multiple", PROP_BOOLEAN, PROP_NONE);
1150 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
1151 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1152 RNA_def_property_ui_text(prop, "Multi React", "React multiple times");
1153 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1155 prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
1156 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
1157 RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted");
1158 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1160 prop= RNA_def_property(srna, "use_dead", PROP_BOOLEAN, PROP_NONE);
1161 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
1162 RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
1163 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1165 prop= RNA_def_property(srna, "use_emit_random", PROP_BOOLEAN, PROP_NONE);
1166 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
1167 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1168 RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
1169 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1171 prop= RNA_def_property(srna, "use_even_distribution", PROP_BOOLEAN, PROP_NONE);
1172 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
1173 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1174 RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths");
1175 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1177 prop= RNA_def_property(srna, "use_die_on_collision", PROP_BOOLEAN, PROP_NONE);
1178 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
1179 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1180 RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object");
1181 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1183 prop= RNA_def_property(srna, "use_size_deflect", PROP_BOOLEAN, PROP_NONE);
1184 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
1185 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1186 RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection");
1187 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1189 prop= RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE);
1190 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
1191 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1192 RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant");
1193 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1195 prop= RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE);
1196 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
1197 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1198 RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass by particle size");
1199 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1201 prop= RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE);
1202 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
1203 RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
1204 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1206 prop= RNA_def_property(srna, "use_branching", PROP_BOOLEAN, PROP_NONE);
1207 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING);
1208 RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other");
1209 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1211 prop= RNA_def_property(srna, "use_animate_branching", PROP_BOOLEAN, PROP_NONE);
1212 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING);
1213 RNA_def_property_ui_text(prop, "Animated", "Animate branching");
1214 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1216 prop= RNA_def_property(srna, "use_symmetric_branching", PROP_BOOLEAN, PROP_NONE);
1217 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING);
1218 RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same");
1219 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1221 prop= RNA_def_property(srna, "use_hair_bspline", PROP_BOOLEAN, PROP_NONE);
1222 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
1223 RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines");
1224 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1226 prop= RNA_def_property(srna, "invert_grid", PROP_BOOLEAN, PROP_NONE);
1227 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
1228 RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not");
1229 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1231 prop= RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE);
1232 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
1233 RNA_def_property_ui_text(prop, "Children", "Apply effectors to children");
1234 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1236 //prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
1237 //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
1238 //RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
1239 //RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1241 prop= RNA_def_property(srna, "apply_guide_to_children", PROP_BOOLEAN, PROP_NONE);
1242 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
1243 RNA_def_property_ui_text(prop, "apply_guide_to_children", "");
1244 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1246 prop= RNA_def_property(srna, "use_self_effect", PROP_BOOLEAN, PROP_NONE);
1247 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
1248 RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves");
1249 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1252 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1253 RNA_def_property_enum_items(prop, type_items);
1254 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1255 RNA_def_property_ui_text(prop, "Type", "");
1256 RNA_def_property_update(prop, 0, "rna_Particle_change_type");
1258 prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
1259 RNA_def_property_enum_sdna(prop, NULL, "from");
1260 RNA_def_property_enum_items(prop, part_reactor_from_items);
1261 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1262 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf");
1263 RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from");
1264 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1266 prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
1267 RNA_def_property_enum_sdna(prop, NULL, "distr");
1268 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1269 RNA_def_property_enum_items(prop, dist_items);
1270 RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element");
1271 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1274 prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
1275 RNA_def_property_enum_sdna(prop, NULL, "phystype");
1276 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1277 RNA_def_property_enum_items(prop, phys_type_items);
1278 RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type");
1279 RNA_def_property_update(prop, 0, "rna_Particle_change_physics");
1281 prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
1282 RNA_def_property_enum_sdna(prop, NULL, "rotmode");
1283 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1284 RNA_def_property_enum_items(prop, rot_mode_items);
1285 RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation");
1286 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1288 prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
1289 RNA_def_property_enum_sdna(prop, NULL, "avemode");
1290 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1291 RNA_def_property_enum_items(prop, ave_mode_items);
1292 RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode");
1293 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1295 prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
1296 RNA_def_property_enum_sdna(prop, NULL, "reactevent");
1297 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1298 RNA_def_property_enum_items(prop, react_event_items);
1299 RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on");
1300 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1303 prop= RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
1304 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
1305 RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
1306 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1308 prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
1309 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE);
1310 RNA_def_property_ui_text(prop, "Size", "Show particle size");
1311 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1313 prop= RNA_def_property(srna, "use_render_emitter", PROP_BOOLEAN, PROP_NONE);
1314 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
1315 RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also");
1316 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1318 prop= RNA_def_property(srna, "show_health", PROP_BOOLEAN, PROP_NONE);
1319 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH);
1320 RNA_def_property_ui_text(prop, "Health", "Draw boid health");
1321 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1323 prop= RNA_def_property(srna, "use_absolute_path_time", PROP_BOOLEAN, PROP_NONE);
1324 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME);
1325 RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames");
1326 RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update");
1328 prop= RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE);
1329 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
1330 RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
1331 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1333 prop= RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE);
1334 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
1335 RNA_def_property_ui_text(prop, "Parents", "Render parent particles");
1336 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1338 prop= RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE);
1339 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
1340 RNA_def_property_ui_text(prop, "Number", "Show particle number");
1341 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1343 prop= RNA_def_property(srna, "use_group_pick_random", PROP_BOOLEAN, PROP_NONE);
1344 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
1345 RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
1346 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1348 prop= RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE);
1349 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COUNT_GR);
1350 RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same group");
1351 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1353 prop= RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
1354 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB);
1355 RNA_def_property_ui_text(prop, "Use Global", "Use object's global coordinates for duplication");
1356 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1358 prop= RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
1359 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
1360 RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
1361 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1363 prop= RNA_def_property(srna, "use_velocity_length", PROP_BOOLEAN, PROP_NONE);
1364 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
1365 RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
1366 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1368 prop= RNA_def_property(srna, "show_material_color", PROP_BOOLEAN, PROP_NONE);
1369 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL);
1370 RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color");
1371 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1373 prop= RNA_def_property(srna, "use_whole_group", PROP_BOOLEAN, PROP_NONE);
1374 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
1375 RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once");
1376 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1378 prop= RNA_def_property(srna, "use_strand_primitive", PROP_BOOLEAN, PROP_NONE);
1379 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
1380 RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
1381 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1383 prop= RNA_def_property(srna, "draw_method", PROP_ENUM, PROP_NONE);
1384 RNA_def_property_enum_sdna(prop, NULL, "draw_as");
1385 RNA_def_property_enum_items(prop, part_draw_as_items);
1386 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf");
1387 RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport");
1388 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1390 prop= RNA_def_property(srna, "render_type", PROP_ENUM, PROP_NONE);
1391 RNA_def_property_enum_sdna(prop, NULL, "ren_as");
1392 RNA_def_property_enum_items(prop, part_ren_as_items);
1393 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf");
1394 RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered");
1395 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1397 prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
1398 RNA_def_property_range(prop, 0, 1000);
1399 RNA_def_property_ui_range(prop, 0, 100, 1, 0);
1400 RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)");
1401 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1403 prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
1404 RNA_def_property_enum_sdna(prop, NULL, "childtype");
1405 RNA_def_property_enum_items(prop, child_type_items);
1406 RNA_def_property_ui_text(prop, "Children From", "Create child particles");
1407 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1409 prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
1410 RNA_def_property_range(prop, 0, 7);
1411 RNA_def_property_ui_range(prop, 0, 10, 1, 0);
1412 RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)");
1413 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1415 prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
1416 RNA_def_property_int_sdna(prop, NULL, "ren_step");
1417 RNA_def_property_range(prop, 0, 9);
1418 RNA_def_property_ui_range(prop, 0, 20, 1, 0);
1419 RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)");
1421 prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
1422 RNA_def_property_range(prop, 2, 50);
1423 RNA_def_property_ui_text(prop, "Segments", "Number of hair segments");
1424 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1427 //TODO: not found in UI, readonly?
1428 prop= RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
1429 RNA_def_property_range(prop, 0, SHRT_MAX);//TODO:min,max
1430 RNA_def_property_ui_text(prop, "Keys Step", "");
1432 /* adaptive path rendering */
1433 prop= RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
1434 RNA_def_property_int_sdna(prop, NULL, "adapt_angle");
1435 RNA_def_property_range(prop, 0, 45);
1436 RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
1438 prop= RNA_def_property(srna, "adaptive_pixel", PROP_INT, PROP_NONE);
1439 RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
1440 RNA_def_property_range(prop, 0, 50);
1441 RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
1443 prop= RNA_def_property(srna, "draw_percentage", PROP_INT, PROP_NONE);
1444 RNA_def_property_int_sdna(prop, NULL, "disp");
1445 RNA_def_property_range(prop, 0, 100);
1446 RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3D view");
1447 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1449 prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
1450 RNA_def_property_int_sdna(prop, NULL, "omat");
1451 RNA_def_property_range(prop, 1, 16);
1452 RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles");
1453 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1456 // not used anywhere, why is this in DNA???
1458 prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
1459 RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
1460 RNA_def_property_enum_items(prop, rot_from_items);
1461 RNA_def_property_ui_text(prop, "Rotate From", "");
1464 prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
1465 RNA_def_property_enum_items(prop, integrator_type_items);
1466 RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type");
1467 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1469 prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
1470 RNA_def_property_enum_items(prop, kink_type_items);
1471 RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path");
1472 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1474 prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
1475 RNA_def_property_enum_items(prop, kink_axis_items);
1476 RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
1477 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1480 prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
1481 RNA_def_property_enum_sdna(prop, NULL, "bb_align");
1482 RNA_def_property_enum_items(prop, bb_align_items);
1483 RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned");
1484 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1486 prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
1487 RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
1488 RNA_def_property_range(prop, 1, 100);
1489 RNA_def_property_ui_range(prop, 1, 10, 1, 0);
1490 RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split UV coordinates for billboards");
1492 prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
1493 RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
1494 RNA_def_property_enum_items(prop, bb_anim_items);
1495 RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures");
1497 prop= RNA_def_property(srna, "billboard_offset_split", PROP_ENUM, PROP_NONE);
1498 RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
1499 RNA_def_property_enum_items(prop, bb_split_offset_items);
1500 RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
1502 prop= RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
1503 RNA_def_property_float_sdna(prop, NULL, "bb_tilt");
1504 RNA_def_property_range(prop, -1.0f, 1.0f);
1505 RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
1506 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1508 prop= RNA_def_property(srna, "billboard_tilt_random", PROP_FLOAT, PROP_NONE);
1509 RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
1510 RNA_def_property_range(prop, 0.0f, 1.0f);
1511 RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
1512 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1514 prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
1515 RNA_def_property_float_sdna(prop, NULL, "bb_offset");
1516 RNA_def_property_array(prop, 2);
1517 RNA_def_property_range(prop, -100.0f, 100.0f);
1518 RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
1519 RNA_def_property_ui_text(prop, "Billboard Offset", "");
1520 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1522 /* simplification */
1523 prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
1524 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
1525 RNA_def_property_ui_text(prop, "Child Simplification", "Remove child strands as the object becomes smaller on the screen");
1527 prop= RNA_def_property(srna, "use_simplify_viewport", PROP_BOOLEAN, PROP_NONE);
1528 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
1529 RNA_def_property_ui_text(prop, "Viewport", "");
1531 prop= RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
1532 RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
1533 RNA_def_property_range(prop, 1, 32768);
1534 RNA_def_property_ui_text(prop, "Reference Size", "Reference size in pixels, after which simplification begins");
1536 prop= RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
1537 RNA_def_property_range(prop, 0.0f, 1.0f);
1538 RNA_def_property_ui_text(prop, "Rate", "Speed of simplification");
1540 prop= RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
1541 RNA_def_property_range(prop, 0.0f, 1.0f);
1542 RNA_def_property_ui_text(prop, "Transition", "Transition period for fading out strands");
1544 prop= RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
1545 RNA_def_property_range(prop, 0.0f, 0.999f);
1546 RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
1548 /* general values */
1549 prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
1550 RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same
1551 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1552 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1553 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
1554 RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles");
1555 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1557 prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
1558 RNA_def_property_float_sdna(prop, NULL, "end");
1559 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1561 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1562 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL);
1563 RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles");
1564 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1566 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
1567 RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
1568 RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles");
1569 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1571 prop= RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE);
1572 RNA_def_property_float_sdna(prop, NULL, "randlife");
1573 RNA_def_property_range(prop, 0.0f, 1.0f);
1574 RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation");
1575 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1577 prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
1578 RNA_def_property_float_sdna(prop, NULL, "timetweak");
1579 RNA_def_property_range(prop, 0.0f, 100.0f);
1580 RNA_def_property_ui_range(prop, 0, 10, 1, 3);
1581 RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
1582 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1584 prop= RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
1585 RNA_def_property_range(prop, 0, 1000);
1586 RNA_def_property_ui_text(prop, "Subframes", "Subframes to simulate for improved stability and finer granularity simulations");
1587 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1589 prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
1590 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1591 RNA_def_property_float_sdna(prop, NULL, "jitfac");
1592 RNA_def_property_range(prop, 0.0f, 2.0f);
1593 RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling");
1594 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1596 prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
1597 RNA_def_property_float_sdna(prop, NULL, "eff_hair");
1598 RNA_def_property_range(prop, 0.0f, 1.0f);
1599 RNA_def_property_ui_text(prop, "Stiffness", "Hair stiffness for effectors");
1600 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1602 prop= RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
1603 RNA_def_property_int_sdna(prop, NULL, "totpart");
1604 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1605 /* This limit is for those freaks who have the machine power to handle it. */
1606 /* 10M particles take around 2.2 Gb of memory / disk space in saved file and */
1607 /* each cached frame takes around 0.5 Gb of memory / disk space depending on cache mode. */
1608 RNA_def_property_range(prop, 0, 10000000);
1609 RNA_def_property_ui_range(prop, 0, 100000, 1, 0);
1610 RNA_def_property_ui_text(prop, "Amount", "Total number of particles");
1611 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1613 prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit?
1614 RNA_def_property_int_sdna(prop, NULL, "userjit");
1615 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1616 RNA_def_property_range(prop, 0, 1000);
1617 RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)");
1618 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1620 prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
1621 RNA_def_property_int_sdna(prop, NULL, "grid_res");
1622 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1623 RNA_def_property_range(prop, 1, 46); /* ~100k particles in a cube */
1624 RNA_def_property_ui_range(prop, 1, 215, 1, 0); /* ~10M particles in a cube */
1625 RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid");
1626 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1628 /* initial velocity factors */
1629 prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
1630 RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same
1631 RNA_def_property_range(prop, -1000.0f, 1000.0f);
1632 RNA_def_property_ui_range(prop, 0, 100, 1, 3);
1633 RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed");
1634 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1636 prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
1637 RNA_def_property_float_sdna(prop, NULL, "obfac");
1638 RNA_def_property_range(prop, -200.0f, 200.0f);
1639 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
1640 RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
1641 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1643 prop= RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
1644 RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same
1645 RNA_def_property_range(prop, 0.0f, 200.0f);
1646 RNA_def_property_ui_range(prop, 0, 100, 1, 3);
1647 RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation");
1648 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1650 prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
1651 RNA_def_property_float_sdna(prop, NULL, "partfac");
1652 RNA_def_property_range(prop, -200.0f, 200.0f);
1653 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
1654 RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed");
1655 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1657 prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
1658 RNA_def_property_float_sdna(prop, NULL, "tanfac");
1659 RNA_def_property_range(prop, -1000.0f, 1000.0f);
1660 RNA_def_property_ui_range(prop, -100, 100, 1, 2);
1661 RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed");
1662 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1664 prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
1665 RNA_def_property_float_sdna(prop, NULL, "tanphase");
1666 RNA_def_property_range(prop, -1.0f, 1.0f);
1667 RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent");
1668 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1670 prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
1671 RNA_def_property_float_sdna(prop, NULL, "reactfac");
1672 RNA_def_property_range(prop, -10.0f, 10.0f);
1673 RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed");
1674 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1676 prop= RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY);
1677 RNA_def_property_float_sdna(prop, NULL, "ob_vel");
1678 RNA_def_property_array(prop, 3);
1679 RNA_def_property_range(prop, -200.0f, 200.0f);
1680 RNA_def_property_ui_range(prop, -100, 100, 1, 3);
1681 RNA_def_property_ui_text(prop, "Object Aligned", "Let the emitter object orientation give the particle a starting speed");
1682 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1684 prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
1685 RNA_def_property_float_sdna(prop, NULL, "avefac");
1686 RNA_def_property_range(prop, -200.0f, 200.0f);
1687 RNA_def_property_ui_range(prop, -100, 100, 10, 3);
1688 RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount");
1689 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1691 prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
1692 RNA_def_property_float_sdna(prop, NULL, "phasefac");
1693 RNA_def_property_range(prop, -1.0f, 1.0f);
1694 RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase");
1695 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1697 prop= RNA_def_property(srna, "rotation_factor_random", PROP_FLOAT, PROP_NONE);
1698 RNA_def_property_float_sdna(prop, NULL, "randrotfac");
1699 RNA_def_property_range(prop, 0.0f, 1.0f);
1700 RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation");
1701 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1703 prop= RNA_def_property(srna, "phase_factor_random", PROP_FLOAT, PROP_NONE);
1704 RNA_def_property_float_sdna(prop, NULL, "randphasefac");
1705 RNA_def_property_range(prop, 0.0f, 1.0f);
1706 RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase");
1707 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1709 /* physical properties */
1710 prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
1711 RNA_def_property_range(prop, 0.001f, 100000.0f);
1712 RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
1713 RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles");
1714 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1716 prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
1717 RNA_def_property_float_sdna(prop, NULL, "size");
1718 RNA_def_property_range(prop, 0.001f, 100000.0f);
1719 RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
1720 RNA_def_property_ui_text(prop, "Size", "The size of the particles");
1721 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1723 prop= RNA_def_property(srna, "size_random", PROP_FLOAT, PROP_NONE);
1724 RNA_def_property_float_sdna(prop, NULL, "randsize");
1725 RNA_def_property_range(prop, 0.0f, 1.0f);
1726 RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
1727 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1729 prop= RNA_def_property(srna, "reaction_shape", PROP_FLOAT, PROP_NONE);
1730 RNA_def_property_float_sdna(prop, NULL, "reactshape");
1731 RNA_def_property_range(prop, 0.0f, 10.0f);
1732 RNA_def_property_ui_text(prop, "Shape", "Power of reaction strength dependence on distance to target");
1733 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1736 /* global physical properties */
1737 prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
1738 RNA_def_property_float_sdna(prop, NULL, "dragfac");
1739 RNA_def_property_range(prop, 0.0f, 1.0f);
1740 RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag");
1741 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1743 prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
1744 RNA_def_property_float_sdna(prop, NULL, "brownfac");
1745 RNA_def_property_range(prop, 0.0f, 200.0f);
1746 RNA_def_property_ui_range(prop, 0, 20, 1, 3);
1747 RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of Brownian motion");
1748 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1750 prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
1751 RNA_def_property_float_sdna(prop, NULL, "dampfac");
1752 RNA_def_property_range(prop, 0.0f, 1.0f);
1753 RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping");
1754 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1757 prop= RNA_def_property(srna, "length_random", PROP_FLOAT, PROP_NONE);
1758 RNA_def_property_float_sdna(prop, NULL, "randlength");
1759 RNA_def_property_range(prop, 0.0f, 1.0f);
1760 RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation");
1761 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1764 prop= RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
1765 RNA_def_property_int_sdna(prop, NULL, "child_nbr");//optional if prop names are the same
1766 RNA_def_property_range(prop, 0, 100000);
1767 RNA_def_property_ui_range(prop, 0, 1000, 1, 0);
1768 RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent");
1769 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1771 prop= RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE);
1772 RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr");
1773 RNA_def_property_range(prop, 0, 100000);
1774 RNA_def_property_ui_range(prop, 0, 10000, 1, 0);
1775 RNA_def_property_ui_text(prop, "Rendered Children", "Amount of children/parent for rendering");
1777 prop= RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
1778 RNA_def_property_float_sdna(prop, NULL, "parents");
1779 RNA_def_property_range(prop, 0.0f, 1.0f);
1780 RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents");
1781 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1783 prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
1784 RNA_def_property_float_sdna(prop, NULL, "childsize");
1785 RNA_def_property_range(prop, 0.001f, 100000.0f);
1786 RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
1787 RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size");
1788 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1790 prop= RNA_def_property(srna, "child_size_random", PROP_FLOAT, PROP_NONE);
1791 RNA_def_property_float_sdna(prop, NULL, "childrandsize");
1792 RNA_def_property_range(prop, 0.0f, 1.0f);
1793 RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles");
1794 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1796 prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
1797 RNA_def_property_float_sdna(prop, NULL, "childrad");
1798 RNA_def_property_range(prop, 0.0f, 10.0f);
1799 RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent");
1800 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1802 prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
1803 RNA_def_property_float_sdna(prop, NULL, "childflat");
1804 RNA_def_property_range(prop, 0.0f, 1.0f);
1805 RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent");
1806 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1809 prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
1810 RNA_def_property_float_sdna(prop, NULL, "clumpfac");
1811 RNA_def_property_range(prop, -1.0f, 1.0f);
1812 RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
1813 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1815 prop= RNA_def_property(srna, "clump_shape", PROP_FLOAT, PROP_NONE);
1816 RNA_def_property_float_sdna(prop, NULL, "clumppow");
1817 RNA_def_property_range(prop, -0.999f, 0.999f);
1818 RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
1819 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1823 prop= RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
1824 RNA_def_property_float_sdna(prop, NULL, "kink_amp");
1825 RNA_def_property_range(prop, -100000.0f, 100000.0f);
1826 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
1827 RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
1828 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1830 prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
1831 RNA_def_property_float_sdna(prop, NULL, "kink_freq");
1832 RNA_def_property_range(prop, -100000.0f, 100000.0f);
1833 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
1834 RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
1835 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1837 prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
1838 RNA_def_property_range(prop, -0.999f, 0.999f);
1839 RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
1840 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1844 prop= RNA_def_property(srna, "roughness_1", PROP_FLOAT, PROP_NONE);
1845 RNA_def_property_float_sdna(prop, NULL, "rough1");
1846 RNA_def_property_range(prop, 0.0f, 100000.0f);
1847 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1848 RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough");
1849 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1851 prop= RNA_def_property(srna, "roughness_1_size", PROP_FLOAT, PROP_NONE);
1852 RNA_def_property_float_sdna(prop, NULL, "rough1_size");
1853 RNA_def_property_range(prop, 0.01f, 100000.0f);
1854 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
1855 RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough");
1856 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1858 prop= RNA_def_property(srna, "roughness_2", PROP_FLOAT, PROP_NONE);
1859 RNA_def_property_float_sdna(prop, NULL, "rough2");
1860 RNA_def_property_range(prop, 0.0f, 100000.0f);
1861 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1862 RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough");
1863 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1865 prop= RNA_def_property(srna, "roughness_2_size", PROP_FLOAT, PROP_NONE);
1866 RNA_def_property_float_sdna(prop, NULL, "rough2_size");
1867 RNA_def_property_range(prop, 0.01f, 100000.0f);
1868 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
1869 RNA_def_property_ui_text(prop, "Size2", "Size of random rough");
1870 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1872 prop= RNA_def_property(srna, "roughness_2_threshold", PROP_FLOAT, PROP_NONE);
1873 RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
1874 RNA_def_property_range(prop, 0.0f, 1.0f);
1875 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough");
1876 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1878 prop= RNA_def_property(srna, "roughness_endpoint", PROP_FLOAT, PROP_NONE);
1879 RNA_def_property_float_sdna(prop, NULL, "rough_end");
1880 RNA_def_property_range(prop, 0.0f, 100000.0f);
1881 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1882 RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough");
1883 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1885 prop= RNA_def_property(srna, "roughness_end_shape", PROP_FLOAT, PROP_NONE);
1886 RNA_def_property_float_sdna(prop, NULL, "rough_end_shape");
1887 RNA_def_property_range(prop, 0.0f, 10.0f);
1888 RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
1889 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1891 prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
1892 RNA_def_property_float_sdna(prop, NULL, "clength");
1893 RNA_def_property_range(prop, 0.0f, 1.0f);
1894 RNA_def_property_ui_text(prop, "Length", "Length of child paths");
1895 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1897 prop= RNA_def_property(srna, "child_length_threshold", PROP_FLOAT, PROP_NONE);
1898 RNA_def_property_float_sdna(prop, NULL, "clength_thres");
1899 RNA_def_property_range(prop, 0.0f, 1.0f);
1900 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length");
1901 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1904 prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
1905 RNA_def_property_float_sdna(prop, NULL, "branch_thres");
1906 RNA_def_property_range(prop, 0.0f, 1.0f);
1907 RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching");
1908 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1911 prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
1912 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL);
1913 RNA_def_property_range(prop, 0.0f, 100000.0f);
1914 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1915 RNA_def_property_ui_text(prop, "Back", "Length of the line's tail");
1916 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1918 prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
1919 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL);
1920 RNA_def_property_range(prop, 0.0f, 100000.0f);
1921 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1922 RNA_def_property_ui_text(prop, "Head", "Length of the line's head");
1923 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1925 prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE);
1926 RNA_def_property_float_sdna(prop, NULL, "path_start");
1927 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
1928 RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path");
1929 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1931 prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE);
1932 RNA_def_property_float_sdna(prop, NULL, "path_end");
1933 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
1934 RNA_def_property_ui_text(prop, "Path End", "End time of drawn path");
1935 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1937 prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE);
1938 RNA_def_property_int_sdna(prop, NULL, "trail_count");
1939 RNA_def_property_range(prop, 1, 100000);
1940 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
1941 RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles");
1942 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1944 /* keyed particles */
1945 prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE);
1946 RNA_def_property_int_sdna(prop, NULL, "keyed_loops");
1947 RNA_def_property_range(prop, 1.0f, 10000.0f);
1948 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3);
1949 RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped");
1950 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1953 prop= RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE);
1954 RNA_def_property_struct_type(prop, "BoidSettings");
1955 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1956 RNA_def_property_ui_text(prop, "Boid Settings", "");
1958 /* Fluid particles */
1959 prop= RNA_def_property(srna, "fluid", PROP_POINTER, PROP_NONE);
1960 RNA_def_property_struct_type(prop, "SPHFluidSettings");
1961 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1962 RNA_def_property_ui_text(prop, "SPH Fluid Settings", "");
1964 /* draw objects & groups */
1965 prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
1966 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
1967 RNA_def_property_struct_type(prop, "Group");
1968 RNA_def_property_flag(prop, PROP_EDITABLE);
1969 RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
1970 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1972 prop= RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE);
1973 RNA_def_property_collection_sdna(prop, NULL, "dupliweights", NULL);
1974 RNA_def_property_struct_type(prop, "ParticleDupliWeight");
1975 RNA_def_property_ui_text(prop, "Dupli Group Weights", "Weights for all of the objects in the dupli group");
1977 prop= RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
1978 RNA_def_property_struct_type(prop, "ParticleDupliWeight");
1979 RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL, NULL);
1980 RNA_def_property_ui_text(prop, "Active Dupli Object", "");
1982 prop= RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
1983 RNA_def_property_int_funcs(prop, "rna_ParticleDupliWeight_active_index_get", "rna_ParticleDupliWeight_active_index_set", "rna_ParticleDupliWeight_active_index_range");
1984 RNA_def_property_ui_text(prop, "Active Dupli Object Index", "");
1986 prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
1987 RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
1988 RNA_def_property_struct_type(prop, "Object");
1989 RNA_def_property_flag(prop, PROP_EDITABLE);
1990 RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles");
1991 RNA_def_property_update(prop, 0, "rna_Particle_redo_dependency");
1993 prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
1994 RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
1995 RNA_def_property_struct_type(prop, "Object");
1996 RNA_def_property_flag(prop, PROP_EDITABLE);
1997 RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
1998 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2000 prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
2001 RNA_def_property_struct_type(prop, "EffectorWeights");
2002 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2003 RNA_def_property_ui_text(prop, "Effector Weights", "");
2005 /* animation here? */
2006 rna_def_animdata_common(srna);
2008 prop= RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
2009 RNA_def_property_pointer_sdna(prop, NULL, "pd");
2010 RNA_def_property_struct_type(prop, "FieldSettings");
2011 RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL, NULL);
2012 RNA_def_property_ui_text(prop, "Force Field 1", "");
2014 prop= RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
2015 RNA_def_property_pointer_sdna(prop, NULL, "pd2");
2016 RNA_def_property_struct_type(prop, "FieldSettings");
2017 RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL, NULL);
2018 RNA_def_property_ui_text(prop, "Force Field 2", "");
2021 static void rna_def_particle_target(BlenderRNA *brna)
2026 static EnumPropertyItem mode_items[] = {
2027 {PTARGET_MODE_FRIEND, "FRIEND", 0, "Friend", ""},
2028 {PTARGET_MODE_NEUTRAL, "NEUTRAL", 0, "Neutral", ""},
2029 {PTARGET_MODE_ENEMY, "ENEMY", 0, "Enemy", ""},
2030 {0, NULL, 0, NULL, NULL}
2034 srna = RNA_def_struct(brna, "ParticleTarget", NULL);
2035 RNA_def_struct_ui_text(srna, "Particle Target", "Target particle system");
2037 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2038 RNA_def_property_string_funcs(prop, "rna_ParticleTarget_name_get", "rna_ParticleTarget_name_length", NULL);
2039 RNA_def_property_ui_text(prop, "Name", "Particle target name");
2040 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2041 RNA_def_struct_name_property(srna, prop);
2043 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
2044 RNA_def_property_pointer_sdna(prop, NULL, "ob");
2045 RNA_def_property_flag(prop, PROP_EDITABLE);
2046 RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object)");
2047 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2049 prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED);
2050 RNA_def_property_int_sdna(prop, NULL, "psys");
2051 RNA_def_property_range(prop, 1, INT_MAX);
2052 RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object");
2053 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2055 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
2056 RNA_def_property_float_sdna(prop, NULL, "time");
2057 RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
2058 RNA_def_property_ui_text(prop, "Time", "");
2059 RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
2061 prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE);
2062 RNA_def_property_float_sdna(prop, NULL, "duration");
2063 RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
2064 RNA_def_property_ui_text(prop, "Duration", "");
2065 RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
2067 prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
2068 RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID);
2069 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2070 RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid");
2072 prop= RNA_def_property(srna, "alliance", PROP_ENUM, PROP_NONE);
2073 RNA_def_property_enum_sdna(prop, NULL, "mode");
2074 RNA_def_property_enum_items(prop, mode_items);
2075 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2076 RNA_def_property_ui_text(prop, "Mode", "");
2077 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2080 static void rna_def_particle_system(BlenderRNA *brna)
2085 srna= RNA_def_struct(brna, "ParticleSystem", NULL);
2086 RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object");
2087 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
2089 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2090 RNA_def_property_ui_text(prop, "Name", "Particle system name");
2091 RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
2092 RNA_def_struct_name_property(srna, prop);
2094 /* access to particle settings is redirected through functions */
2095 /* to allow proper id-buttons functionality */
2096 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
2097 //RNA_def_property_pointer_sdna(prop, NULL, "part");
2098 RNA_def_property_struct_type(prop, "ParticleSettings");
2099 RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
2100 RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL);
2101 RNA_def_property_ui_text(prop, "Settings", "Particle system settings");
2102 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2104 prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
2105 RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart");
2106 RNA_def_property_struct_type(prop, "Particle");
2107 RNA_def_property_ui_text(prop, "Particles", "Particles generated by the particle system");
2109 prop= RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
2110 RNA_def_property_collection_sdna(prop, NULL, "child", "totchild");
2111 RNA_def_property_struct_type(prop, "ChildParticle");
2112 RNA_def_property_ui_text(prop, "Child Particles", "Child particles generated by the particle system");
2114 prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
2115 RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result");
2116 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2119 prop= RNA_def_property(srna, "is_global_hair", PROP_BOOLEAN, PROP_NONE);
2120 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR);
2121 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2122 RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space");
2124 prop= RNA_def_property(srna, "use_hair_dynamics", PROP_BOOLEAN, PROP_NONE);
2125 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_HAIR_DYNAMICS);
2126 RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation");
2127 RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
2129 prop= RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
2130 RNA_def_property_pointer_sdna(prop, NULL, "clmd");
2131 RNA_def_property_struct_type(prop, "ClothModifier");
2132 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2133 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2134 RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair");
2137 prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
2138 RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
2139 RNA_def_property_flag(prop, PROP_EDITABLE);
2140 RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object)");
2141 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2143 prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
2144 RNA_def_property_int_sdna(prop, NULL, "target_psys");
2145 RNA_def_property_range(prop, 1, SHRT_MAX);
2146 RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object");
2147 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2150 prop= RNA_def_property(srna, "use_keyed_timing", PROP_BOOLEAN, PROP_NONE);
2151 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING);
2152 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2153 RNA_def_property_ui_text(prop, "Keyed timing", "Use key times");
2154 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2156 prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
2157 RNA_def_property_struct_type(prop, "ParticleTarget");
2158 RNA_def_property_ui_text(prop, "Targets", "Target particle systems");
2160 prop= RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
2161 RNA_def_property_struct_type(prop, "ParticleTarget");
2162 RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL, NULL);
2163 RNA_def_property_ui_text(prop, "Active Particle Target", "");
2165 prop= RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
2166 RNA_def_property_int_funcs(prop, "rna_ParticleSystem_active_particle_target_index_get", "rna_ParticleSystem_active_particle_target_index_set", "rna_ParticleSystem_active_particle_target_index_range");
2167 RNA_def_property_ui_text(prop, "Active Particle Target Index", "");
2171 prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
2172 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
2173 RNA_def_property_string_maxlength(prop, 32);
2174 RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV Layer to control billboard normals");
2176 prop= RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
2177 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
2178 RNA_def_property_string_maxlength(prop, 32);
2179 RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV Layer to control billboard time index (X-Y)");
2181 prop= RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
2182 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");
2183 RNA_def_property_string_maxlength(prop, 32);
2184 RNA_def_property_ui_text(prop, "Billboard Split UV", "UV Layer to control billboard splitting");
2188 /* note, internally store as ints, access as strings */
2189 #if 0 // int access. works ok but isnt useful for the UI
2190 prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
2191 RNA_def_property_int_sdna(prop, NULL, "vgroup[0]");
2192 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
2193 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2196 prop= RNA_def_property(srna, "vertex_group_density", PROP_STRING, PROP_NONE);
2197 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_0", "rna_ParticleVGroup_name_len_0", "rna_ParticleVGroup_name_set_0");
2198 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
2199 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2201 prop= RNA_def_property(srna, "invert_vertex_group_density", PROP_BOOLEAN, PROP_NONE);
2202 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
2203 RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group");
2204 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2206 prop= RNA_def_property(srna, "vertex_group_velocity", PROP_STRING, PROP_NONE);
2207 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_1", "rna_ParticleVGroup_name_len_1", "rna_ParticleVGroup_name_set_1");
2208 RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity");
2209 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2211 prop= RNA_def_property(srna, "invert_vertex_group_velocity", PROP_BOOLEAN, PROP_NONE);
2212 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
2213 RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group");
2214 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2216 prop= RNA_def_property(srna, "vertex_group_length", PROP_STRING, PROP_NONE);
2217 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_2", "rna_ParticleVGroup_name_len_2", "rna_ParticleVGroup_name_set_2");
2218 RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length");
2219 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2221 prop= RNA_def_property(srna, "invert_vertex_group_length", PROP_BOOLEAN, PROP_NONE);
2222 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
2223 RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group");
2224 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2226 prop= RNA_def_property(srna, "vertex_group_clump", PROP_STRING, PROP_NONE);
2227 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_3", "rna_ParticleVGroup_name_len_3", "rna_ParticleVGroup_name_set_3");
2228 RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump");
2229 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2231 prop= RNA_def_property(srna, "invert_vertex_group_clump", PROP_BOOLEAN, PROP_NONE);
2232 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
2233 RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group");
2234 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2236 prop= RNA_def_property(srna, "vertex_group_kink", PROP_STRING, PROP_NONE);
2237 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_4", "rna_ParticleVGroup_name_len_4", "rna_ParticleVGroup_name_set_4");
2238 RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink");
2239 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2241 prop= RNA_def_property(srna, "invert_vertex_group_kink", PROP_BOOLEAN, PROP_NONE);
2242 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
2243 RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group");
2244 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2246 prop= RNA_def_property(srna, "vertex_group_roughness_1", PROP_STRING, PROP_NONE);
2247 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_5", "rna_ParticleVGroup_name_len_5", "rna_ParticleVGroup_name_set_5");
2248 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1");
2249 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2251 prop= RNA_def_property(srna, "invert_vertex_group_roughness_1", PROP_BOOLEAN, PROP_NONE);
2252 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
2253 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group");
2254 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2256 prop= RNA_def_property(srna, "vertex_group_roughness_2", PROP_STRING, PROP_NONE);
2257 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_6", "rna_ParticleVGroup_name_len_6", "rna_ParticleVGroup_name_set_6");
2258 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2");
2259 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2261 prop= RNA_def_property(srna, "invert_vertex_group_roughness_2", PROP_BOOLEAN, PROP_NONE);
2262 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
2263 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group");
2264 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2266 prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_STRING, PROP_NONE);
2267 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_7", "rna_ParticleVGroup_name_len_7", "rna_ParticleVGroup_name_set_7");
2268 RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end");
2269 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2271 prop= RNA_def_property(srna, "invert_vertex_group_roughness_end", PROP_BOOLEAN, PROP_NONE);
2272 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
2273 RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group");
2274 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2276 prop= RNA_def_property(srna, "vertex_group_size", PROP_STRING, PROP_NONE);
2277 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_8", "rna_ParticleVGroup_name_len_8", "rna_ParticleVGroup_name_set_8");
2278 RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size");
2279 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2281 prop= RNA_def_property(srna, "invert_vertex_group_size", PROP_BOOLEAN, PROP_NONE);
2282 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
2283 RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group");
2284 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2286 prop= RNA_def_property(srna, "vertex_group_tangent", PROP_STRING, PROP_NONE);
2287 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_9", "rna_ParticleVGroup_name_len_9", "rna_ParticleVGroup_name_set_9");
2288 RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent");
2289 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2291 prop= RNA_def_property(srna, "invert_vertex_group_tangent", PROP_BOOLEAN, PROP_NONE);
2292 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
2293 RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group");
2294 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2296 prop= RNA_def_property(srna, "vertex_group_rotation", PROP_STRING, PROP_NONE);
2297 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_10", "rna_ParticleVGroup_name_len_10", "rna_ParticleVGroup_name_set_10");
2298 RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation");
2299 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2301 prop= RNA_def_property(srna, "invert_vertex_group_rotation", PROP_BOOLEAN, PROP_NONE);
2302 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
2303 RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group");
2304 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2306 prop= RNA_def_property(srna, "vertex_group_field", PROP_STRING, PROP_NONE);
2307 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_11", "rna_ParticleVGroup_name_len_11", "rna_ParticleVGroup_name_set_11");
2308 RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field");
2309 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2311 prop= RNA_def_property(srna, "invert_vertex_group_field", PROP_BOOLEAN, PROP_NONE);
2312 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
2313 RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group");
2314 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2317 prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
2318 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2319 RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
2320 RNA_def_property_struct_type(prop, "PointCache");
2321 RNA_def_property_ui_text(prop, "Point Cache", "");
2323 prop= RNA_def_property(srna, "has_multiple_caches", PROP_BOOLEAN, PROP_NONE);
2324 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL);
2325 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2326 RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches");
2329 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
2330 RNA_def_property_pointer_sdna(prop, NULL, "parent");
2331 RNA_def_property_flag(prop, PROP_EDITABLE);
2332 RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system");
2333 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2335 /* hair or cache editing */
2336 prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
2337 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL);
2338 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2339 RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode");
2341 prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
2342 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL);
2343 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2344 RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
2347 void RNA_def_particle(BlenderRNA *brna)
2349 rna_def_particle_target(brna);
2351 rna_def_particle_hair_key(brna);
2352 rna_def_particle_key(brna);
2353 rna_def_fluid_settings(brna);
2355 rna_def_child_particle(brna);
2356 rna_def_particle(brna);
2357 rna_def_particle_dupliweight(brna);
2358 rna_def_particle_system(brna);
2359 rna_def_particle_settings(brna);