generated from stilobique/BlenderTemplate
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:
@@ -5,7 +5,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
class ExportForFange(bpy.types.Operator):
|
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_idname = 'graou.building_export'
|
||||||
bl_label = 'Easily export a building asset'
|
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.')
|
self.report({'ERROR'}, 'Can\'t find the asset category.')
|
||||||
return {'CANCELLED'}
|
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:
|
for coll in self.coll_layout.children:
|
||||||
print(f'[Pipeline] Update "{coll.name}" mesh')
|
print(f'[Pipeline] Update "{coll.name}" mesh')
|
||||||
child = bpy.data.collections.get(coll.name)
|
child = bpy.data.collections.get(coll.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user