Files
Blender-Fange-Pipeline/Fange Pipeline/operators/outline.py
T
stilobique 4f539912eb Refactoring model inside properties
Make a Property Group for blender
2024-05-12 18:15:19 +02:00

28 lines
860 B
Python

import bpy
from ..properties.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):
for key, value in self._outline.collections.items():
collection = bpy.data.collections.get(key)
# Make the collection if this item not exist
if collection is None:
collection = bpy.data.collections.new(value.name)
context.scene.collection.children.link(collection)
# Check if the color are correctly setup, if not update-it
if collection.color_tag is not value.color:
collection.color_tag = value.color
return {'FINISHED'}