From 427c91f7e210f1cdec0f713b07e2c3b54b95ab2e Mon Sep 17 00:00:00 2001 From: Pierre Baillargeon Date: Wed, 22 Jun 2022 10:50:57 -0400 Subject: [PATCH 1/2] MAYA-123903 reset all merge and duplicate options Make sure the default options contain all the possible options so that when using the defaults to reset options, all options get reset. --- .../mayaUsdDuplicateAsMayaDataOptions.py | 17 +++-------------- .../scripts/mayaUsdMergeToUSDOptions.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py b/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py index be6510ce48..293197550a 100644 --- a/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py +++ b/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py @@ -18,6 +18,7 @@ import maya.mel as mel from mayaUsdLibRegisterStrings import getMayaUsdLibString +from mayaUsdMergeToUSDOptions import _getDefaultMergeToUSDOptionsDict import mayaUsdOptions from functools import partial @@ -195,17 +196,5 @@ def _getDefaultDuplicateAsMayaDataOptionsDict(): """ Retrieves the default duplicate-as-Maya-data options. """ - return { - "exportColorSets": "1", - "exportUVs": "1", - "exportSkels": "none", - "exportSkin": "none", - "exportBlendShapes": "0", - "exportDisplayColor": "1", - "shadingMode": "none", - "animation": "1", - "exportVisibility": "1", - "exportInstances": "1", - "mergeTransformAndShape": "1", - "stripNamespaces": "0", - } + # For now, the duplicate and merge options defaults are the same. + return _getDefaultMergeToUSDOptionsDict() diff --git a/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py b/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py index bfc45f6f69..64de7de9b2 100644 --- a/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py +++ b/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py @@ -266,16 +266,23 @@ def _getDefaultMergeToUSDOptionsDict(): Retrieves the default merge-to-USD options. """ return { - "exportColorSets": "1", "exportUVs": "1", "exportSkels": "none", "exportSkin": "none", "exportBlendShapes": "0", "exportDisplayColor": "1", - "shadingMode": "none", + "exportColorSets": "1", + "defaultMeshScheme": "catmullClark", "animation": "1", - "exportVisibility": "1", + "eulerFilter": "0", + "staticSingleSample": "0", + "startTime": "0", + "endTime": "200", + "frameStride": "1", + "frameSample": "", + "shadingMode": "none", "exportInstances": "1", + "exportVisibility": "1", "mergeTransformAndShape": "1", "stripNamespaces": "0", } From 70418e0b9d1f54648bd7aa15f6987c481bb1e11d Mon Sep 17 00:00:00 2001 From: Pierre Baillargeon Date: Wed, 22 Jun 2022 14:50:29 -0400 Subject: [PATCH 2/2] MAYA-123903 remove leading underscore --- .../scripts/mayaUsdDuplicateAsMayaDataOptions.py | 10 +++++----- .../resources/scripts/mayaUsdMergeToUSDOptions.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py b/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py index 293197550a..bdadde75dd 100644 --- a/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py +++ b/lib/mayaUsd/resources/scripts/mayaUsdDuplicateAsMayaDataOptions.py @@ -18,7 +18,7 @@ import maya.mel as mel from mayaUsdLibRegisterStrings import getMayaUsdLibString -from mayaUsdMergeToUSDOptions import _getDefaultMergeToUSDOptionsDict +from mayaUsdMergeToUSDOptions import getDefaultMergeToUSDOptionsDict import mayaUsdOptions from functools import partial @@ -136,7 +136,7 @@ def _resetDuplicateAsMayaDataOptions(subLayout, data=None): """ Resets the duplicate-as-Maya-data options in the dialog. """ - optionsText = mayaUsdOptions.convertOptionsDictToText(_getDefaultDuplicateAsMayaDataOptionsDict()) + optionsText = mayaUsdOptions.convertOptionsDictToText(getDefaultDuplicateAsMayaDataOptionsDict()) _fillDuplicateAsMayaDataOptionsDialog(subLayout, optionsText, "fill") @@ -180,7 +180,7 @@ def getDuplicateAsMayaDataOptionsText(): """ return mayaUsdOptions.getOptionsText( _getDuplicateAsMayaDataOptionsVarName(), - _getDefaultDuplicateAsMayaDataOptionsDict()) + getDefaultDuplicateAsMayaDataOptionsDict()) def setDuplicateAsMayaDataOptionsText(optionsText): @@ -192,9 +192,9 @@ def setDuplicateAsMayaDataOptionsText(optionsText): mayaUsdOptions.setOptionsText(_getDuplicateAsMayaDataOptionsVarName(), optionsText) -def _getDefaultDuplicateAsMayaDataOptionsDict(): +def getDefaultDuplicateAsMayaDataOptionsDict(): """ Retrieves the default duplicate-as-Maya-data options. """ # For now, the duplicate and merge options defaults are the same. - return _getDefaultMergeToUSDOptionsDict() + return getDefaultMergeToUSDOptionsDict() diff --git a/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py b/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py index 64de7de9b2..f2fda0f4b2 100644 --- a/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py +++ b/lib/mayaUsd/resources/scripts/mayaUsdMergeToUSDOptions.py @@ -203,7 +203,7 @@ def _resetMergeToUSDOptions(target, subLayout, data=None): """ Resets the merge-to-USD options in the dialog. """ - optionsText = mayaUsdOptions.convertOptionsDictToText(_getDefaultMergeToUSDOptionsDict()) + optionsText = mayaUsdOptions.convertOptionsDictToText(getDefaultMergeToUSDOptionsDict()) _fillMergeToUSDOptionsDialog(target, subLayout, optionsText, "fill") @@ -249,7 +249,7 @@ def getMergeToUSDOptionsText(): """ return mayaUsdOptions.getOptionsText( _getMergeToUSDOptionsVarName(), - _getDefaultMergeToUSDOptionsDict()) + getDefaultMergeToUSDOptionsDict()) def setMergeToUSDOptionsText(optionsText): @@ -261,7 +261,7 @@ def setMergeToUSDOptionsText(optionsText): mayaUsdOptions.setOptionsText(_getMergeToUSDOptionsVarName(), optionsText) -def _getDefaultMergeToUSDOptionsDict(): +def getDefaultMergeToUSDOptionsDict(): """ Retrieves the default merge-to-USD options. """