Blender exporter bugfixes + Gravitium v1

This commit is contained in:
Jérémie GABOLDE 2024-12-09 23:00:10 +01:00
parent 8736d3f4b7
commit 75d718f880
20 changed files with 62 additions and 57 deletions

BIN
AssetSources/Meshes/STM_Gravitium_Box_01.fbx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
AssetSources/Meshes/STM_Gravitium_Rock_01.blend (Stored with Git LFS) Normal file

Binary file not shown.

BIN
AssetSources/Meshes/STM_Gravitium_Rock_01.fbx (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,7 +11,7 @@ bl_info = \
"blender": (4, 2, 0),
"location": "View 3D > Object Mode > Unreal Exporter",
"description":
"Bartch exporter for Unreal Engine",
"Batch exporter for Unreal Engine",
"warning": "",
"wiki_url": "",
"tracker_url": "",
@ -87,33 +87,28 @@ class OBJECT_OT_CombineExport(bpy.types.Operator):
def invoke(self, context, event):
CombineExport(context.scene.ue_exporter.path)
self.report({'INFO'}, 'Exported')
self.report({'INFO'}, 'Did nothing (yet)')
return {'FINISHED'}
def SeparateExport(exportFolder):
#collection_collision_export = bpy.ops.collection.create("Collision.Export")
collection_collision_export = bpy.data.collections.new("Collision.Export")
bpy.context.scene.collection.children.link(collection_collision_export)
objects = bpy.data.collections[bpy.context.scene.ue_exporter.source_collection].all_objects
#for some absurd logic it works only if objects comes from the selection, no time to explain...
#for object in objects:
# object.select_set(True)
#objects = bpy.context.selected_objects
bpy.ops.object.select_all(action='DESELECT')
for object in list(objects):
if object.type not in ['MESH']:
continue
collision = bpy.data.objects['UCX_' + object.name]
export_collision = collision.copy()
export_collision.data = collision.data.copy()
export_collision.animation_data_clear()
bpy.context.collection.objects.link(export_collision)
#bpy.data.collections['Collision.Export'].objects.link(export_collision)
collection_collision_export.objects.link(export_collision)
export_collision.select_set(True)
bpy.context.view_layer.objects.active = export_collision
bpy.ops.object.modifier_apply(modifier='GeometryNodes')
bpy.ops.mesh.separate(type='LOOSE')
if (('UCX_' + object.name) in bpy.data.objects):
collision = bpy.data.objects['UCX_' + object.name]
export_collision = collision.copy()
export_collision.data = collision.data.copy()
export_collision.animation_data_clear()
bpy.context.collection.objects.link(export_collision)
collection_collision_export.objects.link(export_collision)
export_collision.select_set(True)
bpy.context.view_layer.objects.active = export_collision
bpy.ops.object.modifier_apply(modifier='GeometryNodes')
bpy.ops.mesh.separate(type='LOOSE')
object.select_set(True)
exportName = bpy.path.abspath(exportFolder) + object.name + '.fbx'
bpy.ops.export_scene.fbx(filepath=exportName, use_selection=True, mesh_smooth_type='FACE')
@ -125,27 +120,8 @@ def SeparateExport(exportFolder):
bpy.data.collections.remove(collection_collision_export)
def CombineExport(exportFolder):
objects = bpy.data.collections[bpy.context.scene.ue_exporter.source_collection].all_objects
#for some absurd logic it works only if objects comes from the selection, no time to explain...
for object in objects:
object.select_set(True)
bpy.ops.object.select_all(action='DESELECT')
isOrigin = bpy.context.scene.ue_exporter.local_origin
origLocs = []
for object in objects:
object.select_set(True)
if isOrigin:
origLocs.append(object.location.copy())
object.location = (0.0,0.0,0.0)
object.name = object.name
exportName = exportFolder + bpy.context.active_object.name + '.fbx'
bpy.ops.export_scene.fbx(filepath=exportName, use_selection=True, mesh_smooth_type='FACE')
for object in objects:
if isOrigin:
object.location = origLocs.pop(0)
return
#TBD
classes = (
VIEW3D_PT_PanelExportAll,

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

BIN
Content/Environment/Geology/STM_Gravitium_Box_01.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Environment/Geology/STM_Gravitium_Rock_01.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/LevelDesign/LevelElements/Gravitium/BP_Spline.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Maps/Gym/Gym_Environment.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Maps/Gym/Gym_Gravitium.umap (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Maps/Gym/Gym_Template.umap (Stored with Git LFS)

Binary file not shown.