Skip to content

Commit ccf3401

Browse files
committed
Initial commit
0 parents  commit ccf3401

12 files changed

Lines changed: 1690 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Blender Addon UE
2+
3+
Bridge/Pipeline/Workflow export for Unreal Engine.
4+
5+
\* WIP, I've created this addon to automate the export of meshes, create icons for weapons/items/etc and copy textures.
6+
\* I am planning to create an Unreal Editor Plugin to assign the imported textures (I'm getting over assigning the textures manually).
7+
8+
# Features
9+
10+
- One click FBX Export to UE
11+
- Option to Create Icon
12+
- Option to Copy Textures Folder
13+
14+
# Required Blender Version
15+
16+
2.80.0
17+
18+
\* Will likely work in previous versions but untested.
19+
20+
# IMPORTANT USAGE NOTES
21+
22+
\* Make sure you have a saved .blend file before using, then saving before export is then not required. The addon needs the file location to know where to create the export folder in your Unreal project "Content" folder.
23+
24+
- File Naming Convention
25+
26+
File names are derived from your blender file name.
27+
28+
## \* Be sure to Set the __"Folders"__ in Preferences (See screenshot below)
29+
30+
- Source Root Folder (E.g "C:\Users\kye\Documents\Assets\DigiKrafting\Content\")
31+
- Destination Root Folder (E.g. "C:\Users\kye\Documents\Unreal Projects\DigiKrafting\Content\")
32+
33+
\* The children/sub folders will be created automatically based on the blender file in your folder hierarchy. (E.g. "C:\Users\kye\Documents\Assets\DigiKrafting\Content\Meshes\Logo\Logo.blend" will create "C:\Users\kye\Documents\Unreal Projects\DigiKrafting\Content\Meshes\Logo\Logo.fbx")
34+
35+
# Installation
36+
37+
Download either the tar.gz or zip from [https://github.com/DigiKrafting/blender_addon_ue/releases/latest](https://github.com/DigiKrafting/blender_addon_ue/releases/latest)
38+
39+
Installing an Addon in Blender
40+
41+
- [Edit]->[Preferences]
42+
- Select [Add-ons] Tab
43+
- Click [Install]
44+
- Browse to download location of ZIP.
45+
- Click [Install Add-on from File..]
46+
47+
# Screenshots
48+
## Preferences
49+
![alt](/screenshots/ue_prefs.png)

__init__.py

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# ##### BEGIN GPL LICENSE BLOCK #####
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU General Public License
5+
# as published by the Free Software Foundation; either version 3
6+
# of the License, or (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program; if not, write to the Free Software Foundation,
15+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16+
#
17+
# ##### END GPL LICENSE BLOCK #####
18+
19+
bl_info = {
20+
"name": "DKS UE",
21+
"description": "Export to UE",
22+
"author": "DigiKrafting.Studio",
23+
"version": (0, 1, 0),
24+
"blender": (2, 80, 0),
25+
"location": "Info Toolbar, File -> Export",
26+
"wiki_url": "https://github.com/DigiKrafting/blender_addon_ue/wiki",
27+
"tracker_url": "https://github.com/DigiKrafting/blender_addon_ue/issues",
28+
"category": "Import-Export",
29+
}
30+
31+
import bpy
32+
from bpy.utils import register_class, unregister_class
33+
from . import dks_ue
34+
35+
class dks_ue_addon_prefs(bpy.types.AddonPreferences):
36+
37+
bl_idname = __package__
38+
39+
option_ue_src : bpy.props.StringProperty(
40+
name="Source Root Folder",
41+
subtype="DIR_PATH",
42+
default="",
43+
)
44+
option_ue_dst : bpy.props.StringProperty(
45+
name="Destination Root Folder",
46+
subtype="DIR_PATH",
47+
default="",
48+
)
49+
option_save_before_export : bpy.props.BoolProperty(
50+
name="Save Before Export",
51+
default=True,
52+
)
53+
option_create_icon : bpy.props.BoolProperty(
54+
name="Create Icon",
55+
default=True,
56+
)
57+
option_icon_resolution_x : bpy.props.IntProperty(
58+
name="Resolution Width",
59+
default=64,
60+
)
61+
option_icon_resolution_y : bpy.props.IntProperty(
62+
name="Resolution Height",
63+
default=64,
64+
)
65+
option_copy_textures : bpy.props.BoolProperty(
66+
name="Copy Textures Folder",
67+
default=True,
68+
)
69+
option_override_camera : bpy.props.BoolProperty(
70+
name="Override Camera Location/Rotation",
71+
default=False,
72+
)
73+
option_camera_location : bpy.props.FloatVectorProperty(
74+
name="Camera Location",
75+
)
76+
option_camera_rotation : bpy.props.FloatVectorProperty(
77+
name="Camera Rotation",
78+
)
79+
option_display_type : bpy.props.EnumProperty(
80+
items=[('Buttons', "Buttons", "Use Buttons"),('Menu', "Menu", "Append a Menu to Main Menu"),('Hide', "Import/Export", "Use only Import/Export Menu's"),],
81+
name="Display Type",
82+
default='Buttons',
83+
)
84+
def draw(self, context):
85+
86+
layout = self.layout
87+
88+
box=layout.box()
89+
box.prop(self, 'option_display_type')
90+
box.prop(self, 'option_ue_src')
91+
box.prop(self, 'option_ue_dst')
92+
box=layout.box()
93+
box.prop(self, 'option_create_icon')
94+
box.prop(self, 'option_icon_resolution_x')
95+
box.prop(self, 'option_icon_resolution_y')
96+
box.prop(self, 'option_override_camera')
97+
box.prop(self, 'option_camera_location')
98+
box.prop(self, 'option_camera_rotation')
99+
box=layout.box()
100+
box.prop(self, 'option_copy_textures')
101+
box.prop(self, 'option_save_before_export')
102+
103+
class dks_ue_menu(bpy.types.Menu):
104+
105+
bl_label = " " + bl_info['name']
106+
bl_idname = "dks_ue.menu"
107+
108+
def draw(self, context):
109+
110+
layout = self.layout
111+
112+
self.layout.operator('dks_ue.export',icon="EXPORT")
113+
114+
def draw_dks_ue_menu(self, context):
115+
116+
layout = self.layout
117+
layout.menu(dks_ue_menu.bl_idname,icon="COLLAPSEMENU")
118+
119+
def dks_ue_menu_func_export(self, context):
120+
self.layout.operator(dks_ue_export.bl_idname)
121+
122+
def dks_ue_toolbar_btn_export(self, context):
123+
124+
if context.region.alignment != 'RIGHT':
125+
126+
self.layout.operator('dks_ue.export',text="UE",icon="EXPORT")
127+
128+
classes = (
129+
dks_ue_addon_prefs,
130+
)
131+
132+
def register():
133+
134+
for cls in classes:
135+
register_class(cls)
136+
137+
dks_ue.register()
138+
139+
bpy.types.TOPBAR_MT_file_export.append(dks_ue_menu_func_export)
140+
141+
if bpy.context.preferences.addons[__package__].preferences.option_display_type=='Buttons':
142+
143+
bpy.types.TOPBAR_HT_upper_bar.append(dks_ue_toolbar_btn_export)
144+
145+
elif bpy.context.preferences.addons[__package__].preferences.option_display_type=='Menu':
146+
147+
register_class(dks_ue_menu)
148+
bpy.types.TOPBAR_MT_editor_menus.append(draw_dks_ue_menu)
149+
150+
def unregister():
151+
152+
bpy.types.TOPBAR_MT_file_export.remove(dks_ue_menu_func_export)
153+
154+
if bpy.context.preferences.addons[__package__].preferences.option_display_type=='Buttons':
155+
156+
bpy.types.TOPBAR_HT_upper_bar.remove(dks_ue_toolbar_btn_export)
157+
158+
elif bpy.context.preferences.addons[__package__].preferences.option_display_type=='Menu':
159+
160+
bpy.types.TOPBAR_MT_editor_menus.remove(draw_dks_ue_menu)
161+
unregister_class(dks_ue_menu)
162+
163+
dks_ue.unregister()
164+
165+
for cls in reversed(classes):
166+
unregister_class(cls)
167+
168+
if __name__ == "__main__":
169+
170+
register()
3.4 KB
Binary file not shown.
4.07 KB
Binary file not shown.

__pycache__/dks_ue.cpython-37.pyc

3.9 KB
Binary file not shown.

__pycache__/ds_ue.cpython-35.pyc

5.35 KB
Binary file not shown.

__pycache__/ds_ue.cpython-37.pyc

3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)