Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | static const EnumPropertyItem rna_enum_viewport_lighting_items[] = { | ||||
| {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"}, | {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"}, | ||||
| {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"}, | {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem rna_enum_shading_color_type_items[] = { | static const EnumPropertyItem rna_enum_shading_color_type_items[] = { | ||||
| {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Single", "Show scene in a single color"}, | {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Single", "Show scene in a single color"}, | ||||
| {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"}, | {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"}, | ||||
| {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"}, | {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"}, | ||||
| {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"}, | {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"}, | ||||
| {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Vertex", "Show active vertex color"}, | |||||
| {V3D_SHADING_TEXTURE_COLOR, "TEXTURE", 0, "Texture", "Show texture"}, | {V3D_SHADING_TEXTURE_COLOR, "TEXTURE", 0, "Texture", "Show texture"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem rna_enum_studio_light_items[] = { | static const EnumPropertyItem rna_enum_studio_light_items[] = { | ||||
| {0, "DEFAULT", 0, "Default", ""}, | {0, "DEFAULT", 0, "Default", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| ▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *rna_View3DShading_color_type_itemf( | ||||
| int totitem = 0; | int totitem = 0; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| if (shading->type == OB_SOLID) { | if (shading->type == OB_SOLID) { | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_SINGLE_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_SINGLE_COLOR); | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_MATERIAL_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_MATERIAL_COLOR); | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_OBJECT_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_OBJECT_COLOR); | ||||
| if (shading->light != V3D_LIGHTING_MATCAP) { | |||||
| RNA_enum_item_add_separator(&item, &totitem); | |||||
| } | |||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_RANDOM_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_RANDOM_COLOR); | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_VERTEX_COLOR); | |||||
| if (shading->light != V3D_LIGHTING_MATCAP) { | if (shading->light != V3D_LIGHTING_MATCAP) { | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_TEXTURE_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_TEXTURE_COLOR); | ||||
| } | } | ||||
| } | } | ||||
| else if (shading->type == OB_WIRE) { | else if (shading->type == OB_WIRE) { | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_SINGLE_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_SINGLE_COLOR); | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_OBJECT_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_OBJECT_COLOR); | ||||
| RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_RANDOM_COLOR); | RNA_enum_items_add_value(&item, &totitem, rna_enum_shading_color_type_items, V3D_SHADING_RANDOM_COLOR); | ||||
| ▲ Show 20 Lines • Show All 1,726 Lines • ▼ Show 20 Lines | static void rna_def_space_view3d_shading(BlenderRNA *brna) | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "color_type"); | RNA_def_property_enum_sdna(prop, NULL, "color_type"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color Type"); | RNA_def_property_ui_text(prop, "Color", "Color Type"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "wire_color_type"); | RNA_def_property_enum_sdna(prop, NULL, "wire_color_type"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | RNA_def_property_enum_items(prop, rna_enum_shading_color_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_View3DShading_color_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color Type"); | RNA_def_property_ui_text(prop, "Color", "Color Type"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| ▲ Show 20 Lines • Show All 2,786 Lines • Show Last 20 Lines | |||||