diff --git a/__init__.py b/__init__.py index b8e95a2..245eb1e 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ "name": "DKS Substance Painter", "description": "Substance Painter Pipeline", "author": "DigiKrafting.Studio", - "version": (1, 8, 5), + "version": (1, 8, 6), "blender": (2, 80, 0), "location": "Info Toolbar, File -> Import, File -> Export, Menu", "wiki_url": "https://github.com/DigiKrafting/blender_addon_substance_painter/wiki", diff --git a/dks_sp.py b/dks_sp.py index 35c2fb3..b233e62 100644 --- a/dks_sp.py +++ b/dks_sp.py @@ -583,12 +583,16 @@ def execute(self, context): _export_project = _export_path + _export_name + '.spp' for _obj in bpy.data.collections[_export_name].all_objects: + if _obj.type=='MESH': + _obj.select_set(True) - if bpy.context.preferences.addons[__package__].preferences.option_create_materials: - _checked = dks_sp_check_material() - + if bpy.context.preferences.addons[__package__].preferences.option_create_materials: + + if len(_obj.data.materials)==0: + _created = dks_sp_create_material(_obj) + if bpy.context.preferences.addons[__package__].preferences.option_export_type=='obj': _export_file = dks_sp_obj_export_sel(self, context, _export_name) elif bpy.context.preferences.addons[__package__].preferences.option_export_type=='fbx':