From d39f2dc96241c2ffb8ae10168c0bf47582cf81bf Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 21 Sep 2017 13:13:36 +0200 Subject: [PATCH] Fix extracting alembic with `writeCreases` in Maya 2018+, fix False options for boolean vaues in extracting alembic --- colorbleed/maya/lib.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/colorbleed/maya/lib.py b/colorbleed/maya/lib.py index 64c03b2723..6103facc2b 100644 --- a/colorbleed/maya/lib.py +++ b/colorbleed/maya/lib.py @@ -551,6 +551,11 @@ def extract_alembic(file, raise TypeError("Alembic option unsupported type: " "{0} (expected {1})".format(value, valid_types)) + # The `writeCreases` argument was changed to `autoSubd` in Maya 2018+ + maya_version = int(cmds.about(version=True)) + if maya_version >= 2018: + options['autoSubd'] = options.pop('writeCreases', False) + # Format the job string from options job_args = list() for key, value in options.items(): @@ -558,7 +563,9 @@ def extract_alembic(file, for entry in value: job_args.append("-{} {}".format(key, entry)) elif isinstance(value, bool): - job_args.append("-{0}".format(key)) + # Add only when state is set to True + if value: + job_args.append("-{0}".format(key)) else: job_args.append("-{0} {1}".format(key, value))