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:
authorDalai Felinto <dfelinto@gmail.com>2019-05-20 13:14:48 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 14:47:37 +0300
commit785ff8e1d2e973e10c1a3aea3a986c7e1d3cf1db (patch)
tree086ac1ae7f7fcf8b49f12d6d904cb2590a1c00b6 /source/blender/makesrna
parent81320ce7f7c699d832edf8ba0f609bb246389a33 (diff)
UI: add Visibility panel for objects
The outliner should not be the only way for users to change these settings. The Python API was extended to keep these properties positive and keyframable. Differential Revision: https://developer.blender.org/D4889
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_object.c3
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index b4453996095..dbc822460d9 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2819,7 +2819,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEWPORT);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
- RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
@@ -2827,14 +2826,12 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport");
- RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
- RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
prop = RNA_def_property(srna, "show_instancer_for_render", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 7ce9155e3d9..5a001f05b53 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -101,7 +101,8 @@ static void rna_uiItemR(uiLayout *layout,
bool full_event,
bool emboss,
int index,
- int icon_value)
+ int icon_value,
+ bool invert_checkbox)
{
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
int flag = 0;
@@ -125,6 +126,7 @@ static void rna_uiItemR(uiLayout *layout,
flag |= (event) ? UI_ITEM_R_EVENT : 0;
flag |= (full_event) ? UI_ITEM_R_FULL_EVENT : 0;
flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
+ flag |= (invert_checkbox) ? UI_ITEM_R_CHECKBOX_INVERT : 0;
uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
}
@@ -789,6 +791,7 @@ void RNA_api_ui_layout(StructRNA *srna)
INT_MAX); /* RNA_NO_INDEX == -1 */
parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
+ RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted");
func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
api_ui_item_rna_common(func);