Skip to content

Commit d6af8bc

Browse files
committed
0_4_0
1 parent 5ec6686 commit d6af8bc

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Blender Addon UE
22

3-
Bridge/Pipeline/Workflow export for Unreal Engine.
3+
Blender Unreal Engine Exporter.
44

55
\* WIP, I've created this addon to automate the export of meshes, automatically create icons for weapons/items/etc and copy textures.
66

@@ -12,10 +12,6 @@ Bridge/Pipeline/Workflow export for Unreal Engine.
1212
- Option to override preferences (Useful for a per project setup, see "Overriding Preferences" below)
1313
- Option to create blender_addon_ue_data.json for UE Plugin https://github.com/DigiKrafting/ue_plugin_blender (* ALPHA)
1414

15-
# Roadmap
16-
17-
- Create an Unreal Editor Plugin to assign the imported textures (I'm getting over assigning the textures manually).
18-
1915
# Required Blender Version
2016

2117
2.80.0

__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "DKS UE",
2121
"description": "Export to UE",
2222
"author": "DigiKrafting.Studio",
23-
"version": (0, 3, 0),
23+
"version": (0, 4, 0),
2424
"blender": (2, 80, 0),
2525
"location": "Info Toolbar, File -> Export",
2626
"wiki_url": "https://github.com/DigiKrafting/blender_addon_ue/wiki",
@@ -113,7 +113,7 @@ def draw(self, context):
113113
box.prop(self, 'option_copy_textures')
114114
box=layout.box()
115115
box.prop(self, 'option_ue_json')
116-
box.label(text='Creates blender_addon_ue_data.json for UE Plugin".',icon='INFO')
116+
box.label(text='Creates blender_addon_ue_data.json for UE Plugin.',icon='INFO')
117117

118118
class dks_ue_menu(bpy.types.Menu):
119119

dks_ue.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
5155
def 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-
6063
def 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-
114113
def 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

Comments
 (0)