Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-02 17:16:17 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-02 17:16:17 +0300
commit6a9e6b1448be0f77291fdb9372587ba88421bf3b (patch)
tree278b50140fa6f138c01e3bb562c59f1ae44a07df /source/blender/makesrna/intern
parent404758cc2075931d62bcb14e7ef3310314d2a773 (diff)
parentce7575c823f169747af870058334395cc9bf7b10 (diff)
Merge branch 'blender2.8' into tmp-static-override-insertion
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c5
-rw-r--r--source/blender/makesrna/intern/rna_space.c30
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c4
3 files changed, 30 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index deb9e20f34b..a07e43162c2 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -1106,12 +1106,17 @@ static void rna_def_ID_override_static_property(BlenderRNA *brna)
static void rna_def_ID_override_static(BlenderRNA *brna)
{
StructRNA *srna;
+ PropertyRNA *prop;
srna = RNA_def_struct(brna, "IDOverrideStatic", NULL);
RNA_def_struct_ui_text(srna, "ID Static Override", "Struct gathering all data needed by statically overridden IDs");
RNA_def_pointer(srna, "reference", "ID", "Reference ID", "Linked ID used as reference by this override");
+ prop = RNA_def_boolean(srna, "auto_generate", true, "Auto Generate Override",
+ "Automatically generate overriding operations by detecting changes in properties");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", STATICOVERRIDE_AUTO);
+
RNA_def_collection(srna, "properties", "IDOverrideStaticProperty", "Properties",
"List of overridden properties");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 89465f8e6a0..30c00b93867 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -177,7 +177,7 @@ static const EnumPropertyItem autosnap_items[] = {
const EnumPropertyItem rna_enum_shading_type_items[] = {
{OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
- {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid"},
+ {OB_SOLID, "SOLID", ICON_SOLID, "Single Color", "Display the object or material in a single color"},
{OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"},
{OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"},
{OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"},
@@ -679,6 +679,16 @@ static void rna_3DViewShading_type_set(PointerRNA *ptr, int value)
v3d->drawtype = value;
}
+static void rna_View3DShading_single_color_mode_set(PointerRNA *ptr, int value) {
+ View3D *v3d = (View3D *)ptr->data;
+ v3d->drawtype_options = (v3d->drawtype_options &~ V3D_DRAWOPTION_SOLID_COLOR_MASK) + value;
+}
+
+static int rna_View3DShading_single_color_mode_get(PointerRNA *ptr) {
+ View3D *v3d = (View3D *)ptr->data;
+ return v3d->drawtype_options & V3D_DRAWOPTION_SOLID_COLOR_MASK;
+}
+
static const EnumPropertyItem *rna_3DViewShading_type_itemf(
bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), bool *r_free)
@@ -2184,6 +2194,14 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static const EnumPropertyItem single_color_mode_items[] = {
+ {V3D_DRAWOPTION_SINGLE_COLOR, "SINGLE", 0, "Single", "Show scene in a single color"},
+ {V3D_DRAWOPTION_OBJECT_COLOR, "OBJECT", 0, "Object", "Show Object color"},
+ {V3D_DRAWOPTION_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show Material color"},
+ {V3D_DRAWOPTION_RANDOMIZE, "RANDOM", 0, "Random", "Show random object color"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
srna = RNA_def_struct(brna, "View3DShading", NULL);
RNA_def_struct_sdna(srna, "View3D");
RNA_def_struct_nested(brna, srna, "SpaceView3D");
@@ -2210,10 +2228,12 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object Overlap", "Show Object Overlap");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update");
- prop = RNA_def_property(srna, "show_random_object_colors", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "drawtype_options", V3D_DRAWOPTION_RANDOMIZE);
- RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Random Colors", "Show random object colors");
+ prop = RNA_def_property(srna, "single_color_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, single_color_mode_items);
+ RNA_def_property_enum_funcs(prop, "rna_View3DShading_single_color_mode_get",
+ "rna_View3DShading_single_color_mode_set",
+ NULL);
+ RNA_def_property_ui_text(prop, "Color", "Single Color Mode");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update");
}
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index cb72e237577..d980696c3ee 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -811,10 +811,6 @@ void RNA_api_ui_layout(StructRNA *srna)
parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- func = RNA_def_function(srna, "template_operator_redo_props", "uiTemplateOperatorRedoProperties");
- RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Adds properties of the last executed operator using redo");
-
func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
RNA_def_function_ui_description(func, "Generates the UI layout for constraints");
parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");