From 1146fa5e6c2f43a87f28814ec458d15b69398b8a Mon Sep 17 00:00:00 2001 From: JoshQuake Date: Wed, 24 Jul 2024 19:34:33 -0700 Subject: [PATCH] added support for particle hair --- .../extensions/use_collections_as_folders.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/addons/send2ue/resources/extensions/use_collections_as_folders.py b/src/addons/send2ue/resources/extensions/use_collections_as_folders.py index bf937299..288a6bc6 100644 --- a/src/addons/send2ue/resources/extensions/use_collections_as_folders.py +++ b/src/addons/send2ue/resources/extensions/use_collections_as_folders.py @@ -98,10 +98,14 @@ def pre_groom_export(self, asset_data, properties): object_name = asset_data.get('_object_name') if object_name: scene_object = bpy.data.objects.get(object_name) + particle_object_name = asset_data.get('_particle_object_name') + if particle_object_name: + scene_object = utilities.get_mesh_object_for_groom_name(object_name) + asset_name = utilities.get_asset_name(object_name, properties) _, file_extension = os.path.splitext(asset_data.get('file_path')) - export_path = self.get_full_export_path(properties, UnrealTypes.GROOM, scene_object) + export_path = self.get_full_export_path(properties, asset_type, scene_object) file_name_with_extension = f'{asset_name}{file_extension}' file_path = os.path.join(export_path, file_name_with_extension) self.update_asset_data({ @@ -159,8 +163,12 @@ def pre_import(self, asset_data, properties): object_name = asset_data.get('_object_name') if object_name: scene_object = bpy.data.objects.get(object_name) + particle_object_name = asset_data.get('_particle_object_name') + if particle_object_name: + scene_object = utilities.get_mesh_object_for_groom_name(object_name) + asset_name = utilities.get_asset_name(object_name, properties) - import_path = self.get_full_import_path(properties, UnrealTypes.GROOM, scene_object) + import_path = self.get_full_import_path(properties, asset_type, scene_object) self.update_asset_data({ 'asset_folder': import_path, 'asset_path': f'{import_path}{asset_name}'