Skip to content

Commit

Permalink
MM ImagePlane - 'sourceImages' file rule may not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cattermole committed Sep 30, 2024
1 parent 41f15b7 commit 3a61f4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/mmSolver/tools/createimageplane/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,22 @@


def _get_start_directory():
fallback_path = os.getcwd()

workspace_path = maya.cmds.workspace(query=True, fullName=True)
if workspace_path is None:
return os.getcwd()
return fallback_path
workspace_path = os.path.abspath(workspace_path)

file_rules = maya.cmds.workspace(query=True, fileRule=True)
if file_rules is None:
return os.getcwd()
return fallback_path
file_rule_names = file_rules[0::2]
file_rule_values = file_rules[1::2]

file_rule = 'sourceImages'
if file_rule not in file_rule_names:
return fallback_path
file_rule_index = file_rule_names.index(file_rule)
dir_name = file_rule_values[file_rule_index]

Expand Down

0 comments on commit 3a61f4f

Please sign in to comment.