Change how the color collection are config

This commit is contained in:
2024-05-09 02:28:50 +02:00
parent 5585c8916c
commit 4852d57ef6
+5 -4
View File
@@ -12,15 +12,16 @@ class ConfigBlendScene(bpy.types.Operator):
self._outline = Outline() self._outline = Outline()
def execute(self, context): def execute(self, context):
print(f'[Pipeline] Generate outline')
for key, value in self._outline.collections.items(): for key, value in self._outline.collections.items():
print(f'[Pipeline] Check the collection {key}')
collection = bpy.data.collections.get(key) collection = bpy.data.collections.get(key)
# Make the collection if this item not exist
if collection is None: if collection is None:
collection = bpy.data.collections.new(value.name) collection = bpy.data.collections.new(value.name)
collection.color_tag = value.color
context.scene.collection.children.link(collection) 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'} return {'FINISHED'}