import bpy from ..models import Outline class ConfigBlendScene(bpy.types.Operator): """Init the opened blend scene""" bl_idname = 'graou.build_scene' bl_label = 'Config or update the outline' def __init__(self): self._outline = Outline() def execute(self, context): print(f'[Pipeline] Generate outline') for key, value in self._outline.collections.items(): print(f'[Pipeline] Check the collection {key}') collection = bpy.data.collections.get(key) if collection is None: collection = bpy.data.collections.new(value.name) collection.color_tag = value.color context.scene.collection.children.link(collection) return {'FINISHED'}