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): Campbell Barton
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_scene_types.h"
34 #include "BKE_paint.h"
38 static EnumPropertyItem particle_edit_hair_brush_items[] = {
39 {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."},
40 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."},
41 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."},
42 {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."},
43 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."},
44 {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."},
45 {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."},
46 {0, NULL, 0, NULL, NULL}};
50 #include "BKE_context.h"
51 #include "BKE_pointcache.h"
52 #include "BKE_particle.h"
53 #include "BKE_depsgraph.h"
55 #include "ED_particle.h"
57 static EnumPropertyItem particle_edit_cache_brush_items[] = {
58 {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."},
59 {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."},
60 {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."},
61 {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."},
62 {0, NULL, 0, NULL, NULL}};
64 static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
66 ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
67 ParticleBrushData *brush= NULL;;
69 if(pset->brushtype != PE_BRUSH_NONE)
70 brush= &pset->brush[pset->brushtype];
72 return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
75 static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
77 return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL);
80 static void rna_Paint_brushes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
82 Paint *p= (Paint*)ptr->data;
83 rna_iterator_array_begin(iter, (void*)p->brushes, sizeof(Brush*), p->brush_count, 0, NULL);
86 static int rna_Paint_brushes_length(PointerRNA *ptr)
88 Paint *p= (Paint*)ptr->data;
90 return p->brush_count;
93 static PointerRNA rna_Paint_active_brush_get(PointerRNA *ptr)
95 return rna_pointer_inherit_refine(ptr, &RNA_Brush, paint_brush(ptr->data));
98 static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value)
100 paint_brush_set(ptr->data, value.data);
103 static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr)
105 PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C));
110 psys_free_path_cache(edit->psys, edit);
113 static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr)
115 Object *ob = CTX_data_active_object(C);
117 if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
120 static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free)
122 Scene *scene= CTX_data_scene(C);
123 PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C));
125 if(edit && edit->psys)
126 return particle_edit_hair_brush_items;
128 return particle_edit_cache_brush_items;
131 static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
133 ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
135 return (pset->object && PE_get_current(pset->scene, pset->object));
137 static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
139 ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data;
141 PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
143 return (edit && edit->psys);
147 static void rna_def_paint(BlenderRNA *brna)
152 srna= RNA_def_struct(brna, "Paint", NULL);
153 RNA_def_struct_ui_text(srna, "Paint", "");
155 prop= RNA_def_property(srna, "brushes", PROP_COLLECTION, PROP_NONE);
156 RNA_def_property_struct_type(prop, "Brush");
157 RNA_def_property_collection_funcs(prop, "rna_Paint_brushes_begin",
158 "rna_iterator_array_next",
159 "rna_iterator_array_end",
160 "rna_iterator_array_dereference_get",
161 "rna_Paint_brushes_length", 0, 0, 0, 0);
162 RNA_def_property_ui_text(prop, "Brushes", "Brushes selected for this paint mode.");
164 prop= RNA_def_property(srna, "active_brush_index", PROP_INT, PROP_NONE);
165 RNA_def_property_range(prop, 0, INT_MAX);
167 /* Fake property to get active brush directly, rather than integer index */
168 prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
169 RNA_def_property_struct_type(prop, "Brush");
170 RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL);
171 RNA_def_property_flag(prop, PROP_EDITABLE);
172 RNA_def_property_ui_text(prop, "Brush", "Active paint brush.");
174 prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
175 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
176 RNA_def_property_ui_text(prop, "Show Brush", "");
178 prop= RNA_def_property(srna, "fast_navigate", PROP_BOOLEAN, PROP_NONE);
179 RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
180 RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view.");
183 static void rna_def_sculpt(BlenderRNA *brna)
188 srna= RNA_def_struct(brna, "Sculpt", "Paint");
189 RNA_def_struct_ui_text(srna, "Sculpt", "");
191 prop= RNA_def_property(srna, "symmetry_x", PROP_BOOLEAN, PROP_NONE);
192 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
193 RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis.");
195 prop= RNA_def_property(srna, "symmetry_y", PROP_BOOLEAN, PROP_NONE);
196 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
197 RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis.");
199 prop= RNA_def_property(srna, "symmetry_z", PROP_BOOLEAN, PROP_NONE);
200 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
201 RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis.");
203 prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
204 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
205 RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices.");
207 prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
208 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
209 RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices.");
211 prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
212 RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
213 RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices.");
216 static void rna_def_vertex_paint(BlenderRNA *brna)
220 static EnumPropertyItem brush_mode_items[] = {
221 {0, "MIX", 0, "Mix", "Use mix blending mode while painting."},
222 {1, "ADD", 0, "Add", "Use add blending mode while painting."},
223 {2, "SUB", 0, "Subtract", "Use subtract blending mode while painting."},
224 {3, "MUL", 0, "Multiply", "Use multiply blending mode while painting."},
225 {4, "BLUR", 0, "Blur", "Blur the color with surrounding values"},
226 {5, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."},
227 {6, "DARKEN", 0, "Darken", "Use darken blending mode while painting."},
228 {0, NULL, 0, NULL, NULL}};
230 srna= RNA_def_struct(brna, "VertexPaint", "Paint");
231 RNA_def_struct_sdna(srna, "VPaint");
232 RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode.");
234 prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
235 RNA_def_property_enum_items(prop, brush_mode_items);
236 RNA_def_property_ui_text(prop, "Brush Mode", "Mode in which color is painted.");
238 prop= RNA_def_property(srna, "all_faces", PROP_BOOLEAN, PROP_NONE);
239 RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA);
240 RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush.");
242 prop= RNA_def_property(srna, "vertex_dist", PROP_BOOLEAN, PROP_NONE);
243 RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SOFT);
244 RNA_def_property_ui_text(prop, "Vertex Dist", "Use distances to vertices (instead of paint entire faces).");
246 prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE);
247 RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS);
248 RNA_def_property_ui_text(prop, "Normals", "Applies the vertex normal before painting.");
250 prop= RNA_def_property(srna, "spray", PROP_BOOLEAN, PROP_NONE);
251 RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
252 RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse.");
254 prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
255 RNA_def_property_range(prop, 0.1f, 5.0f);
256 RNA_def_property_ui_text(prop, "Gamma", "Vertex paint Gamma.");
258 prop= RNA_def_property(srna, "mul", PROP_FLOAT, PROP_NONE);
259 RNA_def_property_range(prop, 0.1f, 50.0f);
260 RNA_def_property_ui_text(prop, "Mul", "Vertex paint Mul.");
263 static void rna_def_image_paint(BlenderRNA *brna)
268 static EnumPropertyItem tool_items[] = {
269 {PAINT_TOOL_DRAW, "DRAW", 0, "Draw", ""},
270 {PAINT_TOOL_SOFTEN, "SOFTEN", 0, "Soften", ""},
271 {PAINT_TOOL_SMEAR, "SMEAR", 0, "Smear", ""},
272 {PAINT_TOOL_CLONE, "CLONE", 0, "Clone", ""},
273 {0, NULL, 0, NULL, NULL}};
275 srna= RNA_def_struct(brna, "ImagePaint", "Paint");
276 RNA_def_struct_sdna(srna, "ImagePaintSettings");
277 RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode.");
279 prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
280 RNA_def_property_enum_items(prop, tool_items);
281 RNA_def_property_ui_text(prop, "Tool", "");
285 prop= RNA_def_property(srna, "show_brush_draw", PROP_BOOLEAN, PROP_NONE);
286 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_DRAW_TOOL);
287 RNA_def_property_ui_text(prop, "Show Brush Draw", "Enables brush shape while drawing.");
289 prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
290 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_DRAW_TOOL_DRAWING);
291 RNA_def_property_ui_text(prop, "Show Brush", "Enables brush shape while not drawing.");
293 prop= RNA_def_property(srna, "use_projection", PROP_BOOLEAN, PROP_NONE);
294 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_DISABLE);
295 RNA_def_property_ui_text(prop, "Project Paint", "Use projection painting for improved consistency in the brush strokes.");
297 prop= RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
298 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
299 RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
301 prop= RNA_def_property(srna, "use_backface_cull", PROP_BOOLEAN, PROP_NONE);
302 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
303 RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
305 prop= RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
306 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT);
307 RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
309 prop= RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
310 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_MASK);
311 RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV layer buttons");
313 prop= RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
314 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_MASK_INV);
315 RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
317 prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
318 RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
319 RNA_def_property_ui_text(prop, "Clone Layer", "Use another UV layer as clone source, otherwise use 3D the cursor as the source");
323 prop= RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_UNSIGNED);
324 RNA_def_property_ui_range(prop, 0, 8, 0, 0);
325 RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower).");
327 prop= RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
328 RNA_def_property_range(prop, 0, 90);
329 RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view acording to this angle.");
332 static void rna_def_particle_edit(BlenderRNA *brna)
337 static EnumPropertyItem select_mode_items[] = {
338 {SCE_SELECT_PATH, "PATH", ICON_EDGESEL, "Path", ""}, // XXX icon
339 {SCE_SELECT_POINT, "POINT", ICON_VERTEXSEL, "Point", ""}, // XXX icon
340 {SCE_SELECT_END, "END", ICON_FACESEL, "End", "E"}, // XXX icon
341 {0, NULL, 0, NULL, NULL}};
343 static EnumPropertyItem puff_mode[] = {
344 {0, "ADD", 0, "Add", "Make hairs more puffy."},
345 {1, "SUB", 0, "Sub", "Make hairs less puffy."},
346 {0, NULL, 0, NULL, NULL}};
348 static EnumPropertyItem length_mode[] = {
349 {0, "GROW", 0, "Grow", "Make hairs longer."},
350 {1, "SHRINK", 0, "Shrink", "Make hairs shorter."},
351 {0, NULL, 0, NULL, NULL}};
353 static EnumPropertyItem edit_type_items[]= {
354 {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
355 {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
356 {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
357 {0, NULL, 0, NULL, NULL}
363 srna= RNA_def_struct(brna, "ParticleEdit", NULL);
364 RNA_def_struct_sdna(srna, "ParticleEditSettings");
365 RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode.");
367 prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
368 RNA_def_property_enum_sdna(prop, NULL, "brushtype");
369 RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
370 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf");
371 RNA_def_property_ui_text(prop, "Tool", "");
373 prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE);
374 RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
375 RNA_def_property_enum_items(prop, select_mode_items);
376 RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode.");
377 RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update");
379 prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE);
380 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
381 RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant.");
383 prop= RNA_def_property(srna, "keep_root", PROP_BOOLEAN, PROP_NONE);
384 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
385 RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified.");
387 prop= RNA_def_property(srna, "emitter_deflect", PROP_BOOLEAN, PROP_NONE);
388 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
389 RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter.");
391 prop= RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
392 RNA_def_property_float_sdna(prop, NULL, "emitterdist");
393 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
394 RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter.");
396 prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE);
397 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
398 RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame.");
399 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
401 prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE);
402 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
403 RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically.");
405 prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE);
406 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
407 RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles.");
408 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
410 prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE);
411 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_X_MIRROR);
412 RNA_def_property_ui_text(prop, "X-Axis Mirror", "Mirror operations over the X axis while editing.");
414 prop= RNA_def_property(srna, "add_interpolate", PROP_BOOLEAN, PROP_NONE);
415 RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
416 RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones.");
418 prop= RNA_def_property(srna, "add_keys", PROP_INT, PROP_NONE);
419 RNA_def_property_int_sdna(prop, NULL, "totaddkey");
420 RNA_def_property_range(prop, 2, INT_MAX);
421 RNA_def_property_ui_range(prop, 2, 20, 10, 3);
422 RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with.");
424 prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
425 RNA_def_property_struct_type(prop, "ParticleBrush");
426 RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL);
427 RNA_def_property_ui_text(prop, "Brush", "");
429 prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
430 RNA_def_property_range(prop, 2, 10);
431 RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with.");
432 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
434 prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
435 RNA_def_property_range(prop, 2, 100);
436 RNA_def_property_ui_text(prop, "Frames", "How many frames to fade.");
437 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
439 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
440 RNA_def_property_enum_sdna(prop, NULL, "edittype");
441 RNA_def_property_enum_items(prop, edit_type_items);
442 RNA_def_property_ui_text(prop, "Type", "");
443 RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
445 prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
446 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
447 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
448 RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
450 prop= RNA_def_property(srna, "hair", PROP_BOOLEAN, PROP_NONE);
451 RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
452 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
453 RNA_def_property_ui_text(prop, "Hair", "Editing hair");
455 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
456 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
457 RNA_def_property_ui_text(prop, "Object", "The edited object");
462 srna= RNA_def_struct(brna, "ParticleBrush", NULL);
463 RNA_def_struct_sdna(srna, "ParticleBrushData");
464 RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush.");
466 prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
467 RNA_def_property_range(prop, 1, INT_MAX);
468 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
469 RNA_def_property_ui_text(prop, "Size", "Brush size.");
471 prop= RNA_def_property(srna, "strength", PROP_INT, PROP_NONE);
472 RNA_def_property_range(prop, 1, INT_MAX);
473 RNA_def_property_ui_range(prop, 1, 100, 10, 3);
474 RNA_def_property_ui_text(prop, "Strength", "Brush strength.");
476 prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
477 RNA_def_property_int_sdna(prop, NULL, "step");
478 RNA_def_property_range(prop, 1, INT_MAX);
479 RNA_def_property_ui_range(prop, 1, 50, 10, 3);
480 RNA_def_property_ui_text(prop, "Steps", "Brush steps.");
482 prop= RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
483 RNA_def_property_enum_sdna(prop, NULL, "invert");
484 RNA_def_property_enum_items(prop, puff_mode);
485 RNA_def_property_ui_text(prop, "Puff Mode", "");
487 prop= RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
488 RNA_def_property_enum_sdna(prop, NULL, "invert");
489 RNA_def_property_enum_items(prop, length_mode);
490 RNA_def_property_ui_text(prop, "Length Mode", "");
493 prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
494 RNA_def_property_struct_type(prop, "CurveMapping");
495 RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL);
496 RNA_def_property_ui_text(prop, "Curve", "");
499 void RNA_def_sculpt_paint(BlenderRNA *brna)
502 rna_def_sculpt(brna);
503 rna_def_vertex_paint(brna);
504 rna_def_image_paint(brna);
505 rna_def_particle_edit(brna);