generated from stilobique/BlenderTemplate
Change how the color collection are config
This commit is contained in:
@@ -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'}
|
||||||
|
|||||||
Reference in New Issue
Block a user