Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_modifier.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| static void rna_def_modifier_bevel(BlenderRNA *brna) | static void rna_def_modifier_bevel(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem prop_limit_method_items[] = { | static const EnumPropertyItem prop_limit_method_items[] = { | ||||
| {0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"}, | {0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"}, | ||||
| {MOD_BEVEL_ANGLE, | {MOD_BEVEL_ANGLE, "ANGLE", 0, "Angle", | ||||
| "ANGLE", | |||||
| 0, | |||||
| "Angle", | |||||
| "Only bevel edges with sharp enough angles between faces"}, | "Only bevel edges with sharp enough angles between faces"}, | ||||
| {MOD_BEVEL_WEIGHT, | {MOD_BEVEL_WEIGHT, "WEIGHT", 0, "Weight", | ||||
| "WEIGHT", | |||||
| 0, | |||||
| "Weight", | |||||
| "Use bevel weights to determine how much bevel is applied in edge mode"}, | "Use bevel weights to determine how much bevel is applied in edge mode"}, | ||||
| {MOD_BEVEL_VGROUP, | {MOD_BEVEL_VGROUP, "VGROUP", 0, "Vertex Group", | ||||
| "VGROUP", | |||||
| 0, | |||||
| "Vertex Group", | |||||
| "Use vertex group weights to select whether vertex or edge is beveled"}, | "Use vertex group weights to select whether vertex or edge is beveled"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem prop_val_type_items[] = { | static const EnumPropertyItem prop_val_type_items[] = { | ||||
| {MOD_BEVEL_AMT_OFFSET, "OFFSET", 0, "Offset", "Amount is offset of new edges from original"}, | {MOD_BEVEL_AMT_OFFSET, "OFFSET", 0, "Offset", "Amount is offset of new edges from original"}, | ||||
| {MOD_BEVEL_AMT_WIDTH, "WIDTH", 0, "Width", "Amount is width of new face"}, | {MOD_BEVEL_AMT_WIDTH, "WIDTH", 0, "Width", "Amount is width of new face"}, | ||||
| {MOD_BEVEL_AMT_DEPTH, | {MOD_BEVEL_AMT_DEPTH, "DEPTH", 0, "Depth", | ||||
| "DEPTH", | |||||
| 0, | |||||
| "Depth", | |||||
| "Amount is perpendicular distance from original edge to bevel face"}, | "Amount is perpendicular distance from original edge to bevel face"}, | ||||
| {MOD_BEVEL_AMT_PERCENT, | {MOD_BEVEL_AMT_PERCENT, "PERCENT", 0, "Percent", | ||||
| "PERCENT", | |||||
| 0, | |||||
| "Percent", | |||||
| "Amount is percent of adjacent edge length"}, | "Amount is percent of adjacent edge length"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static EnumPropertyItem prop_harden_normals_items[] = { | static EnumPropertyItem prop_harden_normals_items[] = { | ||||
| {MOD_BEVEL_FACE_STRENGTH_NONE, "FSTR_NONE", 0, "None", "Do not set face strength"}, | {MOD_BEVEL_FACE_STRENGTH_NONE, "FSTR_NONE", 0, "None", "Do not set face strength"}, | ||||
| {MOD_BEVEL_FACE_STRENGTH_NEW, "FSTR_NEW", 0, "New", "Set face strength on new faces only"}, | {MOD_BEVEL_FACE_STRENGTH_NEW, "FSTR_NEW", 0, "New", "Set face strength on new faces only"}, | ||||
| {MOD_BEVEL_FACE_STRENGTH_AFFECTED, | {MOD_BEVEL_FACE_STRENGTH_AFFECTED, "FSTR_AFFECTED", 0, "Affected", | ||||
| "FSTR_AFFECTED", | |||||
| 0, | |||||
| "Affected", | |||||
| "Set face strength on new and affected faces only"}, | "Set face strength on new and affected faces only"}, | ||||
| {MOD_BEVEL_FACE_STRENGTH_ALL, "FSTR_ALL", 0, "All", "Set face strength on all faces"}, | {MOD_BEVEL_FACE_STRENGTH_ALL, "FSTR_ALL", 0, "All", "Set face strength on all faces"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static EnumPropertyItem prop_miter_items[] = { | static const EnumPropertyItem prop_miter_outer_items[] = { | ||||
| {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Default sharp miter"}, | {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Outside of miter is sharp"}, | ||||
| {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Miter with extra corner"}, | {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Outside of miter is squared-off patch"}, | ||||
| {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Miter with curved arc"}, | {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Outside of miter is arc"}, | ||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem prop_miter_inner_items[] = { | |||||
| {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Inside of miter is sharp"}, | |||||
| {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Inside of miter is arc"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static EnumPropertyItem prop_vmesh_method_items[] = { | |||||
| {MOD_BEVEL_VMESH_ADJ, "ADJ", 0, "Grid Fill", "Default patterned fill"}, | |||||
| {MOD_BEVEL_VMESH_CUTOFF, "CUTOFF", 0, "Cutoff", | |||||
| "A cut-off at the end of each profile before the intersection"}, | |||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "BevelModifier", "Modifier"); | srna = RNA_def_struct(brna, "BevelModifier", "Modifier"); | ||||
| RNA_def_struct_ui_text( | RNA_def_struct_ui_text(srna, "Bevel Modifier", | ||||
| srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded"); | "Bevel modifier to make edges and vertices more rounded"); | ||||
| RNA_def_struct_sdna(srna, "BevelModifierData"); | RNA_def_struct_sdna(srna, "BevelModifierData"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL); | RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL); | ||||
| prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "value"); | RNA_def_property_float_sdna(prop, NULL, "value"); | ||||
| RNA_def_property_range(prop, 0, FLT_MAX); | RNA_def_property_range(prop, 0, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4); | RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4); | ||||
| RNA_def_property_ui_text(prop, "Width", "Bevel amount"); | RNA_def_property_ui_text(prop, "Width", "Bevel amount"); | ||||
| Show All 39 Lines | |||||
| prop = RNA_def_property(srna, "use_clamp_overlap", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_clamp_overlap", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", MOD_BEVEL_OVERLAP_OK); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", MOD_BEVEL_OVERLAP_OK); | ||||
| RNA_def_property_ui_text(prop, "Clamp Overlap", "Clamp the width to avoid overlap"); | RNA_def_property_ui_text(prop, "Clamp Overlap", "Clamp the width to avoid overlap"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "offset_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "offset_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "val_flags"); | RNA_def_property_enum_sdna(prop, NULL, "val_flags"); | ||||
| RNA_def_property_enum_items(prop, prop_val_type_items); | RNA_def_property_enum_items(prop, prop_val_type_items); | ||||
| RNA_def_property_ui_text(prop, "Amount Type", "What distance Width measures"); | RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | ||||
| RNA_def_property_ui_text(prop, "Profile", "The profile shape (0.5 = round)"); | RNA_def_property_ui_text(prop, "Profile", "The profile shape (0.5 = round)"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "material", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "material", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "mat"); | RNA_def_property_int_sdna(prop, NULL, "mat"); | ||||
| RNA_def_property_range(prop, -1, SHRT_MAX); | RNA_def_property_range(prop, -1, SHRT_MAX); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text(prop, "Material", | ||||
| prop, "Material", "Material index of generated faces, -1 for automatic"); | "Material index of generated faces, -1 for automatic"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "loop_slide", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "loop_slide", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", MOD_BEVEL_EVEN_WIDTHS); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", MOD_BEVEL_EVEN_WIDTHS); | ||||
| RNA_def_property_ui_text(prop, "Loop Slide", "Prefer sliding along edges to having even widths"); | RNA_def_property_ui_text(prop, "Loop Slide", "Prefer sliding along edges to having even widths"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "mark_seam", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "mark_seam", PROP_BOOLEAN, PROP_NONE); | ||||
| Show All 9 Lines | |||||
| prop = RNA_def_property(srna, "harden_normals", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "harden_normals", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_HARDEN_NORMALS); | RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_HARDEN_NORMALS); | ||||
| RNA_def_property_ui_text(prop, "Harden Normals", "Match normals of new faces to adjacent faces"); | RNA_def_property_ui_text(prop, "Harden Normals", "Match normals of new faces to adjacent faces"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "face_strength_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "face_strength_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "face_str_mode"); | RNA_def_property_enum_sdna(prop, NULL, "face_str_mode"); | ||||
| RNA_def_property_enum_items(prop, prop_harden_normals_items); | RNA_def_property_enum_items(prop, prop_harden_normals_items); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text(prop, "Set Face Strength", | ||||
| prop, "Set Face Strength", "Whether to set face strength, and which faces to set it on"); | "Whether to set face strength, and which faces to set it on"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "miter_outer", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "miter_outer", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "miter_outer"); | RNA_def_property_enum_sdna(prop, NULL, "miter_outer"); | ||||
| RNA_def_property_enum_items(prop, prop_miter_items); | RNA_def_property_enum_items(prop, prop_miter_outer_items); | ||||
| RNA_def_property_ui_text(prop, "Outer Miter", "Pattern to use for outside of miters"); | RNA_def_property_ui_text(prop, "Outer Miter", "Pattern to use for outside of miters"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "miter_inner", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "miter_inner", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "miter_inner"); | RNA_def_property_enum_sdna(prop, NULL, "miter_inner"); | ||||
| RNA_def_property_enum_items(prop, prop_miter_items); | RNA_def_property_enum_items(prop, prop_miter_inner_items); | ||||
| RNA_def_property_ui_text(prop, "Inner Miter", "Pattern to use for inside of miters"); | RNA_def_property_ui_text(prop, "Inner Miter", "Pattern to use for inside of miters"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "spread"); | RNA_def_property_float_sdna(prop, NULL, "spread"); | ||||
| RNA_def_property_range(prop, 0, FLT_MAX); | RNA_def_property_range(prop, 0, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4); | RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4); | ||||
| RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs"); | RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "use_custom_profile", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_CUSTOM_PROFILE); | |||||
| RNA_def_property_ui_text(prop, "Custom Profile", | |||||
| "Whether to use a user inputed curve for the bevel's profile"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "prwdgt", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "ProfileWidget"); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "prwdgt"); | |||||
| RNA_def_property_ui_text(prop, "Custom Profile Path", "The path for the custom profile"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "vmesh_method", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "vmesh_method"); | |||||
| RNA_def_property_enum_items(prop, prop_vmesh_method_items); | |||||
| RNA_def_property_ui_text(prop, "Vertex Mesh Method", | |||||
| "The method to use to create the mesh at intersections"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | } | ||||
| static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) | static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem shrink_type_items[] = { | static const EnumPropertyItem shrink_type_items[] = { | ||||
| {MOD_SHRINKWRAP_NEAREST_SURFACE, | {MOD_SHRINKWRAP_NEAREST_SURFACE, | ||||
| "NEAREST_SURFACEPOINT", | "NEAREST_SURFACEPOINT", | ||||
| 0, | 0, | ||||
| "Nearest Surface Point", | "Nearest Surface Point", | ||||
campbellbarton: This seems needlessly cryptic, why not call `custom_profile` ? (DNA too for that matter). | |||||
| "Shrink the mesh to the nearest target surface"}, | "Shrink the mesh to the nearest target surface"}, | ||||
| {MOD_SHRINKWRAP_PROJECT, | {MOD_SHRINKWRAP_PROJECT, | ||||
| "PROJECT", | "PROJECT", | ||||
| 0, | 0, | ||||
| "Project", | "Project", | ||||
| "Shrink the mesh to the nearest target surface along a given axis"}, | "Shrink the mesh to the nearest target surface along a given axis"}, | ||||
| {MOD_SHRINKWRAP_NEAREST_VERTEX, | {MOD_SHRINKWRAP_NEAREST_VERTEX, | ||||
| "NEAREST_VERTEX", | "NEAREST_VERTEX", | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||
This seems needlessly cryptic, why not call custom_profile ? (DNA too for that matter).