Fix extracting alembic with writeCreases in Maya 2018+, fix False options for boolean vaues in extracting alembic

This commit is contained in:
Roy Nieterau 2017-09-21 13:13:36 +02:00
parent 6709e876e6
commit d39f2dc962

View file

@ -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))