Skip to content

Commit

Permalink
Fixed returns in Maya parser update paths functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed Mar 16, 2021
1 parent 2aa0b45 commit daeb9d4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions artella/dccs/maya/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,23 +263,26 @@ def update_paths(self, file_path=None):
:return:
"""

valid_update = False
converted_file_paths = list()

if not MAYA_AVAILBLE:
logger.warning('Convert Paths functionality is only available if Maya instance is running!')
return False
return valid_update, converted_file_paths

if not file_path:
file_path = dcc.scene_name()

if not file_path or not os.path.isfile(file_path):
logger.warning('Given file to parse does not exists! Skipping convert paths process'.format(file_path))
return False
return valid_update, converted_file_paths

file_ext = os.path.splitext(file_path)[-1]
if file_ext not in dcc.extensions():
logger.warning(
'Given file path has an invalid extension: {}. Supported extensions: {}'.format(
file_ext, dcc.extensions()))
return False
return valid_update, converted_file_paths

if file_path != dcc.scene_name():
dcc.open_scene(file_path, save=True)
Expand All @@ -288,7 +291,7 @@ def update_paths(self, file_path=None):
dirs = cmds.filePathEditor(query=True, listDirectories='')
if not dirs:
logger.debug('File "{}" has no paths to update!'.format(dirs))
return False
return valid_update, converted_file_paths

valid_update = True

Expand All @@ -299,12 +302,11 @@ def update_paths(self, file_path=None):
except Exception as exc:
logger.error(
'Querying scene files in dir "{}" looking for dependent files: {}'.format(dir_name, exc))
return
return valid_update, converted_file_paths
if not file_path_editor:
continue
file_path_editors[dir_name] = file_path_editor

converted_file_paths = list()
for dir_name, file_path_editor in file_path_editors.items():
if not api.is_artella_path(dir_name):
continue
Expand Down

0 comments on commit daeb9d4

Please sign in to comment.