Return an error if the placeholder export are empty or no children collection.

Update the docstring operator to be more clear.
This commit is contained in:
2024-05-31 10:36:28 +02:00
parent e380e894d7
commit d20a7d2198
+8 -2
View File
@@ -5,7 +5,8 @@ from pathlib import Path
class ExportForFange(bpy.types.Operator):
"""Export a building for fange"""
"""Export a building for fange.
Requiert your blend file are write on your hard-drive."""
bl_idname = 'graou.building_export'
bl_label = 'Easily export a building asset'
@@ -37,7 +38,12 @@ class ExportForFange(bpy.types.Operator):
self.report({'ERROR'}, 'Can\'t find the asset category.')
return {'CANCELLED'}
if len(self.coll_layout.collection_children):
if not len(self.coll_layout.children):
self.report({'WARNING'}, 'No children collection, nothing can be exported.')
return {'CANCELLED'}
if not len(self.coll_layout.collection_children):
for coll in self.coll_layout.children:
print(f'[Pipeline] Update "{coll.name}" mesh')
child = bpy.data.collections.get(coll.name)