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"
33 #include "rna_internal.h"
35 #include "DNA_particle_types.h"
36 #include "DNA_object_force.h"
37 #include "DNA_object_types.h"
41 static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
43 ParticleSettings *settings = (ParticleSettings*)ptr->data;
45 /* check for clipping */
46 if(value > settings->end)
47 value = settings->end;
49 if(settings->type==PART_REACTOR && value < 1.0)
51 else if (value < -30000.0f) //TODO: replace 30000 with MAXFRAMEF when available in 2.5
54 settings->sta = value;
57 static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
59 ParticleSettings *settings = (ParticleSettings*)ptr->data;
61 /* check for clipping */
62 if(value < settings->sta)
63 value = settings->sta;
65 settings->end = value;
68 static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value)
70 ParticleSettings *settings = (ParticleSettings*)ptr->data;
71 settings->draw_line[0] = value;
74 static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
76 ParticleSettings *settings = (ParticleSettings*)ptr->data;
77 return settings->draw_line[0];
80 static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
82 ParticleSettings *settings = (ParticleSettings*)ptr->data;
83 settings->draw_line[1] = value;
86 static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
88 ParticleSettings *settings = (ParticleSettings*)ptr->data;
89 return settings->draw_line[1];
92 static int rna_ParticleSystem_name_length(PointerRNA *ptr)
94 ParticleSystem *psys= ptr->data;
97 return strlen(psys->part->id.name+2) + 10;
102 static void rna_ParticleSystem_name_get(PointerRNA *ptr, char *str)
104 Object *ob= ptr->id.data;
105 ParticleSystem *psys= ptr->data;
106 int index= BLI_findindex(&ob->particlesystem, psys);
108 sprintf(str, "%d: ", index+1);
111 strcat(str, psys->part->id.name+2);
116 static void rna_def_particle_hair_key(BlenderRNA *brna)
121 srna = RNA_def_struct(brna, "ParticleHairKey", NULL);
122 RNA_def_struct_sdna(srna, "HairKey");
123 RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for hair particle system.");
125 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
126 RNA_def_property_float_sdna(prop, NULL, "co");
127 RNA_def_property_ui_text(prop, "Location", "Key location.");
129 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
130 RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair length.");
132 prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
133 RNA_def_property_ui_text(prop, "Weight", "Weight for softbody simulation.");
136 static void rna_def_particle_key(BlenderRNA *brna)
141 srna = RNA_def_struct(brna, "ParticleKey", NULL);
142 RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a particle over time.");
144 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
145 RNA_def_property_float_sdna(prop, NULL, "co");
146 RNA_def_property_ui_text(prop, "Location", "Key location.");
148 prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VECTOR);
149 RNA_def_property_float_sdna(prop, NULL, "vel");
150 RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
152 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
153 RNA_def_property_float_sdna(prop, NULL, "rot");
154 RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaterion.");
156 prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, PROP_ROTATION);
157 RNA_def_property_float_sdna(prop, NULL, "ave");
158 RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular velocity.");
160 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
161 RNA_def_property_ui_text(prop, "Time", "Time of key over the simulation.");
164 static void rna_def_child_particle(BlenderRNA *brna)
169 srna = RNA_def_struct(brna, "ChildParticle", NULL);
170 RNA_def_struct_ui_text(srna, "Child Particle", "Child particle interpolated from simulated or edited particles.");
172 // int num, parent; /* num is face index on the final derived mesh */
174 // int pa[4]; /* nearest particles to the child, used for the interpolation */
175 // float w[4]; /* interpolation weights for the above particles */
176 // float fuv[4], foffset; /* face vertex weights and offset */
180 static void rna_def_particle(BlenderRNA *brna)
185 static EnumPropertyItem alive_items[] = {
186 {PARS_KILLED, "KILLED", "Killed", ""},
187 {PARS_DEAD, "DEAD", "Dead", ""},
188 {PARS_UNBORN, "UNBORN", "Unborn", ""},
189 {PARS_ALIVE, "ALIVE", "Alive", ""},
190 {PARS_DYING, "DYING", "Dying", ""},
191 {0, NULL, NULL, NULL}
194 srna = RNA_def_struct(brna, "Particle", NULL);
195 RNA_def_struct_sdna(srna, "ParticleData");
196 RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system.");
198 prop= RNA_def_property(srna, "stick_object", PROP_POINTER, PROP_NONE);
199 RNA_def_property_pointer_sdna(prop, NULL, "stick_ob");
200 RNA_def_property_struct_type(prop, "Object");
201 RNA_def_property_flag(prop, PROP_EDITABLE);
202 RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead");
204 // ParticleKey state; /* normally current global coordinates or */
205 // /* in sticky object space if dead & sticky */
207 // ParticleKey prev_state; /* previous state */
209 // prop= RNA_def_property(srna, "hair", PROP_COLLECTION, PROP_NONE);
210 // RNA_def_property_collection_sdna(prop, NULL, "hair", "???totalHair???"); //don't know what the hair array size is
211 // RNA_def_property_struct_type(prop, "HairKey");
212 // RNA_def_property_ui_text(prop, "Hair", "");
214 prop= RNA_def_property(srna, "keys", PROP_COLLECTION, PROP_NONE);
215 RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey");
216 RNA_def_property_struct_type(prop, "ParticleKey");
217 RNA_def_property_ui_text(prop, "Keyed States", "");
219 prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_NONE);
220 RNA_def_property_float_sdna(prop, NULL, "r_rot");
221 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
222 RNA_def_property_ui_text(prop, "Random Rotation", "");
224 prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_NONE);
225 RNA_def_property_float_sdna(prop, NULL, "r_ave");
226 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
227 RNA_def_property_ui_text(prop, "Random erm.. Velocity", "");//TODO: fix name
229 prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_NONE);
230 RNA_def_property_float_sdna(prop, NULL, "r_ve");//optional if prop names are the same
231 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
232 RNA_def_property_ui_text(prop, "Random Velocity", "");
235 // float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
236 // /* face normal for volume emission */
238 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
239 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
240 RNA_def_property_ui_text(prop, "Time", "");
242 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE);
243 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
244 RNA_def_property_ui_text(prop, "Lifetime", "");
246 prop= RNA_def_property(srna, "die_time", PROP_FLOAT, PROP_NONE);
247 RNA_def_property_float_sdna(prop, NULL, "dietime");
248 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
249 RNA_def_property_ui_text(prop, "Die Time", "");
251 prop= RNA_def_property(srna, "banking_angle", PROP_FLOAT, PROP_NONE);
252 RNA_def_property_float_sdna(prop, NULL, "bank");
253 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
254 RNA_def_property_ui_text(prop, "Banking Angle", "");
256 prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
257 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
258 RNA_def_property_ui_text(prop, "Size", "");
260 prop= RNA_def_property(srna, "size_multiplier", PROP_FLOAT, PROP_NONE);
261 RNA_def_property_float_sdna(prop, NULL, "sizemul");
262 // RNA_def_property_range(prop, lowerLimitf, upperLimitf);
263 RNA_def_property_ui_text(prop, "Size Multiplier", "");
266 // int num; /* index to vert/edge/face */
267 // int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
271 // int bpi; /* softbody body point start index */
274 prop= RNA_def_property(srna, "unexist", PROP_BOOLEAN, PROP_NONE);
275 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_UNEXIST);
276 RNA_def_property_ui_text(prop, "unexist", "");
278 prop= RNA_def_property(srna, "no_disp", PROP_BOOLEAN, PROP_NONE);
279 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_NO_DISP);
280 RNA_def_property_ui_text(prop, "no_disp", "");
282 prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
283 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY);
284 RNA_def_property_ui_text(prop, "sticky", "");
286 prop= RNA_def_property(srna, "transform", PROP_BOOLEAN, PROP_NONE);
287 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TRANSFORM);
288 RNA_def_property_ui_text(prop, "transform", "");
290 prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
291 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_HIDE);
292 RNA_def_property_ui_text(prop, "hide", "");
294 prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
295 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TAG);
296 RNA_def_property_ui_text(prop, "tag", "");
298 prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE);
299 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY);
300 RNA_def_property_ui_text(prop, "rekey", "");
302 prop= RNA_def_property(srna, "edit_recalc", PROP_BOOLEAN, PROP_NONE);
303 RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_EDIT_RECALC);
304 RNA_def_property_ui_text(prop, "edit_recalc", "");
307 prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE);
308 RNA_def_property_enum_sdna(prop, NULL, "alive");
309 RNA_def_property_enum_items(prop, alive_items);
310 RNA_def_property_ui_text(prop, "Alive State", "");
312 prop= RNA_def_property(srna, "loop", PROP_INT, PROP_NONE);
313 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
315 RNA_def_property_ui_text(prop, "Loop", "How may times the particle life has looped");
320 static void rna_def_particle_settings(BlenderRNA *brna)
325 static EnumPropertyItem type_items[] = {
326 {PART_EMITTER, "EMITTER", "Emitter", ""},
327 {PART_REACTOR, "REACTOR", "Reactor", ""},
328 {PART_HAIR, "HAIR", "Hair", ""},
329 {PART_FLUID, "FLUID", "Fluid", ""},
330 {0, NULL, NULL, NULL}
333 static EnumPropertyItem from_items[] = {
334 {PART_FROM_VERT, "VERT", "Vertexes", ""},
335 {PART_FROM_FACE, "FACE", "Faces", ""},
336 {PART_FROM_VOLUME, "VOLUME", "Volume", ""},
337 {PART_FROM_PARTICLE, "PARTICLE", "Particle", ""},
338 {PART_FROM_CHILD, "CHILD", "Child", ""},
339 {0, NULL, NULL, NULL}
342 static EnumPropertyItem dist_items[] = {
343 {PART_DISTR_JIT, "JIT", "Jittered", ""},
344 {PART_DISTR_RAND, "RAND", "Random", ""},
345 {PART_DISTR_GRID, "GRID", "Grid", ""},
346 {0, NULL, NULL, NULL}
349 static EnumPropertyItem phys_type_items[] = {
350 {PART_PHYS_NO, "NO", "no", ""},
351 {PART_PHYS_NEWTON, "NEWTON", "Newtonian", ""},
352 {PART_PHYS_KEYED, "KEYED", "Keyed", ""},
353 {PART_PHYS_BOIDS, "BOIDS", "Boids", ""},
354 {0, NULL, NULL, NULL}
357 static EnumPropertyItem rot_mode_items[] = {
358 {0, "NONE", "None", ""},
359 {PART_ROT_NOR, "NOR", "Normal", ""},
360 {PART_ROT_VEL, "VEL", "Velocity", ""},
361 {PART_ROT_GLOB_X, "GLOB_X", "Global X", ""},
362 {PART_ROT_GLOB_Y, "GLOB_Y", "Global Y", ""},
363 {PART_ROT_GLOB_Z, "GLOB_Z", "Global Z", ""},
364 {PART_ROT_OB_X, "OB_X", "Object X", ""},
365 {PART_ROT_OB_Y, "OB_Y", "Object Y", ""},
366 {PART_ROT_OB_Z, "OB_Z", "Object Z", ""},
367 {0, NULL, NULL, NULL}
370 static EnumPropertyItem ave_mode_items[] = {
371 {0, "NONE", "None", ""},
372 {PART_AVE_SPIN, "SPIN", "Spin", ""},
373 {PART_AVE_RAND, "RAND", "Random", ""} ,
374 {0, NULL, NULL, NULL}
377 static EnumPropertyItem react_event_items[] = {
378 {PART_EVENT_DEATH, "DEATH", "Death", ""},
379 {PART_EVENT_COLLIDE, "COLLIDE", "Collision", ""},
380 {PART_EVENT_NEAR, "NEAR", "Near", ""},
381 {0, NULL, NULL, NULL}
384 static EnumPropertyItem draw_as_items[] = {
385 {PART_DRAW_NOT, "NONE", "None", ""},
386 {PART_DRAW_DOT, "DOT", "Point", ""},
387 {PART_DRAW_CIRC, "CIRC", "Circle", ""},
388 {PART_DRAW_CROSS, "CROSS", "Cross", ""},
389 {PART_DRAW_AXIS, "AXIS", "Axis", ""},
390 {PART_DRAW_LINE, "LINE", "Line", ""},
391 {PART_DRAW_PATH, "PATH", "Path", ""},
392 {PART_DRAW_OB, "OBJECT", "Object", ""},
393 {PART_DRAW_GR, "GROUP", "Group", ""},
394 {PART_DRAW_BB, "BILLBOARD", "Billboard", ""},
395 {0, NULL, NULL, NULL}
398 static EnumPropertyItem child_type_items[] = {
399 {0, "NONE", "None", ""},
400 {PART_CHILD_PARTICLES, "PARTICLES", "Particles", ""},
401 {PART_CHILD_FACES, "FACES", "Faces", ""},
402 {0, NULL, NULL, NULL}
405 //TODO: names, tooltips
406 static EnumPropertyItem rot_from_items[] = {
407 {PART_ROT_KEYS, "KEYS", "keys", ""},
408 {PART_ROT_ZINCR, "ZINCR", "zincr", ""},
409 {PART_ROT_IINCR, "IINCR", "iincr", ""},
410 {0, NULL, NULL, NULL}
413 static EnumPropertyItem integrator_type_items[] = {
414 {PART_INT_EULER, "EULER", "Euler", ""},
415 {PART_INT_MIDPOINT, "MIDPOINT", "Midpoint", ""},
416 {PART_INT_RK4, "RK4", "RK4", ""},
417 {0, NULL, NULL, NULL}
420 static EnumPropertyItem kink_type_items[] = {
421 {PART_KINK_NO, "NO", "Nothing", ""},
422 {PART_KINK_CURL, "CURL", "Curl", ""},
423 {PART_KINK_RADIAL, "RADIAL", "Radial", ""},
424 {PART_KINK_WAVE, "WAVE", "Wave", ""},
425 {PART_KINK_BRAID, "BRAID", "Braid", ""},
426 {0, NULL, NULL, NULL}
429 static EnumPropertyItem kink_axis_items[] = {
433 {0, NULL, NULL, NULL}
436 static EnumPropertyItem bb_align_items[] = {
437 {PART_BB_X, "X", "X", ""},
438 {PART_BB_Y, "Y", "Y", ""},
439 {PART_BB_Z, "Z", "Z", ""},
440 {PART_BB_VIEW, "VIEW", "View", ""},
441 {PART_BB_VEL, "VEL", "Velocity", ""},
442 {0, NULL, NULL, NULL}
445 static EnumPropertyItem bb_anim_items[] = {
446 {PART_BB_ANIM_NONE, "NONE", "None", ""},
447 {PART_BB_ANIM_TIME, "TIME", "Time", ""},
448 {PART_BB_ANIM_ANGLE, "ANGLE", "Angle", ""},
449 //{PART_BB_ANIM_OFF_TIME, "OFF_TIME", "off_time", ""},
450 //{PART_BB_ANIM_OFF_ANGLE, "OFF_ANGLE", "off_angle", ""},
451 {0, NULL, NULL, NULL}
454 static EnumPropertyItem bb_split_offset_items[] = {
455 {PART_BB_OFF_NONE, "NONE", "None", ""},
456 {PART_BB_OFF_LINEAR, "LINEAR", "Linear", ""},
457 {PART_BB_OFF_RANDOM, "RANDOM", "Random", ""},
458 {0, NULL, NULL, NULL}
461 srna= RNA_def_struct(brna, "ParticleSettings", "ID");
462 RNA_def_struct_ui_text(srna, "Particle Settings", "Particle settings, reusable by multiple particle systems.");
463 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
466 prop= RNA_def_property(srna, "react_start_end", PROP_BOOLEAN, PROP_NONE);
467 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END);
468 RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually.");
470 prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE);
471 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE);
472 RNA_def_property_ui_text(prop, "Multi React", "React multiple times.");
474 prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE);
475 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_LOOP);
476 RNA_def_property_ui_text(prop, "Loop", "Loop particle lives.");
478 prop= RNA_def_property(srna, "hair_geometry", PROP_BOOLEAN, PROP_NONE);
479 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_GEOMETRY);
480 RNA_def_property_ui_text(prop, "Hair Geometry", "");//TODO: tooltip
482 prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE);
483 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN);
484 RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted.");
486 prop= RNA_def_property(srna, "died", PROP_BOOLEAN, PROP_NONE);
487 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED);
488 RNA_def_property_ui_text(prop, "Died", "Show particles after they have died");
490 prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE);
491 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND);
492 RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements");
494 prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE);
495 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR);
496 RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths.");
498 prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE);
499 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY);
500 RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision.");
502 prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE);
503 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL);
504 RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object.");
506 prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE);
507 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL);
508 RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection.");
510 prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE);
511 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN);
512 RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant");
514 prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE);
515 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS);
516 RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass with particle size.");
518 prop= RNA_def_property(srna, "abs_length", PROP_BOOLEAN, PROP_NONE);
519 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_LENGTH);
520 RNA_def_property_ui_text(prop, "Abs Length", "Use maximum length for children");
522 prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE);
523 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME);
524 RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time.");
526 prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE);
527 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME);
528 RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time.");
530 prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE);
531 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D);
532 RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface");
534 prop= RNA_def_property(srna, "branching", PROP_BOOLEAN, PROP_NONE);
535 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING);
536 RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other.");
538 prop= RNA_def_property(srna, "animate_branching", PROP_BOOLEAN, PROP_NONE);
539 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING);
540 RNA_def_property_ui_text(prop, "Animated", "Animate branching");
542 prop= RNA_def_property(srna, "symmetric_branching", PROP_BOOLEAN, PROP_NONE);
543 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING);
544 RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same.");
546 prop= RNA_def_property(srna, "hair_bspline", PROP_BOOLEAN, PROP_NONE);
547 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE);
548 RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines.");
550 prop= RNA_def_property(srna, "grid_invert", PROP_BOOLEAN, PROP_NONE);
551 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT);
552 RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not.");
554 prop= RNA_def_property(srna, "child_effector", PROP_BOOLEAN, PROP_NONE);
555 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT);
556 RNA_def_property_ui_text(prop, "Children", "Apply effectors to children.");
558 prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE);
559 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS);
560 RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents");
562 prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE);
563 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_RENDER);
564 RNA_def_property_ui_text(prop, "child_render", "");
566 prop= RNA_def_property(srna, "child_guide", PROP_BOOLEAN, PROP_NONE);
567 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE);
568 RNA_def_property_ui_text(prop, "child_guide", "");
570 prop= RNA_def_property(srna, "self_effect", PROP_BOOLEAN, PROP_NONE);
571 RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT);
572 RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves.");
575 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
576 RNA_def_property_enum_items(prop, type_items);
577 RNA_def_property_ui_text(prop, "Type", "");
579 prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE);
580 RNA_def_property_enum_sdna(prop, NULL, "from");
581 RNA_def_property_enum_items(prop, from_items);
582 RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from");
584 prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE);
585 RNA_def_property_enum_sdna(prop, NULL, "distr");
586 RNA_def_property_enum_items(prop, dist_items);
587 RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element");
590 prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
591 RNA_def_property_enum_sdna(prop, NULL, "phystype");
592 RNA_def_property_enum_items(prop, phys_type_items);
593 RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type");
595 prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
596 RNA_def_property_enum_sdna(prop, NULL, "rotmode");
597 RNA_def_property_enum_items(prop, rot_mode_items);
598 RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation");
600 prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE);
601 RNA_def_property_enum_sdna(prop, NULL, "avemode");
602 RNA_def_property_enum_items(prop, ave_mode_items);
603 RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode.");
605 prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE);
606 RNA_def_property_enum_sdna(prop, NULL, "reactevent");
607 RNA_def_property_enum_items(prop, react_event_items);
608 RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on.");
611 prop= RNA_def_property(srna, "velocity", PROP_BOOLEAN, PROP_NONE);
612 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL);
613 RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity");
616 prop= RNA_def_property(srna, "angle", PROP_BOOLEAN, PROP_NONE);
617 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ANG);
618 RNA_def_property_ui_text(prop, "Angle", "");
621 prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE);
622 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE);
623 RNA_def_property_ui_text(prop, "Size", "Show particle size");
625 prop= RNA_def_property(srna, "emitter", PROP_BOOLEAN, PROP_NONE);
626 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER);
627 RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also.");
630 prop= RNA_def_property(srna, "adapt", PROP_BOOLEAN, PROP_NONE);
631 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_ADAPT);
632 RNA_def_property_ui_text(prop, "adapt", "");
634 prop= RNA_def_property(srna, "cos", PROP_BOOLEAN, PROP_NONE);
635 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_COS);
636 RNA_def_property_ui_text(prop, "cos", "");
639 prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE);
640 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK);
641 RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis");
643 prop= RNA_def_property(srna, "parent", PROP_BOOLEAN, PROP_NONE);
644 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT);
645 RNA_def_property_ui_text(prop, "Parents", "Render parent particles.");
647 prop= RNA_def_property(srna, "num", PROP_BOOLEAN, PROP_NONE);
648 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM);
649 RNA_def_property_ui_text(prop, "Number", "Show particle number");
651 prop= RNA_def_property(srna, "rand_group", PROP_BOOLEAN, PROP_NONE);
652 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR);
653 RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly");
655 prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE);
656 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT);
657 RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path");
659 prop= RNA_def_property(srna, "velocity_length", PROP_BOOLEAN, PROP_NONE);
660 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH);
661 RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed");
663 prop= RNA_def_property(srna, "material_color", PROP_BOOLEAN, PROP_NONE);
664 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL);
665 RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color.");
667 prop= RNA_def_property(srna, "whole_group", PROP_BOOLEAN, PROP_NONE);
668 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR);
669 RNA_def_property_ui_text(prop, "Dupli Group", "Use whole group at once.");
671 prop= RNA_def_property(srna, "render_strand", PROP_BOOLEAN, PROP_NONE);
672 RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND);
673 RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering");
676 prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE);
677 RNA_def_property_enum_items(prop, draw_as_items);
678 RNA_def_property_ui_text(prop, "Particle Visualization", "How particles are visualized");
680 prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE);
681 RNA_def_property_range(prop, 0, 10);
682 RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)");
684 prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE);
685 RNA_def_property_enum_sdna(prop, NULL, "childtype");
686 RNA_def_property_enum_items(prop, child_type_items);
687 RNA_def_property_ui_text(prop, "Children From", "Create child particles");
689 prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
690 RNA_def_property_range(prop, 0, 7);
691 RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)");
693 prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE);
694 RNA_def_property_int_sdna(prop, NULL, "ren_step");
695 RNA_def_property_range(prop, 0, 9);
696 RNA_def_property_ui_text(prop, "Render", "How many steps paths are rendered with (power of 2)");
698 prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE);
699 RNA_def_property_range(prop, 2, 50);
700 RNA_def_property_ui_text(prop, "Segments", "Amount of hair segments");
702 //TODO: not found in UI, readonly?
703 prop= RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
704 RNA_def_property_range(prop, 0, INT_MAX);//TODO:min,max
705 RNA_def_property_ui_text(prop, "Keys Step", "");
707 /* adaptive path rendering */
708 prop= RNA_def_property(srna, "adaptive_angle", PROP_INT, PROP_NONE);
709 RNA_def_property_int_sdna(prop, NULL, "adapt_angle");
710 RNA_def_property_range(prop, 0, 45);
711 RNA_def_property_ui_text(prop, "Degrees", "How many degrees path has to curve to make another render segment");
713 prop= RNA_def_property(srna, "adaptive_pix", PROP_INT, PROP_NONE);
714 RNA_def_property_int_sdna(prop, NULL, "adapt_pix");
715 RNA_def_property_range(prop, 0, 50);
716 RNA_def_property_ui_text(prop, "Pixel", "How many pixels path has to cover to make another render segment");
718 prop= RNA_def_property(srna, "display", PROP_INT, PROP_NONE);
719 RNA_def_property_int_sdna(prop, NULL, "disp");
720 RNA_def_property_range(prop, 0, 100);
721 RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3d view");
723 prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
724 RNA_def_property_int_sdna(prop, NULL, "omat");
725 RNA_def_property_range(prop, 1, 16);
726 RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles");
730 //TODO: can't find where interpolation is used
732 //TODO: is this read only/internal?
733 prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
734 RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
735 RNA_def_property_enum_items(prop, rot_from_items);
736 RNA_def_property_ui_text(prop, "Rotate From", "");
738 prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
739 RNA_def_property_enum_items(prop, integrator_type_items);
740 RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type");
742 prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE);
743 RNA_def_property_enum_items(prop, kink_type_items);
744 RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path");
746 prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE);
747 RNA_def_property_enum_items(prop, kink_axis_items);
748 RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset");
751 prop= RNA_def_property(srna, "inbetween", PROP_INT, PROP_NONE);
752 RNA_def_property_int_sdna(prop, NULL, "nbetween");
753 RNA_def_property_range(prop, 0, INT_MAX);
754 RNA_def_property_ui_text(prop, "Inbetween", "");
757 prop= RNA_def_property(srna, "boid_neighbours", PROP_INT, PROP_NONE);
758 RNA_def_property_int_sdna(prop, NULL, "boidneighbours");
759 RNA_def_property_range(prop, 1, 10);
760 RNA_def_property_ui_text(prop, "Neighbours", "How many neighbours to consider for each boid");
763 prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE);
764 RNA_def_property_enum_sdna(prop, NULL, "bb_align");
765 RNA_def_property_enum_items(prop, bb_align_items);
766 RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned");
768 prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE);
769 RNA_def_property_int_sdna(prop, NULL, "bb_uv_split");
770 RNA_def_property_range(prop, 1, 10);
771 RNA_def_property_ui_text(prop, "UV Split", "Amount of rows/columns to split uv coordinates for billboards");
773 prop= RNA_def_property(srna, "billboard_animation", PROP_ENUM, PROP_NONE);
774 RNA_def_property_enum_sdna(prop, NULL, "bb_anim");
775 RNA_def_property_enum_items(prop, bb_anim_items);
776 RNA_def_property_ui_text(prop, "Animate", "How to animate billboard textures.");
778 prop= RNA_def_property(srna, "billboard_split_offset", PROP_ENUM, PROP_NONE);
779 RNA_def_property_enum_sdna(prop, NULL, "bb_split_offset");
780 RNA_def_property_enum_items(prop, bb_split_offset_items);
781 RNA_def_property_ui_text(prop, "Offset", "How to offset billboard textures");
783 prop= RNA_def_property(srna, "billboard_tilt", PROP_FLOAT, PROP_NONE);
784 RNA_def_property_float_sdna(prop, NULL, "bb_tilt");
785 RNA_def_property_range(prop, -1.0f, 1.0f);
786 RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards");
788 prop= RNA_def_property(srna, "billboard_random_tilt", PROP_FLOAT, PROP_NONE);
789 RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt");
790 RNA_def_property_range(prop, 0.0f, 1.0f);
791 RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards");
793 prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_VECTOR);
794 RNA_def_property_float_sdna(prop, NULL, "bb_offset");
795 RNA_def_property_array(prop, 2);
796 RNA_def_property_range(prop, -1.0f, 1.0f);
797 RNA_def_property_ui_text(prop, "Billboard Offset", "");
800 prop= RNA_def_property(srna, "enable_simplify", PROP_BOOLEAN, PROP_NONE);
801 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE);
802 RNA_def_property_ui_text(prop, "Child Simplification", "Remove child strands as the object becomes smaller on the screen.");
804 prop= RNA_def_property(srna, "viewport", PROP_BOOLEAN, PROP_NONE);
805 RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_VIEWPORT);
806 RNA_def_property_ui_text(prop, "Viewport", "");
808 prop= RNA_def_property(srna, "simplify_refsize", PROP_INT, PROP_UNSIGNED);
809 RNA_def_property_int_sdna(prop, NULL, "simplify_refsize");
810 RNA_def_property_range(prop, 1, 32768);
811 RNA_def_property_ui_text(prop, "Reference Size", "Reference size size in pixels, after which simplification begins.");
813 prop= RNA_def_property(srna, "simplify_rate", PROP_FLOAT, PROP_NONE);
814 RNA_def_property_range(prop, 0.0f, 1.0f);
815 RNA_def_property_ui_text(prop, "Rate", "Speed of simplification");
817 prop= RNA_def_property(srna, "simplify_transition", PROP_FLOAT, PROP_NONE);
818 RNA_def_property_range(prop, 0.0f, 1.0f);
819 RNA_def_property_ui_text(prop, "Transition", "Transition period for fading out strands.");
821 prop= RNA_def_property(srna, "simplify_viewport", PROP_FLOAT, PROP_NONE);
822 RNA_def_property_range(prop, 0.0f, 0.999f);
823 RNA_def_property_ui_text(prop, "Rate", "Speed of Simplification");
826 prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
827 RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same
828 RNA_def_property_range(prop, -30000.0f, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
829 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
830 RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles.");
832 prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
833 RNA_def_property_range(prop, -30000.0f, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5
834 RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL);
835 RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles.");
837 prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE);
838 RNA_def_property_range(prop, 1.0f, 30000.0f);
839 RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles");
841 prop= RNA_def_property(srna, "random_lifetime", PROP_FLOAT, PROP_NONE);
842 RNA_def_property_float_sdna(prop, NULL, "randlife");
843 RNA_def_property_range(prop, 0.0f, 2.0f);
844 RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation.");
846 prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE);
847 RNA_def_property_float_sdna(prop, NULL, "timetweak");
848 RNA_def_property_range(prop, 0.0f, 10.0f);
849 RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
851 prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
852 RNA_def_property_float_sdna(prop, NULL, "jitfac");
853 RNA_def_property_range(prop, 0.0f, 2.0f);
854 RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling.");
856 prop= RNA_def_property(srna, "keyed_time", PROP_FLOAT, PROP_NONE);
857 RNA_def_property_range(prop, 0.0f, 1.0f);
858 RNA_def_property_ui_text(prop, "Time", "Keyed key time relative to remaining particle life.");
860 prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE);
861 RNA_def_property_float_sdna(prop, NULL, "eff_hair");
862 RNA_def_property_range(prop, 0.0f, 1.0f);
863 RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors");
865 //float rt; TODO:find where rt is used - can't find it in UI
867 prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED);
868 RNA_def_property_int_sdna(prop, NULL, "totpart");
869 RNA_def_property_range(prop, 0, 100000);
870 RNA_def_property_ui_text(prop, "Amount", "Total number of particles.");
872 prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit?
873 RNA_def_property_int_sdna(prop, NULL, "userjit");
874 RNA_def_property_range(prop, 0, 1000);
875 RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic).");
877 prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED);
878 RNA_def_property_int_sdna(prop, NULL, "grid_res");
879 RNA_def_property_range(prop, 1, 100);
880 RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid.");
882 /* initial velocity factors */
883 prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
884 RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same
885 RNA_def_property_range(prop, -200.0f, 200.0f);
886 RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed.");
888 prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE);
889 RNA_def_property_float_sdna(prop, NULL, "obfac");
890 RNA_def_property_range(prop, -1.0f, 1.0f);
891 RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed");
893 prop= RNA_def_property(srna, "random_factor", PROP_FLOAT, PROP_NONE);
894 RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same
895 RNA_def_property_range(prop, 0.0f, 200.0f);
896 RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation.");
898 prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE);
899 RNA_def_property_float_sdna(prop, NULL, "partfac");
900 RNA_def_property_range(prop, -10.0f, 10.0f);
901 RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed.");
903 prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE);
904 RNA_def_property_float_sdna(prop, NULL, "tanfac");
905 RNA_def_property_range(prop, -200.0f, 200.0f);
906 RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed.");
908 prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE);
909 RNA_def_property_float_sdna(prop, NULL, "tanphase");
910 RNA_def_property_range(prop, -1.0f, 1.0f);
911 RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent.");
913 prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE);
914 RNA_def_property_float_sdna(prop, NULL, "reactfac");
915 RNA_def_property_range(prop, -10.0f, 10.0f);
916 RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed.");
918 prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE);
919 RNA_def_property_float_sdna(prop, NULL, "avefac");
920 RNA_def_property_range(prop, -200.0f, 200.0f);
921 RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount");
923 prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE);
924 RNA_def_property_float_sdna(prop, NULL, "phasefac");
925 RNA_def_property_range(prop, -1.0f, 1.0f);
926 RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase");
928 prop= RNA_def_property(srna, "random_rotation_factor", PROP_FLOAT, PROP_NONE);
929 RNA_def_property_float_sdna(prop, NULL, "randrotfac");
930 RNA_def_property_range(prop, 0.0f, 1.0f);
931 RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation");
933 prop= RNA_def_property(srna, "random_phase_factor", PROP_FLOAT, PROP_NONE);
934 RNA_def_property_float_sdna(prop, NULL, "randphasefac");
935 RNA_def_property_range(prop, 0.0f, 1.0f);
936 RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase");
938 /* physical properties */
939 prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
940 RNA_def_property_range(prop, 0.01f, 100.0f);
941 RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles");
943 prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE);
944 RNA_def_property_float_sdna(prop, NULL, "size");
945 RNA_def_property_range(prop, 0.01f, 100.0f);
946 RNA_def_property_ui_text(prop, "Size", "The size of the particles");
948 prop= RNA_def_property(srna, "random_size", PROP_FLOAT, PROP_NONE);
949 RNA_def_property_float_sdna(prop, NULL, "randsize");
950 RNA_def_property_range(prop, 0.0f, 1.0f);
951 RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation");
953 prop= RNA_def_property(srna, "reaction_shape", PROP_FLOAT, PROP_NONE);
954 RNA_def_property_float_sdna(prop, NULL, "reactshape");
955 RNA_def_property_range(prop, 0.0f, 10.0f);
956 RNA_def_property_ui_text(prop, "Shape", "Power of reaction strength dependence on distance to target.");
959 /* global physical properties */
960 prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_VECTOR);
961 RNA_def_property_float_sdna(prop, NULL, "acc");
962 RNA_def_property_array(prop, 3);
963 RNA_def_property_range(prop, -200.0f, 200.0f);
964 RNA_def_property_ui_text(prop, "Accelaration", "Constant acceleration");
966 prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE);
967 RNA_def_property_float_sdna(prop, NULL, "dragfac");
968 RNA_def_property_range(prop, 0.0f, 1.0f);
969 RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag.");
971 prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE);
972 RNA_def_property_float_sdna(prop, NULL, "brownfac");
973 RNA_def_property_range(prop, 0.0f, 200.0f);
974 RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of brownian motion");
976 prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE);
977 RNA_def_property_float_sdna(prop, NULL, "dampfac");
978 RNA_def_property_range(prop, 0.0f, 1.0f);
979 RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping");
982 //TODO: is this readonly?
983 prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE);
984 RNA_def_property_float_sdna(prop, NULL, "length");
985 // RNA_def_property_range(prop, 0.0f, upperLimitf);//TODO: limits
986 RNA_def_property_ui_text(prop, "Length", "");
988 prop= RNA_def_property(srna, "absolute_length", PROP_FLOAT, PROP_NONE);
989 RNA_def_property_float_sdna(prop, NULL, "abslength");
990 RNA_def_property_range(prop, 0.0f, 10000.0f);
991 RNA_def_property_ui_text(prop, "Max Length", "Absolute maximum path length for children, in blender units.");
993 prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE);
994 RNA_def_property_float_sdna(prop, NULL, "randlength");
995 RNA_def_property_range(prop, 0.0f, 1.0f);
996 RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation.");
999 prop= RNA_def_property(srna, "child_nbr", PROP_FLOAT, PROP_NONE);
1000 RNA_def_property_float_sdna(prop, NULL, "child_nbr");//optional if prop names are the same
1001 RNA_def_property_range(prop, 0.0f, MAX_PART_CHILDREN);
1002 RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent");
1004 prop= RNA_def_property(srna, "rendered_child_nbr", PROP_FLOAT, PROP_NONE);
1005 RNA_def_property_float_sdna(prop, NULL, "ren_child_nbr");
1006 RNA_def_property_range(prop, 0.0f, MAX_PART_CHILDREN);
1007 RNA_def_property_ui_text(prop, "Rendered Children", "Amount of children/parent for rendering.");
1009 prop= RNA_def_property(srna, "virtual_parents", PROP_FLOAT, PROP_NONE);
1010 RNA_def_property_float_sdna(prop, NULL, "parents");
1011 RNA_def_property_range(prop, 0.0f, 1.0f);
1012 RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents.");
1014 prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE);
1015 RNA_def_property_float_sdna(prop, NULL, "childsize");
1016 RNA_def_property_range(prop, 0.01f, 100.0f);
1017 RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size.");
1019 prop= RNA_def_property(srna, "child_random_size", PROP_FLOAT, PROP_NONE);
1020 RNA_def_property_float_sdna(prop, NULL, "childrandsize");
1021 RNA_def_property_range(prop, 0.0f, 1.0f);
1022 RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles.");
1024 prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE);
1025 RNA_def_property_float_sdna(prop, NULL, "childrad");
1026 RNA_def_property_range(prop, 0.0f, 10.0f);
1027 RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent.");
1029 prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE);
1030 RNA_def_property_float_sdna(prop, NULL, "childflat");
1031 RNA_def_property_range(prop, 0.0f, 1.0f);
1032 RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent.");
1034 //TODO: is this readonly?
1035 prop= RNA_def_property(srna, "child_spread", PROP_FLOAT, PROP_NONE);
1036 RNA_def_property_float_sdna(prop, NULL, "childspread");
1037 // RNA_def_property_range(prop, 0.0f, upperLimitf); TODO: limits
1038 RNA_def_property_ui_text(prop, "Child Spread", "");
1041 prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE);
1042 RNA_def_property_float_sdna(prop, NULL, "clumpfac");
1043 RNA_def_property_range(prop, -1.0f, 1.0f);
1044 RNA_def_property_ui_text(prop, "Clump", "Amount of clumping");
1046 prop= RNA_def_property(srna, "clumppow", PROP_FLOAT, PROP_NONE);
1047 RNA_def_property_float_sdna(prop, NULL, "clumppow");
1048 RNA_def_property_range(prop, -0.999f, 0.999f);
1049 RNA_def_property_ui_text(prop, "Shape", "Shape of clumping");
1053 prop= RNA_def_property(srna, "kink_amplitude", PROP_FLOAT, PROP_NONE);
1054 RNA_def_property_float_sdna(prop, NULL, "kink_amp");
1055 RNA_def_property_range(prop, 0.0f, 10.0f);
1056 RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset.");
1058 prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE);
1059 RNA_def_property_float_sdna(prop, NULL, "kink_freq");
1060 RNA_def_property_range(prop, 0.0f, 10.0f);
1061 RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)");
1063 prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE);
1064 RNA_def_property_range(prop, -0.999f, 0.999f);
1065 RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end");
1069 prop= RNA_def_property(srna, "rough1", PROP_FLOAT, PROP_NONE);
1070 RNA_def_property_range(prop, 0.0f, 10.0f);
1071 RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough.");
1073 prop= RNA_def_property(srna, "rough1_size", PROP_FLOAT, PROP_NONE);
1074 RNA_def_property_range(prop, 0.01f, 10.0f);
1075 RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough.");
1077 prop= RNA_def_property(srna, "rough2", PROP_FLOAT, PROP_NONE);
1078 RNA_def_property_float_sdna(prop, NULL, "rough2");
1079 RNA_def_property_range(prop, 0.0f, 10.0f);
1080 RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough.");
1082 prop= RNA_def_property(srna, "rough2_size", PROP_FLOAT, PROP_NONE);
1083 RNA_def_property_float_sdna(prop, NULL, "rough2_size");
1084 RNA_def_property_range(prop, 0.01f, 10.0f);
1085 RNA_def_property_ui_text(prop, "Size2", "Size of random rough.");
1087 prop= RNA_def_property(srna, "rough2_thres", PROP_FLOAT, PROP_NONE);
1088 RNA_def_property_float_sdna(prop, NULL, "rough2_thres");
1089 RNA_def_property_range(prop, 0.0f, 1.0f);
1090 RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough.");
1092 prop= RNA_def_property(srna, "rough_endpoint", PROP_FLOAT, PROP_NONE);
1093 RNA_def_property_float_sdna(prop, NULL, "rough_end");
1094 RNA_def_property_range(prop, 0.0f, 10.0f);
1095 RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough.");
1097 prop= RNA_def_property(srna, "rough_end_shape", PROP_FLOAT, PROP_NONE);
1098 RNA_def_property_range(prop, 0.0f, 10.0f);
1099 RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
1102 prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE);
1103 RNA_def_property_float_sdna(prop, NULL, "branch_thres");
1104 RNA_def_property_range(prop, 0.0f, 1.0f);
1105 RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching.");
1108 prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE);
1109 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL);
1110 RNA_def_property_range(prop, 0.0f, 10.0f);
1111 RNA_def_property_ui_text(prop, "Back", "Length of the line's tail");
1113 prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE);
1114 RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL);
1115 RNA_def_property_range(prop, 0.0f, 10.0f);
1116 RNA_def_property_ui_text(prop, "Head", "Length of the line's head");
1119 prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE);
1120 RNA_def_property_float_sdna(prop, NULL, "max_vel");
1121 RNA_def_property_range(prop, 0.0f, 200.0f);
1122 RNA_def_property_ui_text(prop, "Maximum Velocity", "");
1124 prop= RNA_def_property(srna, "lateral_acceleration_max", PROP_FLOAT, PROP_NONE);
1125 RNA_def_property_float_sdna(prop, NULL, "max_lat_acc");
1126 RNA_def_property_range(prop, 0.0f, 1.0f);
1127 RNA_def_property_ui_text(prop, "Lateral Acceleration", "Lateral acceleration % of max velocity");
1129 prop= RNA_def_property(srna, "tangential_acceleration_max", PROP_FLOAT, PROP_NONE);
1130 RNA_def_property_float_sdna(prop, NULL, "max_tan_acc");
1131 RNA_def_property_range(prop, 0.0f, 1.0f);
1132 RNA_def_property_ui_text(prop, "Tangential acceleration", "Tangential acceleration % of max velocity");
1134 prop= RNA_def_property(srna, "average_velocity", PROP_FLOAT, PROP_NONE);
1135 RNA_def_property_float_sdna(prop, NULL, "average_vel");
1136 RNA_def_property_range(prop, 0.0f, 1.0f);
1137 RNA_def_property_ui_text(prop, "Average Velocity", "The usual speed % of max velocity");
1139 prop= RNA_def_property(srna, "banking", PROP_FLOAT, PROP_NONE);
1140 RNA_def_property_range(prop, -10.0f, 10.0f);
1141 RNA_def_property_ui_text(prop, "Banking", "Banking of boids on turns (1.0==natural banking)");
1143 prop= RNA_def_property(srna, "banking_max", PROP_FLOAT, PROP_NONE);
1144 RNA_def_property_float_sdna(prop, NULL, "max_bank");
1145 RNA_def_property_range(prop, 0.0f, 1.0f);
1146 RNA_def_property_ui_text(prop, "Maximum Banking", "How much a boid can bank at a single step");
1148 prop= RNA_def_property(srna, "ground_z", PROP_FLOAT, PROP_NONE);
1149 RNA_def_property_float_sdna(prop, NULL, "groundz");
1150 RNA_def_property_range(prop, -100.0f, 100.0f);
1151 RNA_def_property_ui_text(prop, "Ground Z", "Default Z value");
1153 /*TODO: not sure how to deal with this
1154 prop= RNA_def_property(srna, "boid_factor", PROP_FLOAT, PROP_VECTOR);
1155 RNA_def_property_float_sdna(prop, NULL, "boidfac");
1156 RNA_def_property_ui_text(prop, "Boid Factor", "");
1161 prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE);
1162 RNA_def_property_pointer_sdna(prop, NULL, "dup_group");
1163 RNA_def_property_struct_type(prop, "Group");
1164 RNA_def_property_flag(prop, PROP_EDITABLE);
1165 RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles");
1167 prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
1168 RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
1169 RNA_def_property_struct_type(prop, "Group");
1170 RNA_def_property_flag(prop, PROP_EDITABLE);
1171 RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group.");
1173 prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE);
1174 RNA_def_property_pointer_sdna(prop, NULL, "dup_ob");
1175 RNA_def_property_struct_type(prop, "Object");
1176 RNA_def_property_flag(prop, PROP_EDITABLE);
1177 RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles.");
1179 prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE);
1180 RNA_def_property_pointer_sdna(prop, NULL, "bb_ob");
1181 RNA_def_property_struct_type(prop, "Object");
1182 RNA_def_property_flag(prop, PROP_EDITABLE);
1183 RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)");
1186 prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
1187 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1188 RNA_def_property_pointer_sdna(prop, NULL, "ipo");
1189 RNA_def_property_struct_type(prop, "Ipo");
1190 RNA_def_property_ui_text(prop, "Ipo", "");
1193 // struct PartDeflect *pd;
1194 // struct PartDeflect *pd2;
1197 static void rna_def_particle_system(BlenderRNA *brna)
1202 srna= RNA_def_struct(brna, "ParticleSystem", NULL);
1203 RNA_def_struct_ui_text(srna, "Particle System", "Particle system in an object.");
1204 RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
1206 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1207 RNA_def_property_string_funcs(prop, "rna_ParticleSystem_name_get", "rna_ParticleSystem_name_length", NULL);
1208 RNA_def_property_ui_text(prop, "Name", "Particle system name.");
1209 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1210 RNA_def_struct_name_property(srna, prop);
1212 prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL);
1213 RNA_def_property_pointer_sdna(prop, NULL, "part");
1214 RNA_def_property_ui_text(prop, "Settings", "Particle system settings.");
1216 prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE);
1217 RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart");
1218 RNA_def_property_struct_type(prop, "Particle");
1219 RNA_def_property_ui_text(prop, "Particles", "Particles generated by the particle system.");
1221 prop= RNA_def_property(srna, "child_particles", PROP_COLLECTION, PROP_NONE);
1222 RNA_def_property_collection_sdna(prop, NULL, "child", "totchild");
1223 RNA_def_property_struct_type(prop, "ChildParticle");
1224 RNA_def_property_ui_text(prop, "Child Particles", "Child particles generated by the particle system.");
1226 prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1227 RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result.");
1230 prop= RNA_def_property(srna, "softbody", PROP_POINTER, PROP_NONE);
1231 RNA_def_property_pointer_sdna(prop, NULL, "soft");
1232 RNA_def_property_ui_text(prop, "Soft Body", "Soft body settings for hair physics simulation.");
1234 prop= RNA_def_property(srna, "use_softbody", PROP_BOOLEAN, PROP_NONE);
1235 RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE);
1236 RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation.");
1238 prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
1239 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED);
1240 RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks needed */
1241 RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, finalize the hair to enable editing.");
1244 prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE);
1245 RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
1246 RNA_def_property_flag(prop, PROP_EDITABLE);
1247 RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object).");
1249 prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED);
1250 RNA_def_property_int_sdna(prop, NULL, "target_psys");
1251 RNA_def_property_range(prop, 1, INT_MAX);
1252 RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object.");
1255 prop= RNA_def_property(srna, "boids_surface_object", PROP_POINTER, PROP_NONE);
1256 RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
1257 RNA_def_property_flag(prop, PROP_EDITABLE);
1258 RNA_def_property_ui_text(prop, "Boids Surface Object", "For boids physics systems, constrain boids to this object's surface.");
1261 prop= RNA_def_property(srna, "keyed_object", PROP_POINTER, PROP_NONE);
1262 RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
1263 RNA_def_property_flag(prop, PROP_EDITABLE);
1264 RNA_def_property_ui_text(prop, "Keyed Object", "For keyed physics systems, the object that has the target particle system.");
1266 prop= RNA_def_property(srna, "keyed_particle_system", PROP_INT, PROP_UNSIGNED);
1267 RNA_def_property_int_sdna(prop, NULL, "keyed_psys");
1268 RNA_def_property_range(prop, 1, INT_MAX);
1269 RNA_def_property_ui_text(prop, "Keyed Particle System", "For keyed physics systems, index of particle system on the keyed object.");
1271 prop= RNA_def_property(srna, "keyed_first", PROP_BOOLEAN, PROP_NONE);
1272 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_FIRST_KEYED);
1273 RNA_def_property_ui_text(prop, "Keyed First", "Set the system to be the starting point of keyed particles");
1275 prop= RNA_def_property(srna, "keyed_timed", PROP_BOOLEAN, PROP_NONE);
1276 RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIME);
1277 RNA_def_property_ui_text(prop, "Keyed Timed", "Use intermediate key times for keyed particles (setting for starting point only).");
1281 prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE);
1282 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
1283 RNA_def_property_string_maxlength(prop, 32);
1284 RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV Layer to control billboard normals.");
1286 prop= RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, PROP_NONE);
1287 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
1288 RNA_def_property_string_maxlength(prop, 32);
1289 RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV Layer to control billboard time index (X-Y).");
1291 prop= RNA_def_property(srna, "billboard_split_uv", PROP_STRING, PROP_NONE);
1292 RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");
1293 RNA_def_property_string_maxlength(prop, 32);
1294 RNA_def_property_ui_text(prop, "Billboard Split UV", "UV Layer to control billboard splitting.");
1297 prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE);
1298 RNA_def_property_int_sdna(prop, NULL, "vgroup[0]");
1299 RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density.");
1301 prop= RNA_def_property(srna, "vertex_group_density_negate", PROP_BOOLEAN, PROP_NONE);
1302 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY));
1303 RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group.");
1305 prop= RNA_def_property(srna, "vertex_group_velocity", PROP_INT, PROP_NONE);
1306 RNA_def_property_int_sdna(prop, NULL, "vgroup[1]");
1307 RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity.");
1309 prop= RNA_def_property(srna, "vertex_group_velocity_negate", PROP_BOOLEAN, PROP_NONE);
1310 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL));
1311 RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group.");
1313 prop= RNA_def_property(srna, "vertex_group_length", PROP_INT, PROP_NONE);
1314 RNA_def_property_int_sdna(prop, NULL, "vgroup[2]");
1315 RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length.");
1317 prop= RNA_def_property(srna, "vertex_group_length_negate", PROP_BOOLEAN, PROP_NONE);
1318 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH));
1319 RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group.");
1321 prop= RNA_def_property(srna, "vertex_group_clump", PROP_INT, PROP_NONE);
1322 RNA_def_property_int_sdna(prop, NULL, "vgroup[3]");
1323 RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump.");
1325 prop= RNA_def_property(srna, "vertex_group_clump_negate", PROP_BOOLEAN, PROP_NONE);
1326 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP));
1327 RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group.");
1329 prop= RNA_def_property(srna, "vertex_group_kink", PROP_INT, PROP_NONE);
1330 RNA_def_property_int_sdna(prop, NULL, "vgroup[4]");
1331 RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink.");
1333 prop= RNA_def_property(srna, "vertex_group_kink_negate", PROP_BOOLEAN, PROP_NONE);
1334 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK));
1335 RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group.");
1337 prop= RNA_def_property(srna, "vertex_group_roughness1", PROP_INT, PROP_NONE);
1338 RNA_def_property_int_sdna(prop, NULL, "vgroup[5]");
1339 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1.");
1341 prop= RNA_def_property(srna, "vertex_group_roughness1_negate", PROP_BOOLEAN, PROP_NONE);
1342 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1));
1343 RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group.");
1345 prop= RNA_def_property(srna, "vertex_group_roughness2", PROP_INT, PROP_NONE);
1346 RNA_def_property_int_sdna(prop, NULL, "vgroup[6]");
1347 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2.");
1349 prop= RNA_def_property(srna, "vertex_group_roughness2_negate", PROP_BOOLEAN, PROP_NONE);
1350 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2));
1351 RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group.");
1353 prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_INT, PROP_NONE);
1354 RNA_def_property_int_sdna(prop, NULL, "vgroup[7]");
1355 RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end.");
1357 prop= RNA_def_property(srna, "vertex_group_roughness_end_negate", PROP_BOOLEAN, PROP_NONE);
1358 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE));
1359 RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group.");
1361 prop= RNA_def_property(srna, "vertex_group_size", PROP_INT, PROP_NONE);
1362 RNA_def_property_int_sdna(prop, NULL, "vgroup[8]");
1363 RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size.");
1365 prop= RNA_def_property(srna, "vertex_group_size_negate", PROP_BOOLEAN, PROP_NONE);
1366 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE));
1367 RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group.");
1369 prop= RNA_def_property(srna, "vertex_group_tangent", PROP_INT, PROP_NONE);
1370 RNA_def_property_int_sdna(prop, NULL, "vgroup[9]");
1371 RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent.");
1373 prop= RNA_def_property(srna, "vertex_group_tangent_negate", PROP_BOOLEAN, PROP_NONE);
1374 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN));
1375 RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group.");
1377 prop= RNA_def_property(srna, "vertex_group_rotation", PROP_INT, PROP_NONE);
1378 RNA_def_property_int_sdna(prop, NULL, "vgroup[10]");
1379 RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation.");
1381 prop= RNA_def_property(srna, "vertex_group_rotation_negate", PROP_BOOLEAN, PROP_NONE);
1382 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT));
1383 RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group.");
1385 prop= RNA_def_property(srna, "vertex_group_field", PROP_INT, PROP_NONE);
1386 RNA_def_property_int_sdna(prop, NULL, "vgroup[11]");
1387 RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field.");
1389 prop= RNA_def_property(srna, "vertex_group_field_negate", PROP_BOOLEAN, PROP_NONE);
1390 RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR));
1391 RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group.");
1394 prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
1395 RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
1396 RNA_def_property_struct_type(prop, "PointCache");
1397 RNA_def_property_ui_text(prop, "Point Cache", "");
1400 void RNA_def_particle(BlenderRNA *brna)
1402 rna_def_particle_hair_key(brna);
1403 rna_def_particle_key(brna);
1404 rna_def_child_particle(brna);
1405 rna_def_particle(brna);
1406 rna_def_particle_system(brna);
1407 rna_def_particle_settings(brna);