Support empty export

This commit is contained in:
2024-05-09 16:00:41 +02:00
parent e959960e42
commit c000fae4a8
+1 -4
View File
@@ -40,19 +40,16 @@ class ExportForFange(bpy.types.Operator):
print(f'[Pipeline] Update "{coll.name}" mesh')
child = bpy.data.collections.get(coll.name)
print(f'[Pipeline] Select all mesh inside the collection "{child.name}"')
for ob in child.all_objects:
print(f'\tLook "{ob.name}", his type are "{type(ob.data)}"')
# TODO Support another type object, not only SM/SK
if isinstance(ob.data, bpy.types.Mesh):
if ob.type == 'MESH' or 'EMPTY':
ob.select_set(True)
abs_export = self.category.joinpath(self.asset, "Meshes")
if not abs_export.exists():
abs_export.mkdir()
print(f'[Pipeline] Export fbx here "{abs_export.joinpath(f"SM_{coll.name}.fbx").as_posix()}"')
# TODO Use a preset system
bpy.ops.export_scene.fbx(filepath=abs_export.joinpath(f"SM_{coll.name}.fbx").as_posix(),
use_selection=True,