Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * Contributor(s): Blender Foundation (2008), Juho Veps�l�inen 00019 * 00020 * ***** END GPL LICENSE BLOCK ***** 00021 */ 00022 00028 #include <stdlib.h> 00029 #include <assert.h> 00030 00031 #include "RNA_define.h" 00032 00033 #include "rna_internal.h" 00034 00035 #include "DNA_brush_types.h" 00036 #include "DNA_texture_types.h" 00037 #include "DNA_scene_types.h" 00038 #include "DNA_object_types.h" 00039 00040 #include "BLI_math.h" 00041 00042 #include "IMB_imbuf.h" 00043 00044 #include "WM_types.h" 00045 00046 static EnumPropertyItem prop_direction_items[]= { 00047 {0, "ADD", 0, "Add", "Add effect of brush"}, 00048 {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, 00049 {0, NULL, 0, NULL, NULL}}; 00050 00051 EnumPropertyItem brush_sculpt_tool_items[] = { 00052 {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""}, 00053 {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, 00054 {SCULPT_TOOL_CREASE, "CREASE",ICON_BRUSH_CREASE, "Crease", ""}, 00055 {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""}, 00056 {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""}, 00057 {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""}, 00058 {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""}, 00059 {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""}, 00060 {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""}, 00061 {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""}, 00062 {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""}, 00063 {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""}, 00064 {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""}, 00065 {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""}, 00066 {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""}, 00067 {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""}, 00068 {0, NULL, 0, NULL, NULL}}; 00069 00070 00071 EnumPropertyItem brush_vertex_tool_items[] = { 00072 {PAINT_BLEND_MIX, "MIX", ICON_BRUSH_MIX, "Mix", "Use mix blending mode while painting"}, 00073 {PAINT_BLEND_ADD, "ADD", ICON_BRUSH_ADD, "Add", "Use add blending mode while painting"}, 00074 {PAINT_BLEND_SUB, "SUB", ICON_BRUSH_SUBTRACT, "Subtract", "Use subtract blending mode while painting"}, 00075 {PAINT_BLEND_MUL, "MUL", ICON_BRUSH_MULTIPLY, "Multiply", "Use multiply blending mode while painting"}, 00076 {PAINT_BLEND_BLUR, "BLUR", ICON_BRUSH_BLUR, "Blur", "Blur the color with surrounding values"}, 00077 {PAINT_BLEND_LIGHTEN, "LIGHTEN", ICON_BRUSH_LIGHTEN, "Lighten", "Use lighten blending mode while painting"}, 00078 {PAINT_BLEND_DARKEN, "DARKEN", ICON_BRUSH_DARKEN, "Darken", "Use darken blending mode while painting"}, 00079 {0, NULL, 0, NULL, NULL}}; 00080 00081 EnumPropertyItem brush_image_tool_items[] = { 00082 {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""}, 00083 {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""}, 00084 {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""}, 00085 {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""}, 00086 {0, NULL, 0, NULL, NULL}}; 00087 00088 #ifdef RNA_RUNTIME 00089 00090 #include "MEM_guardedalloc.h" 00091 00092 #include "DNA_object_types.h" 00093 00094 #include "RNA_access.h" 00095 00096 #include "BKE_texture.h" 00097 #include "BKE_brush.h" 00098 #include "BKE_icons.h" 00099 #include "BKE_paint.h" 00100 00101 #include "WM_api.h" 00102 00103 static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type)) 00104 { 00105 ID *id = &br->id; 00106 00107 if(br->flag & BRUSH_CUSTOM_ICON) 00108 return; 00109 00110 if(id->icon_id >= BIFICONID_LAST) { 00111 BKE_icon_delete(id); 00112 BKE_previewimg_free_id(id); 00113 } 00114 00115 id->icon_id = 0; 00116 } 00117 00118 static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) 00119 { 00120 Brush *br= (Brush*)ptr->data; 00121 WM_main_add_notifier(NC_BRUSH|NA_EDITED, br); 00122 //WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); 00123 } 00124 00125 static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00126 { 00127 Brush *br= (Brush*)ptr->data; 00128 rna_Brush_reset_icon(br, "sculpt"); 00129 rna_Brush_update(bmain, scene, ptr); 00130 } 00131 00132 static void rna_Brush_vertex_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00133 { 00134 Brush *br= (Brush*)ptr->data; 00135 rna_Brush_reset_icon(br, "vertex_paint"); 00136 rna_Brush_update(bmain, scene, ptr); 00137 } 00138 00139 static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00140 { 00141 Brush *br= (Brush*)ptr->data; 00142 rna_Brush_reset_icon(br, "image_paint"); 00143 rna_Brush_update(bmain, scene, ptr); 00144 } 00145 00146 static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) 00147 { 00148 Brush *br= (Brush*)ptr->data; 00149 00150 if(br->icon_imbuf) { 00151 IMB_freeImBuf(br->icon_imbuf); 00152 br->icon_imbuf= NULL; 00153 } 00154 00155 br->id.icon_id = 0; 00156 00157 if(br->flag & BRUSH_CUSTOM_ICON) { 00158 BKE_previewimg_get(&br->id); 00159 BKE_icon_changed(BKE_icon_getid(&br->id)); 00160 } 00161 00162 WM_main_add_notifier(NC_BRUSH|NA_EDITED, br); 00163 } 00164 00165 static void rna_Brush_set_size(PointerRNA *ptr, int value) 00166 { 00167 Brush* brush = ptr->data; 00168 00169 /* scale unprojected radius so it stays consistent with brush size */ 00170 brush_scale_unprojected_radius(&brush->unprojected_radius, 00171 value, brush->size); 00172 brush->size= value; 00173 } 00174 00175 static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) 00176 { 00177 Brush* brush = ptr->data; 00178 00179 /* scale brush size so it stays consistent with unprojected_radius */ 00180 brush_scale_size(&brush->size, value, brush->unprojected_radius); 00181 brush->unprojected_radius= value; 00182 } 00183 00184 static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) 00185 { 00186 static EnumPropertyItem prop_default_items[]= { 00187 {0, NULL, 0, NULL, NULL}}; 00188 00189 static EnumPropertyItem prop_flatten_contrast_items[]= { 00190 {0, "FLATTEN", 0, "Flatten", "Add effect of brush"}, 00191 {BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"}, 00192 {0, NULL, 0, NULL, NULL}}; 00193 00194 static EnumPropertyItem prop_fill_deepen_items[]= { 00195 {0, "FILL", 0, "Fill", "Add effect of brush"}, 00196 {BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"}, 00197 {0, NULL, 0, NULL, NULL}}; 00198 00199 static EnumPropertyItem prop_scrape_peaks_items[]= { 00200 {0, "SCRAPE", 0, "Scrape", "Add effect of brush"}, 00201 {BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"}, 00202 {0, NULL, 0, NULL, NULL}}; 00203 00204 static EnumPropertyItem prop_pinch_magnify_items[]= { 00205 {0, "PINCH", 0, "Pinch", "Add effect of brush"}, 00206 {BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"}, 00207 {0, NULL, 0, NULL, NULL}}; 00208 00209 static EnumPropertyItem prop_inflate_deflate_items[]= { 00210 {0, "INFLATE", 0, "Inflate", "Add effect of brush"}, 00211 {BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"}, 00212 {0, NULL, 0, NULL, NULL}}; 00213 00214 Brush *me= (Brush*)(ptr->data); 00215 00216 switch (me->sculpt_tool) { 00217 case SCULPT_TOOL_DRAW: 00218 case SCULPT_TOOL_CREASE: 00219 case SCULPT_TOOL_BLOB: 00220 case SCULPT_TOOL_LAYER: 00221 case SCULPT_TOOL_CLAY: 00222 return prop_direction_items; 00223 00224 case SCULPT_TOOL_FLATTEN: 00225 return prop_flatten_contrast_items; 00226 00227 case SCULPT_TOOL_FILL: 00228 return prop_fill_deepen_items; 00229 00230 case SCULPT_TOOL_SCRAPE: 00231 return prop_scrape_peaks_items; 00232 00233 case SCULPT_TOOL_PINCH: 00234 return prop_pinch_magnify_items; 00235 00236 case SCULPT_TOOL_INFLATE: 00237 return prop_inflate_deflate_items; 00238 00239 default: 00240 return prop_default_items; 00241 } 00242 } 00243 00244 #else 00245 00246 static void rna_def_brush_texture_slot(BlenderRNA *brna) 00247 { 00248 StructRNA *srna; 00249 PropertyRNA *prop; 00250 00251 static EnumPropertyItem prop_map_mode_items[] = { 00252 {MTEX_MAP_MODE_FIXED, "FIXED", 0, "Fixed", ""}, 00253 {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, 00254 {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, 00255 {0, NULL, 0, NULL, NULL}}; 00256 00257 srna= RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot"); 00258 RNA_def_struct_sdna(srna, "MTex"); 00259 RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock"); 00260 00261 prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); 00262 RNA_def_property_float_sdna(prop, NULL, "rot"); 00263 RNA_def_property_range(prop, 0, M_PI*2); 00264 RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation"); 00265 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00266 00267 prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE); 00268 RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode"); 00269 RNA_def_property_enum_items(prop, prop_map_mode_items); 00270 RNA_def_property_ui_text(prop, "Mode", ""); 00271 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00272 } 00273 00274 static void rna_def_brush(BlenderRNA *brna) 00275 { 00276 StructRNA *srna; 00277 PropertyRNA *prop; 00278 00279 static EnumPropertyItem prop_blend_items[] = { 00280 {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting"}, 00281 {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting"}, 00282 {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting"}, 00283 {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting"}, 00284 {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting"}, 00285 {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting"}, 00286 {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting"}, 00287 {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting"}, 00288 {0, NULL, 0, NULL, NULL}}; 00289 00290 static EnumPropertyItem brush_stroke_method_items[] = { 00291 {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"}, 00292 {BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"}, 00293 {BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"}, 00294 {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"}, 00295 {BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"}, 00296 {0, NULL, 0, NULL, NULL}}; 00297 00298 static EnumPropertyItem texture_angle_source_items[] = { 00299 {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, 00300 {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, 00301 {BRUSH_RANDOM_ROTATION, "RANDOM", 0, "Random", "Rotate the brush texture at random"}, 00302 {0, NULL, 0, NULL, NULL}}; 00303 00304 static EnumPropertyItem texture_angle_source_no_random_items[] = { 00305 {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, 00306 {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, 00307 {0, NULL, 0, NULL, NULL}}; 00308 00309 static EnumPropertyItem brush_sculpt_plane_items[] = { 00310 {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""}, 00311 {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""}, 00312 {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""}, 00313 {SCULPT_DISP_DIR_Y, "Y", 0, "Y Plane", ""}, 00314 {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""}, 00315 {0, NULL, 0, NULL, NULL}}; 00316 00317 srna= RNA_def_struct(brna, "Brush", "ID"); 00318 RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting"); 00319 RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA); 00320 00321 /* enums */ 00322 prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE); 00323 RNA_def_property_enum_items(prop, prop_blend_items); 00324 RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode"); 00325 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00326 00327 prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE); 00328 RNA_def_property_enum_items(prop, brush_sculpt_tool_items); 00329 RNA_def_property_ui_text(prop, "Sculpt Tool", ""); 00330 RNA_def_property_update(prop, 0, "rna_Brush_sculpt_tool_update"); 00331 00332 prop= RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE); 00333 RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool"); 00334 RNA_def_property_enum_items(prop, brush_vertex_tool_items); 00335 RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", ""); 00336 RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update"); 00337 00338 prop= RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE); 00339 RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool"); 00340 RNA_def_property_enum_items(prop, brush_image_tool_items); 00341 RNA_def_property_ui_text(prop, "Image Paint Tool", ""); 00342 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_imagepaint_tool_update"); 00343 00344 prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); 00345 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); 00346 RNA_def_property_enum_items(prop, prop_direction_items); 00347 RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf"); 00348 RNA_def_property_ui_text(prop, "Direction", ""); 00349 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00350 00351 prop= RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE); 00352 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); 00353 RNA_def_property_enum_items(prop, brush_stroke_method_items); 00354 RNA_def_property_ui_text(prop, "Stroke Method", ""); 00355 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00356 00357 prop= RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE); 00358 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); 00359 RNA_def_property_enum_items(prop, texture_angle_source_items); 00360 RNA_def_property_ui_text(prop, "Texture Angle Source", ""); 00361 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00362 00363 prop= RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE); 00364 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); 00365 RNA_def_property_enum_items(prop, texture_angle_source_no_random_items); 00366 RNA_def_property_ui_text(prop, "Texture Angle Source", ""); 00367 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00368 00369 prop= RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE); 00370 RNA_def_property_enum_items(prop, brush_sculpt_plane_items); 00371 RNA_def_property_ui_text(prop, "Sculpt Plane", ""); 00372 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00373 00374 /* number values */ 00375 prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); 00376 RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); 00377 RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10); 00378 RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0); 00379 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); 00380 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00381 00382 prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE); 00383 RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL); 00384 RNA_def_property_range(prop, 0.001, FLT_MAX); 00385 RNA_def_property_ui_range(prop, 0.001, 1, 0, 0); 00386 RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units"); 00387 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00388 00389 prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE); 00390 RNA_def_property_float_sdna(prop, NULL, "jitter"); 00391 RNA_def_property_range(prop, 0.0f, 1.0f); 00392 RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting"); 00393 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00394 00395 prop= RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE); 00396 RNA_def_property_int_sdna(prop, NULL, "spacing"); 00397 RNA_def_property_range(prop, 1, 1000); 00398 RNA_def_property_ui_range(prop, 1, 500, 5, 0); 00399 RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter"); 00400 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00401 00402 prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE); 00403 RNA_def_property_range(prop, 10, 200); 00404 RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues"); 00405 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00406 00407 prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR); 00408 RNA_def_property_range(prop, 0.5, 0.99); 00409 RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke"); 00410 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00411 00412 prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE); 00413 RNA_def_property_float_sdna(prop, NULL, "rate"); 00414 RNA_def_property_range(prop, 0.0001f , 10000.0f); 00415 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3); 00416 RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush"); 00417 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00418 00419 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); 00420 RNA_def_property_range(prop, 0.0, 1.0); 00421 RNA_def_property_float_sdna(prop, NULL, "rgb"); 00422 RNA_def_property_ui_text(prop, "Color", ""); 00423 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00424 00425 prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); 00426 RNA_def_property_float_sdna(prop, NULL, "alpha"); 00427 RNA_def_property_float_default(prop, 0.5f); 00428 RNA_def_property_range(prop, 0.0f, 10.0f); 00429 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001); 00430 RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied"); 00431 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00432 00433 prop= RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE); 00434 RNA_def_property_float_sdna(prop, NULL, "plane_offset"); 00435 RNA_def_property_float_default(prop, 0); 00436 RNA_def_property_range(prop, -2.0f, 2.0f); 00437 RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 0.001); 00438 RNA_def_property_ui_text(prop, "Plane Offset", "Adjust plane on which the brush acts towards or away from the object surface"); 00439 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00440 00441 prop= RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE); 00442 RNA_def_property_float_sdna(prop, NULL, "plane_trim"); 00443 RNA_def_property_float_default(prop, 0.5f); 00444 RNA_def_property_range(prop, 0, 1.0f); 00445 RNA_def_property_ui_text(prop, "Plane Trim", "If a vertex is further away from offset plane than this, then it is not affected"); 00446 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00447 00448 prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); 00449 RNA_def_property_float_sdna(prop, NULL, "height"); 00450 RNA_def_property_float_default(prop, 0.5f); 00451 RNA_def_property_range(prop, 0, 1.0f); 00452 RNA_def_property_ui_text(prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)"); 00453 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00454 00455 prop= RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE); 00456 RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias"); 00457 RNA_def_property_float_default(prop, 0); 00458 RNA_def_property_range(prop, -1, 1); 00459 RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples"); 00460 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00461 00462 prop= RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR); 00463 RNA_def_property_float_sdna(prop, NULL, "normal_weight"); 00464 RNA_def_property_float_default(prop, 0); 00465 RNA_def_property_range(prop, 0.0f, 1.0f); 00466 RNA_def_property_ui_text(prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab"); 00467 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00468 00469 prop= RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR); 00470 RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor"); 00471 RNA_def_property_float_default(prop, 2.0f/3.0f); 00472 RNA_def_property_range(prop, 0.0f, 1.0f); 00473 RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches"); 00474 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00475 00476 prop= RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR); 00477 RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor"); 00478 RNA_def_property_float_default(prop, 0); 00479 RNA_def_property_range(prop, 0.0f, 1.0f); 00480 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001); 00481 RNA_def_property_ui_text(prop, "Autosmooth", "Amount of smoothing to automatically apply to each stroke"); 00482 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00483 00484 /* flag */ 00485 prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); 00486 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); 00487 RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)"); 00488 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00489 00490 prop= RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE); 00491 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL); 00492 RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated"); 00493 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00494 00495 prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE); 00496 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS); 00497 RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting"); 00498 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00499 00500 prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); 00501 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); 00502 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00503 RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); 00504 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00505 00506 prop= RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE); 00507 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE); 00508 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00509 RNA_def_property_ui_text(prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset"); 00510 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00511 00512 prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE); 00513 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE); 00514 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00515 RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size"); 00516 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00517 00518 prop= RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE); 00519 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE); 00520 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00521 RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter"); 00522 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00523 00524 prop= RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE); 00525 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE); 00526 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00527 RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing"); 00528 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00529 00530 prop= RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE); 00531 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE); 00532 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); 00533 RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); 00534 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00535 00536 prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE); 00537 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE); 00538 RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction"); 00539 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00540 00541 prop= RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE); 00542 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION); 00543 RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random"); 00544 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00545 00546 prop= RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE); 00547 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM); 00548 RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); 00549 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00550 00551 prop= RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE); 00552 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE); 00553 RNA_def_property_ui_text(prop, "Use Front-Face", "Brush only affects vertexes that face the viewer"); 00554 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00555 00556 prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE); 00557 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED); 00558 RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location"); 00559 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00560 00561 prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE); 00562 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); 00563 RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing"); 00564 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00565 00566 prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE); 00567 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE); 00568 RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path"); 00569 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00570 00571 prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE); 00572 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT); 00573 RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh"); 00574 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00575 00576 prop= RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE); 00577 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE); 00578 RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other"); 00579 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00580 00581 prop= RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE); 00582 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN); 00583 RNA_def_property_ui_text(prop, "Use Automatic Strength Adjustment", "Automatically adjust strength to give consistent results for different spacings"); 00584 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00585 00586 /* adaptive space is not implemented yet */ 00587 prop= RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE); 00588 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE); 00589 RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space"); 00590 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00591 00592 prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); 00593 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE); 00594 RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels"); 00595 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00596 00597 prop= RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE); 00598 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY); 00599 RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport"); 00600 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00601 00602 prop= RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE); 00603 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE); 00604 RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge"); 00605 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00606 00607 prop= RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE); 00608 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH); 00609 RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned"); 00610 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00611 00612 prop= RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE); 00613 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX); 00614 RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position"); 00615 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00616 00617 /* only for projection paint, TODO, other paint modes */ 00618 prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); 00619 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA); 00620 RNA_def_property_ui_text(prop, "Alpha", "When this is disabled, lock alpha while painting"); 00621 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00622 00623 prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); 00624 RNA_def_property_flag(prop, PROP_NEVER_NULL); 00625 RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve"); 00626 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00627 00628 /* paint mode flags */ 00629 prop= RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE); 00630 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT); 00631 RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode"); 00632 00633 prop= RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE); 00634 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT); 00635 RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode"); 00636 00637 prop= RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE); 00638 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT); 00639 RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode"); 00640 00641 prop= RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE); 00642 RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT); 00643 RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); 00644 00645 /* texture */ 00646 prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE); 00647 RNA_def_property_struct_type(prop, "BrushTextureSlot"); 00648 RNA_def_property_pointer_sdna(prop, NULL, "mtex"); 00649 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00650 RNA_def_property_ui_text(prop, "Texture Slot", ""); 00651 00652 prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); 00653 RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex"); 00654 RNA_def_property_flag(prop, PROP_EDITABLE); 00655 RNA_def_property_ui_text(prop, "Texture", ""); 00656 RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update"); 00657 00658 prop= RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE); 00659 RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha"); 00660 RNA_def_property_range(prop, 1, 100); 00661 RNA_def_property_ui_text(prop, "Texture Overlay Alpha", ""); 00662 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00663 00664 prop= RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR); 00665 RNA_def_property_float_sdna(prop, NULL, "add_col"); 00666 RNA_def_property_array(prop, 3); 00667 RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding"); 00668 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00669 00670 prop= RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR); 00671 RNA_def_property_float_sdna(prop, NULL, "sub_col"); 00672 RNA_def_property_array(prop, 3); 00673 RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting"); 00674 RNA_def_property_update(prop, 0, "rna_Brush_update"); 00675 00676 prop= RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE); 00677 RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON); 00678 RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file"); 00679 RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); 00680 00681 prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH); 00682 RNA_def_property_string_sdna(prop, NULL, "icon_filepath"); 00683 RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon"); 00684 RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); 00685 00686 /* clone tool */ 00687 prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); 00688 RNA_def_property_pointer_sdna(prop, NULL, "clone.image"); 00689 RNA_def_property_flag(prop, PROP_EDITABLE); 00690 RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool"); 00691 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update"); 00692 00693 prop= RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE); 00694 RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); 00695 RNA_def_property_range(prop, 0.0f, 1.0f); 00696 RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display"); 00697 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update"); 00698 00699 prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ); 00700 RNA_def_property_float_sdna(prop, NULL, "clone.offset"); 00701 RNA_def_property_ui_text(prop, "Clone Offset", ""); 00702 RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3); 00703 RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update"); 00704 } 00705 00706 00707 /* A brush stroke is a list of changes to the brush that 00708 * can occur during a stroke 00709 * 00710 * o 3D location of the brush 00711 * o 2D mouse location 00712 * o Tablet pressure 00713 * o Direction flip 00714 * o Tool switch 00715 * o Time 00716 */ 00717 static void rna_def_operator_stroke_element(BlenderRNA *brna) 00718 { 00719 StructRNA *srna; 00720 PropertyRNA *prop; 00721 00722 srna= RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup"); 00723 RNA_def_struct_ui_text(srna, "Operator Stroke Element", ""); 00724 00725 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); 00726 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00727 RNA_def_property_array(prop, 3); 00728 RNA_def_property_ui_text(prop, "Location", ""); 00729 00730 prop= RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ); 00731 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00732 RNA_def_property_array(prop, 2); 00733 RNA_def_property_ui_text(prop, "Mouse", ""); 00734 00735 prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); 00736 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00737 RNA_def_property_range(prop, 0.0f, 1.0f); 00738 RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure"); 00739 00740 prop= RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE); 00741 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00742 RNA_def_property_ui_text(prop, "Flip", ""); 00743 00744 // used in uv painting 00745 prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); 00746 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00747 RNA_def_property_ui_text(prop, "Time", ""); 00748 00749 /* used for Grease Pencil sketching sessions */ 00750 prop= RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE); 00751 RNA_def_property_flag(prop, PROP_IDPROPERTY); 00752 RNA_def_property_ui_text(prop, "Is Stroke Start", ""); 00753 00754 /* XXX: Tool (this will be for pressing a modifier key for a different brush, 00755 e.g. switching to a Smooth brush in the middle of the stroke */ 00756 00757 // XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke 00758 } 00759 00760 void RNA_def_brush(BlenderRNA *brna) 00761 { 00762 rna_def_brush(brna); 00763 rna_def_brush_texture_slot(brna); 00764 rna_def_operator_stroke_element(brna); 00765 } 00766 00767 #endif