Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_modifier.c
| Show First 20 Lines • Show All 2,082 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void rna_def_modifier_displace(BlenderRNA *brna) | static void rna_def_modifier_displace(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static EnumPropertyItem prop_direction_items[] = { | static EnumPropertyItem prop_direction_items[] = { | ||||
| {MOD_DISP_DIR_X, "X", 0, "X", "Use the texture's intensity value to displace in the X direction"}, | {MOD_DISP_DIR_LOCAL_X, "LOCAL_X", 0, "Local X", "Use the texture's intensity value to displace in the local X direction"}, | ||||
| {MOD_DISP_DIR_Y, "Y", 0, "Y", "Use the texture's intensity value to displace in the Y direction"}, | {MOD_DISP_DIR_LOCAL_Y, "LOCAL_Y", 0, "Local Y", "Use the texture's intensity value to displace in the local Y direction"}, | ||||
| {MOD_DISP_DIR_Z, "Z", 0, "Z", "Use the texture's intensity value to displace in the Z direction"}, | {MOD_DISP_DIR_LOCAL_Z, "LOCAL_Z", 0, "Local Z", "Use the texture's intensity value to displace in the local Z direction"}, | ||||
| {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", | {MOD_DISP_DIR_NOR, "NORMAL", 0, "Normal", | ||||
| "Use the texture's intensity value to displace along the vertex normal"}, | "Use the texture's intensity value to displace along the vertex normal"}, | ||||
| {MOD_DISP_DIR_CLNOR, "CUSTOM_NORMAL", 0, "Custom Normal", | {MOD_DISP_DIR_CLNOR, "CUSTOM_NORMAL", 0, "Custom Normal", | ||||
| "Use the texture's intensity value to displace along the (averaged) custom normal (falls back to vertex)"}, | "Use the texture's intensity value to displace along the (averaged) custom normal (falls back to vertex)"}, | ||||
| {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", | {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", | ||||
| "Use the texture's RGB values to displace the mesh in the XYZ direction"}, | "Use the texture's RGB values to displace the mesh in the XYZ direction"}, | ||||
| {MOD_DISP_DIR_GLOBAL_X, "GLOBAL_X", 0, "Global X", "Use the texture's intensity value to displace in the global X direction"}, | |||||
| {MOD_DISP_DIR_GLOBAL_Y, "GLOBAL_Y", 0, "Global Y", "Use the texture's intensity value to displace in the global Y direction"}, | |||||
| {MOD_DISP_DIR_GLOBAL_Z, "GLOBAL_Z", 0, "Global Z", "Use the texture's intensity value to displace in the global Z direction"}, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "DisplaceModifier", "Modifier"); | srna = RNA_def_struct(brna, "DisplaceModifier", "Modifier"); | ||||
| RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier"); | RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier"); | ||||
| RNA_def_struct_sdna(srna, "DisplaceModifierData"); | RNA_def_struct_sdna(srna, "DisplaceModifierData"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE); | RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE); | ||||
| Show All 17 Lines | static void rna_def_modifier_displace(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry"); | RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry"); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, prop_direction_items); | RNA_def_property_enum_items(prop, prop_direction_items); | ||||
| RNA_def_property_ui_text(prop, "Direction", ""); | RNA_def_property_ui_text(prop, "Direction", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| rna_def_modifier_generic_map_info(srna); | rna_def_modifier_generic_map_info(srna); | ||||
| } | } | ||||
| static void rna_def_modifier_uvproject(BlenderRNA *brna) | static void rna_def_modifier_uvproject(BlenderRNA *brna) | ||||
brecht: I would make this a "space" enum, and have "Local" and "Global" items. No need for a cryptic… | |||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "UVProjectModifier", "Modifier"); | srna = RNA_def_struct(brna, "UVProjectModifier", "Modifier"); | ||||
| RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector"); | RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector"); | ||||
| RNA_def_struct_sdna(srna, "UVProjectModifierData"); | RNA_def_struct_sdna(srna, "UVProjectModifierData"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT); | RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT); | ||||
| ▲ Show 20 Lines • Show All 2,654 Lines • Show Last 20 Lines | |||||
I would make this a "space" enum, and have "Local" and "Global" items. No need for a cryptic "L" label.