137
136
SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
140
static int rna_SculptCapabilities_has_normal_weight_get(PointerRNA *ptr)
139
static int rna_SculptToolCapabilities_has_normal_weight_get(PointerRNA *ptr)
142
141
Brush *br = (Brush *)ptr->data;
143
142
return ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
146
static int rna_SculptCapabilities_has_overlay_get(PointerRNA *ptr)
145
static int rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
148
147
Brush *br = (Brush *)ptr->data;
149
return ELEM(br->mtex.brush_map_mode,
148
return ELEM3(br->mtex.brush_map_mode,
150
149
MTEX_MAP_MODE_VIEW,
151
MTEX_MAP_MODE_TILED);
151
MTEX_MAP_MODE_STENCIL);
154
static int rna_SculptCapabilities_has_persistence_get(PointerRNA *ptr)
154
static int rna_SculptToolCapabilities_has_persistence_get(PointerRNA *ptr)
156
156
Brush *br = (Brush *)ptr->data;
157
157
return br->sculpt_tool == SCULPT_TOOL_LAYER;
160
static int rna_SculptCapabilities_has_pinch_factor_get(PointerRNA *ptr)
160
static int rna_SculptToolCapabilities_has_pinch_factor_get(PointerRNA *ptr)
162
162
Brush *br = (Brush *)ptr->data;
163
163
return ELEM(br->sculpt_tool, SCULPT_TOOL_BLOB, SCULPT_TOOL_CREASE);
166
static int rna_SculptCapabilities_has_plane_offset_get(PointerRNA *ptr)
166
static int rna_SculptToolCapabilities_has_plane_offset_get(PointerRNA *ptr)
168
168
Brush *br = (Brush *)ptr->data;
169
169
return ELEM5(br->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS,
170
170
SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_SCRAPE);
173
static int rna_SculptCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
173
static int rna_SculptToolCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
175
175
Brush *br = (Brush *)ptr->data;
176
return (ELEM(br->mtex.brush_map_mode,
178
MTEX_MAP_MODE_AREA) &&
179
!(br->flag & BRUSH_ANCHORED) &&
180
!ELEM4(br->sculpt_tool,
176
return (!ELEM4(br->sculpt_tool,
181
177
SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
182
178
SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
185
static int rna_SculptCapabilities_has_sculpt_plane_get(PointerRNA *ptr)
181
static int rna_BrushCapabilities_has_random_texture_angle_get(PointerRNA *ptr)
183
Brush *br = (Brush *)ptr->data;
184
return (ELEM3(br->mtex.brush_map_mode,
187
MTEX_MAP_MODE_RANDOM) &&
188
!(br->flag & BRUSH_ANCHORED));
191
static int rna_SculptToolCapabilities_has_sculpt_plane_get(PointerRNA *ptr)
187
193
Brush *br = (Brush *)ptr->data;
188
194
return !ELEM4(br->sculpt_tool, SCULPT_TOOL_INFLATE,
218
224
SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK));
221
static int rna_SculptCapabilities_has_spacing_get(PointerRNA *ptr)
227
static int rna_BrushCapabilities_has_spacing_get(PointerRNA *ptr)
223
229
Brush *br = (Brush *)ptr->data;
224
return (!(br->flag & BRUSH_ANCHORED) &&
225
!ELEM4(br->sculpt_tool,
226
SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE,
227
SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB));
230
return (!(br->flag & BRUSH_ANCHORED));
230
static int rna_SculptCapabilities_has_strength_get(PointerRNA *ptr)
233
static int rna_SculptToolCapabilities_has_strength_get(PointerRNA *ptr)
232
235
Brush *br = (Brush *)ptr->data;
233
236
return !ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK);
236
static int rna_SculptCapabilities_has_texture_angle_get(PointerRNA *ptr)
239
static int rna_BrushCapabilities_has_texture_angle_get(PointerRNA *ptr)
238
241
Brush *br = (Brush *)ptr->data;
239
return ELEM3(br->mtex.brush_map_mode,
242
return ELEM5(br->mtex.brush_map_mode,
240
243
MTEX_MAP_MODE_VIEW,
241
244
MTEX_MAP_MODE_AREA,
242
MTEX_MAP_MODE_TILED);
246
MTEX_MAP_MODE_STENCIL,
247
MTEX_MAP_MODE_RANDOM);
245
static int rna_SculptCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
250
static int rna_BrushCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
247
252
Brush *br = (Brush *)ptr->data;
248
return ELEM(br->mtex.brush_map_mode,
253
return ELEM3(br->mtex.brush_map_mode,
249
254
MTEX_MAP_MODE_VIEW,
253
static PointerRNA rna_Brush_sculpt_capabilities_get(PointerRNA *ptr)
255
return rna_pointer_inherit_refine(ptr, &RNA_SculptCapabilities, ptr->id.data);
256
MTEX_MAP_MODE_RANDOM);
259
static PointerRNA rna_Sculpt_sculpt_tool_capabilities_get(PointerRNA *ptr)
261
return rna_pointer_inherit_refine(ptr, &RNA_SculptToolCapabilities, ptr->id.data);
264
static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr)
266
return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->id.data);
258
269
static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
277
288
/*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
291
static void rna_Brush_main_tex_update(Main *bmain, Scene *scene, PointerRNA *ptr)
293
Brush *br = (Brush *)ptr->data;
294
BKE_paint_invalidate_overlay_tex(scene, br->mtex.tex);
295
rna_Brush_update(bmain, scene, ptr);
298
static void rna_Brush_secondary_tex_update(Main *bmain, Scene *scene, PointerRNA *ptr)
300
Brush *br = (Brush *)ptr->data;
301
BKE_paint_invalidate_overlay_tex(scene, br->mask_mtex.tex);
302
rna_Brush_update(bmain, scene, ptr);
305
static void rna_Brush_size_update(Main *bmain, Scene *scene, PointerRNA *ptr)
307
BKE_paint_invalidate_overlay_all();
308
rna_Brush_update(bmain, scene, ptr);
280
311
static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
282
313
Brush *br = (Brush *)ptr->data;
314
BKE_paint_invalidate_overlay_all();
283
315
rna_Brush_reset_icon(br, "sculpt");
284
316
rna_Brush_update(bmain, scene, ptr);
426
470
{MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
427
471
{MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
428
472
{MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
473
{MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
474
{MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
429
475
{0, NULL, 0, NULL, NULL}
433
479
{MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
434
480
{MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
435
481
{MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
482
{MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
483
{MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
484
{0, NULL, 0, NULL, NULL}
487
static EnumPropertyItem prop_mask_paint_map_mode_items[] = {
488
{MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
489
{MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
490
{MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
491
{MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
436
492
{0, NULL, 0, NULL, NULL}
444
500
RNA_def_property_float_sdna(prop, NULL, "rot");
445
501
RNA_def_property_range(prop, 0, M_PI * 2);
446
502
RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
447
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
503
RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_angle_update");
449
505
prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
450
506
RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
451
507
RNA_def_property_enum_items(prop, prop_map_mode_items);
452
508
RNA_def_property_ui_text(prop, "Mode", "");
453
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
509
RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update");
455
511
prop = RNA_def_property(srna, "tex_paint_map_mode", PROP_ENUM, PROP_NONE);
456
512
RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
457
513
RNA_def_property_enum_items(prop, prop_tex_paint_map_mode_items);
458
514
RNA_def_property_ui_text(prop, "Mode", "");
459
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
515
RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update");
517
prop = RNA_def_property(srna, "mask_map_mode", PROP_ENUM, PROP_NONE);
518
RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
519
RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items);
520
RNA_def_property_ui_text(prop, "Mode", "");
521
RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update");
462
524
static void rna_def_sculpt_capabilities(BlenderRNA *brna)
465
527
PropertyRNA *prop;
467
srna = RNA_def_struct(brna, "SculptCapabilities", NULL);
529
srna = RNA_def_struct(brna, "SculptToolCapabilities", NULL);
468
530
RNA_def_struct_sdna(srna, "Brush");
469
531
RNA_def_struct_nested(brna, srna, "Brush");
470
532
RNA_def_struct_ui_text(srna, "Sculpt Capabilities",
471
533
"Read-only indications of which brush operations "
472
534
"are supported by the current sculpt tool");
536
#define SCULPT_TOOL_CAPABILITY(prop_name_, ui_name_) \
537
prop = RNA_def_property(srna, #prop_name_, \
538
PROP_BOOLEAN, PROP_NONE); \
539
RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
540
RNA_def_property_boolean_funcs(prop, "rna_SculptToolCapabilities_" \
541
#prop_name_ "_get", NULL); \
542
RNA_def_property_ui_text(prop, ui_name_, NULL)
544
SCULPT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate");
545
SCULPT_TOOL_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
546
SCULPT_TOOL_CAPABILITY(has_height, "Has Height");
547
SCULPT_TOOL_CAPABILITY(has_jitter, "Has Jitter");
548
SCULPT_TOOL_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
549
SCULPT_TOOL_CAPABILITY(has_persistence, "Has Persistence");
550
SCULPT_TOOL_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
551
SCULPT_TOOL_CAPABILITY(has_plane_offset, "Has Plane Offset");
552
SCULPT_TOOL_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
553
SCULPT_TOOL_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
554
SCULPT_TOOL_CAPABILITY(has_secondary_color, "Has Secondary Color");
555
SCULPT_TOOL_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
556
SCULPT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
557
SCULPT_TOOL_CAPABILITY(has_strength, "Has Strength");
559
#undef SCULPT_CAPABILITY
562
static void rna_def_brush_capabilities(BlenderRNA *brna)
567
srna = RNA_def_struct(brna, "BrushCapabilities", NULL);
568
RNA_def_struct_sdna(srna, "Brush");
569
RNA_def_struct_nested(brna, srna, "Brush");
570
RNA_def_struct_ui_text(srna, "Brush Capabilities",
571
"Read-only indications of which brush operations "
572
"are supported by the current brush");
474
574
#define BRUSH_CAPABILITY(prop_name_, ui_name_) \
475
575
prop = RNA_def_property(srna, #prop_name_, \
476
576
PROP_BOOLEAN, PROP_NONE); \
477
577
RNA_def_property_clear_flag(prop, PROP_EDITABLE); \
478
RNA_def_property_boolean_funcs(prop, "rna_SculptCapabilities_" \
578
RNA_def_property_boolean_funcs(prop, "rna_BrushCapabilities_" \
479
579
#prop_name_ "_get", NULL); \
480
580
RNA_def_property_ui_text(prop, ui_name_, NULL)
482
BRUSH_CAPABILITY(has_accumulate, "Has Accumulate");
483
BRUSH_CAPABILITY(has_auto_smooth, "Has Auto Smooth");
484
BRUSH_CAPABILITY(has_height, "Has Height");
485
BRUSH_CAPABILITY(has_jitter, "Has Jitter");
486
BRUSH_CAPABILITY(has_normal_weight, "Has Crease/Pinch Factor");
487
582
BRUSH_CAPABILITY(has_overlay, "Has Overlay");
488
BRUSH_CAPABILITY(has_persistence, "Has Persistence");
489
BRUSH_CAPABILITY(has_pinch_factor, "Has Pinch Factor");
490
BRUSH_CAPABILITY(has_plane_offset, "Has Plane Offset");
491
583
BRUSH_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle");
492
BRUSH_CAPABILITY(has_sculpt_plane, "Has Sculpt Plane");
493
BRUSH_CAPABILITY(has_secondary_color, "Has Secondary Color");
494
BRUSH_CAPABILITY(has_smooth_stroke, "Has Smooth Stroke");
495
BRUSH_CAPABILITY(has_space_attenuation, "Has Space Attenuation");
496
BRUSH_CAPABILITY(has_spacing, "Has Spacing");
497
BRUSH_CAPABILITY(has_strength, "Has Strength");
498
584
BRUSH_CAPABILITY(has_texture_angle, "Has Texture Angle");
499
585
BRUSH_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source");
586
BRUSH_CAPABILITY(has_spacing, "Has Spacing");
501
#undef SCULPT_CAPABILITY
588
#undef BRUSH_CAPABILITY
504
591
static void rna_def_brush(BlenderRNA *brna)
527
614
{0, NULL, 0, NULL, NULL}
617
static EnumPropertyItem brush_stroke_method_items[] = {
618
{0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"},
619
{BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"},
620
{BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"},
621
{0, NULL, 0, NULL, NULL}
530
624
static EnumPropertyItem texture_angle_source_items[] = {
531
625
{0, "USER", 0, "User", "Rotate the brush texture by given angle"},
532
626
{BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"},
595
689
RNA_def_property_ui_text(prop, "Stroke Method", "");
596
690
RNA_def_property_update(prop, 0, "rna_Brush_update");
692
prop = RNA_def_property(srna, "sculpt_stroke_method", PROP_ENUM, PROP_NONE);
693
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
694
RNA_def_property_enum_items(prop, sculpt_stroke_method_items);
695
RNA_def_property_ui_text(prop, "Stroke Method", "");
696
RNA_def_property_update(prop, 0, "rna_Brush_update");
598
698
prop = RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
599
699
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
600
700
RNA_def_property_enum_items(prop, texture_angle_source_items);
621
721
prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
622
722
RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
623
723
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10);
624
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
724
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, -1);
625
725
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
626
RNA_def_property_update(prop, 0, "rna_Brush_update");
726
RNA_def_property_update(prop, 0, "rna_Brush_size_update");
628
728
prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
629
729
RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
630
730
RNA_def_property_range(prop, 0.001, FLT_MAX);
631
RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
731
RNA_def_property_ui_range(prop, 0.001, 1, 0, -1);
632
732
RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
633
RNA_def_property_update(prop, 0, "rna_Brush_update");
733
RNA_def_property_update(prop, 0, "rna_Brush_size_update");
635
735
prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
636
736
RNA_def_property_float_sdna(prop, NULL, "jitter");
637
RNA_def_property_range(prop, 0.0f, 1.0f);
737
RNA_def_property_range(prop, 0.0f, 1000.0f);
738
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.1, 4);
638
739
RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
639
740
RNA_def_property_update(prop, 0, "rna_Brush_update");
742
prop = RNA_def_property(srna, "jitter_absolute", PROP_INT, PROP_NONE);
743
RNA_def_property_int_sdna(prop, NULL, "jitter_absolute");
744
RNA_def_property_range(prop, 0, 1000000);
745
RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush in pixels while painting");
746
RNA_def_property_update(prop, 0, "rna_Brush_update");
641
748
prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
642
749
RNA_def_property_int_sdna(prop, NULL, "spacing");
643
750
RNA_def_property_range(prop, 1, 1000);
644
RNA_def_property_ui_range(prop, 1, 500, 5, 0);
751
RNA_def_property_ui_range(prop, 1, 500, 5, -1);
645
752
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
646
753
RNA_def_property_update(prop, 0, "rna_Brush_update");
736
843
RNA_def_property_ui_text(prop, "Autosmooth", "Amount of smoothing to automatically apply to each stroke");
737
844
RNA_def_property_update(prop, 0, "rna_Brush_update");
846
prop = RNA_def_property(srna, "stencil_pos", PROP_FLOAT, PROP_XYZ);
847
RNA_def_property_float_sdna(prop, NULL, "stencil_pos");
848
RNA_def_property_array(prop, 2);
849
RNA_def_property_ui_text(prop, "Stencil Position", "Position of stencil in viewport");
850
RNA_def_property_update(prop, 0, "rna_Brush_update");
852
prop = RNA_def_property(srna, "stencil_dimension", PROP_FLOAT, PROP_XYZ);
853
RNA_def_property_float_sdna(prop, NULL, "stencil_dimension");
854
RNA_def_property_array(prop, 2);
855
RNA_def_property_ui_text(prop, "Stencil Dimensions", "Dimensions of stencil in viewport");
856
RNA_def_property_update(prop, 0, "rna_Brush_update");
858
prop = RNA_def_property(srna, "mask_stencil_pos", PROP_FLOAT, PROP_XYZ);
859
RNA_def_property_float_sdna(prop, NULL, "mask_stencil_pos");
860
RNA_def_property_array(prop, 2);
861
RNA_def_property_ui_text(prop, "Mask Stencil Position", "Position of mask stencil in viewport");
862
RNA_def_property_update(prop, 0, "rna_Brush_update");
864
prop = RNA_def_property(srna, "mask_stencil_dimension", PROP_FLOAT, PROP_XYZ);
865
RNA_def_property_float_sdna(prop, NULL, "mask_stencil_dimension");
866
RNA_def_property_array(prop, 2);
867
RNA_def_property_ui_text(prop, "Mask Stencil Dimensions", "Dimensions of mask stencil in viewport");
868
RNA_def_property_update(prop, 0, "rna_Brush_update");
740
871
prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
741
872
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
794
925
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction");
795
926
RNA_def_property_update(prop, 0, "rna_Brush_update");
928
prop = RNA_def_property(srna, "use_relative_jitter", PROP_BOOLEAN, PROP_NONE);
929
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER);
930
RNA_def_property_ui_text(prop, "Absolute Jitter", "Jittering happens in screen space, not relative to brush size");
931
RNA_def_property_update(prop, 0, "rna_Brush_update");
797
933
prop = RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE);
798
934
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION);
799
935
RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random");
854
990
"given in pixels");
855
991
RNA_def_property_update(prop, 0, "rna_Brush_update");
857
prop = RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE);
858
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY);
859
RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
860
RNA_def_property_update(prop, 0, "rna_Brush_update");
862
993
prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
863
994
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE);
864
995
RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge");
880
1011
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
881
1012
RNA_def_property_update(prop, 0, "rna_Brush_update");
1015
prop = RNA_def_property(srna, "use_primary_overlay", PROP_BOOLEAN, PROP_NONE);
1016
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY);
1017
RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
1018
RNA_def_property_update(prop, 0, "rna_Brush_update");
1020
prop = RNA_def_property(srna, "use_secondary_overlay", PROP_BOOLEAN, PROP_NONE);
1021
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY);
1022
RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
1023
RNA_def_property_update(prop, 0, "rna_Brush_update");
1025
prop = RNA_def_property(srna, "use_cursor_overlay", PROP_BOOLEAN, PROP_NONE);
1026
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR);
1027
RNA_def_property_ui_text(prop, "Use Cursor Overlay", "Show cursor in viewport");
1028
RNA_def_property_update(prop, 0, "rna_Brush_update");
1030
prop = RNA_def_property(srna, "use_cursor_overlay_override", PROP_BOOLEAN, PROP_NONE);
1031
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE);
1032
RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
1033
RNA_def_property_update(prop, 0, "rna_Brush_update");
1035
prop = RNA_def_property(srna, "use_primary_overlay_override", PROP_BOOLEAN, PROP_NONE);
1036
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE);
1037
RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
1038
RNA_def_property_update(prop, 0, "rna_Brush_update");
1040
prop = RNA_def_property(srna, "use_secondary_overlay_override", PROP_BOOLEAN, PROP_NONE);
1041
RNA_def_property_boolean_sdna(prop, NULL, "overlay_flags", BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE);
1042
RNA_def_property_ui_text(prop, "Override Overlay", "Don't show overlay during a stroke");
1043
RNA_def_property_update(prop, 0, "rna_Brush_update");
883
1045
/* paint mode flags */
884
1046
prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
885
1047
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT);
908
1070
RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
909
1071
RNA_def_property_flag(prop, PROP_EDITABLE);
910
1072
RNA_def_property_ui_text(prop, "Texture", "");
911
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
1073
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_main_tex_update");
1075
prop = RNA_def_property(srna, "mask_texture_slot", PROP_POINTER, PROP_NONE);
1076
RNA_def_property_struct_type(prop, "BrushTextureSlot");
1077
RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex");
1078
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
1079
RNA_def_property_ui_text(prop, "Mask Texture Slot", "");
1081
prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
1082
RNA_def_property_pointer_sdna(prop, NULL, "mask_mtex.tex");
1083
RNA_def_property_flag(prop, PROP_EDITABLE);
1084
RNA_def_property_ui_text(prop, "Mask Texture", "");
1085
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_secondary_tex_update");
913
1087
prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
914
1088
RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
916
1090
RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
917
1091
RNA_def_property_update(prop, 0, "rna_Brush_update");
1093
prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
1094
RNA_def_property_int_sdna(prop, NULL, "mask_overlay_alpha");
1095
RNA_def_property_range(prop, 1, 100);
1096
RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
1097
RNA_def_property_update(prop, 0, "rna_Brush_update");
1099
prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
1100
RNA_def_property_int_sdna(prop, NULL, "cursor_overlay_alpha");
1101
RNA_def_property_range(prop, 1, 100);
1102
RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
1103
RNA_def_property_update(prop, 0, "rna_Brush_update");
919
1105
prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
920
1106
RNA_def_property_float_sdna(prop, NULL, "add_col");
921
1107
RNA_def_property_array(prop, 3);
957
1143
RNA_def_property_ui_range(prop, -1.0f, 1.0f, 10.0f, 3);
958
1144
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update");
1146
prop = RNA_def_property(srna, "brush_capabilities", PROP_POINTER, PROP_NONE);
1147
RNA_def_property_flag(prop, PROP_NEVER_NULL);
1148
RNA_def_property_struct_type(prop, "BrushCapabilities");
1149
RNA_def_property_pointer_funcs(prop, "rna_Brush_capabilities_get", NULL, NULL, NULL);
1150
RNA_def_property_ui_text(prop, "Brush Capabilities", "Brush's capabilities");
960
1152
/* brush capabilities (mode-dependent) */
961
1153
prop = RNA_def_property(srna, "sculpt_capabilities", PROP_POINTER, PROP_NONE);
962
1154
RNA_def_property_flag(prop, PROP_NEVER_NULL);
963
RNA_def_property_struct_type(prop, "SculptCapabilities");
964
RNA_def_property_pointer_funcs(prop, "rna_Brush_sculpt_capabilities_get", NULL, NULL, NULL);
1155
RNA_def_property_struct_type(prop, "SculptToolCapabilities");
1156
RNA_def_property_pointer_funcs(prop, "rna_Sculpt_sculpt_tool_capabilities_get", NULL, NULL, NULL);
965
1157
RNA_def_property_ui_text(prop, "Sculpt Capabilities", "Brush's capabilities in sculpt mode");