Skip to content

Commit

Permalink
Fix the issue when using a custom output path
Browse files Browse the repository at this point in the history
  • Loading branch information
passivestar committed Dec 13, 2023
1 parent 238e4d5 commit fbb2bbe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

bl_info = {
'name': 'Substance Import-Export Tools',
'version': (1, 3, 20),
'version': (1, 3, 21),
'author': 'passivestar',
'blender': (4, 0, 0),
'location': '3D View N Panel',
Expand Down Expand Up @@ -92,10 +92,11 @@ def get_paths(context):

if textures_path == '':
textures_path = Path(bpy.path.abspath('//'))
else:
textures_path = Path(textures_path)

collection_name_clean = re.sub(r'[^a-zA-Z0-9_]', '_', bpy.context.view_layer.active_layer_collection.name)

textures_path_for_collection_no_collection = textures_path.joinpath('textures')
textures_path_for_collection = textures_path.joinpath('textures_' + collection_name_clean + '/')

fbx_path = textures_path_for_collection.joinpath(collection_name_clean + '.fbx')
Expand All @@ -104,7 +105,6 @@ def get_paths(context):
return {
'fbx': fbx_path,
'spp': spp_path,
'directory_no_collection': textures_path_for_collection_no_collection,
'directory': textures_path_for_collection,
'collection_name_clean': collection_name_clean
}
Expand Down Expand Up @@ -147,7 +147,6 @@ def execute(self, context):
painter_path = preferences["painter_path"]

paths = get_paths(context)
directory_no_collection = paths['directory_no_collection']
directory = paths['directory']
fbx = paths['fbx']
spp = paths['spp']
Expand Down

0 comments on commit fbb2bbe

Please sign in to comment.