2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Blender Foundation (2008).
21 * Copyright 2011 AutoCRC
23 * ***** END GPL LICENSE BLOCK *****
26 /** \file blender/makesrna/intern/rna_particle.c
35 #include "RNA_define.h"
36 #include "RNA_enum_types.h"
38 #include "rna_internal.h"
40 #include "DNA_material_types.h"
41 #include "DNA_meshdata_types.h"
42 #include "DNA_modifier_types.h"
43 #include "DNA_cloth_types.h"
44 #include "DNA_particle_types.h"
45 #include "DNA_object_force.h"
46 #include "DNA_object_types.h"
47 #include "DNA_scene_types.h"
48 #include "DNA_boid_types.h"
49 #include "DNA_texture_types.h"
54 EnumPropertyItem part_from_items[] = {
55 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
56 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
57 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
58 {0, NULL, 0, NULL, NULL}
61 EnumPropertyItem part_reactor_from_items[] = {
62 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
63 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
64 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
65 {0, NULL, 0, NULL, NULL}
68 EnumPropertyItem part_dist_items[] = {
69 {PART_DISTR_JIT, "JIT", 0, "Jittered", ""},
70 {PART_DISTR_RAND, "RAND", 0, "Random", ""},
71 {PART_DISTR_GRID, "GRID", 0, "Grid", ""},
72 {0, NULL, 0, NULL, NULL}
75 EnumPropertyItem part_hair_dist_items[] = {
76 {PART_DISTR_JIT, "JIT", 0, "Jittered", ""},
77 {PART_DISTR_RAND, "RAND", 0, "Random", ""},
78 {0, NULL, 0, NULL, NULL}
81 EnumPropertyItem part_draw_as_items[] = {
82 {PART_DRAW_NOT, "NONE", 0, "None", ""},
83 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
84 {PART_DRAW_DOT, "DOT", 0, "Point", ""},
85 {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""},
86 {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""},
87 {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""},
88 {0, NULL, 0, NULL, NULL}
91 EnumPropertyItem part_hair_draw_as_items[] = {
92 {PART_DRAW_NOT, "NONE", 0, "None", ""},
93 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
94 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
95 {0, NULL, 0, NULL, NULL}
98 EnumPropertyItem part_ren_as_items[] = {
99 {PART_DRAW_NOT, "NONE", 0, "None", ""},
100 {PART_DRAW_HALO, "HALO", 0, "Halo", ""},
101 {PART_DRAW_LINE, "LINE", 0, "Line", ""},
102 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
103 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
104 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
105 {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""},
106 {0, NULL, 0, NULL, NULL}
109 EnumPropertyItem part_hair_ren_as_items[] = {
110 {PART_DRAW_NOT, "NONE", 0, "None", ""},
111 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
112 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
113 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
114 {0, NULL, 0, NULL, NULL}
119 #include "BLI_math.h"
121 #include "BKE_context.h"
122 #include "BKE_cloth.h"
123 #include "BKE_deform.h"
124 #include "BKE_depsgraph.h"
125 #include "BKE_DerivedMesh.h"
126 #include "BKE_cdderivedmesh.h"
127 #include "BKE_effect.h"
128 #include "BKE_modifier.h"
129 #include "BKE_particle.h"
130 #include "BKE_pointcache.h"
131 #include "BKE_texture.h"
133 /* use for object space hair get/set */
134 static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSystemModifierData **psmd_pt,
135 ParticleData **pa_pt)
137 HairKey *hkey = (HairKey *)ptr->data;
138 Object *ob = (Object *)ptr->id.data;
140 ParticleSystemModifierData *psmd = NULL;
141 ParticleSystem *psys;
148 /* given the pointer HairKey *hkey, we iterate over all particles in all
149 * particle systems in the object "ob" in order to find
150 * - the ParticleSystemData to which the HairKey (and hence the particle)
151 * belongs (will be stored in psmd_pt)
152 * - the ParticleData to which the HairKey belongs (will be stored in pa_pt)
154 * not a very efficient way of getting hair key location data,
155 * but it's the best we've got at the present
157 * IDEAS: include additional information in pointerRNA beforehand,
158 * for example a pointer to the ParticleStstemModifierData to which the
162 for (md = ob->modifiers.first; md; md = md->next) {
163 if (md->type == eModifierType_ParticleSystem) {
164 psmd = (ParticleSystemModifierData *) md;
165 if (psmd && psmd->dm && psmd->psys) {
167 for (i = 0, pa = psys->particles; i < psys->totpart; i++, pa++) {
168 /* hairkeys are stored sequentially in memory, so we can
169 * find if it's the same particle by comparing pointers,
170 * without having to iterate over them all */
171 if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey)) {
182 static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values)
184 HairKey *hkey = (HairKey *)ptr->data;
185 Object *ob = (Object *)ptr->id.data;
186 ParticleSystemModifierData *psmd;
189 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
192 DerivedMesh *hairdm = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_dm : NULL;
195 MVert *mvert = CDDM_get_vert(hairdm, pa->hair_index + (hkey - pa->hair));
196 copy_v3_v3(values, mvert->co);
200 psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
201 copy_v3_v3(values, hkey->co);
202 mul_m4_v3(hairmat, values);
210 static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float *values)
212 HairKey *hkey = (HairKey *)ptr->data;
213 Object *ob = (Object *)ptr->id.data;
214 ParticleSystemModifierData *psmd;
217 rna_ParticleHairKey_location_object_info(ptr, &psmd, &pa);
220 DerivedMesh *hairdm = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_dm : NULL;
223 MVert *mvert = CDDM_get_vert(hairdm, pa->hair_index + (hkey - pa->hair));
224 copy_v3_v3(mvert->co, values);
230 psys_mat_hair_to_object(ob, psmd->dm, psmd->psys->part->from, pa, hairmat);
231 invert_m4_m4(imat, hairmat);
232 copy_v3_v3(hkey->co, values);
233 mul_m4_v3(imat, hkey->co);
241 /* property update functions */
242 static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag)
244 if (ptr->type == &RNA_ParticleSystem) {
245 ParticleSystem *psys = (ParticleSystem *)ptr->data;
249 DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
252 DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | flag);
254 WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
256 static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
258 particle_recalc(bmain, scene, ptr, PSYS_RECALC_REDO);
261 static void rna_Particle_redo_dependency(Main *bmain, Scene *scene, PointerRNA *ptr)
263 DAG_scene_sort(bmain, scene);
264 rna_Particle_redo(bmain, scene, ptr);
267 static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
269 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET);
272 static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr)
274 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_TYPE);
277 static void rna_Particle_change_physics(Main *bmain, Scene *scene, PointerRNA *ptr)
279 particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_PHYS);
282 static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr)
284 particle_recalc(bmain, scene, ptr, PSYS_RECALC_CHILD);
287 static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget *target)
289 ParticleSystem *psys;
292 for (psys = ob->particlesystem.first; psys; psys = psys->next)
293 for (pt = psys->targets.first; pt; pt = pt->next)
300 static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
302 if (ptr->type == &RNA_ParticleTarget) {
303 Object *ob = (Object *)ptr->id.data;
304 ParticleTarget *pt = (ParticleTarget *)ptr->data;
305 ParticleSystem *kpsys = NULL, *psys = rna_particle_system_for_target(ob, pt);
307 if (pt->ob == ob || pt->ob == NULL) {
308 kpsys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
311 pt->flag |= PTARGET_VALID;
313 pt->flag &= ~PTARGET_VALID;
317 kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
320 pt->flag |= PTARGET_VALID;
322 pt->flag &= ~PTARGET_VALID;
325 psys->recalc = PSYS_RECALC_RESET;
327 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
328 DAG_scene_sort(bmain, scene);
331 WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
334 static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
336 if (ptr->type == &RNA_ParticleTarget) {
337 Object *ob = (Object *)ptr->id.data;
338 ParticleTarget *pt = (ParticleTarget *)ptr->data;
339 ParticleSystem *psys = rna_particle_system_for_target(ob, pt);
341 psys->recalc = PSYS_RECALC_REDO;
343 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
344 WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
348 static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *ptr)
350 Object *ob = (Object *)ptr->id.data;
351 ParticleSystem *psys = (ParticleSystem *)ptr->data;
353 if (psys && !psys->clmd) {
354 psys->clmd = (ClothModifierData *)modifier_new(eModifierType_Cloth);
355 psys->clmd->sim_parms->goalspring = 0.0f;
356 psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL | CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
357 psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF;
358 rna_Particle_redo(bmain, scene, ptr);
361 WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
363 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
365 static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
367 ParticleSystem *psys = (ParticleSystem *)ptr->data;
368 ParticleSettings *part = psys->part;
370 return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
373 static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
375 ParticleSystem *psys = (ParticleSystem *)ptr->data;
380 old_type = psys->part->type;
384 psys->part = (ParticleSettings *)value.data;
388 psys_check_boid_data(psys);
389 if (old_type != psys->part->type)
390 psys->recalc |= PSYS_RECALC_TYPE;
393 static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr)
395 ParticleSettings *settings = (ParticleSettings *)ptr->data;
396 float delta = settings->end + settings->lifetime - settings->sta;
397 if (settings->draw & PART_ABS_PATH_TIME) {
398 settings->path_start = settings->sta + settings->path_start * delta;
399 settings->path_end = settings->sta + settings->path_end * delta;
402 settings->path_start = (settings->path_start - settings->sta) / delta;
403 settings->path_end = (settings->path_end - settings->sta) / delta;
405 rna_Particle_redo(bmain, scene, ptr);
407 static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
409 ParticleSettings *settings = (ParticleSettings *)ptr->data;
411 /* check for clipping */
412 if (value > settings->end)
413 value = settings->end;
415 /*if (settings->type==PART_REACTOR && value < 1.0) */
418 if (value < MINAFRAMEF)
421 settings->sta = value;
424 static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
426 ParticleSettings *settings = (ParticleSettings *)ptr->data;
428 /* check for clipping */
429 if (value < settings->sta)
430 value = settings->sta;
432 settings->end = value;
435 static void rna_PartSetings_timestep_set(struct PointerRNA *ptr, float value)
437 ParticleSettings *settings = (ParticleSettings *)ptr->data;
439 settings->timetweak = value / 0.04f;
442 static float rna_PartSettings_timestep_get(struct PointerRNA *ptr)
444 ParticleSettings *settings = (ParticleSettings *)ptr->data;
446 return settings->timetweak * 0.04f;
449 static void rna_PartSetting_hairlength_set(struct PointerRNA *ptr, float value)
451 ParticleSettings *settings = (ParticleSettings *)ptr->data;
452 settings->normfac = value / 4.f;
455 static float rna_PartSetting_hairlength_get(struct PointerRNA *ptr)
457 ParticleSettings *settings = (ParticleSettings *)ptr->data;
458 return settings->normfac * 4.f;
461 static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value)
463 ParticleSettings *settings = (ParticleSettings *)ptr->data;
464 settings->draw_line[0] = value;
467 static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
469 ParticleSettings *settings = (ParticleSettings *)ptr->data;
470 return settings->draw_line[0];
472 static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
474 ParticleSettings *settings = (ParticleSettings *)ptr->data;
476 if (settings->type == PART_HAIR) {
478 *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0f;
481 *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f;
482 *max = (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f;
485 static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
487 ParticleSettings *settings = (ParticleSettings *)ptr->data;
488 settings->draw_line[1] = value;
491 static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
493 ParticleSettings *settings = (ParticleSettings *)ptr->data;
494 return settings->draw_line[1];
498 static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
500 ParticleSettings *part = (ParticleSettings *)ptr->data;
502 return part->type == PART_FLUID;
505 static void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
507 Object *ob = ptr->id.data;
508 ParticleSystem *part = (ParticleSystem *)ptr->data;
510 /* copy the new name into the name slot */
511 BLI_strncpy_utf8(part->name, value, sizeof(part->name));
513 BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name),
517 static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
519 ParticleSystem *psys = (ParticleSystem *)ptr->data;
520 ParticleTarget *pt = psys->targets.first;
522 for (; pt; pt = pt->next) {
523 if (pt->flag & PTARGET_CURRENT)
524 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, pt);
526 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
528 static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max,
529 int *softmin, int *softmax)
531 ParticleSystem *psys = (ParticleSystem *)ptr->data;
533 *max = max_ii(0, BLI_countlist(&psys->targets) - 1);
536 static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
538 ParticleSystem *psys = (ParticleSystem *)ptr->data;
539 ParticleTarget *pt = psys->targets.first;
542 for (; pt; pt = pt->next, i++)
543 if (pt->flag & PTARGET_CURRENT)
549 static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value)
551 ParticleSystem *psys = (ParticleSystem *)ptr->data;
552 ParticleTarget *pt = psys->targets.first;
555 for (; pt; pt = pt->next, i++) {
557 pt->flag |= PTARGET_CURRENT;
559 pt->flag &= ~PTARGET_CURRENT;
562 static int rna_ParticleTarget_name_length(PointerRNA *ptr)
564 ParticleTarget *pt = ptr->data;
566 if (pt->flag & PTARGET_VALID) {
567 ParticleSystem *psys = NULL;
570 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
572 Object *ob = (Object *) ptr->id.data;
573 psys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
578 return strlen(pt->ob->id.name + 2) + 2 + strlen(psys->name);
580 return strlen(psys->name);
589 static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
591 ParticleTarget *pt = ptr->data;
593 if (pt->flag & PTARGET_VALID) {
594 ParticleSystem *psys = NULL;
597 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
599 Object *ob = (Object *) ptr->id.data;
600 psys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
605 sprintf(str, "%s: %s", pt->ob->id.name + 2, psys->name);
607 strcpy(str, psys->name);
610 strcpy(str, "Invalid target!");
613 strcpy(str, "Invalid target!");
616 static int particle_id_check(PointerRNA *ptr)
618 ID *id = ptr->id.data;
620 return (GS(id->name) == ID_PA);
623 static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
625 SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data;
627 if (particle_id_check(ptr)) {
628 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
630 if (part->fluid == fluid)
631 return BLI_sprintfN("fluid");
636 static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr)
638 ParticleSystem *psys = (ParticleSystem *)ptr->data;
640 return (psys->ptcaches.first != psys->ptcaches.last);
642 static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
644 ParticleSystem *psys = (ParticleSystem *)ptr->data;
646 return psys_check_edited(psys);
648 static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
650 ParticleSystem *psys = (ParticleSystem *)ptr->data;
652 if (psys->part && psys->part->type == PART_HAIR)
653 return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited));
655 return (psys->pointcache->edit && psys->pointcache->edit->edited);
657 static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
659 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
660 ParticleDupliWeight *dw = part->dupliweights.first;
662 for (; dw; dw = dw->next) {
663 if (dw->flag & PART_DUPLIW_CURRENT)
664 return rna_pointer_inherit_refine(ptr, &RNA_ParticleDupliWeight, dw);
666 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
668 static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
670 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
672 *max = max_ii(0, BLI_countlist(&part->dupliweights) - 1);
675 static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
677 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
678 ParticleDupliWeight *dw = part->dupliweights.first;
681 for (; dw; dw = dw->next, i++)
682 if (dw->flag & PART_DUPLIW_CURRENT)
688 static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value)
690 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
691 ParticleDupliWeight *dw = part->dupliweights.first;
694 for (; dw; dw = dw->next, i++) {
696 dw->flag |= PART_DUPLIW_CURRENT;
698 dw->flag &= ~PART_DUPLIW_CURRENT;
702 static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str);
704 static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
707 rna_ParticleDupliWeight_name_get(ptr, tstr);
711 static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
713 ParticleDupliWeight *dw = ptr->data;
716 sprintf(str, "%s: %i", dw->ob->id.name + 2, dw->count);
718 strcpy(str, "No object");
721 static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
722 PropertyRNA *UNUSED(prop), int *UNUSED(free))
724 /*if (part->type==PART_REACTOR) */
725 /* return part_reactor_from_items; */
727 return part_from_items;
730 static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr,
731 PropertyRNA *UNUSED(prop), int *UNUSED(free))
733 ParticleSettings *part = ptr->id.data;
735 if (part->type == PART_HAIR)
736 return part_hair_dist_items;
738 return part_dist_items;
741 static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
742 PropertyRNA *UNUSED(prop), int *UNUSED(free))
744 ParticleSettings *part = ptr->id.data;
746 if (part->type == PART_HAIR)
747 return part_hair_draw_as_items;
749 return part_draw_as_items;
752 static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerRNA *ptr,
753 PropertyRNA *UNUSED(prop), int *UNUSED(free))
755 ParticleSettings *part = ptr->id.data;
757 if (part->type == PART_HAIR)
758 return part_hair_ren_as_items;
760 return part_ren_as_items;
763 static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
765 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
769 part->pd = object_add_collision_fields(0);
771 return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd);
774 static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
776 ParticleSettings *part = (ParticleSettings *)ptr->id.data;
780 part->pd2 = object_add_collision_fields(0);
782 return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2);
785 static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index)
787 Object *ob = ptr->id.data;
788 ParticleSystem *psys = (ParticleSystem *)ptr->data;
790 if (psys->vgroup[index] > 0) {
791 bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1);
794 strcpy(value, defGroup->name);
801 static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
803 Object *ob = ptr->id.data;
804 ParticleSystem *psys = (ParticleSystem *)ptr->data;
806 if (psys->vgroup[index] > 0) {
807 bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1);
810 return strlen(defGroup->name);
815 static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index)
817 Object *ob = ptr->id.data;
818 ParticleSystem *psys = (ParticleSystem *)ptr->data;
820 if (value[0] == '\0') {
821 psys->vgroup[index] = 0;
824 int defgrp_index = defgroup_name_index(ob, value);
826 if (defgrp_index == -1)
829 psys->vgroup[index] = defgrp_index + 1;
833 static char *rna_ParticleSystem_path(PointerRNA *ptr)
835 ParticleSystem *psys = (ParticleSystem *)ptr->data;
836 return BLI_sprintfN("particle_systems[\"%s\"]", psys->name);
839 static void rna_ParticleSettings_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
841 ParticleSettings *part = (ParticleSettings *)ptr->data;
842 rna_iterator_array_begin(iter, (void *)part->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
845 static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr)
847 ParticleSettings *part = (ParticleSettings *)ptr->data;
850 tex = give_current_particle_texture(part);
851 return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
854 static void rna_ParticleSettings_active_texture_set(PointerRNA *ptr, PointerRNA value)
856 ParticleSettings *part = (ParticleSettings *)ptr->data;
858 set_current_particle_texture(part, value.data);
861 /* irritating string functions for each index :/ */
862 static void rna_ParticleVGroup_name_get_0(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 0); }
863 static void rna_ParticleVGroup_name_get_1(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 1); }
864 static void rna_ParticleVGroup_name_get_2(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 2); }
865 static void rna_ParticleVGroup_name_get_3(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 3); }
866 static void rna_ParticleVGroup_name_get_4(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 4); }
867 static void rna_ParticleVGroup_name_get_5(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 5); }
868 static void rna_ParticleVGroup_name_get_6(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 6); }
869 static void rna_ParticleVGroup_name_get_7(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 7); }
870 static void rna_ParticleVGroup_name_get_8(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 8); }
871 static void rna_ParticleVGroup_name_get_9(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 9); }
872 static void rna_ParticleVGroup_name_get_10(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 10); }
873 static void rna_ParticleVGroup_name_get_11(PointerRNA *ptr, char *value) { psys_vg_name_get__internal(ptr, value, 11); }
875 static int rna_ParticleVGroup_name_len_0(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 0); }
876 static int rna_ParticleVGroup_name_len_1(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 1); }
877 static int rna_ParticleVGroup_name_len_2(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 2); }
878 static int rna_ParticleVGroup_name_len_3(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 3); }
879 static int rna_ParticleVGroup_name_len_4(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 4); }
880 static int rna_ParticleVGroup_name_len_5(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 5); }
881 static int rna_ParticleVGroup_name_len_6(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 6); }
882 static int rna_ParticleVGroup_name_len_7(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 7); }
883 static int rna_ParticleVGroup_name_len_8(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 8); }
884 static int rna_ParticleVGroup_name_len_9(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 9); }
885 static int rna_ParticleVGroup_name_len_10(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 10); }
886 static int rna_ParticleVGroup_name_len_11(PointerRNA *ptr) { return psys_vg_name_len__internal(ptr, 11); }
888 static void rna_ParticleVGroup_name_set_0(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 0); }
889 static void rna_ParticleVGroup_name_set_1(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 1); }
890 static void rna_ParticleVGroup_name_set_2(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 2); }
891 static void rna_ParticleVGroup_name_set_3(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 3); }
892 static void rna_ParticleVGroup_name_set_4(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 4); }
893 static void rna_ParticleVGroup_name_set_5(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 5); }
894 static void rna_ParticleVGroup_name_set_6(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 6); }
895 static void rna_ParticleVGroup_name_set_7(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 7); }
896 static void rna_ParticleVGroup_name_set_8(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 8); }
897 static void rna_ParticleVGroup_name_set_9(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 9); }
898 static void rna_ParticleVGroup_name_set_10(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 10); }
899 static void rna_ParticleVGroup_name_set_11(PointerRNA *ptr, const char *value) { psys_vg_name_set__internal(ptr, value, 11); }
904 static void rna_def_particle_hair_key(BlenderRNA *brna)
909 srna = RNA_def_struct(brna, "ParticleHairKey", NULL);
910 RNA_def_struct_sdna(srna, "HairKey");
911 RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system");
913 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
914 RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length");
916 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
917 RNA_def_property_range(prop, 0.0, 1.0);
918 RNA_def_property_ui_text(prop, "Weight", "Weight for cloth simulation");
920 prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
921 RNA_def_property_array(prop, 3);
922 RNA_def_property_ui_text(prop, "Location (Object Space)", "Location of the hair key in object space");
923 RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get",
924 "rna_ParticleHairKey_location_object_set", NULL);
926 prop = RNA_def_property(srna, "co_hair_space", PROP_FLOAT, PROP_TRANSLATION);
927 RNA_def_property_float_sdna(prop, NULL, "co");
928 RNA_def_property_ui_text(prop, "Location",
929 "Location of the hair key in its internal coordinate system, "
930 "relative to the emitting face");
933 static void rna_def_particle_key(BlenderRNA *brna)
938 srna = RNA_def_struct(brna, "ParticleKey", NULL);
939 RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time");
941 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
942 RNA_def_property_float_sdna(prop, NULL, "co");
943 RNA_def_property_ui_text(prop, "Location", "Key location");
945 prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
946 RNA_def_property_float_sdna(prop, NULL, "vel");
947 RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
949 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
950 RNA_def_property_float_sdna(prop, NULL, "rot");
951 RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaternion");
953 prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
954 RNA_def_property_float_sdna(prop, NULL, "ave");
955 RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity");
957 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
958 RNA_def_property_ui_text(prop, "Time", "Time of key over the simulation");
961 static void rna_def_child_particle(BlenderRNA *brna)
964 /*PropertyRNA *prop; */
966 srna = RNA_def_struct(brna, "ChildParticle", NULL);
967 RNA_def_struct_ui_text(srna, "Child Particle",
968 "Child particle interpolated from simulated or edited particles");
970 /* int num, parent; *//* num is face index on the final derived mesh */
972 /* int pa[4]; *//* nearest particles to the child, used for the interpolation */
973 /* float w[4]; *//* interpolation weights for the above particles */
974 /* float fuv[4], foffset; *//* face vertex weights and offset */
978 static void rna_def_particle(BlenderRNA *brna)
983 static EnumPropertyItem alive_items[] = {
984 /*{PARS_KILLED, "KILLED", 0, "Killed", ""}, */
985 {PARS_DEAD, "DEAD", 0, "Dead", ""},
986 {PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
987 {PARS_ALIVE, "ALIVE", 0, "Alive", ""},
988 {PARS_DYING, "DYING", 0, "Dying", ""},
989 {0, NULL, 0, NULL, NULL}
992 srna = RNA_def_struct(brna, "Particle", NULL);
993 RNA_def_struct_sdna(srna, "ParticleData");
994 RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system");
996 /* Particle State & Previous State */
997 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
998 RNA_def_property_float_sdna(prop, NULL, "state.co");
999 RNA_def_property_ui_text(prop, "Particle Location", "");
1001 prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
1002 RNA_def_property_float_sdna(prop, NULL, "state.vel");
1003 RNA_def_property_ui_text(prop, "Particle Velocity", "");
1005 prop = RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
1006 RNA_def_property_float_sdna(prop, NULL, "state.ave");
1007 RNA_def_property_ui_text(prop, "Angular Velocity", "");
1009 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
1010 RNA_def_property_float_sdna(prop, NULL, "state.rot");
1011 RNA_def_property_ui_text(prop, "Rotation", "");
1013 prop = RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
1014 RNA_def_property_float_sdna(prop, NULL, "prev_state.co");
1015 RNA_def_property_ui_text(prop, "Previous Particle Location", "");
1017 prop = RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
1018 RNA_def_property_float_sdna(prop, NULL, "prev_state.vel");
1019 RNA_def_property_ui_text(prop, "Previous Particle Velocity", "");
1021 prop = RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
1022 RNA_def_property_float_sdna(prop, NULL, "prev_state.ave");
1023 RNA_def_property_ui_text(prop, "Previous Angular Velocity", "");
1025 prop = RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
1026 RNA_def_property_float_sdna(prop, NULL, "prev_state.rot");
1027 RNA_def_property_ui_text(prop, "Previous Rotation", "");
1029 /* Hair & Keyed Keys */
1031 prop = RNA_def_property(srna, "hair_keys", PROP_COLLECTION, PROP_NONE);
1032 RNA_def_property_collection_sdna(prop, NULL, "hair", "totkey");
1033 RNA_def_property_struct_type(prop, "ParticleHairKey");
1034 RNA_def_property_ui_text(prop, "Hair", "");
1036 prop = RNA_def_property(srna, "particle_keys", PROP_COLLECTION, PROP_NONE);
1037 RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey");
1038 RNA_def_property_struct_type(prop, "ParticleKey");
1039 RNA_def_property_ui_text(prop, "Keyed States", "");
1041 /* float fuv[4], foffset; *//* coordinates on face/edge number "num" and depth along*/
1042 /* *//* face normal for volume emission */
1044 prop = RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
1045 RNA_def_property_float_sdna(prop, NULL, "time");
1046 /* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
1047 RNA_def_property_ui_text(prop, "Birth Time", "");
1049 prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
1050 /* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
1051 RNA_def_property_ui_text(prop, "Lifetime", "");
1053 prop = RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
1054 RNA_def_property_float_sdna(prop, NULL, "dietime");
1055 /* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
1056 RNA_def_property_ui_text(prop, "Die Time", "");
1058 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1059 /* RNA_def_property_range(prop, lowerLimitf, upperLimitf); */
1060 RNA_def_property_ui_text(prop, "Size", "");
1063 /* int num; *//* index to vert/edge/face */
1064 /* int num_dmcache; *//* index to derived mesh data (face) to avoid slow lookups */
1070 prop = RNA_def_property(srna, "is_exist", PROP_BOOLEAN, PROP_NONE);
1071 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_UNEXIST);
1072 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1073 RNA_def_property_ui_text(prop, "Exists", "");
1075 prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
1076 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PARS_NO_DISP);
1077 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1078 RNA_def_property_ui_text(prop, "Visible", "");
1080 prop = RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
1081 RNA_def_property_enum_sdna(prop, NULL, "alive");
1082 RNA_def_property_enum_items(prop, alive_items);
1083 RNA_def_property_ui_text(prop, "Alive State", "");
1088 static void rna_def_particle_dupliweight(BlenderRNA *brna)
1093 srna = RNA_def_struct(brna, "ParticleDupliWeight", NULL);
1094 RNA_def_struct_ui_text(srna, "Particle Dupliobject Weight", "Weight of a particle dupliobject in a group");
1095 RNA_def_struct_sdna(srna, "ParticleDupliWeight");
1097 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1098 RNA_def_property_string_funcs(prop, "rna_ParticleDupliWeight_name_get",
1099 "rna_ParticleDupliWeight_name_length", NULL);
1100 RNA_def_property_ui_text(prop, "Name", "Particle dupliobject name");
1101 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1102 RNA_def_struct_name_property(srna, prop);
1104 prop = RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
1105 RNA_def_property_range(prop, 0, SHRT_MAX);
1106 RNA_def_property_ui_text(prop, "Count",
1107 "The number of times this object is repeated with respect to other objects");
1108 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1111 static void rna_def_fluid_settings(BlenderRNA *brna)
1116 static EnumPropertyItem sph_solver_items[] = {
1117 {SPH_SOLVER_DDR, "DDR", 0, "Double-Density", "An artistic solver with strong surface tension effects (original)"},
1118 {SPH_SOLVER_CLASSICAL, "CLASSICAL", 0, "Classical", "A more physically-accurate solver"},
1119 {0, NULL, 0, NULL, NULL}
1122 srna = RNA_def_struct(brna, "SPHFluidSettings", NULL);
1123 RNA_def_struct_path_func(srna, "rna_SPHFluidSettings_path");
1124 RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics");
1126 /* Fluid settings */
1127 prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
1128 RNA_def_property_enum_sdna(prop, NULL, "solver");
1129 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1130 RNA_def_property_enum_items(prop, sph_solver_items);
1131 RNA_def_property_ui_text(prop, "SPH Solver", "The code used to calculate internal forces on particles");
1132 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1134 prop = RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE);
1135 RNA_def_property_float_sdna(prop, NULL, "spring_k");
1136 RNA_def_property_range(prop, 0.0f, 100.0f);
1137 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
1138 RNA_def_property_ui_text(prop, "Spring Force", "Spring force");
1139 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1141 prop = RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE);
1142 RNA_def_property_float_sdna(prop, NULL, "radius");
1143 RNA_def_property_range(prop, 0.0f, 20.0f);
1144 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
1145 RNA_def_property_ui_text(prop, "Interaction Radius", "Fluid interaction radius");
1146 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1148 prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE);
1149 RNA_def_property_range(prop, 0.0f, 2.0f);
1150 RNA_def_property_ui_text(prop, "Rest Length", "Spring rest length (factor of particle radius)");
1151 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1153 prop = RNA_def_property(srna, "use_viscoelastic_springs", PROP_BOOLEAN, PROP_NONE);
1154 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_VISCOELASTIC_SPRINGS);
1155 RNA_def_property_ui_text(prop, "Viscoelastic Springs", "Use viscoelastic springs instead of Hooke's springs");
1156 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1158 prop = RNA_def_property(srna, "use_initial_rest_length", PROP_BOOLEAN, PROP_NONE);
1159 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_CURRENT_REST_LENGTH);
1160 RNA_def_property_ui_text(prop, "Initial Rest Length",
1161 "Use the initial length as spring rest length instead of 2 * particle size");
1162 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1164 prop = RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE);
1165 RNA_def_property_float_sdna(prop, NULL, "plasticity_constant");
1166 RNA_def_property_range(prop, 0.0f, 100.0f);
1167 RNA_def_property_ui_text(prop, "Plasticity",
1168 "How much the spring rest length can change after the elastic limit is crossed");
1169 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1171 prop = RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE);
1172 RNA_def_property_float_sdna(prop, NULL, "yield_ratio");
1173 RNA_def_property_range(prop, 0.0f, 1.0f);
1174 RNA_def_property_ui_text(prop, "Elastic Limit",
1175 "How much the spring has to be stretched/compressed in order to change it's rest length");
1176 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1178 prop = RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE);
1179 RNA_def_property_range(prop, 0.0f, 100.0f);
1180 RNA_def_property_ui_text(prop, "Spring Frames",
1181 "Create springs for this number of frames since particles birth (0 is always)");
1182 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1185 prop = RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE);
1186 RNA_def_property_float_sdna(prop, NULL, "viscosity_omega");
1187 RNA_def_property_range(prop, 0.0f, 100.0f);
1188 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
1189 RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity");
1190 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1192 prop = RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE);
1193 RNA_def_property_float_sdna(prop, NULL, "viscosity_beta");
1194 RNA_def_property_range(prop, 0.0f, 100.0f);
1195 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
1196 RNA_def_property_ui_text(prop, "Stiff viscosity", "Creates viscosity for expanding fluid");
1197 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1199 /* Double density relaxation */
1200 prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
1201 RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
1202 RNA_def_property_range(prop, 0.0f, 100000.0f);
1203 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
1204 RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is");
1205 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1207 prop = RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);
1208 RNA_def_property_float_sdna(prop, NULL, "stiffness_knear");
1209 RNA_def_property_range(prop, 0.0f, 100.0f);
1210 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
1211 RNA_def_property_ui_text(prop, "Repulsion Factor",
1212 "How strongly the fluid tries to keep from clustering (factor of stiffness)");
1213 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1215 prop = RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE);
1216 RNA_def_property_float_sdna(prop, NULL, "rest_density");
1217 RNA_def_property_range(prop, 0.0f, 10000.0f);
1218 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
1219 RNA_def_property_ui_text(prop, "Rest Density", "Fluid rest density");
1220 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1223 prop = RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE);
1224 RNA_def_property_float_sdna(prop, NULL, "buoyancy");
1225 RNA_def_property_range(prop, 0.0f, 10.0f);
1226 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
1227 RNA_def_property_ui_text(prop, "Buoyancy",
1228 "Artificial buoyancy force in negative gravity direction based on pressure "
1229 "differences inside the fluid");
1230 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1234 prop = RNA_def_property(srna, "factor_repulsion", PROP_BOOLEAN, PROP_NONE);
1235 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REPULSION);
1236 RNA_def_property_ui_text(prop, "Factor Repulsion", "Repulsion is a factor of stiffness");
1237 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1239 prop = RNA_def_property(srna, "factor_density", PROP_BOOLEAN, PROP_NONE);
1240 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_DENSITY);
1241 RNA_def_property_ui_text(prop, "Factor Density",
1242 "Density is calculated as a factor of default density (depends on particle size)");
1243 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1245 prop = RNA_def_property(srna, "factor_radius", PROP_BOOLEAN, PROP_NONE);
1246 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_RADIUS);
1247 RNA_def_property_ui_text(prop, "Factor Radius", "Interaction radius is a factor of 4 * particle size");
1248 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1250 prop = RNA_def_property(srna, "factor_stiff_viscosity", PROP_BOOLEAN, PROP_NONE);
1251 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_VISCOSITY);
1252 RNA_def_property_ui_text(prop, "Factor Stiff Viscosity", "Stiff viscosity is a factor of normal viscosity");
1253 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1255 prop = RNA_def_property(srna, "factor_rest_length", PROP_BOOLEAN, PROP_NONE);
1256 RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REST_LENGTH);
1257 RNA_def_property_ui_text(prop, "Factor Rest Length", "Spring rest length is a factor of 2 * particle size");
1258 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1261 static void rna_def_particle_settings_mtex(BlenderRNA *brna)
1266 static EnumPropertyItem texco_items[] = {
1267 {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
1268 {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
1269 {TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"},
1270 {TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"},
1271 {TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
1272 "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
1273 {0, NULL, 0, NULL, NULL}
1276 static EnumPropertyItem prop_mapping_items[] = {
1277 {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
1278 {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
1279 {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
1280 {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
1281 {0, NULL, 0, NULL, NULL}
1284 static EnumPropertyItem prop_x_mapping_items[] = {
1285 {0, "NONE", 0, "None", ""},
1286 {1, "X", 0, "X", ""},
1287 {2, "Y", 0, "Y", ""},
1288 {3, "Z", 0, "Z", ""},
1289 {0, NULL, 0, NULL, NULL}
1292 static EnumPropertyItem prop_y_mapping_items[] = {
1293 {0, "NONE", 0, "None", ""},
1294 {1, "X", 0, "X", ""},
1295 {2, "Y", 0, "Y", ""},
1296 {3, "Z", 0, "Z", ""},
1297 {0, NULL, 0, NULL, NULL}
1300 static EnumPropertyItem prop_z_mapping_items[] = {
1301 {0, "NONE", 0, "None", ""},
1302 {1, "X", 0, "X", ""},
1303 {2, "Y", 0, "Y", ""},
1304 {3, "Z", 0, "Z", ""},
1305 {0, NULL, 0, NULL, NULL}
1308 srna = RNA_def_struct(brna, "ParticleSettingsTextureSlot", "TextureSlot");
1309 RNA_def_struct_sdna(srna, "MTex");
1310 RNA_def_struct_ui_text(srna, "Particle Settings Texture Slot",
1311 "Texture slot for textures in a Particle Settings datablock");
1313 prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
1314 RNA_def_property_enum_sdna(prop, NULL, "texco");
1315 RNA_def_property_enum_items(prop, texco_items);
1316 RNA_def_property_ui_text(prop, "Texture Coordinates",
1317 "Texture coordinates used to map the texture onto the background");
1318 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1320 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1321 RNA_def_property_pointer_sdna(prop, NULL, "object");
1322 RNA_def_property_struct_type(prop, "Object");
1323 RNA_def_property_flag(prop, PROP_EDITABLE);
1324 RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
1325 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1327 prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
1328 RNA_def_property_string_sdna(prop, NULL, "uvname");
1329 RNA_def_property_ui_text(prop, "UV Map", "UV map to use for mapping with UV texture coordinates");
1330 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1332 prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
1333 RNA_def_property_enum_sdna(prop, NULL, "projx");
1334 RNA_def_property_enum_items(prop, prop_x_mapping_items);
1335 RNA_def_property_ui_text(prop, "X Mapping", "");
1336 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1338 prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
1339 RNA_def_property_enum_sdna(prop, NULL, "projy");
1340 RNA_def_property_enum_items(prop, prop_y_mapping_items);
1341 RNA_def_property_ui_text(prop, "Y Mapping", "");
1342 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1344 prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
1345 RNA_def_property_enum_sdna(prop, NULL, "projz");
1346 RNA_def_property_enum_items(prop, prop_z_mapping_items);
1347 RNA_def_property_ui_text(prop, "Z Mapping", "");
1348 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1350 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
1351 RNA_def_property_enum_items(prop, prop_mapping_items);
1352 RNA_def_property_ui_text(prop, "Mapping", "");
1353 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1356 prop = RNA_def_property(srna, "use_map_time", PROP_BOOLEAN, PROP_NONE);
1357 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_TIME);
1358 RNA_def_property_ui_text(prop, "Emission Time", "Affect the emission time of the particles");
1359 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1361 prop = RNA_def_property(srna, "use_map_life", PROP_BOOLEAN, PROP_NONE);
1362 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_LIFE);
1363 RNA_def_property_ui_text(prop, "Life Time", "Affect the life time of the particles");
1364 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1366 prop = RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
1367 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_DENS);
1368 RNA_def_property_ui_text(prop, "Density", "Affect the density of the particles");
1369 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1371 prop = RNA_def_property(srna, "use_map_size", PROP_BOOLEAN, PROP_NONE);
1372 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_SIZE);
1373 RNA_def_property_ui_text(prop, "Size", "Affect the particle size");
1374 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1376 prop = RNA_def_property(srna, "use_map_velocity", PROP_BOOLEAN, PROP_NONE);
1377 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_IVEL);
1378 RNA_def_property_ui_text(prop, "Initial Velocity", "Affect the particle initial velocity");
1379 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1381 prop = RNA_def_property(srna, "use_map_field", PROP_BOOLEAN, PROP_NONE);
1382 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_FIELD);
1383 RNA_def_property_ui_text(prop, "Force Field", "Affect the particle force fields");
1384 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1386 prop = RNA_def_property(srna, "use_map_gravity", PROP_BOOLEAN, PROP_NONE);
1387 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_GRAVITY);
1388 RNA_def_property_ui_text(prop, "Gravity", "Affect the particle gravity");
1389 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1391 prop = RNA_def_property(srna, "use_map_damp", PROP_BOOLEAN, PROP_NONE);
1392 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_DAMP);
1393 RNA_def_property_ui_text(prop, "Damp", "Affect the particle velocity damping");
1394 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1396 prop = RNA_def_property(srna, "use_map_clump", PROP_BOOLEAN, PROP_NONE);
1397 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_CLUMP);
1398 RNA_def_property_ui_text(prop, "Clump", "Affect the child clumping");
1399 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1401 prop = RNA_def_property(srna, "use_map_kink", PROP_BOOLEAN, PROP_NONE);
1402 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK);
1403 RNA_def_property_ui_text(prop, "Kink", "Affect the child kink");
1404 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1406 prop = RNA_def_property(srna, "use_map_rough", PROP_BOOLEAN, PROP_NONE);
1407 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_ROUGH);
1408 RNA_def_property_ui_text(prop, "Rough", "Affect the child rough");
1409 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1411 prop = RNA_def_property(srna, "use_map_length", PROP_BOOLEAN, PROP_NONE);
1412 RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_LENGTH);
1413 RNA_def_property_ui_text(prop, "Length", "Affect the child hair length");
1414 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1417 /* influence factors */
1418 prop = RNA_def_property(srna, "time_factor", PROP_FLOAT, PROP_NONE);
1419 RNA_def_property_float_sdna(prop, NULL, "timefac");
1420 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1421 RNA_def_property_ui_text(prop, "Emission Time Factor", "Amount texture affects particle emission time");
1422 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1424 prop = RNA_def_property(srna, "life_factor", PROP_FLOAT, PROP_NONE);
1425 RNA_def_property_float_sdna(prop, NULL, "lifefac");
1426 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1427 RNA_def_property_ui_text(prop, "Life Time Factor", "Amount texture affects particle life time");
1428 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1430 prop = RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
1431 RNA_def_property_float_sdna(prop, NULL, "padensfac");
1432 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1433 RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects particle density");
1434 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1436 prop = RNA_def_property(srna, "size_factor", PROP_FLOAT, PROP_NONE);
1437 RNA_def_property_float_sdna(prop, NULL, "sizefac");
1438 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1439 RNA_def_property_ui_text(prop, "Size Factor", "Amount texture affects physical particle size");
1440 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1442 prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
1443 RNA_def_property_float_sdna(prop, NULL, "ivelfac");
1444 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1445 RNA_def_property_ui_text(prop, "Velocity Factor", "Amount texture affects particle initial velocity");
1446 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1449 prop = RNA_def_property(srna, "field_factor", PROP_FLOAT, PROP_NONE);
1450 RNA_def_property_float_sdna(prop, NULL, "fieldfac");
1451 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1452 RNA_def_property_ui_text(prop, "Field Factor", "Amount texture affects particle force fields");
1453 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1455 prop = RNA_def_property(srna, "gravity_factor", PROP_FLOAT, PROP_NONE);
1456 RNA_def_property_float_sdna(prop, NULL, "gravityfac");
1457 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1458 RNA_def_property_ui_text(prop, "Gravity Factor", "Amount texture affects particle gravity");
1459 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1461 prop = RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
1462 RNA_def_property_float_sdna(prop, NULL, "dampfac");
1463 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1464 RNA_def_property_ui_text(prop, "Damp Factor", "Amount texture affects particle damping");
1465 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1468 prop = RNA_def_property(srna, "length_factor", PROP_FLOAT, PROP_NONE);
1469 RNA_def_property_float_sdna(prop, NULL, "lengthfac");
1470 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1471 RNA_def_property_ui_text(prop, "Length Factor", "Amount texture affects child hair length");
1472 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1474 prop = RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
1475 RNA_def_property_float_sdna(prop, NULL, "clumpfac");
1476 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1477 RNA_def_property_ui_text(prop, "Clump Factor", "Amount texture affects child clump");
1478 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1480 prop = RNA_def_property(srna, "kink_factor", PROP_FLOAT, PROP_NONE);
1481 RNA_def_property_float_sdna(prop, NULL, "kinkfac");
1482 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1483 RNA_def_property_ui_text(prop, "Kink Factor", "Amount texture affects child kink");
1484 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1486 prop = RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE);
1487 RNA_def_property_float_sdna(prop, NULL, "roughfac");
1488 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
1489 RNA_def_property_ui_text(prop, "Rough Factor", "Amount texture affects child roughness");
1490 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1493 static void rna_def_particle_settings(BlenderRNA *brna)
1498 static EnumPropertyItem type_items[] = {
1499 {PART_EMITTER, "EMITTER", 0, "Emitter", ""},
1500 /*{PART_REACTOR, "REACTOR", 0, "Reactor", ""}, */
1501 {PART_HAIR, "HAIR", 0, "Hair", ""},
1502 {0, NULL, 0, NULL, NULL}
1505 static EnumPropertyItem phys_type_items[] = {
1506 {PART_PHYS_NO, "NO", 0, "No", ""},
1507 {PART_PHYS_NEWTON, "NEWTON", 0, "Newtonian", ""},
1508 {PART_PHYS_KEYED, "KEYED", 0, "Keyed", ""},
1509 {PART_PHYS_BOIDS, "BOIDS", 0, "Boids", ""},
1510 {PART_PHYS_FLUID, "FLUID", 0, "Fluid", ""},
1511 {0, NULL, 0, NULL, NULL}
1514 static EnumPropertyItem rot_mode_items[] = {
1515 {0, "NONE", 0, "None", ""},
1516 {PART_ROT_NOR, "NOR", 0, "Normal", ""},
1517 {PART_ROT_VEL, "VEL", 0, "Velocity / Hair", ""},
1518 {PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""},
1519 {PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""},
1520 {PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""},
1521 {PART_ROT_OB_X, "OB_X", 0, "Object X", ""},
1522 {PART_ROT_OB_Y, "OB_Y", 0, "Object Y", ""},
1523 {PART_ROT_OB_Z, "OB_Z", 0, "Object Z", ""},
1524 {0, NULL, 0, NULL, NULL}
1527 static EnumPropertyItem ave_mode_items[] = {
1528 {0, "NONE", 0, "None", ""},
1529 {PART_AVE_VELOCITY, "VELOCITY", 0, "Velocity", ""},
1530 {PART_AVE_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
1531 {PART_AVE_VERTICAL, "VERTICAL", 0, "Vertical", ""},
1532 {PART_AVE_GLOBAL_X, "GLOBAL_X", 0, "Global X", ""},
1533 {PART_AVE_GLOBAL_Y, "GLOBAL_Y", 0, "Global Y", ""},
1534 {PART_AVE_GLOBAL_Z, "GLOBAL_Z", 0, "Global Z", ""},
1535 {PART_AVE_RAND, "RAND", 0, "Random", ""},
1536 {0, NULL, 0, NULL, NULL}
1539 static EnumPropertyItem react_event_items[] = {
1540 {PART_EVENT_DEATH, "DEATH", 0, "Death", ""},
1541 {PART_EVENT_COLLIDE, "COLLIDE", 0, "Collision", ""},
1542 {PART_EVENT_NEAR, "NEAR", 0, "Near", ""},
1543 {0, NULL, 0, NULL, NULL}
1546 static EnumPropertyItem child_type_items[] = {
1547 {0, "NONE", 0, "None", ""},
1548 {PART_CHILD_PARTICLES, "SIMPLE", 0, "Simple", ""},
1549 {PART_CHILD_FACES, "INTERPOLATED", 0, "Interpolated", ""},
1550 {0, NULL, 0, NULL, NULL}
1553 /*TODO: names, tooltips */
1555 static EnumPropertyItem rot_from_items[] = {
1556 {PART_ROT_KEYS, "KEYS", 0, "keys", ""},
1557 {PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""},
1558 {PART_ROT_IINCR, "IINCR", 0, "iincr", ""},
1559 {0, NULL, 0, NULL, NULL}
1562 static EnumPropertyItem integrator_type_items[] = {
1563 {PART_INT_EULER, "EULER", 0, "Euler", ""},
1564 {PART_INT_VERLET, "VERLET", 0, "Verlet", ""},
1565 {PART_INT_MIDPOINT, "MIDPOINT", 0, "Midpoint", ""},
1566 {PART_INT_RK4, "RK4", 0, "RK4", ""},
1567 {0, NULL, 0, NULL, NULL}
1570 static EnumPropertyItem kink_type_items[] = {
1571 {PART_KINK_NO, "NO", 0, "Nothing", ""},
1572 {PART_KINK_CURL, "CURL", 0, "Curl", ""},
1573 {PART_KINK_RADIAL, "RADIAL", 0, "Radial", ""},
1574 {PART_KINK_WAVE, "WAVE", 0, "Wave", ""},
1575 {PART_KINK_BRAID, "BRAID", 0, "Braid", ""},
1576 {0, NULL, 0, NULL, NULL}
1579 static EnumPropertyItem kink_axis_items[] = {
1580 {0, "X", 0, "X", ""},
1581 {1, "Y", 0, "Y", ""},
1582 {2, "Z", 0, "Z", ""},
1583 {0, NULL, 0, NULL, NULL}
1586 static EnumPropertyItem bb_align_items[] = {
1587 {PART_BB_X, "X", 0, "X", ""},
1588 {PART_BB_Y, "Y", 0, "Y", ""},
1589 {PART_BB_Z, "Z", 0, "Z", ""},
1590 {PART_BB_VIEW, "VIEW", 0, "View", ""},
1591 {PART_BB_VEL, "VEL", 0, "Velocity", ""},
1592 {0, NULL, 0, NULL, NULL}
1595 static EnumPropertyItem bb_anim_items[] = {
1596 {PART_BB_ANIM_NONE, "NONE", 0, "None", ""},
1597 {PART_BB_ANIM_AGE, "AGE", 0, "Age", ""},
1598 {PART_BB_ANIM_FRAME, "FRAME", 0, "Frame", ""},
1599 {PART_BB_ANIM_ANGLE, "ANGLE", 0, "Angle", ""},
1600 {0, NULL, 0, NULL, NULL}
1603 static EnumPropertyItem bb_split_offset_items[] = {
1604 {PART_BB_OFF_NONE, "NONE", 0, "None", ""},
1605 {PART_BB_OFF_LINEAR, "LINEAR", 0, "Linear", ""},
1606 {PART_BB_OFF_RANDOM, "RANDOM", 0, "Random", ""},
1607 {0, NULL, 0, NULL, NULL}
1610 static EnumPropertyItem draw_col_items[] = {
1611 {PART_DRAW_COL_NONE, "NONE", 0, "None", ""},
1612 {PART_DRAW_COL_MAT, "MATERIAL", 0, "Material", ""},
1613 {PART_DRAW_COL_VEL, "VELOCITY", 0, "Velocity", ""},
1614 {PART_DRAW_COL_ACC, "ACCELERATION", 0, "Acceleration", ""},
1615 {0, NULL, 0, NULL, NULL}
1618 srna = RNA_def_struct(brna, "ParticleSettings", "ID");
1619 RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems");
1620 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
1622 rna_def_mtex_common(brna, srna, "rna_ParticleSettings_mtex_begin", "rna_ParticleSettings_active_texture_get",
1623 "rna_ParticleSettings_active_texture_set", NULL, "ParticleSettingsTextureSlot",
1624 "ParticleSettingsTextureSlots", "rna_Particle_reset");
1626 /* fluid particle type can't be checked from the type value in rna as it's not shown in the menu */
1627 prop = RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE);
1628 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1629 RNA_def_property_boolean_funcs(prop, "rna_PartSettings_is_fluid_get", NULL);
1630 RNA_def_property_ui_text(prop, "Fluid", "Particles were created by a fluid simulation");
1633 prop = RNA_def_property(srna, "use_react_start_end", PROP_BOOLEAN, PROP_NONE);
1634 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
1635 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1636 RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually");
1637 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1639 prop = RNA_def_property(srna, "use_react_multiple", PROP_BOOLEAN, PROP_NONE);
1640 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
1641 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1642 RNA_def_property_ui_text(prop, "Multi React", "React multiple times");
1643 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1645 prop = RNA_def_property(srna, "regrow_hair", PROP_BOOLEAN, PROP_NONE);
1646 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_REGROW);
1647 RNA_def_property_ui_text(prop, "Regrow", "Regrow hair for each frame");
1648 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1650 prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
1651 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
1652 RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted");
1653 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1655 prop = RNA_def_property(srna, "use_dead", PROP_BOOLEAN, PROP_NONE);
1656 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
1657 RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
1658 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1660 prop = RNA_def_property(srna, "use_emit_random", PROP_BOOLEAN, PROP_NONE);
1661 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
1662 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1663 RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
1664 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1666 prop = RNA_def_property(srna, "use_even_distribution", PROP_BOOLEAN, PROP_NONE);
1667 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
1668 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1669 RNA_def_property_ui_text(prop, "Even Distribution",
1670 "Use even distribution from faces based on face areas or edge lengths");
1671 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1673 prop = RNA_def_property(srna, "use_die_on_collision", PROP_BOOLEAN, PROP_NONE);
1674 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
1675 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1676 RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object");
1677 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1679 prop = RNA_def_property(srna, "use_size_deflect", PROP_BOOLEAN, PROP_NONE);
1680 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
1681 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1682 RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection");
1683 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1685 prop = RNA_def_property(srna, "use_rotations", PROP_BOOLEAN, PROP_NONE);
1686 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROTATIONS);
1687 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1688 RNA_def_property_ui_text(prop, "Rotations", "Calculate particle rotations");
1689 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1691 prop = RNA_def_property(srna, "use_dynamic_rotation", PROP_BOOLEAN, PROP_NONE);
1692 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
1693 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1694 RNA_def_property_ui_text(prop, "Dynamic", "Particle rotations are effected by collisions and effectors");
1695 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1697 prop = RNA_def_property(srna, "use_multiply_size_mass", PROP_BOOLEAN, PROP_NONE);
1698 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
1699 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1700 RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass by particle size");
1701 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1703 prop = RNA_def_property(srna, "use_advanced_hair", PROP_BOOLEAN, PROP_NONE);
1704 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PART_HIDE_ADVANCED_HAIR);
1705 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1706 RNA_def_property_ui_text(prop, "Advanced", "Use full physics calculations for growing hair");
1707 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1709 prop = RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE);
1710 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
1711 RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
1712 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1714 prop = RNA_def_property(srna, "use_hair_bspline", PROP_BOOLEAN, PROP_NONE);
1715 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
1716 RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines");
1717 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1719 prop = RNA_def_property(srna, "invert_grid", PROP_BOOLEAN, PROP_NONE);
1720 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
1721 RNA_def_property_ui_text(prop, "Invert Grid", "Invert what is considered object and what is not");
1722 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1724 prop = RNA_def_property(srna, "hexagonal_grid", PROP_BOOLEAN, PROP_NONE);
1725 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_HEXAGONAL);
1726 RNA_def_property_ui_text(prop, "Hexagonal Grid", "Create the grid in a hexagonal pattern");
1727 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1729 prop = RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE);
1730 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
1731 RNA_def_property_ui_text(prop, "Effect Children", "Apply effectors to children");
1732 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1734 prop = RNA_def_property(srna, "create_long_hair_children", PROP_BOOLEAN, PROP_NONE);
1735 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_LONG_HAIR);
1736 RNA_def_property_ui_text(prop, "Long Hair", "Calculate children that suit long hair well");
1737 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1739 prop = RNA_def_property(srna, "apply_guide_to_children", PROP_BOOLEAN, PROP_NONE);
1740 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
1741 RNA_def_property_ui_text(prop, "apply_guide_to_children", "");
1742 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1744 prop = RNA_def_property(srna, "use_self_effect", PROP_BOOLEAN, PROP_NONE);
1745 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
1746 RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves");
1747 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1750 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1751 RNA_def_property_enum_items(prop, type_items);
1752 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1753 RNA_def_property_ui_text(prop, "Type", "Particle Type");
1754 RNA_def_property_update(prop, 0, "rna_Particle_change_type");
1756 prop = RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
1757 RNA_def_property_enum_sdna(prop, NULL, "from");
1758 RNA_def_property_enum_items(prop, part_reactor_from_items);
1759 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1760 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf");
1761 RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from");
1762 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1764 prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
1765 RNA_def_property_enum_sdna(prop, NULL, "distr");
1766 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1767 RNA_def_property_enum_items(prop, part_dist_items);
1768 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_dist_itemf");
1769 RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element");
1770 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1773 prop = RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
1774 RNA_def_property_enum_sdna(prop, NULL, "phystype");
1775 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1776 RNA_def_property_enum_items(prop, phys_type_items);
1777 RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type");
1778 RNA_def_property_update(prop, 0, "rna_Particle_change_physics");
1780 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
1781 RNA_def_property_enum_sdna(prop, NULL, "rotmode");
1782 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1783 RNA_def_property_enum_items(prop, rot_mode_items);
1784 RNA_def_property_ui_text(prop, "Orientation axis",
1785 "Particle orientation axis (does not affect Explode modifier's results)");
1786 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1788 prop = RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
1789 RNA_def_property_enum_sdna(prop, NULL, "avemode");
1790 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1791 RNA_def_property_enum_items(prop, ave_mode_items);
1792 RNA_def_property_ui_text(prop, "Angular Velocity Axis", "What axis is used to change particle rotation with time");
1793 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1795 prop = RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
1796 RNA_def_property_enum_sdna(prop, NULL, "reactevent");
1797 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
1798 RNA_def_property_enum_items(prop, react_event_items);
1799 RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on");
1800 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1803 prop = RNA_def_property(srna, "show_velocity", PROP_BOOLEAN, PROP_NONE);
1804 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
1805 RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
1806 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1808 prop = RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
1809 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE);
1810 RNA_def_property_ui_text(prop, "Size", "Show particle size");
1811 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1813 prop = RNA_def_property(srna, "use_render_emitter", PROP_BOOLEAN, PROP_NONE);
1814 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
1815 RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also");
1816 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1818 prop = RNA_def_property(srna, "show_health", PROP_BOOLEAN, PROP_NONE);
1819 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH);
1820 RNA_def_property_ui_text(prop, "Health", "Draw boid health");
1821 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1823 prop = RNA_def_property(srna, "use_absolute_path_time", PROP_BOOLEAN, PROP_NONE);
1824 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME);
1825 RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames");
1826 RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update");
1828 prop = RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE);
1829 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
1830 RNA_def_property_ui_text(prop, "Parents", "Render parent particles");
1831 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1833 prop = RNA_def_property(srna, "show_number", PROP_BOOLEAN, PROP_NONE);
1834 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
1835 RNA_def_property_ui_text(prop, "Number", "Show particle number");
1836 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1838 prop = RNA_def_property(srna, "use_group_pick_random", PROP_BOOLEAN, PROP_NONE);
1839 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
1840 RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
1841 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1843 prop = RNA_def_property(srna, "use_group_count", PROP_BOOLEAN, PROP_NONE);
1844 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COUNT_GR);
1845 RNA_def_property_ui_text(prop, "Use Count", "Use object multiple times in the same group");
1846 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1848 prop = RNA_def_property(srna, "use_global_dupli", PROP_BOOLEAN, PROP_NONE);
1849 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_GLOBAL_OB);
1850 RNA_def_property_ui_text(prop, "Global", "Use object's global coordinates for duplication");
1851 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1853 prop = RNA_def_property(srna, "use_rotation_dupli", PROP_BOOLEAN, PROP_NONE);
1854 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ROTATE_OB);
1855 RNA_def_property_ui_text(prop, "Rotation",
1856 "Use object's rotation for duplication (global x-axis is aligned "
1857 "particle rotation axis)");
1858 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1860 prop = RNA_def_property(srna, "use_scale_dupli", PROP_BOOLEAN, PROP_NONE);
1861 RNA_def_property_boolean_negative_sdna(prop, NULL, "draw", PART_DRAW_NO_SCALE_OB);
1862 RNA_def_property_ui_text(prop, "Scale", "Use object's scale for duplication");
1863 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1865 prop = RNA_def_property(srna, "use_render_adaptive", PROP_BOOLEAN, PROP_NONE);
1866 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
1867 RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
1868 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1870 prop = RNA_def_property(srna, "use_velocity_length", PROP_BOOLEAN, PROP_NONE);
1871 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
1872 RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
1873 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1875 prop = RNA_def_property(srna, "use_whole_group", PROP_BOOLEAN, PROP_NONE);
1876 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
1877 RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once");
1878 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1880 prop = RNA_def_property(srna, "use_strand_primitive", PROP_BOOLEAN, PROP_NONE);
1881 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
1882 RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
1883 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1885 prop = RNA_def_property(srna, "draw_method", PROP_ENUM, PROP_NONE);
1886 RNA_def_property_enum_sdna(prop, NULL, "draw_as");
1887 RNA_def_property_enum_items(prop, part_draw_as_items);
1888 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf");
1889 RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport");
1890 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1892 prop = RNA_def_property(srna, "render_type", PROP_ENUM, PROP_NONE);
1893 RNA_def_property_enum_sdna(prop, NULL, "ren_as");
1894 RNA_def_property_enum_items(prop, part_ren_as_items);
1895 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf");
1896 RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered");
1897 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1899 prop = RNA_def_property(srna, "draw_color", PROP_ENUM, PROP_NONE);
1900 RNA_def_property_enum_sdna(prop, NULL, "draw_col");
1901 RNA_def_property_enum_items(prop, draw_col_items);
1902 RNA_def_property_ui_text(prop, "Draw Color", "Draw additional particle data as a color");
1903 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1905 prop = RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
1906 RNA_def_property_range(prop, 0, 1000);
1907 RNA_def_property_ui_range(prop, 0, 100, 1, 0);
1908 RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)");
1909 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1911 prop = RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
1912 RNA_def_property_enum_sdna(prop, NULL, "childtype");
1913 RNA_def_property_enum_items(prop, child_type_items);
1914 RNA_def_property_ui_text(prop, "Children From", "Create child particles");
1915 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1917 prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
1918 RNA_def_property_range(prop, 0, 10);
1919 RNA_def_property_ui_range(prop, 0, 7, 1, 0);
1920 RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)");
1921 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1923 prop = RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
1924 RNA_def_property_int_sdna(prop, NULL, "ren_step");
1925 RNA_def_property_range(prop, 0, 20);
1926 RNA_def_property_ui_range(prop, 0, 9, 1, 0);
1927 RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)");
1929 prop = RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
1930 RNA_def_property_range(prop, 2, 50);
1931 RNA_def_property_ui_text(prop, "Segments", "Number of hair segments");
1932 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1935 /*TODO: not found in UI, readonly? */
1936 prop = RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
1937 RNA_def_property_range(prop, 0, SHRT_MAX); /*TODO:min,max */
1938 RNA_def_property_ui_text(prop, "Keys Step", "");
1940 /* adaptive path rendering */
1941 prop = RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
1942 RNA_def_property_int_sdna(prop, NULL, "adapt_angle");
1943 RNA_def_property_range(prop, 0, 45);
1944 RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
1946 prop = RNA_def_property(srna, "adaptive_pixel", PROP_INT, PROP_NONE);
1947 RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
1948 RNA_def_property_range(prop, 0, 50);
1949 RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
1951 prop = RNA_def_property(srna, "draw_percentage", PROP_INT, PROP_NONE);
1952 RNA_def_property_int_sdna(prop, NULL, "disp");
1953 RNA_def_property_range(prop, 0, 100);
1954 RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3D view");
1955 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1957 prop = RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
1958 RNA_def_property_int_sdna(prop, NULL, "omat");
1959 RNA_def_property_range(prop, 1, 32767);
1960 RNA_def_property_ui_text(prop, "Material", "Material used for the particles");
1961 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1964 /* not used anywhere, why is this in DNA??? */
1966 prop = RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
1967 RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
1968 RNA_def_property_enum_items(prop, rot_from_items);
1969 RNA_def_property_ui_text(prop, "Rotate From", "");
1972 prop = RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
1973 RNA_def_property_enum_items(prop, integrator_type_items);
1974 RNA_def_property_ui_text(prop, "Integration",
1975 "Algorithm used to calculate physics, from the fastest to the "
1976 "most stable/accurate: Midpoint, Euler, Verlet, RK4 (Old)");
1977 RNA_def_property_update(prop, 0, "rna_Particle_reset");
1979 prop = RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
1980 RNA_def_property_enum_items(prop, kink_type_items);
1981 RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path");
1982 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1984 prop = RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
1985 RNA_def_property_enum_items(prop, kink_axis_items);
1986 RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
1987 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
1990 prop = RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE);
1991 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
1992 RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
1993 RNA_def_property_update(prop, 0, "rna_Particle_redo");
1995 prop = RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
1996 RNA_def_property_enum_sdna(prop, NULL, "bb_align");
1997 RNA_def_property_enum_items(prop, bb_align_items);
1998 RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned");
1999 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2001 prop = RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
2002 RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
2003 RNA_def_property_range(prop, 1, 100);
2004 RNA_def_property_ui_range(prop, 1, 10, 1, 0);
2005 RNA_def_property_ui_text(prop, "UV Split", "Number of rows/columns to split UV coordinates for billboards");
2007 prop = RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
2008 RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
2009 RNA_def_property_enum_items(prop, bb_anim_items);
2010 RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures");
2012 prop = RNA_def_property(srna, "billboard_offset_split", PROP_ENUM, PROP_NONE);
2013 RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
2014 RNA_def_property_enum_items(prop, bb_split_offset_items);
2015 RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
2017 prop = RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
2018 RNA_def_property_float_sdna(prop, NULL, "bb_tilt");
2019 RNA_def_property_range(prop, -1.0f, 1.0f);
2020 RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
2021 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2023 prop = RNA_def_property(srna, "color_maximum", PROP_FLOAT, PROP_NONE);
2024 RNA_def_property_float_sdna(prop, NULL, "color_vec_max");
2025 RNA_def_property_range(prop, 0.01f, 100.0f);
2026 RNA_def_property_ui_text(prop, "Color Maximum", "Maximum length of the particle color vector");
2027 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2029 prop = RNA_def_property(srna, "billboard_tilt_random", PROP_FLOAT, PROP_NONE);
2030 RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
2031 RNA_def_property_range(prop, 0.0f, 1.0f);
2032 RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
2033 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2035 prop = RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
2036 RNA_def_property_float_sdna(prop, NULL, "bb_offset");
2037 RNA_def_property_array(prop, 2);
2038 RNA_def_property_range(prop, -100.0f, 100.0f);
2039 RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
2040 RNA_def_property_ui_text(prop, "Billboard Offset", "");
2041 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2043 prop = RNA_def_property(srna, "billboard_size", PROP_FLOAT, PROP_FACTOR);
2044 RNA_def_property_float_sdna(prop, NULL, "bb_size");
2045 RNA_def_property_array(prop, 2);
2046 RNA_def_property_range(prop, 0.001f, 10.0f);
2047 RNA_def_property_ui_text(prop, "Billboard Scale", "Scale billboards relative to particle size");
2048 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2050 prop = RNA_def_property(srna, "billboard_velocity_head", PROP_FLOAT, PROP_FACTOR);
2051 RNA_def_property_float_sdna(prop, NULL, "bb_vel_head");
2052 RNA_def_property_range(prop, 0.0f, 10.0f);
2053 RNA_def_property_ui_text(prop, "Billboard Velocity Head", "Scale billboards by velocity");
2054 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2056 prop = RNA_def_property(srna, "billboard_velocity_tail", PROP_FLOAT, PROP_FACTOR);
2057 RNA_def_property_float_sdna(prop, NULL, "bb_vel_tail");
2058 RNA_def_property_range(prop, 0.0f, 10.0f);
2059 RNA_def_property_ui_text(prop, "Billboard Velocity Tail", "Scale billboards by velocity");
2060 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2062 /* simplification */
2063 prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
2064 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
2065 RNA_def_property_ui_text(prop, "Child Simplification",
2066 "Remove child strands as the object becomes smaller on the screen");
2068 prop = RNA_def_property(srna, "use_simplify_viewport", PROP_BOOLEAN, PROP_NONE);
2069 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
2070 RNA_def_property_ui_text(prop, "Viewport", "");
2072 prop = RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
2073 RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
2074 RNA_def_property_range(prop, 1, 32768);
2075 RNA_def_property_ui_text(prop, "Reference Size", "Reference size in pixels, after which simplification begins");
2077 prop = RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
2078 RNA_def_property_range(prop, 0.0f, 1.0f);
2079 RNA_def_property_ui_text(prop, "Rate", "Speed of simplification");
2081 prop = RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
2082 RNA_def_property_range(prop, 0.0f, 1.0f);
2083 RNA_def_property_ui_text(prop, "Transition", "Transition period for fading out strands");
2085 prop = RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
2086 RNA_def_property_range(prop, 0.0f, 0.999f);
2087 RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
2089 /* general values */
2090 prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
2091 RNA_def_property_float_sdna(prop, NULL, "sta"); /*optional if prop names are the same */
2092 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
2093 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2094 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
2095 RNA_def_property_ui_text(prop, "Start", "Frame number to start emitting particles");
2096 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2098 prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
2099 RNA_def_property_float_sdna(prop, NULL, "end");
2100 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
2102 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2103 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL);
2104 RNA_def_property_ui_text(prop, "End", "Frame number to stop emitting particles");
2105 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2107 prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
2108 RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
2109 RNA_def_property_ui_text(prop, "Lifetime", "Life span of the particles");
2110 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2112 prop = RNA_def_property(srna, "lifetime_random", PROP_FLOAT, PROP_NONE);
2113 RNA_def_property_float_sdna(prop, NULL, "randlife");
2114 RNA_def_property_range(prop, 0.0f, 1.0f);
2115 RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation");
2116 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2118 prop = RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
2119 RNA_def_property_float_sdna(prop, NULL, "timetweak");
2120 RNA_def_property_range(prop, 0.0f, 100.0f);
2121 RNA_def_property_ui_range(prop, 0, 10, 1, 3);
2122 RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
2123 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2125 prop = RNA_def_property(srna, "timestep", PROP_FLOAT, PROP_NONE);
2126 RNA_def_property_float_funcs(prop, "rna_PartSettings_timestep_get", "rna_PartSetings_timestep_set", NULL);
2127 RNA_def_property_range(prop, 0.0001, 100.0);
2128 RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
2129 RNA_def_property_ui_text(prop, "Timestep", "The simulation timestep per frame (seconds per frame)");
2130 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2132 prop = RNA_def_property(srna, "adaptive_subframes", PROP_BOOLEAN, PROP_NONE);
2133 RNA_def_property_boolean_sdna(prop, NULL, "time_flag", PART_TIME_AUTOSF);
2134 RNA_def_property_ui_text(prop, "Automatic Subframes", "Automatically set the number of subframes");
2135 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2137 prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
2138 RNA_def_property_range(prop, 0, 1000);
2139 RNA_def_property_ui_text(prop, "Subframes",
2140 "Subframes to simulate for improved stability and finer granularity simulations "
2141 "(dt = timestep / (subframes + 1))");
2142 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2144 prop = RNA_def_property(srna, "courant_target", PROP_FLOAT, PROP_NONE);
2145 RNA_def_property_range(prop, 0.0001, 10);
2146 RNA_def_property_float_default(prop, 0.1);
2147 RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold",
2148 "The relative distance a particle can move before requiring more subframes "
2149 "(target Courant number); 0.01-0.3 is the recommended range");
2150 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2152 prop = RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
2153 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2154 RNA_def_property_float_sdna(prop, NULL, "jitfac");
2155 RNA_def_property_range(prop, 0.0f, 2.0f);
2156 RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling");
2157 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2159 prop = RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
2160 RNA_def_property_float_sdna(prop, NULL, "eff_hair");
2161 RNA_def_property_range(prop, 0.0f, 1.0f);
2162 RNA_def_property_ui_text(prop, "Stiffness", "Hair stiffness for effectors");
2163 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2165 prop = RNA_def_property(srna, "count", PROP_INT, PROP_UNSIGNED);
2166 RNA_def_property_int_sdna(prop, NULL, "totpart");
2167 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2168 /* This limit is for those freaks who have the machine power to handle it. */
2169 /* 10M particles take around 2.2 Gb of memory / disk space in saved file and */
2170 /* each cached frame takes around 0.5 Gb of memory / disk space depending on cache mode. */
2171 RNA_def_property_range(prop, 0, 10000000);
2172 RNA_def_property_ui_range(prop, 0, 100000, 1, 0);
2173 RNA_def_property_ui_text(prop, "Number", "Total number of particles");
2174 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2176 prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED); /*TODO: can we get a better name for userjit? */
2177 RNA_def_property_int_sdna(prop, NULL, "userjit");
2178 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2179 RNA_def_property_range(prop, 0, 1000);
2180 RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)");
2181 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2183 prop = RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
2184 RNA_def_property_int_sdna(prop, NULL, "grid_res");
2185 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2186 RNA_def_property_range(prop, 1, 250); /* ~15M particles in a cube (ouch!), but could be very usable in a plane */
2187 RNA_def_property_ui_range(prop, 1, 50, 1, 0); /* ~100k particles in a cube */
2188 RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid");
2189 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2191 prop = RNA_def_property(srna, "grid_random", PROP_FLOAT, PROP_NONE);
2192 RNA_def_property_float_sdna(prop, NULL, "grid_rand");
2193 RNA_def_property_range(prop, 0.0f, 1.0f);
2194 RNA_def_property_ui_text(prop, "Grid Randomness", "Add random offset to the grid locations");
2195 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2197 prop = RNA_def_property(srna, "effector_amount", PROP_INT, PROP_UNSIGNED);
2198 /* in theory PROP_ANIMATABLE perhaps should be cleared, but animating this can give some interesting results! */
2199 RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will bel SLOW, but who knows */
2200 RNA_def_property_ui_range(prop, 0, 100, 1, 0);
2201 RNA_def_property_ui_text(prop, "Effector Number", "How many particles are effectors (0 is all particles)");
2202 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2204 /* initial velocity factors */
2205 prop = RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
2206 RNA_def_property_float_sdna(prop, NULL, "normfac"); /*optional if prop names are the same */
2207 RNA_def_property_range(prop, -1000.0f, 1000.0f);
2208 RNA_def_property_ui_range(prop, 0, 100, 1, 3);
2209 RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed");
2210 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2212 prop = RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
2213 RNA_def_property_float_sdna(prop, NULL, "obfac");
2214 RNA_def_property_range(prop, -200.0f, 200.0f);
2215 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
2216 RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
2217 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2219 prop = RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
2220 RNA_def_property_float_sdna(prop, NULL, "randfac"); /*optional if prop names are the same */
2221 RNA_def_property_range(prop, 0.0f, 200.0f);
2222 RNA_def_property_ui_range(prop, 0, 100, 1, 3);
2223 RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation");
2224 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2226 prop = RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
2227 RNA_def_property_float_sdna(prop, NULL, "partfac");
2228 RNA_def_property_range(prop, -200.0f, 200.0f);
2229 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
2230 RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed");
2231 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2233 prop = RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
2234 RNA_def_property_float_sdna(prop, NULL, "tanfac");
2235 RNA_def_property_range(prop, -1000.0f, 1000.0f);
2236 RNA_def_property_ui_range(prop, -100, 100, 1, 2);
2237 RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed");
2238 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2240 prop = RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
2241 RNA_def_property_float_sdna(prop, NULL, "tanphase");
2242 RNA_def_property_range(prop, -1.0f, 1.0f);
2243 RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent");
2244 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2246 prop = RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
2247 RNA_def_property_float_sdna(prop, NULL, "reactfac");
2248 RNA_def_property_range(prop, -10.0f, 10.0f);
2249 RNA_def_property_ui_text(prop, "Reactor",
2250 "Let the vector away from the target particle's location give the particle "
2251 "a starting speed");
2252 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2254 prop = RNA_def_property(srna, "object_align_factor", PROP_FLOAT, PROP_VELOCITY);
2255 RNA_def_property_float_sdna(prop, NULL, "ob_vel");
2256 RNA_def_property_array(prop, 3);
2257 RNA_def_property_range(prop, -200.0f, 200.0f);
2258 RNA_def_property_ui_range(prop, -100, 100, 1, 3);
2259 RNA_def_property_ui_text(prop, "Object Aligned",
2260 "Let the emitter object orientation give the particle a starting speed");
2261 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2263 prop = RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
2264 RNA_def_property_float_sdna(prop, NULL, "avefac");
2265 RNA_def_property_range(prop, -200.0f, 200.0f);
2266 RNA_def_property_ui_range(prop, -100, 100, 10, 3);
2267 RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount (in radians per second)");
2268 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2270 prop = RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
2271 RNA_def_property_float_sdna(prop, NULL, "phasefac");
2272 RNA_def_property_range(prop, -1.0f, 1.0f);
2273 RNA_def_property_ui_text(prop, "Phase", "Rotation around the chosen orientation axis");
2274 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2276 prop = RNA_def_property(srna, "rotation_factor_random", PROP_FLOAT, PROP_NONE);
2277 RNA_def_property_float_sdna(prop, NULL, "randrotfac");
2278 RNA_def_property_range(prop, 0.0f, 1.0f);
2279 RNA_def_property_ui_text(prop, "Random Orientation", "Randomize particle orientation");
2280 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2282 prop = RNA_def_property(srna, "phase_factor_random", PROP_FLOAT, PROP_NONE);
2283 RNA_def_property_float_sdna(prop, NULL, "randphasefac");
2284 RNA_def_property_range(prop, 0.0f, 1.0f);
2285 RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation around the chosen orientation axis");
2286 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2288 prop = RNA_def_property(srna, "hair_length", PROP_FLOAT, PROP_NONE);
2289 RNA_def_property_float_funcs(prop, "rna_PartSetting_hairlength_get", "rna_PartSetting_hairlength_set", NULL);
2290 RNA_def_property_range(prop, 0.0f, 1000.0f);
2291 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
2292 RNA_def_property_ui_text(prop, "Hair Length", "Length of the hair");
2293 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2295 /* physical properties */
2296 prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
2297 RNA_def_property_range(prop, 0.00000001f, 100000.0f);
2298 RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
2299 RNA_def_property_ui_text(prop, "Mass", "Mass of the particles");
2300 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2302 prop = RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
2303 RNA_def_property_float_sdna(prop, NULL, "size");
2304 RNA_def_property_range(prop, 0.001f, 100000.0f);
2305 RNA_def_property_ui_range(prop, 0.01, 100, 1, 3);
2306 RNA_def_property_ui_text(prop, "Size", "The size of the particles");
2307 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2309 prop = RNA_def_property(srna, "size_random", PROP_FLOAT, PROP_NONE);
2310 RNA_def_property_float_sdna(prop, NULL, "randsize");
2311 RNA_def_property_range(prop, 0.0f, 1.0f);
2312 RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
2313 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2316 /* global physical properties */
2317 prop = RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
2318 RNA_def_property_float_sdna(prop, NULL, "dragfac");
2319 RNA_def_property_range(prop, 0.0f, 1.0f);
2320 RNA_def_property_ui_text(prop, "Drag", "Amount of air-drag");
2321 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2323 prop = RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
2324 RNA_def_property_float_sdna(prop, NULL, "brownfac");
2325 RNA_def_property_range(prop, 0.0f, 200.0f);
2326 RNA_def_property_ui_range(prop, 0, 20, 1, 3);
2327 RNA_def_property_ui_text(prop, "Brownian", "Amount of Brownian motion");
2328 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2330 prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
2331 RNA_def_property_float_sdna(prop, NULL, "dampfac");
2332 RNA_def_property_range(prop, 0.0f, 1.0f);
2333 RNA_def_property_ui_text(prop, "Damp", "Amount of damping");
2334 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2337 prop = RNA_def_property(srna, "length_random", PROP_FLOAT, PROP_NONE);
2338 RNA_def_property_float_sdna(prop, NULL, "randlength");
2339 RNA_def_property_range(prop, 0.0f, 1.0f);
2340 RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation");
2341 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2344 prop = RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
2345 RNA_def_property_int_sdna(prop, NULL, "child_nbr"); /*optional if prop names are the same */
2346 RNA_def_property_range(prop, 0, 100000);
2347 RNA_def_property_ui_range(prop, 0, 1000, 1, 0);
2348 RNA_def_property_ui_text(prop, "Children Per Parent", "Number of children/parent");
2349 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2351 prop = RNA_def_property(srna, "rendered_child_count", PROP_INT, PROP_NONE);
2352 RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr");
2353 RNA_def_property_range(prop, 0, 100000);
2354 RNA_def_property_ui_range(prop, 0, 10000, 1, 0);
2355 RNA_def_property_ui_text(prop, "Rendered Children", "Number of children/parent for rendering");
2357 prop = RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
2358 RNA_def_property_float_sdna(prop, NULL, "parents");
2359 RNA_def_property_range(prop, 0.0f, 1.0f);
2360 RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents");
2361 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2363 prop = RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
2364 RNA_def_property_float_sdna(prop, NULL, "childsize");
2365 RNA_def_property_range(prop, 0.001f, 100000.0f);
2366 RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
2367 RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size");
2368 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2370 prop = RNA_def_property(srna, "child_size_random", PROP_FLOAT, PROP_NONE);
2371 RNA_def_property_float_sdna(prop, NULL, "childrandsize");
2372 RNA_def_property_range(prop, 0.0f, 1.0f);
2373 RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles");
2374 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2376 prop = RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
2377 RNA_def_property_float_sdna(prop, NULL, "childrad");
2378 RNA_def_property_range(prop, 0.0f, 10.0f);
2379 RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent");
2380 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2382 prop = RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
2383 RNA_def_property_float_sdna(prop, NULL, "childflat");
2384 RNA_def_property_range(prop, 0.0f, 1.0f);
2385 RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent");
2386 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2389 prop = RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
2390 RNA_def_property_float_sdna(prop, NULL, "clumpfac");
2391 RNA_def_property_range(prop, -1.0f, 1.0f);
2392 RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
2393 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2395 prop = RNA_def_property(srna, "clump_shape", PROP_FLOAT, PROP_NONE);
2396 RNA_def_property_float_sdna(prop, NULL, "clumppow");
2397 RNA_def_property_range(prop, -0.999f, 0.999f);
2398 RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
2399 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2403 prop = RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
2404 RNA_def_property_float_sdna(prop, NULL, "kink_amp");
2405 RNA_def_property_range(prop, -100000.0f, 100000.0f);
2406 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
2407 RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset");
2408 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2410 prop = RNA_def_property(srna, "kink_amplitude_clump", PROP_FLOAT, PROP_NONE);
2411 RNA_def_property_float_sdna(prop, NULL, "kink_amp_clump");
2412 RNA_def_property_range(prop, 0.0f, 1.0f);
2413 RNA_def_property_ui_text(prop, "Amplitude Clump", "How much clump affects kink amplitude");
2414 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2416 prop = RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
2417 RNA_def_property_float_sdna(prop, NULL, "kink_freq");
2418 RNA_def_property_range(prop, -100000.0f, 100000.0f);
2419 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
2420 RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
2421 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2423 prop = RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
2424 RNA_def_property_range(prop, -0.999f, 0.999f);
2425 RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
2426 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2428 prop = RNA_def_property(srna, "kink_flat", PROP_FLOAT, PROP_NONE);
2429 RNA_def_property_range(prop, 0.0f, 1.0f);
2430 RNA_def_property_ui_text(prop, "Flatness", "How flat the hairs are");
2431 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2434 prop = RNA_def_property(srna, "roughness_1", PROP_FLOAT, PROP_NONE);
2435 RNA_def_property_float_sdna(prop, NULL, "rough1");
2436 RNA_def_property_range(prop, 0.0f, 100000.0f);
2437 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
2438 RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough");
2439 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2441 prop = RNA_def_property(srna, "roughness_1_size", PROP_FLOAT, PROP_NONE);
2442 RNA_def_property_float_sdna(prop, NULL, "rough1_size");
2443 RNA_def_property_range(prop, 0.01f, 100000.0f);
2444 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
2445 RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough");
2446 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2448 prop = RNA_def_property(srna, "roughness_2", PROP_FLOAT, PROP_NONE);
2449 RNA_def_property_float_sdna(prop, NULL, "rough2");
2450 RNA_def_property_range(prop, 0.0f, 100000.0f);
2451 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
2452 RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough");
2453 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2455 prop = RNA_def_property(srna, "roughness_2_size", PROP_FLOAT, PROP_NONE);
2456 RNA_def_property_float_sdna(prop, NULL, "rough2_size");
2457 RNA_def_property_range(prop, 0.01f, 100000.0f);
2458 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
2459 RNA_def_property_ui_text(prop, "Size2", "Size of random rough");
2460 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2462 prop = RNA_def_property(srna, "roughness_2_threshold", PROP_FLOAT, PROP_NONE);
2463 RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
2464 RNA_def_property_range(prop, 0.0f, 1.0f);
2465 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough");
2466 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2468 prop = RNA_def_property(srna, "roughness_endpoint", PROP_FLOAT, PROP_NONE);
2469 RNA_def_property_float_sdna(prop, NULL, "rough_end");
2470 RNA_def_property_range(prop, 0.0f, 100000.0f);
2471 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
2472 RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough");
2473 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2475 prop = RNA_def_property(srna, "roughness_end_shape", PROP_FLOAT, PROP_NONE);
2476 RNA_def_property_float_sdna(prop, NULL, "rough_end_shape");
2477 RNA_def_property_range(prop, 0.0f, 10.0f);
2478 RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
2479 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2481 prop = RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
2482 RNA_def_property_float_sdna(prop, NULL, "clength");
2483 RNA_def_property_range(prop, 0.0f, 1.0f);
2484 RNA_def_property_ui_text(prop, "Length", "Length of child paths");
2485 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2487 prop = RNA_def_property(srna, "child_length_threshold", PROP_FLOAT, PROP_NONE);
2488 RNA_def_property_float_sdna(prop, NULL, "clength_thres");
2489 RNA_def_property_range(prop, 0.0f, 1.0f);
2490 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length");
2491 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2494 prop = RNA_def_property(srna, "child_parting_factor", PROP_FLOAT, PROP_NONE);
2495 RNA_def_property_float_sdna(prop, NULL, "parting_fac");
2496 RNA_def_property_range(prop, 0.0f, 1.0f);
2497 RNA_def_property_ui_text(prop, "Parting Factor", "Create parting in the children based on parent strands");
2498 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2500 prop = RNA_def_property(srna, "child_parting_min", PROP_FLOAT, PROP_NONE);
2501 RNA_def_property_float_sdna(prop, NULL, "parting_min");
2502 RNA_def_property_range(prop, 0.0f, 180.0f);
2503 RNA_def_property_ui_text(prop, "Parting Minimum",
2504 "Minimum root to tip angle (tip distance/root distance for long hair)");
2505 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2507 prop = RNA_def_property(srna, "child_parting_max", PROP_FLOAT, PROP_NONE);
2508 RNA_def_property_float_sdna(prop, NULL, "parting_max");
2509 RNA_def_property_range(prop, 0.0f, 180.0f);
2510 RNA_def_property_ui_text(prop, "Parting Maximum",
2511 "Maximum root to tip angle (tip distance/root distance for long hair)");
2512 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2515 prop = RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
2516 RNA_def_property_float_sdna(prop, NULL, "branch_thres");
2517 RNA_def_property_range(prop, 0.0f, 1.0f);
2518 RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching");
2519 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2522 prop = RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
2523 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL);
2524 RNA_def_property_range(prop, 0.0f, 100000.0f);
2525 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
2526 RNA_def_property_ui_text(prop, "Back", "Length of the line's tail");
2527 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2529 prop = RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
2530 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL);
2531 RNA_def_property_range(prop, 0.0f, 100000.0f);
2532 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
2533 RNA_def_property_ui_text(prop, "Head", "Length of the line's head");
2534 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2536 prop = RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE);
2537 RNA_def_property_float_sdna(prop, NULL, "path_start");
2538 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
2539 RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path");
2540 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2542 prop = RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE);
2543 RNA_def_property_float_sdna(prop, NULL, "path_end");
2544 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
2545 RNA_def_property_ui_text(prop, "Path End", "End time of drawn path");
2546 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2548 prop = RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE);
2549 RNA_def_property_int_sdna(prop, NULL, "trail_count");
2550 RNA_def_property_range(prop, 1, 100000);
2551 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
2552 RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles");
2553 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2555 /* keyed particles */
2556 prop = RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE);
2557 RNA_def_property_int_sdna(prop, NULL, "keyed_loops");
2558 RNA_def_property_range(prop, 1.0f, 10000.0f);
2559 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3);
2560 RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped");
2561 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2563 /* draw objects & groups */
2564 prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
2565 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
2566 RNA_def_property_struct_type(prop, "Group");
2567 RNA_def_property_flag(prop, PROP_EDITABLE);
2568 RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
2569 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2571 prop = RNA_def_property(srna, "dupli_weights", PROP_COLLECTION, PROP_NONE);
2572 RNA_def_property_collection_sdna(prop, NULL, "dupliweights", NULL);
2573 RNA_def_property_struct_type(prop, "ParticleDupliWeight");
2574 RNA_def_property_ui_text(prop, "Dupli Group Weights", "Weights for all of the objects in the dupli group");
2576 prop = RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE);
2577 RNA_def_property_struct_type(prop, "ParticleDupliWeight");
2578 RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL, NULL);
2579 RNA_def_property_ui_text(prop, "Active Dupli Object", "");
2581 prop = RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED);
2582 RNA_def_property_int_funcs(prop, "rna_ParticleDupliWeight_active_index_get",
2583 "rna_ParticleDupliWeight_active_index_set",
2584 "rna_ParticleDupliWeight_active_index_range");
2585 RNA_def_property_ui_text(prop, "Active Dupli Object Index", "");
2587 prop = RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
2588 RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
2589 RNA_def_property_struct_type(prop, "Object");
2590 RNA_def_property_flag(prop, PROP_EDITABLE);
2591 RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles");
2592 RNA_def_property_update(prop, 0, "rna_Particle_redo_dependency");
2594 prop = RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
2595 RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
2596 RNA_def_property_struct_type(prop, "Object");
2597 RNA_def_property_flag(prop, PROP_EDITABLE);
2598 RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
2599 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2602 prop = RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE);
2603 RNA_def_property_struct_type(prop, "BoidSettings");
2604 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2605 RNA_def_property_ui_text(prop, "Boid Settings", "");
2607 /* Fluid particles */
2608 prop = RNA_def_property(srna, "fluid", PROP_POINTER, PROP_NONE);
2609 RNA_def_property_struct_type(prop, "SPHFluidSettings");
2610 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2611 RNA_def_property_ui_text(prop, "SPH Fluid Settings", "");
2613 /* Effector weights */
2614 prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
2615 RNA_def_property_struct_type(prop, "EffectorWeights");
2616 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2617 RNA_def_property_ui_text(prop, "Effector Weights", "");
2619 /* animation here? */
2620 rna_def_animdata_common(srna);
2622 prop = RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE);
2623 RNA_def_property_pointer_sdna(prop, NULL, "pd");
2624 RNA_def_property_struct_type(prop, "FieldSettings");
2625 RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL, NULL);
2626 RNA_def_property_ui_text(prop, "Force Field 1", "");
2628 prop = RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE);
2629 RNA_def_property_pointer_sdna(prop, NULL, "pd2");
2630 RNA_def_property_struct_type(prop, "FieldSettings");
2631 RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL, NULL);
2632 RNA_def_property_ui_text(prop, "Force Field 2", "");
2635 static void rna_def_particle_target(BlenderRNA *brna)
2640 static EnumPropertyItem mode_items[] = {
2641 {PTARGET_MODE_FRIEND, "FRIEND", 0, "Friend", ""},
2642 {PTARGET_MODE_NEUTRAL, "NEUTRAL", 0, "Neutral", ""},
2643 {PTARGET_MODE_ENEMY, "ENEMY", 0, "Enemy", ""},
2644 {0, NULL, 0, NULL, NULL}
2648 srna = RNA_def_struct(brna, "ParticleTarget", NULL);
2649 RNA_def_struct_ui_text(srna, "Particle Target", "Target particle system");
2651 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2652 RNA_def_property_string_funcs(prop, "rna_ParticleTarget_name_get", "rna_ParticleTarget_name_length", NULL);
2653 RNA_def_property_ui_text(prop, "Name", "Particle target name");
2654 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2655 RNA_def_struct_name_property(srna, prop);
2657 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
2658 RNA_def_property_pointer_sdna(prop, NULL, "ob");
2659 RNA_def_property_flag(prop, PROP_EDITABLE);
2660 RNA_def_property_ui_text(prop, "Target Object",
2661 "The object that has the target particle system (empty if same object)");
2662 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2664 prop = RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED);
2665 RNA_def_property_int_sdna(prop, NULL, "psys");
2666 RNA_def_property_range(prop, 1, INT_MAX);
2667 RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object");
2668 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2670 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
2671 RNA_def_property_float_sdna(prop, NULL, "time");
2672 RNA_def_property_range(prop, 0.0, 30000.0f); /*TODO: replace 30000 with MAXFRAMEF when available in 2.5 */
2673 RNA_def_property_ui_text(prop, "Time", "");
2674 RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
2676 prop = RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE);
2677 RNA_def_property_float_sdna(prop, NULL, "duration");
2678 RNA_def_property_range(prop, 0.0, 30000.0f); /*TODO: replace 30000 with MAXFRAMEF when available in 2.5 */
2679 RNA_def_property_ui_text(prop, "Duration", "");
2680 RNA_def_property_update(prop, 0, "rna_Particle_target_redo");
2682 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
2683 RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID);
2684 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2685 RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid");
2687 prop = RNA_def_property(srna, "alliance", PROP_ENUM, PROP_NONE);
2688 RNA_def_property_enum_sdna(prop, NULL, "mode");
2689 RNA_def_property_enum_items(prop, mode_items);
2690 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2691 RNA_def_property_ui_text(prop, "Mode", "");
2692 RNA_def_property_update(prop, 0, "rna_Particle_target_reset");
2695 static void rna_def_particle_system(BlenderRNA *brna)
2700 srna = RNA_def_struct(brna, "ParticleSystem", NULL);
2701 RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object");
2702 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
2704 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2705 RNA_def_property_ui_text(prop, "Name", "Particle system name");
2706 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL);
2707 RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set");
2708 RNA_def_struct_name_property(srna, prop);
2710 /* access to particle settings is redirected through functions */
2711 /* to allow proper id-buttons functionality */
2712 prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
2713 /*RNA_def_property_pointer_sdna(prop, NULL, "part"); */
2714 RNA_def_property_struct_type(prop, "ParticleSettings");
2715 RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
2716 RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL);
2717 RNA_def_property_ui_text(prop, "Settings", "Particle system settings");
2718 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2720 prop = RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
2721 RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart");
2722 RNA_def_property_struct_type(prop, "Particle");
2723 RNA_def_property_ui_text(prop, "Particles", "Particles generated by the particle system");
2725 prop = RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
2726 RNA_def_property_collection_sdna(prop, NULL, "child", "totchild");
2727 RNA_def_property_struct_type(prop, "ChildParticle");
2728 RNA_def_property_ui_text(prop, "Child Particles", "Child particles generated by the particle system");
2730 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
2731 RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result");
2732 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2734 prop = RNA_def_property(srna, "child_seed", PROP_INT, PROP_UNSIGNED);
2735 RNA_def_property_ui_text(prop, "Child Seed",
2736 "Offset in the random number table for child particles, to get a different "
2737 "randomized result");
2738 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2741 prop = RNA_def_property(srna, "is_global_hair", PROP_BOOLEAN, PROP_NONE);
2742 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR);
2743 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2744 RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space");
2746 prop = RNA_def_property(srna, "use_hair_dynamics", PROP_BOOLEAN, PROP_NONE);
2747 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_HAIR_DYNAMICS);
2748 RNA_def_property_ui_text(prop, "Hair Dynamics", "Enable hair dynamics using cloth simulation");
2749 RNA_def_property_update(prop, 0, "rna_Particle_hair_dynamics");
2751 prop = RNA_def_property(srna, "cloth", PROP_POINTER, PROP_NONE);
2752 RNA_def_property_pointer_sdna(prop, NULL, "clmd");
2753 RNA_def_property_struct_type(prop, "ClothModifier");
2754 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2755 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2756 RNA_def_property_ui_text(prop, "Cloth", "Cloth dynamics for hair");
2759 prop = RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
2760 RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
2761 RNA_def_property_flag(prop, PROP_EDITABLE);
2762 RNA_def_property_ui_text(prop, "Reactor Target Object",
2763 "For reactor systems, the object that has the target particle system "
2764 "(empty if same object)");
2765 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2767 prop = RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
2768 RNA_def_property_int_sdna(prop, NULL, "target_psys");
2769 RNA_def_property_range(prop, 1, SHRT_MAX);
2770 RNA_def_property_ui_text(prop, "Reactor Target Particle System",
2771 "For reactor systems, index of particle system on the target object");
2772 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2775 prop = RNA_def_property(srna, "use_keyed_timing", PROP_BOOLEAN, PROP_NONE);
2776 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING);
2777 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
2778 RNA_def_property_ui_text(prop, "Keyed timing", "Use key times");
2779 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2781 prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
2782 RNA_def_property_struct_type(prop, "ParticleTarget");
2783 RNA_def_property_ui_text(prop, "Targets", "Target particle systems");
2785 prop = RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
2786 RNA_def_property_struct_type(prop, "ParticleTarget");
2787 RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL, NULL);
2788 RNA_def_property_ui_text(prop, "Active Particle Target", "");
2790 prop = RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
2791 RNA_def_property_int_funcs(prop, "rna_ParticleSystem_active_particle_target_index_get",
2792 "rna_ParticleSystem_active_particle_target_index_set",
2793 "rna_ParticleSystem_active_particle_target_index_range");
2794 RNA_def_property_ui_text(prop, "Active Particle Target Index", "");
2798 prop = RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
2799 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
2800 RNA_def_property_string_maxlength(prop, 32);
2801 RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV map to control billboard normals");
2803 prop = RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
2804 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
2805 RNA_def_property_string_maxlength(prop, 32);
2806 RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV map to control billboard time index (X-Y)");
2808 prop = RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
2809 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");
2810 RNA_def_property_string_maxlength(prop, 32);
2811 RNA_def_property_ui_text(prop, "Billboard Split UV", "UV map to control billboard splitting");
2815 /* note, internally store as ints, access as strings */
2816 #if 0 /* int access. works ok but isn't useful for the UI */
2817 prop = RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
2818 RNA_def_property_int_sdna(prop, NULL, "vgroup[0]");
2819 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
2820 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2823 prop = RNA_def_property(srna, "vertex_group_density", PROP_STRING, PROP_NONE);
2824 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_0", "rna_ParticleVGroup_name_len_0",
2825 "rna_ParticleVGroup_name_set_0");
2826 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density");
2827 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2829 prop = RNA_def_property(srna, "invert_vertex_group_density", PROP_BOOLEAN, PROP_NONE);
2830 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
2831 RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group");
2832 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2834 prop = RNA_def_property(srna, "vertex_group_velocity", PROP_STRING, PROP_NONE);
2835 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_1", "rna_ParticleVGroup_name_len_1",
2836 "rna_ParticleVGroup_name_set_1");
2837 RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity");
2838 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2840 prop = RNA_def_property(srna, "invert_vertex_group_velocity", PROP_BOOLEAN, PROP_NONE);
2841 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
2842 RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group");
2843 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2845 prop = RNA_def_property(srna, "vertex_group_length", PROP_STRING, PROP_NONE);
2846 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_2", "rna_ParticleVGroup_name_len_2",
2847 "rna_ParticleVGroup_name_set_2");
2848 RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length");
2849 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2851 prop = RNA_def_property(srna, "invert_vertex_group_length", PROP_BOOLEAN, PROP_NONE);
2852 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
2853 RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group");
2854 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2856 prop = RNA_def_property(srna, "vertex_group_clump", PROP_STRING, PROP_NONE);
2857 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_3", "rna_ParticleVGroup_name_len_3",
2858 "rna_ParticleVGroup_name_set_3");
2859 RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump");
2860 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2862 prop = RNA_def_property(srna, "invert_vertex_group_clump", PROP_BOOLEAN, PROP_NONE);
2863 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
2864 RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group");
2865 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2867 prop = RNA_def_property(srna, "vertex_group_kink", PROP_STRING, PROP_NONE);
2868 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_4", "rna_ParticleVGroup_name_len_4",
2869 "rna_ParticleVGroup_name_set_4");
2870 RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink");
2871 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2873 prop = RNA_def_property(srna, "invert_vertex_group_kink", PROP_BOOLEAN, PROP_NONE);
2874 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
2875 RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group");
2876 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2878 prop = RNA_def_property(srna, "vertex_group_roughness_1", PROP_STRING, PROP_NONE);
2879 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_5", "rna_ParticleVGroup_name_len_5",
2880 "rna_ParticleVGroup_name_set_5");
2881 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1");
2882 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2884 prop = RNA_def_property(srna, "invert_vertex_group_roughness_1", PROP_BOOLEAN, PROP_NONE);
2885 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
2886 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate",
2887 "Negate the effect of the roughness 1 vertex group");
2888 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2890 prop = RNA_def_property(srna, "vertex_group_roughness_2", PROP_STRING, PROP_NONE);
2891 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_6", "rna_ParticleVGroup_name_len_6",
2892 "rna_ParticleVGroup_name_set_6");
2893 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2");
2894 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2896 prop = RNA_def_property(srna, "invert_vertex_group_roughness_2", PROP_BOOLEAN, PROP_NONE);
2897 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
2898 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate",
2899 "Negate the effect of the roughness 2 vertex group");
2900 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2902 prop = RNA_def_property(srna, "vertex_group_roughness_end", PROP_STRING, PROP_NONE);
2903 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_7", "rna_ParticleVGroup_name_len_7",
2904 "rna_ParticleVGroup_name_set_7");
2905 RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end");
2906 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2908 prop = RNA_def_property(srna, "invert_vertex_group_roughness_end", PROP_BOOLEAN, PROP_NONE);
2909 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
2910 RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate",
2911 "Negate the effect of the roughness end vertex group");
2912 RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
2914 prop = RNA_def_property(srna, "vertex_group_size", PROP_STRING, PROP_NONE);
2915 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_8", "rna_ParticleVGroup_name_len_8",
2916 "rna_ParticleVGroup_name_set_8");
2917 RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size");
2918 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2920 prop = RNA_def_property(srna, "invert_vertex_group_size", PROP_BOOLEAN, PROP_NONE);
2921 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
2922 RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group");
2923 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2925 prop = RNA_def_property(srna, "vertex_group_tangent", PROP_STRING, PROP_NONE);
2926 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_9", "rna_ParticleVGroup_name_len_9",
2927 "rna_ParticleVGroup_name_set_9");
2928 RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent");
2929 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2931 prop = RNA_def_property(srna, "invert_vertex_group_tangent", PROP_BOOLEAN, PROP_NONE);
2932 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
2933 RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group");
2934 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2936 prop = RNA_def_property(srna, "vertex_group_rotation", PROP_STRING, PROP_NONE);
2937 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_10", "rna_ParticleVGroup_name_len_10",
2938 "rna_ParticleVGroup_name_set_10");
2939 RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation");
2940 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2942 prop = RNA_def_property(srna, "invert_vertex_group_rotation", PROP_BOOLEAN, PROP_NONE);
2943 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
2944 RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group");
2945 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2947 prop = RNA_def_property(srna, "vertex_group_field", PROP_STRING, PROP_NONE);
2948 RNA_def_property_string_funcs(prop, "rna_ParticleVGroup_name_get_11", "rna_ParticleVGroup_name_len_11",
2949 "rna_ParticleVGroup_name_set_11");
2950 RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field");
2951 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2953 prop = RNA_def_property(srna, "invert_vertex_group_field", PROP_BOOLEAN, PROP_NONE);
2954 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
2955 RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group");
2956 RNA_def_property_update(prop, 0, "rna_Particle_reset");
2959 prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
2960 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2961 RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
2962 RNA_def_property_struct_type(prop, "PointCache");
2963 RNA_def_property_ui_text(prop, "Point Cache", "");
2965 prop = RNA_def_property(srna, "has_multiple_caches", PROP_BOOLEAN, PROP_NONE);
2966 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL);
2967 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2968 RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches");
2971 prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
2972 RNA_def_property_pointer_sdna(prop, NULL, "parent");
2973 RNA_def_property_flag(prop, PROP_EDITABLE);
2974 RNA_def_property_ui_text(prop, "Parent",
2975 "Use this object's coordinate system instead of global coordinate system");
2976 RNA_def_property_update(prop, 0, "rna_Particle_redo");
2978 /* hair or cache editing */
2979 prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
2980 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL);
2981 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2982 RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode");
2984 prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
2985 RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL);
2986 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2987 RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
2989 /* Read-only: this is calculated internally. Changing it would only affect
2990 * the next time-step. The user should change ParticlSettings.subframes or
2991 * ParticleSettings.courant_target instead. */
2992 prop = RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE);
2993 RNA_def_property_range(prop, 1.0f / 101.0f, 1.0f);
2994 RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame");
2995 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
2997 RNA_def_struct_path_func(srna, "rna_ParticleSystem_path");
3000 void RNA_def_particle(BlenderRNA *brna)
3002 rna_def_particle_target(brna);
3003 rna_def_fluid_settings(brna);
3004 rna_def_particle_hair_key(brna);
3005 rna_def_particle_key(brna);
3007 rna_def_child_particle(brna);
3008 rna_def_particle(brna);
3009 rna_def_particle_dupliweight(brna);
3010 rna_def_particle_system(brna);
3011 rna_def_particle_settings_mtex(brna);
3012 rna_def_particle_settings(brna);