Revert API change (hide_viewport > hide_instance)

The change was introduced on b1af68200159.

We may still change the name functionality of this anyways -  we are
not really changing only the instancing visibility here at the moment.

So there is no reason to break the API in the meantime.
And in the future we can simply add a new API entry, leaving the old one
to be slowly deprecated.
This commit is contained in:
Dalai Felinto 2019-05-11 11:22:41 -03:00
parent 741e8cc118
commit 5f84e2d732
3 changed files with 12 additions and 12 deletions

@ -858,21 +858,21 @@ static void outliner_draw_restrictbuts(uiBlock *block,
static struct RestrictProperties { static struct RestrictProperties {
bool initialized; bool initialized;
PropertyRNA *object_hide_instance, *object_hide_select, *object_hide_render; PropertyRNA *object_hide_viewport, *object_hide_select, *object_hide_render;
PropertyRNA *base_hide_viewport; PropertyRNA *base_hide_viewport;
PropertyRNA *collection_hide_instance, *collection_hide_select, *collection_hide_render; PropertyRNA *collection_hide_viewport, *collection_hide_select, *collection_hide_render;
PropertyRNA *layer_collection_holdout, *layer_collection_indirect_only, PropertyRNA *layer_collection_holdout, *layer_collection_indirect_only,
*layer_collection_hide_viewport; *layer_collection_hide_viewport;
PropertyRNA *modifier_show_viewport, *modifier_show_render; PropertyRNA *modifier_show_viewport, *modifier_show_render;
} props = {false}; } props = {false};
if (!props.initialized) { if (!props.initialized) {
props.object_hide_instance = RNA_struct_type_find_property(&RNA_Object, "hide_instance"); props.object_hide_viewport = RNA_struct_type_find_property(&RNA_Object, "hide_viewport");
props.object_hide_select = RNA_struct_type_find_property(&RNA_Object, "hide_select"); props.object_hide_select = RNA_struct_type_find_property(&RNA_Object, "hide_select");
props.object_hide_render = RNA_struct_type_find_property(&RNA_Object, "hide_render"); props.object_hide_render = RNA_struct_type_find_property(&RNA_Object, "hide_render");
props.base_hide_viewport = RNA_struct_type_find_property(&RNA_ObjectBase, "hide_viewport"); props.base_hide_viewport = RNA_struct_type_find_property(&RNA_ObjectBase, "hide_viewport");
props.collection_hide_instance = RNA_struct_type_find_property(&RNA_Collection, props.collection_hide_viewport = RNA_struct_type_find_property(&RNA_Collection,
"hide_instance"); "hide_viewport");
props.collection_hide_select = RNA_struct_type_find_property(&RNA_Collection, "hide_select"); props.collection_hide_select = RNA_struct_type_find_property(&RNA_Collection, "hide_select");
props.collection_hide_render = RNA_struct_type_find_property(&RNA_Collection, "hide_render"); props.collection_hide_render = RNA_struct_type_find_property(&RNA_Collection, "hide_render");
props.layer_collection_holdout = RNA_struct_type_find_property(&RNA_LayerCollection, props.layer_collection_holdout = RNA_struct_type_find_property(&RNA_LayerCollection,
@ -995,7 +995,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
UI_UNIT_X, UI_UNIT_X,
UI_UNIT_Y, UI_UNIT_Y,
&ptr, &ptr,
props.object_hide_instance, props.object_hide_viewport,
-1, -1,
0, 0,
0, 0,
@ -1036,7 +1036,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
UI_UNIT_X, UI_UNIT_X,
UI_UNIT_Y, UI_UNIT_Y,
&ptr, &ptr,
props.object_hide_instance, props.object_hide_viewport,
-1, -1,
0, 0,
0, 0,
@ -1357,7 +1357,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
UI_UNIT_X, UI_UNIT_X,
UI_UNIT_Y, UI_UNIT_Y,
&collection_ptr, &collection_ptr,
props.collection_hide_instance, props.collection_hide_viewport,
-1, -1,
0, 0,
0, 0,
@ -1370,13 +1370,13 @@ static void outliner_draw_restrictbuts(uiBlock *block,
UI_but_func_set(bt, UI_but_func_set(bt,
view_layer__collection_set_flag_recursive_cb, view_layer__collection_set_flag_recursive_cb,
layer_collection, layer_collection,
(char *)"hide_instance"); (char *)"hide_viewport");
} }
else { else {
UI_but_func_set(bt, UI_but_func_set(bt,
scenes__collection_set_flag_recursive_cb, scenes__collection_set_flag_recursive_cb,
collection, collection,
(char *)"hide_instance"); (char *)"hide_viewport");
} }
UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
} }

@ -408,7 +408,7 @@ void RNA_def_collections(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Disable Select", "Disable collection for viewport selection"); RNA_def_property_ui_text(prop, "Disable Select", "Disable collection for viewport selection");
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
prop = RNA_def_property(srna, "hide_instance", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_INSTANCE); RNA_def_property_boolean_sdna(prop, NULL, "flag", COLLECTION_RESTRICT_INSTANCE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);

@ -2800,7 +2800,7 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies"); RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies");
/* restrict */ /* restrict */
prop = RNA_def_property(srna, "hide_instance", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_INSTANCE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_INSTANCE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
RNA_def_property_ui_text(prop, "Disable View", "Disable object in the viewport"); RNA_def_property_ui_text(prop, "Disable View", "Disable object in the viewport");