FBX broken with the latest visibility changes commit 'b1af682 - Outliner Visibility Update' #64474

Closed
opened 2019-05-11 10:17:33 +02:00 by Daniel Santana · 8 comments

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64

Blender Version
Broken: version: 2.80 (sub 61), branch: master, commit date: 2019-05-10 22:48, hash: b1af682001
Worked: (optional)

Short description of error
FBX Export fails due to changes on the visibility properties.

Exact steps for others to reproduce the error
Export default scene to FBX format.

location: D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py:200
Error: Traceback (most recent call last):

File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\__init__.py", line 552, in execute
  return export_fbx_bin.save(self, context, **keywords)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3092, in save
  ret = save_single(operator, context.scene, context.depsgraph, filepath, **kwargs_mod)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2990, in save_single
  fbx_objects_elements(root, scene_data)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2799, in fbx_objects_elements
  fbx_data_object_elements(objects, ob_obj, scene_data)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1612, in fbx_data_object_elements
  elem_props_template_set(tmpl, props, "p_visibility", b"Visibility", float(not ob_obj.hide))
File "D:\Tools\Blender\Blender28Traceback (most recent call last):
File "D:\ySync\yScripts\_blender\2.80\scripts\addons\AssetGen\GA.py", line 689, in execute
File "D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py", line 200, in __call__
  ret = op_call(self.idname_py(), None, kw)

RuntimeError: Error: Traceback (most recent call last):

File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\__init__.py", line 552, in execute
  return export_fbx_bin.save(self, context, **keywords)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3092, in save
  ret = save_single(operator, context.scene, context.depsgraph, filepath, **kwargs_mod)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2990, in save_single
  fbx_objects_elements(root, scene_data)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2799, in fbx_objects_elements
  fbx_data_object_elements(objects, ob_obj, scene_data)
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1612, in fbx_data_object_elements
  elem_props_template_set(tmpl, props, "p_visibility", b"Visibility", float(not ob_obj.hide))
File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\fbx_utils.py", line 987, in get_hide
  return self.bdata.hide_viewport if self._tag in {'OB', 'DP'} else self.bdata.hide

AttributeError: 'Object' object has no attribute 'hide_viewport'

location: D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py:200

**System Information** Operating system: Windows-10-10.0.17763 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64 **Blender Version** Broken: version: 2.80 (sub 61), branch: master, commit date: 2019-05-10 22:48, hash: `b1af682001` Worked: (optional) **Short description of error** FBX Export fails due to changes on the visibility properties. **Exact steps for others to reproduce the error** Export default scene to FBX format. location: D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py:200 Error: Traceback (most recent call last): ``` File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\__init__.py", line 552, in execute return export_fbx_bin.save(self, context, **keywords) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3092, in save ret = save_single(operator, context.scene, context.depsgraph, filepath, **kwargs_mod) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2990, in save_single fbx_objects_elements(root, scene_data) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2799, in fbx_objects_elements fbx_data_object_elements(objects, ob_obj, scene_data) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1612, in fbx_data_object_elements elem_props_template_set(tmpl, props, "p_visibility", b"Visibility", float(not ob_obj.hide)) File "D:\Tools\Blender\Blender28Traceback (most recent call last): File "D:\ySync\yScripts\_blender\2.80\scripts\addons\AssetGen\GA.py", line 689, in execute ``` ``` File "D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py", line 200, in __call__ ret = op_call(self.idname_py(), None, kw) ``` RuntimeError: Error: Traceback (most recent call last): ``` File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\__init__.py", line 552, in execute return export_fbx_bin.save(self, context, **keywords) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 3092, in save ret = save_single(operator, context.scene, context.depsgraph, filepath, **kwargs_mod) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2990, in save_single fbx_objects_elements(root, scene_data) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2799, in fbx_objects_elements fbx_data_object_elements(objects, ob_obj, scene_data) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1612, in fbx_data_object_elements elem_props_template_set(tmpl, props, "p_visibility", b"Visibility", float(not ob_obj.hide)) File "D:\Tools\Blender\Blender280\2.80\scripts\addons\io_scene_fbx\fbx_utils.py", line 987, in get_hide return self.bdata.hide_viewport if self._tag in {'OB', 'DP'} else self.bdata.hide ``` AttributeError: 'Object' object has no attribute 'hide_viewport' location: D:\Tools\Blender\Blender280\2.80\scripts\modules\bpy\ops.py:200
Author

Added subscriber: @dgsantana

Added subscriber: @dgsantana
Author

Setting line 987 of fbx_utils.by to

return self.bdata.hide_instance if self._tag in {'OB', 'DP'} else self.bdata.hide_get()

Seems to fix the problem. Is this correct, was hide_viewport replace by hide_instance?

Setting line 987 of fbx_utils.by to ``` return self.bdata.hide_instance if self._tag in {'OB', 'DP'} else self.bdata.hide_get() ``` Seems to fix the problem. Is this correct, was `hide_viewport` replace by `hide_instance`?
Dalai Felinto was assigned by Brecht Van Lommel 2019-05-11 12:25:57 +02:00

Added subscriber: @brecht

Added subscriber: @brecht

The add-ons and Python scripts should have been updated along with the outliner visibility updates. Someone will need to do a search for all usage of the properties.

Further, this API breakage should be mentioned in the meeting notes.

The add-ons and Python scripts should have been updated along with the outliner visibility updates. Someone will need to do a search for all usage of the properties. Further, this API breakage should be mentioned in the meeting notes.
Author

To save some time, maybe this could help you guys:
blender/master

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index f05cdc8f5f8..8c803973fe1 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4847,7 +4847,7 @@ class VIEW3D_PT_collections(Panel):
             if child.exclude:
                 continue

-            if child.collection.hide_viewport:
+            if child.collection.hide_instance:
                 continue

             if need_separator:

addons

diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py
index 5ea23001..358a2505 100644
--- a/add_curve_sapling/utils.py
+++ b/add_curve_sapling/utils.py
@@ -743,7 +743,7 @@ def create_armature(armAnim, leafP, cu, frameRate, leafMesh, leafObj, leafVertSi
     if previewArm:
         armMod.show_viewport = False
         arm.display_type = 'WIRE'
-        treeOb.hide_viewport = True
+        treeOb.hide_instance = True
     armMod.use_apply_on_spline = True
     armMod.object = armOb
     armMod.use_bone_envelopes = True
@@ -1997,7 +1997,7 @@ def addTree(props):
         if useArm:
             armMod = treeObj.modifiers.new('windSway', 'ARMATURE')
             if previewArm:
-                bpy.data.objects['treeArm'].hide_viewport = True
+                bpy.data.objects['treeArm'].hide_instance = True
                 bpy.data.armatures['tree'].display_type = 'STICK'
             armMod.object = bpy.data.objects['treeArm']
             armMod.use_bone_envelopes = False
diff --git a/archimesh/achm_door_maker.py b/archimesh/achm_door_maker.py
index 9a8644a7..946d938b 100644
--- a/archimesh/achm_door_maker.py
+++ b/archimesh/achm_door_maker.py
@@ -121,7 +121,7 @@ def update_object(self, context):
             # noinspection PyBroadException
             try:
                 # clear child data
-                child.hide_viewport = False  # must be visible to avoid bug
+                child.hide_instance = False  # must be visible to avoid bug
                 child.hide_render = False  # must be visible to avoid bug
                 old = child.data
                 child.select_set(True)
@@ -234,7 +234,7 @@ def shape_children(mainobject, update=False):
     myctrl.location.y = -((mp.frame_thick * 3) / 2)
     myctrl.location.z = -gap
     myctrl.display_type = 'BOUNDS'
-    myctrl.hide_viewport = False
+    myctrl.hide_instance = False
     myctrl.hide_render = True
     if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
         myctrl.cycles_visibility.camera = False
@@ -257,7 +257,7 @@ def shape_children(mainobject, update=False):
     myctrlbase.location.y = -0.15 - (mp.frame_thick / 3)
     myctrlbase.location.z = -0.10
     myctrlbase.display_type = 'BOUNDS'
-    myctrlbase.hide_viewport = False
+    myctrlbase.hide_instance = False
     myctrlbase.hide_render = True
     if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
         myctrlbase.cycles_visibility.camera = False
diff --git a/archimesh/achm_window_maker.py b/archimesh/achm_window_maker.py
index 2389387f..2e0c5ef4 100644
--- a/archimesh/achm_window_maker.py
+++ b/archimesh/achm_window_maker.py
@@ -120,7 +120,7 @@ def update_object(self, context):
             # noinspection PyBroadException
             try:
                 # clear child data
-                child.hide_viewport = False  # must be visible to avoid bug
+                child.hide_instance = False  # must be visible to avoid bug
                 child.hide_render = False  # must be visible to avoid bug
                 old = child.data
                 child.select_set(True)
@@ -217,7 +217,7 @@ def shape_mesh_and_create_children(mainobject, tmp_mesh, update=False):
     myctrl.location.y = -mp.depth * 3 / 2
     myctrl.location.z = 0
     myctrl.display_type = 'BOUNDS'
-    myctrl.hide_viewport = False
+    myctrl.hide_instance = False
     myctrl.hide_render = True
     if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
         myctrl.cycles_visibility.camera = False
diff --git a/archimesh/achm_window_panel.py b/archimesh/achm_window_panel.py
index b2050875..7b22caa3 100644
--- a/archimesh/achm_window_panel.py
+++ b/archimesh/achm_window_panel.py
@@ -291,7 +291,7 @@ def update_window(self, context):
             # noinspection PyBroadException
             try:
                 # clear child data
-                child.hide_viewport = False  # must be visible to avoid bug
+                child.hide_instance = False  # must be visible to avoid bug
                 child.hide_render = False  # must be visible to avoid bug
                 old = child.data
                 child.select_set(True)
@@ -395,7 +395,7 @@ def do_ctrl_box(myobject):
     myctrl.location.y = 0
     myctrl.location.z = 0
     myctrl.display_type = 'WIRE'
-    myctrl.hide_viewport = False
+    myctrl.hide_instance = False
     myctrl.hide_render = True
     if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}:
         myctrl.cycles_visibility.camera = False
diff --git a/archipack/archipack_door.py b/archipack/archipack_door.py
index 4d8b61ca..7755a753 100644
--- a/archipack/archipack_door.py
+++ b/archipack/archipack_door.py
@@ -1722,14 +1722,14 @@ class ARCHIPACK_OT_door_draw(ArchipackDrawTool, Operator):
 
         # hide hole from raycast
         if hole is not None:
-            o.hide_viewport = True
-            hole.hide_viewport = True
+            o.hide_instance = True
+            hole.hide_instance = True
 
         res, tM, wall, width, y, z_offset = self.mouse_hover_wall(context, event)
 
         if hole is not None:
-            o.hide_viewport = False
-            hole.hide_viewport = False
+            o.hide_instance = False
+            hole.hide_instance = False
 
         if res and d is not None:
             o.matrix_world = tM
diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py
index 8e3bfb43..81de807b 100644
--- a/archipack/archipack_wall2.py
+++ b/archipack/archipack_wall2.py
@@ -1637,11 +1637,11 @@ class archipack_wall2(ArchipackObject, Manipulable, PropertyGroup):
             p = tM @ seg.p0.to_3d()
             p.z = 0.01
             # prevent self intersect
-            o.hide_viewport = True
+            o.hide_instance = True
             res, pos, normal, face_index, r, matrix_world = context.scene.ray_cast(
                 p,
                 up)
-            o.hide_viewport = False
+            o.hide_instance = False
             # print("res:%s" % res)
             if res and r.data is not None and "archipack_roof" in r.data:
                 return r, r.data.archipack_roof[0]
@@ -1674,7 +1674,7 @@ class ARCHIPACK_OT_wall2_throttle_update(Operator):
                 if o is not None:
                     m = o.modifiers.get("AutoBoolean")
                     if m is not None:
-                        o.hide_viewport = False
+                        o.hide_instance = False
                         - o.display_type = 'TEXTURED'
                         - m.show_viewport = True
 
diff --git a/archipack/archipack_window.py b/archipack/archipack_window.py
index f9bb4903..6dcc3ebf 100644
--- a/archipack/archipack_window.py
+++ b/archipack/archipack_window.py
@@ -1914,14 +1914,14 @@ class ARCHIPACK_OT_window_draw(ArchipackDrawTool, Operator):
 
         # hide hole from raycast
         if hole is not None:
-            o.hide_viewport = True
-            hole.hide_viewport = True
+            o.hide_instance = True
+            hole.hide_instance = True
 
         res, tM, wall, width, y, z_offset = self.mouse_hover_wall(context, event)
 
         if hole is not None:
-            o.hide_viewport = False
-            hole.hide_viewport = False
+            o.hide_instance = False
+            hole.hide_instance = False
 
         if res and d is not None:
             o.matrix_world = tM
diff --git a/blenderkit/append_link.py b/blenderkit/append_link.py
index fef0c25f..c6cd0241 100644
--- a/blenderkit/append_link.py
+++ b/blenderkit/append_link.py
@@ -171,16 +171,16 @@ def append_objects(file_name, obnames=[], location=(0, 0, 0), link=False, **kwar
             obj.select_set(True)
             # we need to unhide object so make_local op can use those too.
             if link == True:
-                if obj.hide_viewport:
+                if obj.hide_instance:
                     hidden_objects.append(obj)
-                    obj.hide_viewport = False
+                    obj.hide_instance = False
             return_obs.append(obj)
 
     # Only after all objects are in scene! Otherwise gets broken relationships
     if link == True:
         bpy.ops.object.make_local(type='SELECT_OBJECT')
         for ob in hidden_objects:
-            ob.hide_viewport = True
+            ob.hide_instance = True
 
     if kwargs.get('rotation') is not None:
         main_object.rotation_euler = kwargs['rotation']
diff --git a/blenderkit/autothumb_material_bg.py b/blenderkit/autothumb_material_bg.py
index 824a0190..66f17e88 100644
--- a/blenderkit/autothumb_material_bg.py
+++ b/blenderkit/autothumb_material_bg.py
@@ -33,7 +33,7 @@ def render_thumbnails():
 
 def unhide_collection(cname):
     collection = bpy.context.scene.collection.children[cname]
-    collection.hide_viewport = False
+    collection.hide_instance = False
     collection.hide_render = False
     collection.hide_select = False
 
diff --git a/blenderkit/autothumb_model_bg.py b/blenderkit/autothumb_model_bg.py
index dc34d59c..a34c4c68 100644
--- a/blenderkit/autothumb_model_bg.py
+++ b/blenderkit/autothumb_model_bg.py
@@ -119,7 +119,7 @@ if __name__ == "__main__":
         }
 
         collection = bpy.context.scene.collection.children[snapdict[data['thumbnail_snap_to']]]
-        collection.hide_viewport = False
+        collection.hide_instance = False
         collection.hide_render = False
         collection.hide_select = False
 
diff --git a/camera_dolly_crane_rigs.py b/camera_dolly_crane_rigs.py
index 13025675..5f77049d 100644
--- a/camera_dolly_crane_rigs.py
+++ b/camera_dolly_crane_rigs.py
@@ -57,7 +57,7 @@ def create_widget(self, name):
         c.objects.link(obj)
     else:
         c = bpy.data.collections.new(collection_name)
-        c.hide_viewport = True
+        c.hide_instance = True
         c.hide_render = True
 
         # link the collection
diff --git a/io_export_dxf/export_dxf.py b/io_export_dxf/export_dxf.py
index 66913b6a..bb9a5b12 100644
--- a/io_export_dxf/export_dxf.py
+++ b/io_export_dxf/export_dxf.py
@@ -41,11 +41,11 @@ def exportDXF(context, filePath, settings):
         print("Generating Object list for export... (Root parents only)")
 
     scene = context.scene
-    
+
     if settings['onlySelected'] is True:
-        objects = (ob for ob in scene.objects if not ob.hide_viewport and ob.select_get() and ob.type in SUPPORTED_TYPES)
+        objects = (ob for ob in scene.objects if not ob.hide_instance and ob.select_get() and ob.type in SUPPORTED_TYPES)
     else:
-        objects = (ob for ob in scene.objects if not ob.hide_viewport and ob.type in SUPPORTED_TYPES)
+        objects = (ob for ob in scene.objects if not ob.hide_instance and ob.type in SUPPORTED_TYPES)
 
     if DEBUG: pydevd.settrace()
     mw = get_view_projection_matrix(context, settings)
diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py
index 1ba3219a..b3bfd93d 100644
--- a/io_import_dxf/dxfimport/do.py
+++ b/io_import_dxf/dxfimport/do.py
@@ -830,7 +830,7 @@ class Do:
                 if new_insert.name not in group.objects:
                     group.objects.link(new_insert)
                 if invisible is not None:
-                    new_insert.hide_viewport = bool(invisible)
+                    new_insert.hide_instance = bool(invisible)
                 if inserts is not None:
                     inserts.append(new_insert)
                 new_insert.parent = parent
@@ -940,7 +940,7 @@ class Do:
         # visibility
         if invisible is not None:
             for obj in objects:
-                obj.hide_viewport = bool(invisible)
+                obj.hide_instance = bool(invisible)
 
         # block transformations
         o.location = self.proj(entity.basepoint)
@@ -1010,7 +1010,7 @@ class Do:
         o.instance_collection = block_group
         group.objects.link(o)
         if invisible is not None:
-            o.hide_viewport = invisible
+            o.hide_instance = invisible
         o.location = self.proj(entity.basepoint)
         scene.collection.objects.link(o)
         # block_scene.update()
@@ -1079,9 +1079,9 @@ class Do:
 
         # visibility
         if invisible is None:
-            o.hide_viewport = bool(entity.invisible)
+            o.hide_instance = bool(entity.invisible)
         else:
-            o.hide_viewport = bool(invisible)
+            o.hide_instance = bool(invisible)
 
         # attributes
         if self.import_text:
diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index 19f32800..dc4da682 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -984,7 +984,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
 
     # XXX Not sure how much thatΓÇÖs useful now... :/
     def get_hide(self):
-        return self.bdata.hide_viewport if self._tag in {'OB', 'DP'} else self.bdata.hide
+        return self.bdata.hide_instance if self._tag in {'OB', 'DP'} else self.bdata.hide
     hide = property(get_hide)
 
     def get_parent(self):
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 26e31363..e8b1e8dc 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1948,7 +1948,7 @@ class FbxImportHelperNode:
         # Misc Attributes
 
         obj.color[0:3] = elem_props_get_color_rgb(fbx_props, b'Color', (0.8, 0.8, 0.8))
-        obj.hide_viewport = not bool(elem_props_get_visibility(fbx_props, b'Visibility', 1.0))
+        obj.hide_instance = not bool(elem_props_get_visibility(fbx_props, b'Visibility', 1.0))
 
         obj.matrix_basis = self.get_matrix()
 
@@ -2112,8 +2112,8 @@ class FbxImportHelperNode:
 
             # Switch to Edit mode.
             view_layer.objects.active = arm
-            is_hidden = arm.hide_viewport
-            arm.hide_viewport = False  # Can't switch to Edit mode hidden objects...
+            is_hidden = arm.hide_instance
+            arm.hide_instance = False  # Can't switch to Edit mode hidden objects...
             bpy.ops.object.mode_set(mode='EDIT')
 
             for child in self.children:
@@ -2124,7 +2124,7 @@ class FbxImportHelperNode:
 
             bpy.ops.object.mode_set(mode='OBJECT')
 
-            arm.hide_viewport = is_hidden
+            arm.hide_instance = is_hidden
 
             # Set pose matrix
             for child in self.children:
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
index e87912ff..92837c85 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
@@ -128,8 +128,8 @@ class BlenderScene():
 
                     # Avoid rotation bug if collection is hidden or disabled
                     if gltf.blender_active_collection is not None:
-                        gltf.collection_hide_viewport = bpy.data.collections[gltf.blender_active_collection].hide_viewport
-                        bpy.data.collections[gltf.blender_active_collection].hide_viewport = False
+                        gltf.collection_hide_viewport = bpy.data.collections[gltf.blender_active_collection].hide_instance
+                        bpy.data.collections[gltf.blender_active_collection].hide_instance = False
                         # TODO for visibility ... but seems not exposed on bpy for now
 
                     for node_idx in list_nodes:
@@ -156,7 +156,7 @@ class BlenderScene():
 
                     # Restore collection hiden / disabled values
                     if gltf.blender_active_collection is not None:
-                        bpy.data.collections[gltf.blender_active_collection].hide_viewport = gltf.collection_hide_viewport
+                        bpy.data.collections[gltf.blender_active_collection].hide_instance = gltf.collection_hide_viewport
                         # TODO restore visibility when expose in bpy
 
         # Make first root object the new active one
diff --git a/object_boolean_tools.py b/object_boolean_tools.py
index 28e9ebc9..e5e8ef8d 100644
--- a/object_boolean_tools.py
+++ b/object_boolean_tools.py
@@ -51,7 +51,7 @@ def update_BoolHide(self, context):
     hide_state = context.scene.BoolHide
 
     for o in objs:
-        o.hide_viewport = hide_state
+        o.hide_instance = hide_state
 
 
 # Object is a Canvas
diff --git a/object_carver/carver_utils.py b/object_carver/carver_utils.py
index 67c5769d..7d22a1a8 100644
--- a/object_carver/carver_utils.py
+++ b/object_carver/carver_utils.py
@@ -530,11 +530,11 @@ def Undo(self):
 	for o in self.UList[self.UList_Index]:
 		if o[1] == "REBOOL":
 			o[0].select_set(True)
-			o[0].hide_viewport = False
+			o[0].hide_instance = False
 
 		if o[1] == "DUPLICATE":
 			o[0].select_set(True)
-			o[0].hide_viewport = False
+			o[0].hide_instance = False
 
 	bpy.ops.object.delete(use_global=False)
 
@@ -597,7 +597,7 @@ def duplicateObject(self):
 	ob_new.rotation_mode = 'XYZ'
 
 	if (ob_new.display_type == "WIRE") and (self.BrushSolidify is False):
-		ob_new.hide_viewport = True
+		ob_new.hide_instance = True
 
 	if self.BrushSolidify:
 		ob_new.display_type = "SOLID"
diff --git a/rigify/legacy/utils.py b/rigify/legacy/utils.py
index f74a7abf..52fd4109 100644
--- a/rigify/legacy/utils.py
+++ b/rigify/legacy/utils.py
@@ -960,7 +960,7 @@ def ensure_widget_collection(context):
         - ------------------------------------------
         - Create the widget collection
         widget_collection = bpy.data.collections.new(wgts_collection_name)
-        widget_collection.hide_viewport = True
+        widget_collection.hide_instance = True
         widget_collection.hide_render = True
 
         widget_layer_collection = None
diff --git a/rigify/utils/collections.py b/rigify/utils/collections.py
index 5682ec64..60b066b6 100644
--- a/rigify/utils/collections.py
+++ b/rigify/utils/collections.py
@@ -46,7 +46,7 @@ def list_layer_collections(layer_collection, visible=False, selectable=False):
         return []
 
     collection = layer_collection.collection
-    is_visible = not (layer_collection.hide_viewport or collection.hide_viewport)
+    is_visible = not (layer_collection.hide_instance or collection.hide_instance)
     is_selectable = is_visible and not collection.hide_select
 
     if (selectable and not is_selectable) or (visible and not is_visible):
@@ -77,7 +77,7 @@ def ensure_widget_collection(context):
         - ------------------------------------------
         - Create the widget collection
         widget_collection = bpy.data.collections.new(wgts_collection_name)
-        widget_collection.hide_viewport = True
+        widget_collection.hide_instance = True
         widget_collection.hide_render = True
 
         widget_layer_collection = None
To save some time, maybe this could help you guys: blender/master ``` diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index f05cdc8f5f8..8c803973fe1 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4847,7 +4847,7 @@ class VIEW3D_PT_collections(Panel): if child.exclude: continue - if child.collection.hide_viewport: + if child.collection.hide_instance: continue if need_separator: ``` addons ``` diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py index 5ea23001..358a2505 100644 --- a/add_curve_sapling/utils.py +++ b/add_curve_sapling/utils.py @@ -743,7 +743,7 @@ def create_armature(armAnim, leafP, cu, frameRate, leafMesh, leafObj, leafVertSi if previewArm: armMod.show_viewport = False arm.display_type = 'WIRE' - treeOb.hide_viewport = True + treeOb.hide_instance = True armMod.use_apply_on_spline = True armMod.object = armOb armMod.use_bone_envelopes = True @@ -1997,7 +1997,7 @@ def addTree(props): if useArm: armMod = treeObj.modifiers.new('windSway', 'ARMATURE') if previewArm: - bpy.data.objects['treeArm'].hide_viewport = True + bpy.data.objects['treeArm'].hide_instance = True bpy.data.armatures['tree'].display_type = 'STICK' armMod.object = bpy.data.objects['treeArm'] armMod.use_bone_envelopes = False diff --git a/archimesh/achm_door_maker.py b/archimesh/achm_door_maker.py index 9a8644a7..946d938b 100644 --- a/archimesh/achm_door_maker.py +++ b/archimesh/achm_door_maker.py @@ -121,7 +121,7 @@ def update_object(self, context): # noinspection PyBroadException try: # clear child data - child.hide_viewport = False # must be visible to avoid bug + child.hide_instance = False # must be visible to avoid bug child.hide_render = False # must be visible to avoid bug old = child.data child.select_set(True) @@ -234,7 +234,7 @@ def shape_children(mainobject, update=False): myctrl.location.y = -((mp.frame_thick * 3) / 2) myctrl.location.z = -gap myctrl.display_type = 'BOUNDS' - myctrl.hide_viewport = False + myctrl.hide_instance = False myctrl.hide_render = True if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: myctrl.cycles_visibility.camera = False @@ -257,7 +257,7 @@ def shape_children(mainobject, update=False): myctrlbase.location.y = -0.15 - (mp.frame_thick / 3) myctrlbase.location.z = -0.10 myctrlbase.display_type = 'BOUNDS' - myctrlbase.hide_viewport = False + myctrlbase.hide_instance = False myctrlbase.hide_render = True if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: myctrlbase.cycles_visibility.camera = False diff --git a/archimesh/achm_window_maker.py b/archimesh/achm_window_maker.py index 2389387f..2e0c5ef4 100644 --- a/archimesh/achm_window_maker.py +++ b/archimesh/achm_window_maker.py @@ -120,7 +120,7 @@ def update_object(self, context): # noinspection PyBroadException try: # clear child data - child.hide_viewport = False # must be visible to avoid bug + child.hide_instance = False # must be visible to avoid bug child.hide_render = False # must be visible to avoid bug old = child.data child.select_set(True) @@ -217,7 +217,7 @@ def shape_mesh_and_create_children(mainobject, tmp_mesh, update=False): myctrl.location.y = -mp.depth * 3 / 2 myctrl.location.z = 0 myctrl.display_type = 'BOUNDS' - myctrl.hide_viewport = False + myctrl.hide_instance = False myctrl.hide_render = True if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: myctrl.cycles_visibility.camera = False diff --git a/archimesh/achm_window_panel.py b/archimesh/achm_window_panel.py index b2050875..7b22caa3 100644 --- a/archimesh/achm_window_panel.py +++ b/archimesh/achm_window_panel.py @@ -291,7 +291,7 @@ def update_window(self, context): # noinspection PyBroadException try: # clear child data - child.hide_viewport = False # must be visible to avoid bug + child.hide_instance = False # must be visible to avoid bug child.hide_render = False # must be visible to avoid bug old = child.data child.select_set(True) @@ -395,7 +395,7 @@ def do_ctrl_box(myobject): myctrl.location.y = 0 myctrl.location.z = 0 myctrl.display_type = 'WIRE' - myctrl.hide_viewport = False + myctrl.hide_instance = False myctrl.hide_render = True if bpy.context.scene.render.engine in {'CYCLES', 'BLENDER_EEVEE'}: myctrl.cycles_visibility.camera = False diff --git a/archipack/archipack_door.py b/archipack/archipack_door.py index 4d8b61ca..7755a753 100644 --- a/archipack/archipack_door.py +++ b/archipack/archipack_door.py @@ -1722,14 +1722,14 @@ class ARCHIPACK_OT_door_draw(ArchipackDrawTool, Operator): # hide hole from raycast if hole is not None: - o.hide_viewport = True - hole.hide_viewport = True + o.hide_instance = True + hole.hide_instance = True res, tM, wall, width, y, z_offset = self.mouse_hover_wall(context, event) if hole is not None: - o.hide_viewport = False - hole.hide_viewport = False + o.hide_instance = False + hole.hide_instance = False if res and d is not None: o.matrix_world = tM diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py index 8e3bfb43..81de807b 100644 --- a/archipack/archipack_wall2.py +++ b/archipack/archipack_wall2.py @@ -1637,11 +1637,11 @@ class archipack_wall2(ArchipackObject, Manipulable, PropertyGroup): p = tM @ seg.p0.to_3d() p.z = 0.01 # prevent self intersect - o.hide_viewport = True + o.hide_instance = True res, pos, normal, face_index, r, matrix_world = context.scene.ray_cast( p, up) - o.hide_viewport = False + o.hide_instance = False # print("res:%s" % res) if res and r.data is not None and "archipack_roof" in r.data: return r, r.data.archipack_roof[0] @@ -1674,7 +1674,7 @@ class ARCHIPACK_OT_wall2_throttle_update(Operator): if o is not None: m = o.modifiers.get("AutoBoolean") if m is not None: - o.hide_viewport = False + o.hide_instance = False - o.display_type = 'TEXTURED' - m.show_viewport = True diff --git a/archipack/archipack_window.py b/archipack/archipack_window.py index f9bb4903..6dcc3ebf 100644 --- a/archipack/archipack_window.py +++ b/archipack/archipack_window.py @@ -1914,14 +1914,14 @@ class ARCHIPACK_OT_window_draw(ArchipackDrawTool, Operator): # hide hole from raycast if hole is not None: - o.hide_viewport = True - hole.hide_viewport = True + o.hide_instance = True + hole.hide_instance = True res, tM, wall, width, y, z_offset = self.mouse_hover_wall(context, event) if hole is not None: - o.hide_viewport = False - hole.hide_viewport = False + o.hide_instance = False + hole.hide_instance = False if res and d is not None: o.matrix_world = tM diff --git a/blenderkit/append_link.py b/blenderkit/append_link.py index fef0c25f..c6cd0241 100644 --- a/blenderkit/append_link.py +++ b/blenderkit/append_link.py @@ -171,16 +171,16 @@ def append_objects(file_name, obnames=[], location=(0, 0, 0), link=False, **kwar obj.select_set(True) # we need to unhide object so make_local op can use those too. if link == True: - if obj.hide_viewport: + if obj.hide_instance: hidden_objects.append(obj) - obj.hide_viewport = False + obj.hide_instance = False return_obs.append(obj) # Only after all objects are in scene! Otherwise gets broken relationships if link == True: bpy.ops.object.make_local(type='SELECT_OBJECT') for ob in hidden_objects: - ob.hide_viewport = True + ob.hide_instance = True if kwargs.get('rotation') is not None: main_object.rotation_euler = kwargs['rotation'] diff --git a/blenderkit/autothumb_material_bg.py b/blenderkit/autothumb_material_bg.py index 824a0190..66f17e88 100644 --- a/blenderkit/autothumb_material_bg.py +++ b/blenderkit/autothumb_material_bg.py @@ -33,7 +33,7 @@ def render_thumbnails(): def unhide_collection(cname): collection = bpy.context.scene.collection.children[cname] - collection.hide_viewport = False + collection.hide_instance = False collection.hide_render = False collection.hide_select = False diff --git a/blenderkit/autothumb_model_bg.py b/blenderkit/autothumb_model_bg.py index dc34d59c..a34c4c68 100644 --- a/blenderkit/autothumb_model_bg.py +++ b/blenderkit/autothumb_model_bg.py @@ -119,7 +119,7 @@ if __name__ == "__main__": } collection = bpy.context.scene.collection.children[snapdict[data['thumbnail_snap_to']]] - collection.hide_viewport = False + collection.hide_instance = False collection.hide_render = False collection.hide_select = False diff --git a/camera_dolly_crane_rigs.py b/camera_dolly_crane_rigs.py index 13025675..5f77049d 100644 --- a/camera_dolly_crane_rigs.py +++ b/camera_dolly_crane_rigs.py @@ -57,7 +57,7 @@ def create_widget(self, name): c.objects.link(obj) else: c = bpy.data.collections.new(collection_name) - c.hide_viewport = True + c.hide_instance = True c.hide_render = True # link the collection diff --git a/io_export_dxf/export_dxf.py b/io_export_dxf/export_dxf.py index 66913b6a..bb9a5b12 100644 --- a/io_export_dxf/export_dxf.py +++ b/io_export_dxf/export_dxf.py @@ -41,11 +41,11 @@ def exportDXF(context, filePath, settings): print("Generating Object list for export... (Root parents only)") scene = context.scene - + if settings['onlySelected'] is True: - objects = (ob for ob in scene.objects if not ob.hide_viewport and ob.select_get() and ob.type in SUPPORTED_TYPES) + objects = (ob for ob in scene.objects if not ob.hide_instance and ob.select_get() and ob.type in SUPPORTED_TYPES) else: - objects = (ob for ob in scene.objects if not ob.hide_viewport and ob.type in SUPPORTED_TYPES) + objects = (ob for ob in scene.objects if not ob.hide_instance and ob.type in SUPPORTED_TYPES) if DEBUG: pydevd.settrace() mw = get_view_projection_matrix(context, settings) diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py index 1ba3219a..b3bfd93d 100644 --- a/io_import_dxf/dxfimport/do.py +++ b/io_import_dxf/dxfimport/do.py @@ -830,7 +830,7 @@ class Do: if new_insert.name not in group.objects: group.objects.link(new_insert) if invisible is not None: - new_insert.hide_viewport = bool(invisible) + new_insert.hide_instance = bool(invisible) if inserts is not None: inserts.append(new_insert) new_insert.parent = parent @@ -940,7 +940,7 @@ class Do: # visibility if invisible is not None: for obj in objects: - obj.hide_viewport = bool(invisible) + obj.hide_instance = bool(invisible) # block transformations o.location = self.proj(entity.basepoint) @@ -1010,7 +1010,7 @@ class Do: o.instance_collection = block_group group.objects.link(o) if invisible is not None: - o.hide_viewport = invisible + o.hide_instance = invisible o.location = self.proj(entity.basepoint) scene.collection.objects.link(o) # block_scene.update() @@ -1079,9 +1079,9 @@ class Do: # visibility if invisible is None: - o.hide_viewport = bool(entity.invisible) + o.hide_instance = bool(entity.invisible) else: - o.hide_viewport = bool(invisible) + o.hide_instance = bool(invisible) # attributes if self.import_text: diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py index 19f32800..dc4da682 100644 --- a/io_scene_fbx/fbx_utils.py +++ b/io_scene_fbx/fbx_utils.py @@ -984,7 +984,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper): # XXX Not sure how much thatΓÇÖs useful now... :/ def get_hide(self): - return self.bdata.hide_viewport if self._tag in {'OB', 'DP'} else self.bdata.hide + return self.bdata.hide_instance if self._tag in {'OB', 'DP'} else self.bdata.hide hide = property(get_hide) def get_parent(self): diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 26e31363..e8b1e8dc 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -1948,7 +1948,7 @@ class FbxImportHelperNode: # Misc Attributes obj.color[0:3] = elem_props_get_color_rgb(fbx_props, b'Color', (0.8, 0.8, 0.8)) - obj.hide_viewport = not bool(elem_props_get_visibility(fbx_props, b'Visibility', 1.0)) + obj.hide_instance = not bool(elem_props_get_visibility(fbx_props, b'Visibility', 1.0)) obj.matrix_basis = self.get_matrix() @@ -2112,8 +2112,8 @@ class FbxImportHelperNode: # Switch to Edit mode. view_layer.objects.active = arm - is_hidden = arm.hide_viewport - arm.hide_viewport = False # Can't switch to Edit mode hidden objects... + is_hidden = arm.hide_instance + arm.hide_instance = False # Can't switch to Edit mode hidden objects... bpy.ops.object.mode_set(mode='EDIT') for child in self.children: @@ -2124,7 +2124,7 @@ class FbxImportHelperNode: bpy.ops.object.mode_set(mode='OBJECT') - arm.hide_viewport = is_hidden + arm.hide_instance = is_hidden # Set pose matrix for child in self.children: diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py index e87912ff..92837c85 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py @@ -128,8 +128,8 @@ class BlenderScene(): # Avoid rotation bug if collection is hidden or disabled if gltf.blender_active_collection is not None: - gltf.collection_hide_viewport = bpy.data.collections[gltf.blender_active_collection].hide_viewport - bpy.data.collections[gltf.blender_active_collection].hide_viewport = False + gltf.collection_hide_viewport = bpy.data.collections[gltf.blender_active_collection].hide_instance + bpy.data.collections[gltf.blender_active_collection].hide_instance = False # TODO for visibility ... but seems not exposed on bpy for now for node_idx in list_nodes: @@ -156,7 +156,7 @@ class BlenderScene(): # Restore collection hiden / disabled values if gltf.blender_active_collection is not None: - bpy.data.collections[gltf.blender_active_collection].hide_viewport = gltf.collection_hide_viewport + bpy.data.collections[gltf.blender_active_collection].hide_instance = gltf.collection_hide_viewport # TODO restore visibility when expose in bpy # Make first root object the new active one diff --git a/object_boolean_tools.py b/object_boolean_tools.py index 28e9ebc9..e5e8ef8d 100644 --- a/object_boolean_tools.py +++ b/object_boolean_tools.py @@ -51,7 +51,7 @@ def update_BoolHide(self, context): hide_state = context.scene.BoolHide for o in objs: - o.hide_viewport = hide_state + o.hide_instance = hide_state # Object is a Canvas diff --git a/object_carver/carver_utils.py b/object_carver/carver_utils.py index 67c5769d..7d22a1a8 100644 --- a/object_carver/carver_utils.py +++ b/object_carver/carver_utils.py @@ -530,11 +530,11 @@ def Undo(self): for o in self.UList[self.UList_Index]: if o[1] == "REBOOL": o[0].select_set(True) - o[0].hide_viewport = False + o[0].hide_instance = False if o[1] == "DUPLICATE": o[0].select_set(True) - o[0].hide_viewport = False + o[0].hide_instance = False bpy.ops.object.delete(use_global=False) @@ -597,7 +597,7 @@ def duplicateObject(self): ob_new.rotation_mode = 'XYZ' if (ob_new.display_type == "WIRE") and (self.BrushSolidify is False): - ob_new.hide_viewport = True + ob_new.hide_instance = True if self.BrushSolidify: ob_new.display_type = "SOLID" diff --git a/rigify/legacy/utils.py b/rigify/legacy/utils.py index f74a7abf..52fd4109 100644 --- a/rigify/legacy/utils.py +++ b/rigify/legacy/utils.py @@ -960,7 +960,7 @@ def ensure_widget_collection(context): - ------------------------------------------ - Create the widget collection widget_collection = bpy.data.collections.new(wgts_collection_name) - widget_collection.hide_viewport = True + widget_collection.hide_instance = True widget_collection.hide_render = True widget_layer_collection = None diff --git a/rigify/utils/collections.py b/rigify/utils/collections.py index 5682ec64..60b066b6 100644 --- a/rigify/utils/collections.py +++ b/rigify/utils/collections.py @@ -46,7 +46,7 @@ def list_layer_collections(layer_collection, visible=False, selectable=False): return [] collection = layer_collection.collection - is_visible = not (layer_collection.hide_viewport or collection.hide_viewport) + is_visible = not (layer_collection.hide_instance or collection.hide_instance) is_selectable = is_visible and not collection.hide_select if (selectable and not is_selectable) or (visible and not is_visible): @@ -77,7 +77,7 @@ def ensure_widget_collection(context): - ------------------------------------------ - Create the widget collection widget_collection = bpy.data.collections.new(wgts_collection_name) - widget_collection.hide_viewport = True + widget_collection.hide_instance = True widget_collection.hide_render = True widget_layer_collection = None ```

I reverted the API change for now. I want to be sure we are settle on the new name (hide_instance) before moving further with the original proposed change.

I reverted the API change for now. I want to be sure we are settle on the new name (hide_instance) before moving further with the original proposed change.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Marking these as resolved for now, this should not break again when we do the API change.

Marking these as resolved for now, this should not break again when we do the API change.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#64474
No description provided.