@@ -48,20 +48,23 @@ def dks_ue_get_export_path():
4848
4949 return _export_path
5050
51+ def dks_ue_get_file_name ():
52+
53+ return bpy .path .basename (bpy .context .blend_data .filepath ).replace ('.blend' ,'' )
54+
5155def dks_ue_filename (self , context ):
5256
53- _object_name = bpy . path . basename ( bpy . context . blend_data . filepath ). replace ( '.blend' , '' )
57+ _object_name = dks_ue_get_file_name ( )
5458 _export_path = dks_ue_get_export_path ()
5559 _export_file = _export_path + _object_name + '.fbx'
5660
5761 return _export_file
5862
59-
6063def screenshot (self , context ):
6164
6265 global _preferences
6366
64- _object_name = bpy . path . basename ( bpy . context . blend_data . filepath ). replace ( '.blend' , '' )
67+ _object_name = dks_ue_get_file_name ( )
6568 _object_file = dks_ue_get_export_path () + _object_name + '_Icon.png'
6669
6770 if _preferences ["option_override_camera" ]:
@@ -107,10 +110,6 @@ def dks_ue_folder_crawl(directory):
107110
108111 return found
109112
110- def dks_ue_get_file_name ():
111-
112- return bpy .path .basename (bpy .context .blend_data .filepath ).replace ('.blend' ,'' )
113-
114113def dks_ue_get_texture_file (texture_path ,mesh_name ,mat_name ,texture_name ,texture_ext ):
115114
116115 if path .exists (texture_path + mesh_name + '_' + mat_name + '_' + texture_name + '.' + texture_ext ):
@@ -249,16 +248,18 @@ def execute(self, context):
249248 _file_ORM = dks_ue_get_texture_file (_path_textures_from ,_obj_name ,_material_name ,'OcclusionRoughnessMetallic' ,_texture_ext )
250249 _file_Opacity = dks_ue_get_texture_file (_path_textures_from ,_obj_name ,_material_name ,'Opacity' ,_texture_ext )
251250 _file_Normal = dks_ue_get_texture_file (_path_textures_from ,_obj_name ,_material_name ,'Normal' ,_texture_ext )
252- if _file_Base_Color == "" :
251+ if _file_Normal == "" :
253252 _file_Normal = dks_ue_get_texture_file (_path_textures_from ,_obj_name ,_material_name ,'Normal_OpenGL' ,_texture_ext )
254-
253+ _file_Emissive = dks_ue_get_texture_file (_path_textures_from ,_obj_name ,_material_name ,'Emissive' ,_texture_ext )
254+
255255 _material_data ['base_color' ]= _file_Base_Color [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
256256 _material_data ['normal' ]= _file_Normal [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
257257 _material_data ['orm' ]= _file_ORM [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
258258 _material_data ['opacity' ]= _file_Opacity [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
259259 _material_data ['ambient_occlusion' ]= _file_Ambient_occlusion [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
260260 _material_data ['metallic' ]= _file_Metallic [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
261261 _material_data ['roughness' ]= _file_Roughness [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
262+ _material_data ['emissive' ]= _file_Emissive [len (bpy .path .abspath ('//' )):].replace ("\\ " ,"/" ).replace ("." + _texture_ext ,"" )
262263
263264 blender_data ['materials' ].append (_material_data )
264265
0 commit comments