Skip to content

Commit 139ad30

Browse files
committed
Fixed Maya Project path decoding. Project is not define in not path is given.
1 parent 45d523e commit 139ad30

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

artella/dccs/maya/plugin.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,24 @@ def setup_project(self, artella_local_root_path):
117117
:param str artella_local_root_path: current user Artella local root path
118118
"""
119119

120+
if not artella_local_root_path:
121+
logger.warning('No Project Path to setup. Skipping setup project ...')
122+
return
123+
124+
artella_local_root_path = utils.clean_path(artella_local_root_path)
125+
if utils.is_python2():
126+
artella_local_root_path = artella_local_root_path.decode('utf-8')
120127
artella_local_root_path = cmds.encodeString(artella_local_root_path)
121-
mel.eval('setProject "%s"' % artella_local_root_path.replace('\\', '\\\\'))
128+
mel.eval('setProject "%s"' % artella_local_root_path.replace('\\', '/'))
122129
cmds.workspace(directory=artella_local_root_path)
123130
cmds.workspace(fileRule=['sourceImages', ''])
124131
cmds.workspace(fileRule=['scene', ''])
125132
cmds.workspace(fileRule=['mayaAscii', ''])
126133
cmds.workspace(fileRule=['mayaBinary', ''])
127-
logger.info('Set Maya Workspace Path: {}'.format(artella_local_root_path))
134+
if utils.is_python2():
135+
logger.info('Set Maya Workspace Path: {}'.format(artella_local_root_path.encode('utf-8')))
136+
else:
137+
logger.info('Set Maya Workspace Path: {}'.format(artella_local_root_path))
128138

129139
def validate_environment_for_callback(self, callback_name):
130140
"""

0 commit comments

Comments
 (0)