4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
30 #include "RNA_define.h"
31 #include "RNA_types.h"
32 #include "RNA_access.h"
34 #include "rna_internal.h"
36 #include "DNA_particle_types.h"
37 #include "DNA_object_force.h"
38 #include "DNA_object_types.h"
39 #include "DNA_scene_types.h"
40 #include "DNA_boid_types.h"
45 EnumPropertyItem part_from_items[] = {
46 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
47 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
48 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
49 {0, NULL, 0, NULL, NULL}
52 EnumPropertyItem part_reactor_from_items[] = {
53 {PART_FROM_VERT, "VERT", 0, "Verts", ""},
54 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
55 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
56 {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""},
57 {0, NULL, 0, NULL, NULL}
60 EnumPropertyItem part_draw_as_items[] = {
61 {PART_DRAW_NOT, "NONE", 0, "None", ""},
62 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
63 {PART_DRAW_DOT, "DOT", 0, "Point", ""},
64 {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""},
65 {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""},
66 {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""},
67 {0, NULL, 0, NULL, NULL}
70 EnumPropertyItem part_hair_draw_as_items[] = {
71 {PART_DRAW_NOT, "NONE", 0, "None", ""},
72 {PART_DRAW_REND, "RENDER", 0, "Rendered", ""},
73 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
74 {0, NULL, 0, NULL, NULL}
77 EnumPropertyItem part_ren_as_items[] = {
78 {PART_DRAW_NOT, "NONE", 0, "None", ""},
79 {PART_DRAW_HALO, "HALO", 0, "Halo", ""},
80 {PART_DRAW_LINE, "LINE", 0, "Line", ""},
81 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
82 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
83 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
84 {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""},
85 {0, NULL, 0, NULL, NULL}
88 EnumPropertyItem part_hair_ren_as_items[] = {
89 {PART_DRAW_NOT, "NONE", 0, "None", ""},
90 {PART_DRAW_PATH, "PATH", 0, "Path", ""},
91 {PART_DRAW_OB, "OBJECT", 0, "Object", ""},
92 {PART_DRAW_GR, "GROUP", 0, "Group", ""},
93 {0, NULL, 0, NULL, NULL}
98 #include "BKE_context.h"
99 #include "BKE_depsgraph.h"
100 #include "BKE_particle.h"
102 #include "BLI_arithb.h"
104 /* property update functions */
105 static void rna_Particle_redo(bContext *C, PointerRNA *ptr)
107 Scene *scene = CTX_data_scene(C);
108 ParticleSettings *part;
109 if(ptr->type==&RNA_ParticleSystem) {
110 ParticleSystem *psys = (ParticleSystem*)ptr->data;
111 Object *ob = psys_find_object(scene, psys);
113 psys->recalc = PSYS_RECALC_REDO;
116 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
120 psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO);
124 static void rna_Particle_reset(bContext *C, PointerRNA *ptr)
126 Scene *scene = CTX_data_scene(C);
127 ParticleSettings *part;
129 if(ptr->type==&RNA_ParticleSystem) {
130 ParticleSystem *psys = (ParticleSystem*)ptr->data;
131 Object *ob = psys_find_object(scene, psys);
133 psys->recalc = PSYS_RECALC_RESET;
136 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
141 psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET);
145 static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr)
147 Scene *scene = CTX_data_scene(C);
149 if(ptr->type==&RNA_ParticleTarget) {
150 ParticleTarget *pt = (ParticleTarget*)ptr->data;
151 Object *ob = (Object*)ptr->id.data;
152 ParticleSystem *kpsys=NULL, *psys=psys_get_current(ob);
154 if(pt->ob==ob || pt->ob==NULL) {
155 kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1);
158 pt->flag |= PTARGET_VALID;
160 pt->flag &= ~PTARGET_VALID;
164 kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
167 pt->flag |= PTARGET_VALID;
169 pt->flag &= ~PTARGET_VALID;
172 psys->recalc = PSYS_RECALC_RESET;
174 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
175 DAG_scene_sort(scene);
179 static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr)
181 Scene *scene = CTX_data_scene(C);
183 if(ptr->type==&RNA_ParticleTarget) {
184 Object *ob = (Object*)ptr->id.data;
185 ParticleSystem *psys = psys_get_current(ob);
187 psys->recalc = PSYS_RECALC_REDO;
189 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
193 static void rna_Particle_change_type(bContext *C, PointerRNA *ptr)
195 Scene *scene = CTX_data_scene(C);
196 ParticleSettings *part;
198 if(ptr->type==&RNA_ParticleSystem) {
199 ParticleSystem *psys = (ParticleSystem*)ptr->data;
200 Object *ob = psys_find_object(scene, psys);
202 psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE;
205 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
210 psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
214 static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr)
216 Scene *scene = CTX_data_scene(C);
217 ParticleSettings *part = ptr->id.data;
218 psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
221 static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr)
223 Scene *scene = CTX_data_scene(C);
224 ParticleSettings *part;
226 if(ptr->type==&RNA_ParticleSystem) {
227 ParticleSystem *psys = (ParticleSystem*)ptr->data;
228 Object *ob = psys_find_object(scene, psys);
230 psys->recalc = PSYS_RECALC_CHILD;
233 DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
238 psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD);
241 static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
243 Object *ob= (Object*)ptr->id.data;
244 ParticleSettings *part = psys_get_current(ob)->part;
246 return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
249 static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
251 Object *ob= (Object*)ptr->id.data;
252 ParticleSystem *psys = psys_get_current(ob);
257 psys->part = (ParticleSettings *)value.data;
261 psys_check_boid_data(psys);
264 static void rna_Particle_abspathtime_update(bContext *C, PointerRNA *ptr)
266 ParticleSettings *settings = (ParticleSettings*)ptr->data;
267 float delta = settings->end + settings->lifetime - settings->sta;
268 if(settings->draw & PART_ABS_PATH_TIME) {
269 settings->path_start = settings->sta + settings->path_start * delta;
270 settings->path_end = settings->sta + settings->path_end * delta;
273 settings->path_start = (settings->path_start - settings->sta)/delta;
274 settings->path_end = (settings->path_end - settings->sta)/delta;
276 rna_Particle_redo(C, ptr);
278 static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
280 ParticleSettings *settings = (ParticleSettings*)ptr->data;
282 /* check for clipping */
283 if(value > settings->end)
284 value = settings->end;
286 if(settings->type==PART_REACTOR && value < 1.0)
288 else if (value < MINAFRAMEF)
291 settings->sta = value;
294 static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
296 ParticleSettings *settings = (ParticleSettings*)ptr->data;
298 /* check for clipping */
299 if(value < settings->sta)
300 value = settings->sta;
302 settings->end = value;
305 static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value)
307 ParticleSettings *settings = (ParticleSettings*)ptr->data;
308 settings->draw_line[0] = value;
311 static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
313 ParticleSettings *settings = (ParticleSettings*)ptr->data;
314 return settings->draw_line[0];
316 static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max)
318 ParticleSettings *settings = (ParticleSettings*)ptr->data;
320 if(settings->type==PART_HAIR) {
322 *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0;
325 *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f;
326 *max= (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f;
329 static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
331 ParticleSettings *settings = (ParticleSettings*)ptr->data;
332 settings->draw_line[1] = value;
335 static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
337 ParticleSettings *settings = (ParticleSettings*)ptr->data;
338 return settings->draw_line[1];
341 static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
343 ParticleSystem *psys= (ParticleSystem*)ptr->data;
344 ParticleTarget *pt = psys->targets.first;
346 for(; pt; pt=pt->next) {
347 if(pt->flag & PTARGET_CURRENT)
348 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, pt);
350 return rna_pointer_inherit_refine(ptr, &RNA_ParticleTarget, NULL);
352 static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max)
354 ParticleSystem *psys= (ParticleSystem*)ptr->data;
356 *max= BLI_countlist(&psys->targets)-1;
360 static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
362 ParticleSystem *psys= (ParticleSystem*)ptr->data;
363 ParticleTarget *pt = psys->targets.first;
366 for(; pt; pt=pt->next, i++)
367 if(pt->flag & PTARGET_CURRENT)
373 static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value)
375 ParticleSystem *psys= (ParticleSystem*)ptr->data;
376 ParticleTarget *pt = psys->targets.first;
379 for(; pt; pt=pt->next, i++) {
381 pt->flag |= PTARGET_CURRENT;
383 pt->flag &= ~PTARGET_CURRENT;
386 static int rna_ParticleTarget_name_length(PointerRNA *ptr)
388 ParticleTarget *pt= ptr->data;
390 if(pt->flag & PTARGET_VALID) {
391 ParticleSystem *psys = NULL;
394 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
396 Object *ob = (Object*) ptr->id.data;
397 psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
402 return strlen(pt->ob->id.name+2) + 2 + strlen(psys->name);
404 return strlen(psys->name);
413 static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
415 ParticleTarget *pt= ptr->data;
417 if(pt->flag & PTARGET_VALID) {
418 ParticleSystem *psys = NULL;
421 psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
423 Object *ob = (Object*) ptr->id.data;
424 psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
429 sprintf(str, "%s: %s", pt->ob->id.name+2, psys->name);
431 strcpy(str, psys->name);
434 strcpy(str, "Invalid target!");
437 strcpy(str, "Invalid target!");
440 EnumPropertyItem from_items[] = {
441 {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
442 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
443 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
444 {0, NULL, 0, NULL, NULL}
447 EnumPropertyItem reactor_from_items[] = {
448 {PART_FROM_VERT, "VERT", 0, "Vertexes", ""},
449 {PART_FROM_FACE, "FACE", 0, "Faces", ""},
450 {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""},
451 {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""},
452 {0, NULL, 0, NULL, NULL}
455 static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free)
457 ParticleSettings *part = ptr->id.data;
460 EnumPropertyItem *item= NULL;
463 /* needed for doc generation */
464 RNA_enum_items_add(&item, &totitem, part_reactor_from_items);
465 RNA_enum_items_add(&item, &totitem, part_from_items);
466 RNA_enum_item_end(&item, &totitem);
473 if(part->type==PART_REACTOR)
474 return part_reactor_from_items;
476 return part_from_items;
479 static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *C, PointerRNA *ptr, int *free)
481 ParticleSettings *part = ptr->id.data;
484 EnumPropertyItem *item= NULL;
487 /* needed for doc generation */
488 RNA_enum_items_add(&item, &totitem, part_hair_draw_as_items);
489 RNA_enum_items_add(&item, &totitem, part_draw_as_items);
490 RNA_enum_item_end(&item, &totitem);
497 if(part->type==PART_HAIR)
498 return part_hair_draw_as_items;
500 return part_draw_as_items;
503 static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr, int *free)
505 ParticleSettings *part = ptr->id.data;
508 EnumPropertyItem *item= NULL;
511 /* needed for doc generation */
512 RNA_enum_items_add(&item, &totitem, part_hair_ren_as_items);
513 RNA_enum_items_add(&item, &totitem, part_ren_as_items);
514 RNA_enum_item_end(&item, &totitem);
521 if(part->type==PART_HAIR)
522 return part_hair_ren_as_items;
524 return part_ren_as_items;
530 static void rna_def_particle_hair_key(BlenderRNA *brna)
535 srna = RNA_def_struct(brna, "ParticleHairKey", NULL);
536 RNA_def_struct_sdna(srna, "HairKey");
537 RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system.");
539 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
540 RNA_def_property_float_sdna(prop, NULL, "co");
541 RNA_def_property_ui_text(prop, "Location", "Key location.");
543 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
544 RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length.");
546 prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
547 RNA_def_property_ui_text(prop, "Weight", "Weight for softbody simulation.");
550 static void rna_def_particle_key(BlenderRNA *brna)
555 srna = RNA_def_struct(brna, "ParticleKey", NULL);
556 RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time.");
558 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
559 RNA_def_property_float_sdna(prop, NULL, "co");
560 RNA_def_property_ui_text(prop, "Location", "Key location.");
562 prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
563 RNA_def_property_float_sdna(prop, NULL, "vel");
564 RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
566 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
567 RNA_def_property_float_sdna(prop, NULL, "rot");
568 RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaterion.");
570 prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
571 RNA_def_property_float_sdna(prop, NULL, "ave");
572 RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity.");
574 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
575 RNA_def_property_ui_text(prop, "Time", "Time of key over the simulation.");
578 static void rna_def_child_particle(BlenderRNA *brna)
583 srna = RNA_def_struct(brna, "ChildParticle", NULL);
584 RNA_def_struct_ui_text(srna, "Child Particle", "Child particle interpolated from simulated or edited particles.");
586 // int num, parent; /* num is face index on the final derived mesh */
588 // int pa[4]; /* nearest particles to the child, used for the interpolation */
589 // float w[4]; /* interpolation weights for the above particles */
590 // float fuv[4], foffset; /* face vertex weights and offset */
594 static void rna_def_particle(BlenderRNA *brna)
599 static EnumPropertyItem alive_items[] = {
600 {PARS_KILLED, "KILLED", 0, "Killed", ""},
601 {PARS_DEAD, "DEAD", 0, "Dead", ""},
602 {PARS_UNBORN, "UNBORN", 0, "Unborn", ""},
603 {PARS_ALIVE, "ALIVE", 0, "Alive", ""},
604 {PARS_DYING, "DYING", 0, "Dying", ""},
605 {0, NULL, 0, NULL, NULL}
608 srna = RNA_def_struct(brna, "Particle", NULL);
609 RNA_def_struct_sdna(srna, "ParticleData");
610 RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system.");
612 prop= RNA_def_property(srna, "stick_object", PROP_POINTER, PROP_NONE);
613 RNA_def_property_pointer_sdna(prop, NULL, "stick_ob");
614 RNA_def_property_struct_type(prop, "Object");
615 RNA_def_property_flag(prop, PROP_EDITABLE);
616 RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead");
618 /* Particle State & Previous State */
619 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
620 RNA_def_property_float_sdna(prop, NULL, "state.co");
621 RNA_def_property_ui_text(prop, "Particle Location", "");
623 prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
624 RNA_def_property_float_sdna(prop, NULL, "state.vel");
625 RNA_def_property_ui_text(prop, "Particle Velocity", "");
627 prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_VELOCITY);
628 RNA_def_property_float_sdna(prop, NULL, "state.ave");
629 RNA_def_property_ui_text(prop, "Angular Velocity", "");
631 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
632 RNA_def_property_float_sdna(prop, NULL, "state.rot");
633 RNA_def_property_ui_text(prop, "Rotation", "");
635 prop= RNA_def_property(srna, "prev_location", PROP_FLOAT, PROP_TRANSLATION);
636 RNA_def_property_float_sdna(prop, NULL, "prev_state.co");
637 RNA_def_property_ui_text(prop, "Previous Particle Location", "");
639 prop= RNA_def_property(srna, "prev_velocity", PROP_FLOAT, PROP_VELOCITY);
640 RNA_def_property_float_sdna(prop, NULL, "prev_state.vel");
641 RNA_def_property_ui_text(prop, "Previous Particle Velocity", "");
643 prop= RNA_def_property(srna, "prev_angular_velocity", PROP_FLOAT, PROP_VELOCITY);
644 RNA_def_property_float_sdna(prop, NULL, "prev_state.ave");
645 RNA_def_property_ui_text(prop, "Previous Angular Velocity", "");
647 prop= RNA_def_property(srna, "prev_rotation", PROP_FLOAT, PROP_QUATERNION);
648 RNA_def_property_float_sdna(prop, NULL, "prev_state.rot");
649 RNA_def_property_ui_text(prop, "Previous Rotation", "");
651 /* Hair & Keyed Keys */
653 prop= RNA_def_property(srna, "hair", PROP_COLLECTION, PROP_NONE);
654 RNA_def_property_collection_sdna(prop, NULL, "hair", "totkey");
655 RNA_def_property_struct_type(prop, "ParticleHairKey");
656 RNA_def_property_ui_text(prop, "Hair", "");
658 prop= RNA_def_property(srna, "keys", PROP_COLLECTION, PROP_NONE);
659 RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey");
660 RNA_def_property_struct_type(prop, "ParticleKey");
661 RNA_def_property_ui_text(prop, "Keyed States", "");
663 /* Random variables */
665 prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_QUATERNION);
666 RNA_def_property_float_sdna(prop, NULL, "r_rot");
667 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
668 RNA_def_property_ui_text(prop, "Random Rotation", "");
670 prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_VELOCITY);
671 RNA_def_property_float_sdna(prop, NULL, "r_ave");
672 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
673 RNA_def_property_ui_text(prop, "Random Angular Velocity", "");
675 prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_VELOCITY);
676 RNA_def_property_float_sdna(prop, NULL, "r_ve");
677 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
678 RNA_def_property_ui_text(prop, "Random Velocity", "");
681 // float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
682 // /* face normal for volume emission */
684 prop= RNA_def_property(srna, "birthtime", PROP_FLOAT, PROP_TIME);
685 RNA_def_property_float_sdna(prop, NULL, "time");
686 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
687 RNA_def_property_ui_text(prop, "Birth Time", "");
689 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
690 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
691 RNA_def_property_ui_text(prop, "Lifetime", "");
693 prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_TIME);
694 RNA_def_property_float_sdna(prop, NULL, "dietime");
695 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
696 RNA_def_property_ui_text(prop, "Die Time", "");
698 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
699 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
700 RNA_def_property_ui_text(prop, "Size", "");
702 prop= RNA_def_property(srna, "size_multiplier", PROP_FLOAT, PROP_NONE);
703 RNA_def_property_float_sdna(prop, NULL, "sizemul");
704 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
705 RNA_def_property_ui_text(prop, "Size Multiplier", "");
708 // int num; /* index to vert/edge/face */
709 // int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
713 // int bpi; /* softbody body point start index */
716 prop= RNA_def_property(srna, "unexist", PROP_BOOLEAN, PROP_NONE);
717 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_UNEXIST);
718 RNA_def_property_ui_text(prop, "unexist", "");
720 prop= RNA_def_property(srna, "no_disp", PROP_BOOLEAN, PROP_NONE);
721 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_NO_DISP);
722 RNA_def_property_ui_text(prop, "no_disp", "");
724 prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
725 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY);
726 RNA_def_property_ui_text(prop, "sticky", "");
728 prop= RNA_def_property(srna, "transform", PROP_BOOLEAN, PROP_NONE);
729 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TRANSFORM);
730 RNA_def_property_ui_text(prop, "transform", "");
732 prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
733 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_HIDE);
734 RNA_def_property_ui_text(prop, "hide", "");
736 prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
737 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TAG);
738 RNA_def_property_ui_text(prop, "tag", "");
740 prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE);
741 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY);
742 RNA_def_property_ui_text(prop, "rekey", "");
744 prop= RNA_def_property(srna, "edit_recalc", PROP_BOOLEAN, PROP_NONE);
745 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_EDIT_RECALC);
746 RNA_def_property_ui_text(prop, "edit_recalc", "");
749 prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
750 RNA_def_property_enum_sdna(prop, NULL, "alive");
751 RNA_def_property_enum_items(prop, alive_items);
752 RNA_def_property_ui_text(prop, "Alive State", "");
754 prop= RNA_def_property(srna, "loop", PROP_INT, PROP_NONE);
755 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
757 RNA_def_property_ui_text(prop, "Loop", "How may times the particle life has looped");
762 static void rna_def_particle_settings(BlenderRNA *brna)
767 static EnumPropertyItem type_items[] = {
768 {PART_EMITTER, "EMITTER", 0, "Emitter", ""},
769 {PART_REACTOR, "REACTOR", 0, "Reactor", ""},
770 {PART_HAIR, "HAIR", 0, "Hair", ""},
771 {0, NULL, 0, NULL, NULL}
774 static EnumPropertyItem dist_items[] = {
775 {PART_DISTR_JIT, "JIT", 0, "Jittered", ""},
776 {PART_DISTR_RAND, "RAND", 0, "Random", ""},
777 {PART_DISTR_GRID, "GRID", 0, "Grid", ""},
778 {0, NULL, 0, NULL, NULL}
781 static EnumPropertyItem phys_type_items[] = {
782 {PART_PHYS_NO, "NO", 0, "No", ""},
783 {PART_PHYS_NEWTON, "NEWTON", 0, "Newtonian", ""},
784 {PART_PHYS_KEYED, "KEYED", 0, "Keyed", ""},
785 {PART_PHYS_BOIDS, "BOIDS", 0, "Boids", ""},
786 {0, NULL, 0, NULL, NULL}
789 static EnumPropertyItem rot_mode_items[] = {
790 {0, "NONE", 0, "None", ""},
791 {PART_ROT_NOR, "NOR", 0, "Normal", ""},
792 {PART_ROT_VEL, "VEL", 0, "Velocity", ""},
793 {PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""},
794 {PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""},
795 {PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""},
796 {PART_ROT_OB_X, "OB_X", 0, "Object X", ""},
797 {PART_ROT_OB_Y, "OB_Y", 0, "Object Y", ""},
798 {PART_ROT_OB_Z, "OB_Z", 0, "Object Z", ""},
799 {0, NULL, 0, NULL, NULL}
802 static EnumPropertyItem ave_mode_items[] = {
803 {0, "NONE", 0, "None", ""},
804 {PART_AVE_SPIN, "SPIN", 0, "Spin", ""},
805 {PART_AVE_RAND, "RAND", 0, "Random", ""} ,
806 {0, NULL, 0, NULL, NULL}
809 static EnumPropertyItem react_event_items[] = {
810 {PART_EVENT_DEATH, "DEATH", 0, "Death", ""},
811 {PART_EVENT_COLLIDE, "COLLIDE", 0, "Collision", ""},
812 {PART_EVENT_NEAR, "NEAR", 0, "Near", ""},
813 {0, NULL, 0, NULL, NULL}
816 static EnumPropertyItem child_type_items[] = {
817 {0, "NONE", 0, "None", ""},
818 {PART_CHILD_PARTICLES, "PARTICLES", 0, "Particles", ""},
819 {PART_CHILD_FACES, "FACES", 0, "Faces", ""},
820 {0, NULL, 0, NULL, NULL}
823 //TODO: names, tooltips
824 static EnumPropertyItem rot_from_items[] = {
825 {PART_ROT_KEYS, "KEYS", 0, "keys", ""},
826 {PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""},
827 {PART_ROT_IINCR, "IINCR", 0, "iincr", ""},
828 {0, NULL, 0, NULL, NULL}
831 static EnumPropertyItem integrator_type_items[] = {
832 {PART_INT_EULER, "EULER", 0, "Euler", ""},
833 {PART_INT_MIDPOINT, "MIDPOINT", 0, "Midpoint", ""},
834 {PART_INT_RK4, "RK4", 0, "RK4", ""},
835 {0, NULL, 0, NULL, NULL}
838 static EnumPropertyItem kink_type_items[] = {
839 {PART_KINK_NO, "NO", 0, "Nothing", ""},
840 {PART_KINK_CURL, "CURL", 0, "Curl", ""},
841 {PART_KINK_RADIAL, "RADIAL", 0, "Radial", ""},
842 {PART_KINK_WAVE, "WAVE", 0, "Wave", ""},
843 {PART_KINK_BRAID, "BRAID", 0, "Braid", ""},
844 {0, NULL, 0, NULL, NULL}
847 static EnumPropertyItem kink_axis_items[] = {
848 {0, "X", 0, "X", ""},
849 {1, "Y", 0, "Y", ""},
850 {2, "Z", 0, "Z", ""},
851 {0, NULL, 0, NULL, NULL}
854 static EnumPropertyItem bb_align_items[] = {
855 {PART_BB_X, "X", 0, "X", ""},
856 {PART_BB_Y, "Y", 0, "Y", ""},
857 {PART_BB_Z, "Z", 0, "Z", ""},
858 {PART_BB_VIEW, "VIEW", 0, "View", ""},
859 {PART_BB_VEL, "VEL", 0, "Velocity", ""},
860 {0, NULL, 0, NULL, NULL}
863 static EnumPropertyItem bb_anim_items[] = {
864 {PART_BB_ANIM_NONE, "NONE", 0, "None", ""},
865 {PART_BB_ANIM_TIME, "TIME", 0, "Time", ""},
866 {PART_BB_ANIM_ANGLE, "ANGLE", 0, "Angle", ""},
867 //{PART_BB_ANIM_OFF_TIME, "OFF_TIME", 0, "off_time", ""},
868 //{PART_BB_ANIM_OFF_ANGLE, "OFF_ANGLE", 0, "off_angle", ""},
869 {0, NULL, 0, NULL, NULL}
872 static EnumPropertyItem bb_split_offset_items[] = {
873 {PART_BB_OFF_NONE, "NONE", 0, "None", ""},
874 {PART_BB_OFF_LINEAR, "LINEAR", 0, "Linear", ""},
875 {PART_BB_OFF_RANDOM, "RANDOM", 0, "Random", ""},
876 {0, NULL, 0, NULL, NULL}
879 srna= RNA_def_struct(brna, "ParticleSettings", "ID");
880 RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems.");
881 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
884 prop= RNA_def_property(srna, "react_start_end", PROP_BOOLEAN, PROP_NONE);
885 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
886 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
887 RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually.");
888 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
890 prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE);
891 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
892 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
893 RNA_def_property_ui_text(prop, "Multi React", "React multiple times.");
894 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
896 prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE);
897 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_LOOP);
898 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
899 RNA_def_property_ui_text(prop, "Loop", "Loop particle lives.");
900 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
902 /* TODO: used somewhere? */
903 prop= RNA_def_property(srna, "hair_geometry", PROP_BOOLEAN, PROP_NONE);
904 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_GEOMETRY);
905 RNA_def_property_ui_text(prop, "Hair Geometry", "");//TODO: tooltip
907 prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE);
908 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
909 RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted.");
910 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
912 prop= RNA_def_property(srna, "died", PROP_BOOLEAN, PROP_NONE);
913 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
914 RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
915 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
917 prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE);
918 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
919 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
920 RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
921 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
923 prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE);
924 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
925 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
926 RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths.");
927 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
929 prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
930 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY);
931 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
932 RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision.");
933 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
935 prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE);
936 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
937 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
938 RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object.");
939 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
941 prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE);
942 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
943 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
944 RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection.");
945 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
947 prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE);
948 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
949 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
950 RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant");
951 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
953 prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE);
954 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
955 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
956 RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass with particle size.");
957 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
959 prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE);
960 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
961 RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
962 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
964 prop= RNA_def_property(srna, "branching", PROP_BOOLEAN, PROP_NONE);
965 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING);
966 RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other.");
967 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
969 prop= RNA_def_property(srna, "animate_branching", PROP_BOOLEAN, PROP_NONE);
970 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING);
971 RNA_def_property_ui_text(prop, "Animated", "Animate branching");
972 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
974 prop= RNA_def_property(srna, "symmetric_branching", PROP_BOOLEAN, PROP_NONE);
975 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING);
976 RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same.");
977 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
979 prop= RNA_def_property(srna, "hair_bspline", PROP_BOOLEAN, PROP_NONE);
980 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
981 RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines.");
982 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
984 prop= RNA_def_property(srna, "grid_invert", PROP_BOOLEAN, PROP_NONE);
985 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
986 RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not.");
987 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
989 prop= RNA_def_property(srna, "child_effector", PROP_BOOLEAN, PROP_NONE);
990 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
991 RNA_def_property_ui_text(prop, "Children", "Apply effectors to children.");
992 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
994 prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
995 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
996 RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
997 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
999 /* TODO: used somewhere? */
1000 prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE);
1001 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_RENDER);
1002 RNA_def_property_ui_text(prop, "child_render", "");
1004 prop= RNA_def_property(srna, "child_guide", PROP_BOOLEAN, PROP_NONE);
1005 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
1006 RNA_def_property_ui_text(prop, "child_guide", "");
1007 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1009 prop= RNA_def_property(srna, "self_effect", PROP_BOOLEAN, PROP_NONE);
1010 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
1011 RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves.");
1012 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1015 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1016 RNA_def_property_enum_items(prop, type_items);
1017 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1018 RNA_def_property_ui_text(prop, "Type", "");
1019 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_type");
1021 prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
1022 RNA_def_property_enum_sdna(prop, NULL, "from");
1023 RNA_def_property_enum_items(prop, part_reactor_from_items);
1024 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1025 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf");
1026 RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from");
1027 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1029 prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
1030 RNA_def_property_enum_sdna(prop, NULL, "distr");
1031 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1032 RNA_def_property_enum_items(prop, dist_items);
1033 RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element");
1034 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1037 prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
1038 RNA_def_property_enum_sdna(prop, NULL, "phystype");
1039 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1040 RNA_def_property_enum_items(prop, phys_type_items);
1041 RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type");
1042 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_physics");
1044 prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
1045 RNA_def_property_enum_sdna(prop, NULL, "rotmode");
1046 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1047 RNA_def_property_enum_items(prop, rot_mode_items);
1048 RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation");
1049 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1051 prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
1052 RNA_def_property_enum_sdna(prop, NULL, "avemode");
1053 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1054 RNA_def_property_enum_items(prop, ave_mode_items);
1055 RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode.");
1056 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1058 prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
1059 RNA_def_property_enum_sdna(prop, NULL, "reactevent");
1060 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1061 RNA_def_property_enum_items(prop, react_event_items);
1062 RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on.");
1063 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1066 prop= RNA_def_property(srna, "velocity", PROP_BOOLEAN, PROP_NONE);
1067 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
1068 RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
1069 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1071 prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
1072 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE);
1073 RNA_def_property_ui_text(prop, "Size", "Show particle size");
1074 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1076 prop= RNA_def_property(srna, "emitter", PROP_BOOLEAN, PROP_NONE);
1077 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
1078 RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also.");
1079 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1081 prop= RNA_def_property(srna, "draw_health", PROP_BOOLEAN, PROP_NONE);
1082 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH);
1083 RNA_def_property_ui_text(prop, "Health", "Draw boid health");
1084 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1086 prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE);
1087 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME);
1088 RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames");
1089 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_abspathtime_update");
1091 prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE);
1092 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
1093 RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
1094 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1096 prop= RNA_def_property(srna, "parent", PROP_BOOLEAN, PROP_NONE);
1097 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
1098 RNA_def_property_ui_text(prop, "Parents", "Render parent particles.");
1099 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1101 prop= RNA_def_property(srna, "num", PROP_BOOLEAN, PROP_NONE);
1102 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
1103 RNA_def_property_ui_text(prop, "Number", "Show particle number");
1104 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1106 prop= RNA_def_property(srna, "rand_group", PROP_BOOLEAN, PROP_NONE);
1107 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
1108 RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
1109 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1111 prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE);
1112 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
1113 RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
1114 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1116 prop= RNA_def_property(srna, "velocity_length", PROP_BOOLEAN, PROP_NONE);
1117 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
1118 RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
1119 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1121 prop= RNA_def_property(srna, "material_color", PROP_BOOLEAN, PROP_NONE);
1122 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL);
1123 RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color.");
1124 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1126 prop= RNA_def_property(srna, "whole_group", PROP_BOOLEAN, PROP_NONE);
1127 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
1128 RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once.");
1129 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1131 prop= RNA_def_property(srna, "render_strand", PROP_BOOLEAN, PROP_NONE);
1132 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
1133 RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
1134 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1136 prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE);
1137 RNA_def_property_enum_sdna(prop, NULL, "draw_as");
1138 RNA_def_property_enum_items(prop, part_draw_as_items);
1139 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf");
1140 RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport");
1141 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1143 prop= RNA_def_property(srna, "ren_as", PROP_ENUM, PROP_NONE);
1144 RNA_def_property_enum_sdna(prop, NULL, "ren_as");
1145 RNA_def_property_enum_items(prop, part_ren_as_items);
1146 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf");
1147 RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered");
1148 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1150 prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
1151 RNA_def_property_range(prop, 0, 10);
1152 RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)");
1153 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1155 prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
1156 RNA_def_property_enum_sdna(prop, NULL, "childtype");
1157 RNA_def_property_enum_items(prop, child_type_items);
1158 RNA_def_property_ui_text(prop, "Children From", "Create child particles");
1159 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1161 prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
1162 RNA_def_property_range(prop, 0, 7);
1163 RNA_def_property_ui_range(prop, 0, 10, 1, 0);
1164 RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)");
1165 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1167 prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
1168 RNA_def_property_int_sdna(prop, NULL, "ren_step");
1169 RNA_def_property_range(prop, 0, 9);
1170 RNA_def_property_ui_range(prop, 0, 20, 1, 0);
1171 RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)");
1173 prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
1174 RNA_def_property_range(prop, 2, 50);
1175 RNA_def_property_ui_text(prop, "Segments", "Number of hair segments");
1176 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1179 //TODO: not found in UI, readonly?
1180 prop= RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
1181 RNA_def_property_range(prop, 0, INT_MAX);//TODO:min,max
1182 RNA_def_property_ui_text(prop, "Keys Step", "");
1184 /* adaptive path rendering */
1185 prop= RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
1186 RNA_def_property_int_sdna(prop, NULL, "adapt_angle");
1187 RNA_def_property_range(prop, 0, 45);
1188 RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
1190 prop= RNA_def_property(srna, "adaptive_pix", PROP_INT, PROP_NONE);
1191 RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
1192 RNA_def_property_range(prop, 0, 50);
1193 RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
1195 prop= RNA_def_property(srna, "display", PROP_INT, PROP_NONE);
1196 RNA_def_property_int_sdna(prop, NULL, "disp");
1197 RNA_def_property_range(prop, 0, 100);
1198 RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3d view");
1199 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1201 prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
1202 RNA_def_property_int_sdna(prop, NULL, "omat");
1203 RNA_def_property_range(prop, 1, 16);
1204 RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles");
1205 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1208 //TODO: is this read only/internal?
1209 prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
1210 RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
1211 RNA_def_property_enum_items(prop, rot_from_items);
1212 RNA_def_property_ui_text(prop, "Rotate From", "");
1214 prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
1215 RNA_def_property_enum_items(prop, integrator_type_items);
1216 RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type");
1217 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1219 prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
1220 RNA_def_property_enum_items(prop, kink_type_items);
1221 RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path");
1222 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1224 prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
1225 RNA_def_property_enum_items(prop, kink_axis_items);
1226 RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
1227 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1230 prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
1231 RNA_def_property_enum_sdna(prop, NULL, "bb_align");
1232 RNA_def_property_enum_items(prop, bb_align_items);
1233 RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned");
1234 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1236 prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
1237 RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
1238 RNA_def_property_range(prop, 1, 100);
1239 RNA_def_property_ui_range(prop, 1, 10, 1, 0);
1240 RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split uv coordinates for billboards");
1242 prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
1243 RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
1244 RNA_def_property_enum_items(prop, bb_anim_items);
1245 RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures.");
1247 prop= RNA_def_property(srna, "billboard_split_offset", PROP_ENUM, PROP_NONE);
1248 RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
1249 RNA_def_property_enum_items(prop, bb_split_offset_items);
1250 RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
1252 prop= RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
1253 RNA_def_property_float_sdna(prop, NULL, "bb_tilt");
1254 RNA_def_property_range(prop, -1.0f, 1.0f);
1255 RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
1256 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1258 prop= RNA_def_property(srna, "billboard_random_tilt", PROP_FLOAT, PROP_NONE);
1259 RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
1260 RNA_def_property_range(prop, 0.0f, 1.0f);
1261 RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
1262 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1264 prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION);
1265 RNA_def_property_float_sdna(prop, NULL, "bb_offset");
1266 RNA_def_property_array(prop, 2);
1267 RNA_def_property_range(prop, -100.0f, 100.0f);
1268 RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
1269 RNA_def_property_ui_text(prop, "Billboard Offset", "");
1270 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1272 /* simplification */
1273 prop= RNA_def_property(srna, "enable_simplify", PROP_BOOLEAN, PROP_NONE);
1274 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
1275 RNA_def_property_ui_text(prop, "Child Simplification", "Remove child strands as the object becomes smaller on the screen.");
1277 prop= RNA_def_property(srna, "viewport", PROP_BOOLEAN, PROP_NONE);
1278 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
1279 RNA_def_property_ui_text(prop, "Viewport", "");
1281 prop= RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
1282 RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
1283 RNA_def_property_range(prop, 1, 32768);
1284 RNA_def_property_ui_text(prop, "Reference Size", "Reference size size in pixels, after which simplification begins.");
1286 prop= RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
1287 RNA_def_property_range(prop, 0.0f, 1.0f);
1288 RNA_def_property_ui_text(prop, "Rate", "Speed of simplification");
1290 prop= RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
1291 RNA_def_property_range(prop, 0.0f, 1.0f);
1292 RNA_def_property_ui_text(prop, "Transition", "Transition period for fading out strands.");
1294 prop= RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
1295 RNA_def_property_range(prop, 0.0f, 0.999f);
1296 RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
1298 /* general values */
1299 prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
1300 RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same
1301 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1302 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1303 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
1304 RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles.");
1305 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1307 prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
1308 RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
1310 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1311 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL);
1312 RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles.");
1313 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1315 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
1316 RNA_def_property_range(prop, 1.0f, MAXFRAMEF);
1317 RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles");
1318 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1320 prop= RNA_def_property(srna, "random_lifetime", PROP_FLOAT, PROP_NONE);
1321 RNA_def_property_float_sdna(prop, NULL, "randlife");
1322 RNA_def_property_range(prop, 0.0f, 1.0f);
1323 RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation.");
1324 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1326 prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
1327 RNA_def_property_float_sdna(prop, NULL, "timetweak");
1328 RNA_def_property_range(prop, 0.0f, 10.0f);
1329 RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
1330 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1332 prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
1333 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1334 RNA_def_property_float_sdna(prop, NULL, "jitfac");
1335 RNA_def_property_range(prop, 0.0f, 2.0f);
1336 RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling.");
1337 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1339 prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
1340 RNA_def_property_float_sdna(prop, NULL, "eff_hair");
1341 RNA_def_property_range(prop, 0.0f, 1.0f);
1342 RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors");
1343 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1345 prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED);
1346 RNA_def_property_int_sdna(prop, NULL, "totpart");
1347 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1348 /* This limit is for those freaks who have the machine power to handle it. */
1349 /* 10M particles take around 2.2 Gb of memory / disk space in saved file and */
1350 /* each cached frame takes around 0.5 Gb of memory / disk space depending on cache mode. */
1351 RNA_def_property_range(prop, 0, 10000000);
1352 RNA_def_property_ui_range(prop, 0, 100000, 1, 0);
1353 RNA_def_property_ui_text(prop, "Amount", "Total number of particles.");
1354 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1356 prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit?
1357 RNA_def_property_int_sdna(prop, NULL, "userjit");
1358 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1359 RNA_def_property_range(prop, 0, 1000);
1360 RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic).");
1361 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1363 prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
1364 RNA_def_property_int_sdna(prop, NULL, "grid_res");
1365 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1366 RNA_def_property_range(prop, 1, 46); /* ~100k particles in a cube */
1367 RNA_def_property_ui_range(prop, 1, 215, 1, 0); /* ~10M particles in a cube */
1368 RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid.");
1369 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1371 /* initial velocity factors */
1372 prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
1373 RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same
1374 RNA_def_property_range(prop, -200.0f, 200.0f);
1375 RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed.");
1376 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1378 prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
1379 RNA_def_property_float_sdna(prop, NULL, "obfac");
1380 RNA_def_property_range(prop, -200.0f, 200.0f);
1381 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
1382 RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
1383 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1385 prop= RNA_def_property(srna, "random_factor", PROP_FLOAT, PROP_NONE);
1386 RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same
1387 RNA_def_property_range(prop, 0.0f, 200.0f);
1388 RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation.");
1389 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1391 prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
1392 RNA_def_property_float_sdna(prop, NULL, "partfac");
1393 RNA_def_property_range(prop, -200.0f, 200.0f);
1394 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3);
1395 RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed.");
1396 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1398 prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
1399 RNA_def_property_float_sdna(prop, NULL, "tanfac");
1400 RNA_def_property_range(prop, -200.0f, 200.0f);
1401 RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed.");
1402 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1404 prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
1405 RNA_def_property_float_sdna(prop, NULL, "tanphase");
1406 RNA_def_property_range(prop, -1.0f, 1.0f);
1407 RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent.");
1408 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1410 prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
1411 RNA_def_property_float_sdna(prop, NULL, "reactfac");
1412 RNA_def_property_range(prop, -10.0f, 10.0f);
1413 RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed.");
1414 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1416 prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
1417 RNA_def_property_float_sdna(prop, NULL, "avefac");
1418 RNA_def_property_range(prop, -200.0f, 200.0f);
1419 RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount");
1420 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1422 prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
1423 RNA_def_property_float_sdna(prop, NULL, "phasefac");
1424 RNA_def_property_range(prop, -1.0f, 1.0f);
1425 RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase");
1426 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1428 prop= RNA_def_property(srna, "random_rotation_factor", PROP_FLOAT, PROP_NONE);
1429 RNA_def_property_float_sdna(prop, NULL, "randrotfac");
1430 RNA_def_property_range(prop, 0.0f, 1.0f);
1431 RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation");
1432 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1434 prop= RNA_def_property(srna, "random_phase_factor", PROP_FLOAT, PROP_NONE);
1435 RNA_def_property_float_sdna(prop, NULL, "randphasefac");
1436 RNA_def_property_range(prop, 0.0f, 1.0f);
1437 RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase");
1438 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1440 /* physical properties */
1441 prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
1442 RNA_def_property_range(prop, 0.001f, 100000.0f);
1443 RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
1444 RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles");
1445 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1447 prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
1448 RNA_def_property_float_sdna(prop, NULL, "size");
1449 RNA_def_property_range(prop, 0.001f, 100000.0f);
1450 RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
1451 RNA_def_property_ui_text(prop, "Size", "The size of the particles");
1452 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1454 prop= RNA_def_property(srna, "random_size", PROP_FLOAT, PROP_NONE);
1455 RNA_def_property_float_sdna(prop, NULL, "randsize");
1456 RNA_def_property_range(prop, 0.0f, 1.0f);
1457 RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
1458 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1460 prop= RNA_def_property(srna, "reaction_shape", PROP_FLOAT, PROP_NONE);
1461 RNA_def_property_float_sdna(prop, NULL, "reactshape");
1462 RNA_def_property_range(prop, 0.0f, 10.0f);
1463 RNA_def_property_ui_text(prop, "Shape", "Power of reaction strength dependence on distance to target.");
1464 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1467 /* global physical properties */
1468 prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_ACCELERATION);
1469 RNA_def_property_float_sdna(prop, NULL, "acc");
1470 RNA_def_property_array(prop, 3);
1471 RNA_def_property_range(prop, -200.0f, 200.0f);
1472 RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration");
1473 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1475 prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
1476 RNA_def_property_float_sdna(prop, NULL, "acc[2]");
1477 RNA_def_property_range(prop, -200.0f, 200.0f);
1478 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in global Z axis direction");
1479 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1481 prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
1482 RNA_def_property_float_sdna(prop, NULL, "dragfac");
1483 RNA_def_property_range(prop, 0.0f, 1.0f);
1484 RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag.");
1485 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1487 prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
1488 RNA_def_property_float_sdna(prop, NULL, "brownfac");
1489 RNA_def_property_range(prop, 0.0f, 200.0f);
1490 RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of brownian motion");
1491 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1493 prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
1494 RNA_def_property_float_sdna(prop, NULL, "dampfac");
1495 RNA_def_property_range(prop, 0.0f, 1.0f);
1496 RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping");
1497 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1500 prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE);
1501 RNA_def_property_float_sdna(prop, NULL, "randlength");
1502 RNA_def_property_range(prop, 0.0f, 1.0f);
1503 RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation.");
1504 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1507 prop= RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
1508 RNA_def_property_int_sdna(prop, NULL, "child_nbr");//optional if prop names are the same
1509 RNA_def_property_range(prop, 0, 100000);
1510 RNA_def_property_ui_range(prop, 0, 1000, 1, 0);
1511 RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent");
1512 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1514 prop= RNA_def_property(srna, "rendered_child_nbr", PROP_INT, PROP_NONE);
1515 RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr");
1516 RNA_def_property_range(prop, 0, 100000);
1517 RNA_def_property_ui_range(prop, 0, 10000, 1, 0);
1518 RNA_def_property_ui_text(prop, "Rendered Children", "Amount of children/parent for rendering.");
1520 prop= RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
1521 RNA_def_property_float_sdna(prop, NULL, "parents");
1522 RNA_def_property_range(prop, 0.0f, 1.0f);
1523 RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents.");
1524 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1526 prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
1527 RNA_def_property_float_sdna(prop, NULL, "childsize");
1528 RNA_def_property_range(prop, 0.001f, 100000.0f);
1529 RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3);
1530 RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size.");
1531 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1533 prop= RNA_def_property(srna, "child_random_size", PROP_FLOAT, PROP_NONE);
1534 RNA_def_property_float_sdna(prop, NULL, "childrandsize");
1535 RNA_def_property_range(prop, 0.0f, 1.0f);
1536 RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles.");
1537 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1539 prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
1540 RNA_def_property_float_sdna(prop, NULL, "childrad");
1541 RNA_def_property_range(prop, 0.0f, 10.0f);
1542 RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent.");
1543 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1545 prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
1546 RNA_def_property_float_sdna(prop, NULL, "childflat");
1547 RNA_def_property_range(prop, 0.0f, 1.0f);
1548 RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent.");
1549 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1552 prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
1553 RNA_def_property_float_sdna(prop, NULL, "clumpfac");
1554 RNA_def_property_range(prop, -1.0f, 1.0f);
1555 RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
1556 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1558 prop= RNA_def_property(srna, "clumppow", PROP_FLOAT, PROP_NONE);
1559 RNA_def_property_float_sdna(prop, NULL, "clumppow");
1560 RNA_def_property_range(prop, -0.999f, 0.999f);
1561 RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
1562 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1566 prop= RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
1567 RNA_def_property_float_sdna(prop, NULL, "kink_amp");
1568 RNA_def_property_range(prop, -100000.0f, 100000.0f);
1569 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
1570 RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset.");
1571 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1573 prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
1574 RNA_def_property_float_sdna(prop, NULL, "kink_freq");
1575 RNA_def_property_range(prop, -100000.0f, 100000.0f);
1576 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3);
1577 RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
1578 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1580 prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
1581 RNA_def_property_range(prop, -0.999f, 0.999f);
1582 RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
1583 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1587 prop= RNA_def_property(srna, "rough1", PROP_FLOAT, PROP_NONE);
1588 RNA_def_property_range(prop, 0.0f, 100000.0f);
1589 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1590 RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough.");
1591 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1593 prop= RNA_def_property(srna, "rough1_size", PROP_FLOAT, PROP_NONE);
1594 RNA_def_property_range(prop, 0.01f, 100000.0f);
1595 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
1596 RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough.");
1597 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1599 prop= RNA_def_property(srna, "rough2", PROP_FLOAT, PROP_NONE);
1600 RNA_def_property_float_sdna(prop, NULL, "rough2");
1601 RNA_def_property_range(prop, 0.0f, 100000.0f);
1602 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1603 RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough.");
1604 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1606 prop= RNA_def_property(srna, "rough2_size", PROP_FLOAT, PROP_NONE);
1607 RNA_def_property_float_sdna(prop, NULL, "rough2_size");
1608 RNA_def_property_range(prop, 0.01f, 100000.0f);
1609 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3);
1610 RNA_def_property_ui_text(prop, "Size2", "Size of random rough.");
1611 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1613 prop= RNA_def_property(srna, "rough2_thres", PROP_FLOAT, PROP_NONE);
1614 RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
1615 RNA_def_property_range(prop, 0.0f, 1.0f);
1616 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough.");
1617 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1619 prop= RNA_def_property(srna, "rough_endpoint", PROP_FLOAT, PROP_NONE);
1620 RNA_def_property_float_sdna(prop, NULL, "rough_end");
1621 RNA_def_property_range(prop, 0.0f, 100000.0f);
1622 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1623 RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough.");
1624 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1626 prop= RNA_def_property(srna, "rough_end_shape", PROP_FLOAT, PROP_NONE);
1627 RNA_def_property_range(prop, 0.0f, 10.0f);
1628 RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
1629 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1631 prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
1632 RNA_def_property_float_sdna(prop, NULL, "clength");
1633 RNA_def_property_range(prop, 0.0f, 1.0f);
1634 RNA_def_property_ui_text(prop, "Length", "Length of child paths");
1635 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1637 prop= RNA_def_property(srna, "child_length_thres", PROP_FLOAT, PROP_NONE);
1638 RNA_def_property_float_sdna(prop, NULL, "clength_thres");
1639 RNA_def_property_range(prop, 0.0f, 1.0f);
1640 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length.");
1641 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1644 prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
1645 RNA_def_property_float_sdna(prop, NULL, "branch_thres");
1646 RNA_def_property_range(prop, 0.0f, 1.0f);
1647 RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching.");
1648 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
1651 prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
1652 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL);
1653 RNA_def_property_range(prop, 0.0f, 100000.0f);
1654 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1655 RNA_def_property_ui_text(prop, "Back", "Length of the line's tail");
1656 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1658 prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
1659 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL);
1660 RNA_def_property_range(prop, 0.0f, 100000.0f);
1661 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3);
1662 RNA_def_property_ui_text(prop, "Head", "Length of the line's head");
1663 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1665 prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE);
1666 RNA_def_property_float_sdna(prop, NULL, "path_start");
1667 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
1668 RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path.");
1669 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1671 prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE);
1672 RNA_def_property_float_sdna(prop, NULL, "path_end");
1673 RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range");
1674 RNA_def_property_ui_text(prop, "Path End", "End time of drawn path.");
1675 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1677 prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE);
1678 RNA_def_property_int_sdna(prop, NULL, "trail_count");
1679 RNA_def_property_range(prop, 1, 100000);
1680 RNA_def_property_ui_range(prop, 1, 100, 1, 0);
1681 RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles.");
1682 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1684 /* keyed particles */
1685 prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE);
1686 RNA_def_property_int_sdna(prop, NULL, "keyed_loops");
1687 RNA_def_property_range(prop, 1.0f, 10000.0f);
1688 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3);
1689 RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped.");
1690 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1693 prop= RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE);
1694 RNA_def_property_struct_type(prop, "BoidSettings");
1695 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1696 RNA_def_property_ui_text(prop, "Boid Settings", "");
1698 /* draw objects & groups */
1700 prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
1701 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
1702 RNA_def_property_struct_type(prop, "Group");
1703 RNA_def_property_flag(prop, PROP_EDITABLE);
1704 RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
1705 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1707 prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
1708 RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
1709 RNA_def_property_struct_type(prop, "Object");
1710 RNA_def_property_flag(prop, PROP_EDITABLE);
1711 RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles.");
1712 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1714 prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
1715 RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
1716 RNA_def_property_struct_type(prop, "Object");
1717 RNA_def_property_flag(prop, PROP_EDITABLE);
1718 RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
1719 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1722 prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
1723 RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
1724 RNA_def_property_struct_type(prop, "Group");
1725 RNA_def_property_flag(prop, PROP_EDITABLE);
1726 RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
1727 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1729 prop= RNA_def_property(srna, "eweight_all", PROP_FLOAT, PROP_NONE);
1730 RNA_def_property_float_sdna(prop, NULL, "effector_weight[0]");
1731 RNA_def_property_range(prop, -200.0f, 200.0f);
1732 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1733 RNA_def_property_ui_text(prop, "All", "All effector's weight.");
1734 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1736 prop= RNA_def_property(srna, "eweight_spherical", PROP_FLOAT, PROP_NONE);
1737 RNA_def_property_float_sdna(prop, NULL, "effector_weight[1]");
1738 RNA_def_property_range(prop, -200.0f, 200.0f);
1739 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1740 RNA_def_property_ui_text(prop, "Spherical", "Spherical effector weight.");
1741 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1743 prop= RNA_def_property(srna, "eweight_vortex", PROP_FLOAT, PROP_NONE);
1744 RNA_def_property_float_sdna(prop, NULL, "effector_weight[2]");
1745 RNA_def_property_range(prop, -200.0f, 200.0f);
1746 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1747 RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight.");
1748 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1750 prop= RNA_def_property(srna, "eweight_magnetic", PROP_FLOAT, PROP_NONE);
1751 RNA_def_property_float_sdna(prop, NULL, "effector_weight[3]");
1752 RNA_def_property_range(prop, -200.0f, 200.0f);
1753 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1754 RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight.");
1755 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1757 prop= RNA_def_property(srna, "eweight_wind", PROP_FLOAT, PROP_NONE);
1758 RNA_def_property_float_sdna(prop, NULL, "effector_weight[4]");
1759 RNA_def_property_range(prop, -200.0f, 200.0f);
1760 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1761 RNA_def_property_ui_text(prop, "Wind", "Wind effector weight.");
1762 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1764 prop= RNA_def_property(srna, "eweight_curveguide", PROP_FLOAT, PROP_NONE);
1765 RNA_def_property_float_sdna(prop, NULL, "effector_weight[5]");
1766 RNA_def_property_range(prop, -200.0f, 200.0f);
1767 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1768 RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight.");
1769 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1771 prop= RNA_def_property(srna, "eweight_texture", PROP_FLOAT, PROP_NONE);
1772 RNA_def_property_float_sdna(prop, NULL, "effector_weight[6]");
1773 RNA_def_property_range(prop, -200.0f, 200.0f);
1774 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1775 RNA_def_property_ui_text(prop, "Magnetic", "Texture effector weight.");
1776 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1778 prop= RNA_def_property(srna, "eweight_harmonic", PROP_FLOAT, PROP_NONE);
1779 RNA_def_property_float_sdna(prop, NULL, "effector_weight[7]");
1780 RNA_def_property_range(prop, -200.0f, 200.0f);
1781 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1782 RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight.");
1783 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1785 prop= RNA_def_property(srna, "eweight_charge", PROP_FLOAT, PROP_NONE);
1786 RNA_def_property_float_sdna(prop, NULL, "effector_weight[8]");
1787 RNA_def_property_range(prop, -200.0f, 200.0f);
1788 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1789 RNA_def_property_ui_text(prop, "Charge", "Charge effector weight.");
1790 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1792 prop= RNA_def_property(srna, "eweight_lennardjones", PROP_FLOAT, PROP_NONE);
1793 RNA_def_property_float_sdna(prop, NULL, "effector_weight[9]");
1794 RNA_def_property_range(prop, -200.0f, 200.0f);
1795 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1796 RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight.");
1797 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1799 /* animation here? */
1800 rna_def_animdata_common(srna);
1802 // struct PartDeflect *pd;
1803 // struct PartDeflect *pd2;
1806 static void rna_def_particle_target(BlenderRNA *brna)
1811 static EnumPropertyItem mode_items[] = {
1812 {PTARGET_MODE_FRIEND, "FRIEND", 0, "Friend", ""},
1813 {PTARGET_MODE_NEUTRAL, "NEUTRAL", 0, "Neutral", ""},
1814 {PTARGET_MODE_ENEMY, "ENEMY", 0, "Enemy", ""},
1815 {0, NULL, 0, NULL, NULL}
1819 srna = RNA_def_struct(brna, "ParticleTarget", NULL);
1820 RNA_def_struct_ui_text(srna, "Particle Target", "Target particle system.");
1822 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1823 RNA_def_property_string_funcs(prop, "rna_ParticleTarget_name_get", "rna_ParticleTarget_name_length", NULL);
1824 RNA_def_property_ui_text(prop, "Name", "Particle target name.");
1825 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1826 RNA_def_struct_name_property(srna, prop);
1828 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
1829 RNA_def_property_pointer_sdna(prop, NULL, "ob");
1830 RNA_def_property_flag(prop, PROP_EDITABLE);
1831 RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object).");
1832 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset");
1834 prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED);
1835 RNA_def_property_int_sdna(prop, NULL, "psys");
1836 RNA_def_property_range(prop, 1, INT_MAX);
1837 RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object.");
1838 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset");
1840 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME);
1841 RNA_def_property_float_sdna(prop, NULL, "time");
1842 RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
1843 RNA_def_property_ui_text(prop, "Time", "");
1844 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo");
1846 prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE);
1847 RNA_def_property_float_sdna(prop, NULL, "duration");
1848 RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
1849 RNA_def_property_ui_text(prop, "Duration", "");
1850 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo");
1852 prop= RNA_def_property(srna, "valid", PROP_BOOLEAN, PROP_NONE);
1853 RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID);
1854 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1855 RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid.");
1857 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
1858 RNA_def_property_enum_items(prop, mode_items);
1859 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1860 RNA_def_property_ui_text(prop, "Mode", "");
1861 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset");
1864 static void rna_def_particle_system(BlenderRNA *brna)
1869 srna= RNA_def_struct(brna, "ParticleSystem", NULL);
1870 RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object.");
1871 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
1873 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1874 RNA_def_property_ui_text(prop, "Name", "Particle system name.");
1875 RNA_def_struct_name_property(srna, prop);
1877 /* access to particle settings is redirected through functions */
1878 /* to allow proper id-buttons functionality */
1879 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
1880 //RNA_def_property_pointer_sdna(prop, NULL, "part");
1881 RNA_def_property_struct_type(prop, "ParticleSettings");
1882 RNA_def_property_flag(prop, PROP_EDITABLE);
1883 RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL);
1884 RNA_def_property_ui_text(prop, "Settings", "Particle system settings.");
1885 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1887 prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
1888 RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart");
1889 RNA_def_property_struct_type(prop, "Particle");
1890 RNA_def_property_ui_text(prop, "Particles", "Particles generated by the particle system.");
1892 prop= RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
1893 RNA_def_property_collection_sdna(prop, NULL, "child", "totchild");
1894 RNA_def_property_struct_type(prop, "ChildParticle");
1895 RNA_def_property_ui_text(prop, "Child Particles", "Child particles generated by the particle system.");
1897 prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1898 RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result.");
1899 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1902 prop= RNA_def_property(srna, "softbody", PROP_POINTER, PROP_NONE);
1903 RNA_def_property_pointer_sdna(prop, NULL, "soft");
1904 RNA_def_property_ui_text(prop, "Soft Body", "Soft body settings for hair physics simulation.");
1906 prop= RNA_def_property(srna, "use_softbody", PROP_BOOLEAN, PROP_NONE);
1907 RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE);
1908 RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation.");
1910 prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
1911 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED);
1912 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks needed */
1913 RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, finalize the hair to enable editing.");
1916 prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
1917 RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
1918 RNA_def_property_flag(prop, PROP_EDITABLE);
1919 RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object).");
1920 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1922 prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
1923 RNA_def_property_int_sdna(prop, NULL, "target_psys");
1924 RNA_def_property_range(prop, 1, INT_MAX);
1925 RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object.");
1926 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1929 prop= RNA_def_property(srna, "keyed_timing", PROP_BOOLEAN, PROP_NONE);
1930 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING);
1931 RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
1932 RNA_def_property_ui_text(prop, "Keyed timing", "Use key times");
1933 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1935 prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);
1936 RNA_def_property_struct_type(prop, "ParticleTarget");
1937 RNA_def_property_ui_text(prop, "Targets", "Target particle systems.");
1939 prop= RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE);
1940 RNA_def_property_struct_type(prop, "ParticleTarget");
1941 RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL);
1942 RNA_def_property_ui_text(prop, "Active Particle Target", "");
1944 prop= RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED);
1945 RNA_def_property_int_funcs(prop, "rna_ParticleSystem_active_particle_target_index_get", "rna_ParticleSystem_active_particle_target_index_set", "rna_ParticleSystem_active_particle_target_index_range");
1946 RNA_def_property_ui_text(prop, "Active Particle Target Index", "");
1950 prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
1951 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
1952 RNA_def_property_string_maxlength(prop, 32);
1953 RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV Layer to control billboard normals.");
1955 prop= RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
1956 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
1957 RNA_def_property_string_maxlength(prop, 32);
1958 RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV Layer to control billboard time index (X-Y).");
1960 prop= RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
1961 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");
1962 RNA_def_property_string_maxlength(prop, 32);
1963 RNA_def_property_ui_text(prop, "Billboard Split UV", "UV Layer to control billboard splitting.");
1966 prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
1967 RNA_def_property_int_sdna(prop, NULL, "vgroup[0]");
1968 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density.");
1969 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1971 prop= RNA_def_property(srna, "vertex_group_density_negate", PROP_BOOLEAN, PROP_NONE);
1972 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
1973 RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group.");
1974 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1976 prop= RNA_def_property(srna, "vertex_group_velocity", PROP_INT, PROP_NONE);
1977 RNA_def_property_int_sdna(prop, NULL, "vgroup[1]");
1978 RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity.");
1979 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1981 prop= RNA_def_property(srna, "vertex_group_velocity_negate", PROP_BOOLEAN, PROP_NONE);
1982 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
1983 RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group.");
1984 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
1986 prop= RNA_def_property(srna, "vertex_group_length", PROP_INT, PROP_NONE);
1987 RNA_def_property_int_sdna(prop, NULL, "vgroup[2]");
1988 RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length.");
1989 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1991 prop= RNA_def_property(srna, "vertex_group_length_negate", PROP_BOOLEAN, PROP_NONE);
1992 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
1993 RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group.");
1994 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
1996 prop= RNA_def_property(srna, "vertex_group_clump", PROP_INT, PROP_NONE);
1997 RNA_def_property_int_sdna(prop, NULL, "vgroup[3]");
1998 RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump.");
1999 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2001 prop= RNA_def_property(srna, "vertex_group_clump_negate", PROP_BOOLEAN, PROP_NONE);
2002 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
2003 RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group.");
2004 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2006 prop= RNA_def_property(srna, "vertex_group_kink", PROP_INT, PROP_NONE);
2007 RNA_def_property_int_sdna(prop, NULL, "vgroup[4]");
2008 RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink.");
2009 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2011 prop= RNA_def_property(srna, "vertex_group_kink_negate", PROP_BOOLEAN, PROP_NONE);
2012 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
2013 RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group.");
2014 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2016 prop= RNA_def_property(srna, "vertex_group_roughness1", PROP_INT, PROP_NONE);
2017 RNA_def_property_int_sdna(prop, NULL, "vgroup[5]");
2018 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1.");
2019 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2021 prop= RNA_def_property(srna, "vertex_group_roughness1_negate", PROP_BOOLEAN, PROP_NONE);
2022 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
2023 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group.");
2024 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2026 prop= RNA_def_property(srna, "vertex_group_roughness2", PROP_INT, PROP_NONE);
2027 RNA_def_property_int_sdna(prop, NULL, "vgroup[6]");
2028 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2.");
2029 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2031 prop= RNA_def_property(srna, "vertex_group_roughness2_negate", PROP_BOOLEAN, PROP_NONE);
2032 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
2033 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group.");
2034 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2036 prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_INT, PROP_NONE);
2037 RNA_def_property_int_sdna(prop, NULL, "vgroup[7]");
2038 RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end.");
2039 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2041 prop= RNA_def_property(srna, "vertex_group_roughness_end_negate", PROP_BOOLEAN, PROP_NONE);
2042 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
2043 RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group.");
2044 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child");
2046 prop= RNA_def_property(srna, "vertex_group_size", PROP_INT, PROP_NONE);
2047 RNA_def_property_int_sdna(prop, NULL, "vgroup[8]");
2048 RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size.");
2049 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2051 prop= RNA_def_property(srna, "vertex_group_size_negate", PROP_BOOLEAN, PROP_NONE);
2052 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
2053 RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group.");
2054 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2056 prop= RNA_def_property(srna, "vertex_group_tangent", PROP_INT, PROP_NONE);
2057 RNA_def_property_int_sdna(prop, NULL, "vgroup[9]");
2058 RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent.");
2059 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2061 prop= RNA_def_property(srna, "vertex_group_tangent_negate", PROP_BOOLEAN, PROP_NONE);
2062 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
2063 RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group.");
2064 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2066 prop= RNA_def_property(srna, "vertex_group_rotation", PROP_INT, PROP_NONE);
2067 RNA_def_property_int_sdna(prop, NULL, "vgroup[10]");
2068 RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation.");
2069 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2071 prop= RNA_def_property(srna, "vertex_group_rotation_negate", PROP_BOOLEAN, PROP_NONE);
2072 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
2073 RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group.");
2074 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2076 prop= RNA_def_property(srna, "vertex_group_field", PROP_INT, PROP_NONE);
2077 RNA_def_property_int_sdna(prop, NULL, "vgroup[11]");
2078 RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field.");
2079 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2081 prop= RNA_def_property(srna, "vertex_group_field_negate", PROP_BOOLEAN, PROP_NONE);
2082 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
2083 RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group.");
2084 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset");
2087 prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
2088 RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
2089 RNA_def_property_struct_type(prop, "PointCache");
2090 RNA_def_property_ui_text(prop, "Point Cache", "");
2093 prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
2094 RNA_def_property_pointer_sdna(prop, NULL, "parent");
2095 RNA_def_property_flag(prop, PROP_EDITABLE);
2096 RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system.");
2097 RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo");
2100 void RNA_def_particle(BlenderRNA *brna)
2102 rna_def_particle_target(brna);
2104 rna_def_particle_hair_key(brna);
2105 rna_def_particle_key(brna);
2107 rna_def_child_particle(brna);
2108 rna_def_particle(brna);
2109 rna_def_particle_system(brna);
2110 rna_def_particle_settings(brna);