Skip to content

Commit ef38a76

Browse files
committed
1_8_5
Added collection export
1 parent 2eb8611 commit ef38a76

3 files changed

Lines changed: 120 additions & 90 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Pipeline/Workflow import/export for Substance Painter.
44

55
# Features
66

7-
- Blender 2.80 (Tested on Linux/Windows)
7+
- Blender 2.80+ (Tested on Linux/Windows)
88

99
- Export in either FBX or OBJ.
1010
- Exports to export folder and opens Substance Painter.
11-
- Creates SPP Project File "{mesh}.spp" or "{filename}.spp". * (Excludes 2018.1.0-2018.3.0)
11+
- Creates SPP Project File "{filename}.spp" or "{mesh}.spp" or "{collection}.spp". * (Excludes 2018.1.0-2018.3.0 - See usage notes below)
1212
- Passes textures folder from preferences to Substance Painter.
1313
- Creates Nodes using the Principled BSDF shader.
1414
- Autosave before export option.
@@ -17,12 +17,17 @@ Pipeline/Workflow import/export for Substance Painter.
1717
- Optional Height Maps (Combines Height and Normal maps using the Bump Node, use with care, see screenshots below)
1818
- Checks if Mesh has material and will create one if it doesn't (Can be turned off in preferences "Create Material")
1919

20-
## Selected Mesh
20+
## Scene
2121

2222
- One Click Export
2323
- One Click Textures Import
2424

25-
## Scene
25+
## Selected Mesh(s)
26+
27+
- One Click Export
28+
- One Click Textures Import
29+
30+
## Selected Collection
2631

2732
- One Click Export
2833
- One Click Textures Import

__init__.py

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "DKS Substance Painter",
2121
"description": "Substance Painter Pipeline",
2222
"author": "DigiKrafting.Studio",
23-
"version": (1, 8, 2),
23+
"version": (1, 8, 5),
2424
"blender": (2, 80, 0),
2525
"location": "Info Toolbar, File -> Import, File -> Export, Menu",
2626
"wiki_url": "https://github.com/DigiKrafting/blender_addon_substance_painter/wiki",
@@ -130,11 +130,14 @@ def draw(self, context):
130130

131131
layout = self.layout
132132

133-
self.layout.operator(dks_sp.dks_sp_export_scene.bl_idname,icon="EXPORT")
134-
self.layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Scene)', icon="IMPORT").import_setting = 'scene'
133+
layout.operator(dks_sp.dks_sp_export_scene.bl_idname,icon="EXPORT")
134+
layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Scene)', icon="IMPORT").import_setting = 'scene'
135135

136-
self.layout.operator(dks_sp.dks_sp_export_sel.bl_idname,icon="EXPORT")
137-
self.layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Selected)', icon="IMPORT").import_setting = 'selected'
136+
layout.operator(dks_sp.dks_sp_export_sel.bl_idname,icon="EXPORT")
137+
layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Selected)', icon="IMPORT").import_setting = 'selected'
138+
139+
layout.operator(dks_sp.dks_sp_export_col.bl_idname,icon="EXPORT")
140+
layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Collection)', icon="IMPORT").import_setting = 'collection'
138141

139142
def dks_sp_draw_menu(self, context):
140143

@@ -148,6 +151,14 @@ def dks_sp_menu_func_export_sel(self, context):
148151

149152
self.layout.operator(dks_sp.dks_sp_export_sel.bl_idname)
150153

154+
def dks_sp_menu_func_export_col(self, context):
155+
156+
self.layout.operator(dks_sp.dks_sp_export_col.bl_idname)
157+
158+
def dks_sp_menu_func_import_col(self, context):
159+
160+
self.layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Collection)').import_setting = 'collection'
161+
151162
def dks_sp_menu_func_import_scene(self, context):
152163

153164
self.layout.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='Substance Painter (Scene)').import_setting = 'scene'
@@ -162,21 +173,27 @@ def dks_sp_draw_btns(self, context):
162173

163174
layout = self.layout
164175
row = layout.row(align=True)
176+
sp_lbl="SP:"
165177

166178
if bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle:
167179

168180
if bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle_state:
169181
row.operator(dks_sp_toggle.bl_idname,text="SP",icon="TRIA_LEFT")
170182
else:
171183
row.operator(dks_sp_toggle.bl_idname,text="SP",icon="TRIA_RIGHT")
184+
185+
sp_lbl=""
172186

173187
if bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle_state or not bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle:
174188

175-
row.operator(dks_sp.dks_sp_export_scene.bl_idname,text="SP:Scene",icon="EXPORT")
176-
row.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='SP:Scene',icon="IMPORT").import_setting = 'scene'
189+
row.operator(dks_sp.dks_sp_export_scene.bl_idname,text=sp_lbl+"Scn",icon="EXPORT")
190+
row.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text=sp_lbl+'Scn',icon="IMPORT").import_setting = 'scene'
191+
192+
row.operator(dks_sp.dks_sp_export_sel.bl_idname,text=sp_lbl+"Sel",icon="EXPORT")
193+
row.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text=sp_lbl+'Sel', icon="IMPORT").import_setting = 'selected'
177194

178-
row.operator(dks_sp.dks_sp_export_sel.bl_idname,text="SP:Sel",icon="EXPORT")
179-
row.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text='SP:Sel', icon="IMPORT").import_setting = 'selected'
195+
row.operator(dks_sp.dks_sp_export_col.bl_idname,text=sp_lbl+"Col",icon="EXPORT")
196+
row.operator(dks_sp.dks_sp_pbr_nodes.bl_idname, text=sp_lbl+'Col', icon="IMPORT").import_setting = 'collection'
180197

181198
class dks_sp_toggle(bpy.types.Operator):
182199

@@ -191,6 +208,7 @@ def execute(self, context):
191208
bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle_state=True
192209
else:
193210
bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle_state=False
211+
194212
return {'FINISHED'}
195213

196214
classes = (
@@ -210,6 +228,8 @@ def register():
210228
bpy.types.TOPBAR_MT_file_import.append(dks_sp_menu_func_import_scene)
211229
bpy.types.TOPBAR_MT_file_export.append(dks_sp_menu_func_export_sel)
212230
bpy.types.TOPBAR_MT_file_import.append(dks_sp_menu_func_import_sel)
231+
bpy.types.TOPBAR_MT_file_export.append(dks_sp_menu_func_export_col)
232+
bpy.types.TOPBAR_MT_file_import.append(dks_sp_menu_func_import_col)
213233

214234
bpy.context.preferences.addons[__package__].preferences.option_show_sp_toggle_state=False
215235

@@ -230,14 +250,16 @@ def unregister():
230250
bpy.types.TOPBAR_MT_file_import.remove(dks_sp_menu_func_import_scene)
231251
bpy.types.TOPBAR_MT_file_export.remove(dks_sp_menu_func_export_sel)
232252
bpy.types.TOPBAR_MT_file_import.remove(dks_sp_menu_func_import_sel)
253+
bpy.types.TOPBAR_MT_file_export.remove(dks_sp_menu_func_export_col)
254+
bpy.types.TOPBAR_MT_file_import.remove(dks_sp_menu_func_import_col)
233255

234256
if bpy.context.preferences.addons[__package__].preferences.option_display_type=='Buttons':
235257

236258
bpy.types.TOPBAR_HT_upper_bar.remove(dks_sp_draw_btns)
237259

238260
elif bpy.context.preferences.addons[__package__].preferences.option_display_type=='Menu':
239261

240-
register_class(dks_sp_menu)
262+
unregister_class(dks_sp_menu)
241263
bpy.types.TOPBAR_MT_editor_menus.remove(dks_sp_draw_menu)
242264

243265
from bpy.utils import unregister_class

0 commit comments

Comments
 (0)