[Bf-blender-cvs] [5f84e2d732c] master: Revert API change (hide_viewport > hide_instance)

Dalai Felinto noreply at git.blender.org
Sat May 11 16:33:10 CEST 2019


Commit: 5f84e2d732c22969c79abf244e59e2c8f5eeedb6
Author: Dalai Felinto
Date:   Sat May 11 11:22:41 2019 -0300
Branches: master
https://developer.blender.org/rB5f84e2d732c22969c79abf244e59e2c8f5eeedb6

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.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/makesrna/intern/rna_collection.c
M	source/blender/makesrna/intern/rna_object.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 94f768b609c..7f8cd4304c3 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -858,21 +858,21 @@ static void outliner_draw_restrictbuts(uiBlock *block,
   static struct RestrictProperties {
     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 *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,
         *layer_collection_hide_viewport;
     PropertyRNA *modifier_show_viewport, *modifier_show_render;
   } props = {false};
 
   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_render = RNA_struct_type_find_property(&RNA_Object, "hide_render");
     props.base_hide_viewport = RNA_struct_type_find_property(&RNA_ObjectBase, "hide_viewport");
-    props.collection_hide_instance = RNA_struct_type_find_property(&RNA_Collection,
-                                                                   "hide_instance");
+    props.collection_hide_viewport = RNA_struct_type_find_property(&RNA_Collection,
+                                                                   "hide_viewport");
     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.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_Y,
                                     &ptr,
-                                    props.object_hide_instance,
+                                    props.object_hide_viewport,
                                     -1,
                                     0,
                                     0,
@@ -1036,7 +1036,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
                                   UI_UNIT_X,
                                   UI_UNIT_Y,
                                   &ptr,
-                                  props.object_hide_instance,
+                                  props.object_hide_viewport,
                                   -1,
                                   0,
                                   0,
@@ -1357,7 +1357,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
                                     UI_UNIT_X,
                                     UI_UNIT_Y,
                                     &collection_ptr,
-                                    props.collection_hide_instance,
+                                    props.collection_hide_viewport,
                                     -1,
                                     0,
                                     0,
@@ -1370,13 +1370,13 @@ static void outliner_draw_restrictbuts(uiBlock *block,
               UI_but_func_set(bt,
                               view_layer__collection_set_flag_recursive_cb,
                               layer_collection,
-                              (char *)"hide_instance");
+                              (char *)"hide_viewport");
             }
             else {
               UI_but_func_set(bt,
                               scenes__collection_set_flag_recursive_cb,
                               collection,
-                              (char *)"hide_instance");
+                              (char *)"hide_viewport");
             }
             UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
           }
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index e2ffddc8e07..ebe97ad4fe7 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -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_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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 1e90fba0eb6..1dfe38584ef 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2800,7 +2800,7 @@ static void rna_def_object(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies");
 
   /* 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
   RNA_def_property_ui_text(prop, "Disable View", "Disable object in the viewport");



More information about the Bf-blender-cvs mailing list