Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = { | ||||
| {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, | {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, | ||||
| {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""}, | {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""}, | ||||
| {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""}, | {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| /* clang-format off */ | /* clang-format off */ | ||||
| /* Note: we don't actually turn these into a single enum bitmask property, | |||||
| * instead we construct individual boolean properties. */ | |||||
| const EnumPropertyItem RNA_automasking_flags[] = { | |||||
| {BRUSH_AUTOMASKING_TOPOLOGY, "use_automasking_topology", 0,"Topology", "Affect only vertices connected to the active vertex under the brush"}, | |||||
| {BRUSH_AUTOMASKING_FACE_SETS, "use_automasking_face_sets", 0,"Face Sets", "Affect only vertices that share Face Sets with the active vertex"}, | |||||
| {BRUSH_AUTOMASKING_BOUNDARY_EDGES, "use_automasking_boundary_edges", 0,"Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges"}, | |||||
| {BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, "use_automasking_boundary_face_sets", 0,"Face Sets Boundary Automasking", "Do not affect vertices that belong to a Face Set boundary"}, | |||||
| {BRUSH_AUTOMASKING_CAVITY_NORMAL, "use_automasking_cavity", 0,"Cavity Mask", "Do not affect vertices on peaks, based on the surface curvature"}, | |||||
| {BRUSH_AUTOMASKING_CAVITY_INVERTED, "use_automasking_cavity_inverted", 0,"Inverted Cavity Mask", "Do not affect vertices within crevices, based on the surface curvature"}, | |||||
| {BRUSH_AUTOMASKING_CAVITY_USE_CURVE, "use_automasking_custom_cavity_curve", 0,"Custom Cavity Curve", "Use custom curve"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { | const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { | ||||
| {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""}, | {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""}, | ||||
| {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""}, | {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""}, | ||||
| {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, | {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, | ||||
| {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""}, | {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""}, | ||||
| {SCULPT_TOOL_CLAY_THUMB, "CLAY_THUMB", ICON_BRUSH_CLAY_STRIPS, "Clay Thumb", ""}, | {SCULPT_TOOL_CLAY_THUMB, "CLAY_THUMB", ICON_BRUSH_CLAY_STRIPS, "Clay Thumb", ""}, | ||||
| {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""}, | {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""}, | ||||
| {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""}, | {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""}, | ||||
| ▲ Show 20 Lines • Show All 976 Lines • ▼ Show 20 Lines | # define rna_enum_brush_texture_slot_map_sculpt_mode_items \ | ||||
| if (mode == PAINT_MODE_SCULPT) { | if (mode == PAINT_MODE_SCULPT) { | ||||
| return rna_enum_brush_texture_slot_map_sculpt_mode_items; | return rna_enum_brush_texture_slot_map_sculpt_mode_items; | ||||
| } | } | ||||
| return rna_enum_brush_texture_slot_map_texture_mode_items; | return rna_enum_brush_texture_slot_map_texture_mode_items; | ||||
| # undef rna_enum_brush_texture_slot_map_sculpt_mode_items | # undef rna_enum_brush_texture_slot_map_sculpt_mode_items | ||||
| } | } | ||||
| static void rna_Brush_automasking_invert_cavity_set(PointerRNA *ptr, bool val) | |||||
| { | |||||
| Brush *brush = (Brush *)ptr->data; | |||||
| if (val) { | |||||
| brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL; | |||||
| brush->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_INVERTED; | |||||
| } | |||||
| else { | |||||
| brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED; | |||||
| } | |||||
| } | |||||
| static void rna_Brush_automasking_cavity_set(PointerRNA *ptr, bool val) | |||||
| { | |||||
| Brush *brush = (Brush *)ptr->data; | |||||
| if (val) { | |||||
| brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_INVERTED; | |||||
| brush->automasking_flags |= BRUSH_AUTOMASKING_CAVITY_NORMAL; | |||||
| } | |||||
| else { | |||||
| brush->automasking_flags &= ~BRUSH_AUTOMASKING_CAVITY_NORMAL; | |||||
| } | |||||
| } | |||||
| #else | #else | ||||
| static void rna_def_brush_texture_slot(BlenderRNA *brna) | static void rna_def_brush_texture_slot(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem prop_mask_paint_map_mode_items[] = { | static const EnumPropertyItem prop_mask_paint_map_mode_items[] = { | ||||
| ▲ Show 20 Lines • Show All 827 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_options(BlenderRNA *brna) | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_HELPLINES); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_HELPLINES); | ||||
| RNA_def_property_boolean_default(prop, true); | RNA_def_property_boolean_default(prop, true); | ||||
| RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries"); | RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_EXTENDLINES); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_EXTENDLINES); | ||||
| RNA_def_property_boolean_default(prop, true); | RNA_def_property_boolean_default(prop, true); | ||||
| RNA_def_property_ui_text(prop, "Show Extend Lines", "Show help lines for stroke extension"); | RNA_def_property_ui_text(prop, "Visual Aids", "Show help lines for stroke extension"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| prop = RNA_def_property(srna, "use_collide_strokes", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_STROKE_COLLIDE); | |||||
| RNA_def_property_boolean_default(prop, false); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Strokes Collision", "Check if extend lines collide with strokes"); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE); | ||||
| RNA_def_property_boolean_default(prop, true); | RNA_def_property_boolean_default(prop, true); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Show Fill", "Show transparent lines to use as boundary for filling"); | prop, "Show Fill", "Show transparent lines to use as boundary for filling"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| ▲ Show 20 Lines • Show All 1,234 Lines • ▼ Show 20 Lines | |||||
| prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_original_plane", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_PLANE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_PLANE); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Original Plane", | "Original Plane", | ||||
| "When locked keep using the plane origin of surface where stroke was initiated"); | "When locked keep using the plane origin of surface where stroke was initiated"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_automasking_topology", PROP_BOOLEAN, PROP_NONE); | const EnumPropertyItem *entry = RNA_automasking_flags; | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_TOPOLOGY); | do { | ||||
| RNA_def_property_ui_text(prop, | prop = RNA_def_property(srna, entry->identifier, PROP_BOOLEAN, PROP_NONE); | ||||
| "Topology Auto-Masking", | RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", entry->value); | ||||
| "Affect only vertices connected to the active vertex under the brush"); | RNA_def_property_ui_text(prop, entry->name, entry->description); | ||||
| if (entry->value == BRUSH_AUTOMASKING_CAVITY_NORMAL) { | |||||
| RNA_def_property_boolean_funcs(prop, NULL, "rna_Brush_automasking_cavity_set"); | |||||
| } | |||||
| else if (entry->value == BRUSH_AUTOMASKING_CAVITY_INVERTED) { | |||||
| RNA_def_property_boolean_funcs(prop, NULL, "rna_Brush_automasking_invert_cavity_set"); | |||||
| } | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| } while ((++entry)->identifier); | |||||
| prop = RNA_def_property(srna, "use_automasking_face_sets", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_FACE_SETS); | RNA_def_property_float_sdna(prop, NULL, "automasking_cavity_factor"); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask"); | ||||
| "Face Sets Auto-Masking", | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); | ||||
| "Affect only vertices that share Face Sets with the active vertex"); | RNA_def_property_range(prop, 0.0f, 5.0f); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "automasking_cavity_blur_steps"); | |||||
| RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred"); | |||||
| RNA_def_property_range(prop, 0.0f, 25.0f); | |||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "automasking_cavity_curve"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Cavity Curve", "Curve used for the sensitivity"); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_automasking_boundary_edges", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_automasking_start_normal", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_EDGES); | RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BRUSH_NORMAL); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Mesh Boundary Auto-Masking", "Do not affect non manifold boundary edges"); | prop, | ||||
| "Area Normal", | |||||
| "Affect only vertices with a similar normal to where the stroke starts"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_automasking_boundary_face_sets", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_automasking_view_normal", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna( | RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_VIEW_NORMAL); | ||||
| prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS); | RNA_def_property_ui_text( | ||||
| RNA_def_property_ui_text(prop, | prop, "View Normal", "Affect only vertices with a normal that faces the viewer"); | ||||
| "Face Sets Boundary Automasking", | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| "Do not affect vertices that belong to a Face Set boundary"); | |||||
| prop = RNA_def_property(srna, "use_automasking_view_occlusion", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "automasking_flags", BRUSH_AUTOMASKING_VIEW_OCCLUSION); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "Occlusion", | |||||
| "Only affect vertices that are not occluded by other faces. (Slower performance)"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "use_scene_spacing", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | ||||
| RNA_def_property_enum_items(prop, brush_spacing_unit_items); | RNA_def_property_enum_items(prop, brush_spacing_unit_items); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance"); | prop, "Spacing Distance", "Calculate the brush spacing using view or scene distance"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| ▲ Show 20 Lines • Show All 541 Lines • Show Last 20 Lines | |||||