Archived
0
0

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.
This commit is contained in:
2018-09-04 15:50:19 +02:00
committed by Demeter Dzadik
parent f2af22e5f7
commit 1062f7b1f6

View File

@@ -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)