From 1062f7b1f6aeefd08af5ed80eeaa1886df2e6a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 4 Sep 2018 15:50:19 +0200 Subject: [PATCH] Make biped file work with Blender 2.80 collections - Import collection rather than group. - Changed the blenrig_biped.blend file so that it has nested collections, rather than setting layers after importing it. --- blenrig_biped/ops_blenrig_biped_add.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/blenrig_biped/ops_blenrig_biped_add.py b/blenrig_biped/ops_blenrig_biped_add.py index c986652..a897a0e 100644 --- a/blenrig_biped/ops_blenrig_biped_add.py +++ b/blenrig_biped/ops_blenrig_biped_add.py @@ -20,27 +20,11 @@ class Operator_BlenRig5_Add_Biped(bpy.types.Operator): # Link the top-level collection into the file. with bpy.data.libraries.load(filepath, link=False) as (data_from, data_to): - data_to.collections = ["BlenRig_Master_Collection"] - - hide_collections = ['Mesh_Deform_Cage', 'Lattices', 'Proxy_Model', 'Bone_Shapes'] + data_to.collections = ["blenrig_biped"] # Add the collection(s) to the scene. for collection in data_to.collections: scene.collection.children.link(collection) - for coll in collection.children: - if coll.name in hide_collections: - coll.hide_viewport = True - #Context Override - #areas = [area for area in bpy.context.screen.areas if area.type == 'OUTLINER'] - - #if areas: - #regions = [region for region in areas[0].regions if region.type == 'VIEW_3D'] - - #if regions: - #override = {'area': areas[0], - #'region': regions[0]} - #bpy.context.view_layer.active_layer_collection = context.view_layer.layer_collection.children[coll.name] - #bpy.ops.outliner.show_one_level(open=False) def execute(self, context): self.import_blenrig_biped(context)