Skip to content

Commit

Permalink
Merge branch '6-usdmaya-add-blendshapes-to-usdskel-mesh-export-2' int…
Browse files Browse the repository at this point in the history
…o 'laika-dev'

Resolve "UsdMaya: add blendshapes to UsdSkel mesh export"

Closes #6

See merge request third-party/USD!2
  • Loading branch information
pstuart42 committed Jul 10, 2019
2 parents fbe6b68 + 40066db commit 70bbfde
Show file tree
Hide file tree
Showing 13 changed files with 3,209 additions and 0 deletions.
16 changes: 16 additions & 0 deletions third_party/maya/lib/usdMaya/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pxr_test_scripts(
testenv/testPointBasedDeformerNode.py
testenv/testUsdExportAssembly.py
testenv/testUsdExportAssemblyEdits.py
testenv/testUsdExportBlendShape.py
testenv/testUsdExportCamera.py
testenv/testUsdExportColorSets.py
testenv/testUsdExportConnected.py
Expand Down Expand Up @@ -289,6 +290,21 @@ pxr_register_test(testUsdExportAssemblyEdits
MAYA_APP_DIR=<PXR_TEST_DIR>/maya_profile
)

pxr_install_test_dir(
SRC testenv/UsdExportBlendShapeTest
DEST testUsdExportBlendShape
)
pxr_register_test(testUsdExportBlendShape
CUSTOM_PYTHON ${MAYA_PY_EXECUTABLE}
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdExportBlendShape"
TESTENV testUsdExportBlendShape
ENV
MAYA_PLUG_IN_PATH=${CMAKE_INSTALL_PREFIX}/third_party/maya/plugin
MAYA_SCRIPT_PATH=${CMAKE_INSTALL_PREFIX}/third_party/maya/share/usd/plugins/usdMaya/resources
MAYA_DISABLE_CIP=1
MAYA_APP_DIR=<PXR_TEST_DIR>/maya_profile
)

pxr_install_test_dir(
SRC testenv/UsdExportCameraTest
DEST testUsdExportCamera
Expand Down
3 changes: 3 additions & 0 deletions third_party/maya/lib/usdMaya/exportCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ MSyntax UsdMayaExportCommand::createSyntax()
syntax.addFlag("-skn",
UsdMayaJobExportArgsTokens->exportSkin.GetText(),
MSyntax::kString);
syntax.addFlag("-ebs",
UsdMayaJobExportArgsTokens->exportBlendShapes.GetText(),
MSyntax::kString);
syntax.addFlag("-psc",
UsdMayaJobExportArgsTokens->parentScope.GetText(),
MSyntax::kString);
Expand Down
11 changes: 11 additions & 0 deletions third_party/maya/lib/usdMaya/jobArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@ UsdMayaJobExportArgs::UsdMayaJobExportArgs(
UsdMayaJobExportArgsTokens->auto_,
UsdMayaJobExportArgsTokens->explicit_
})),
exportBlendShapes(
_Token(userArgs,
UsdMayaJobExportArgsTokens->exportBlendShapes,
UsdMayaJobExportArgsTokens->none,
{
UsdMayaJobExportArgsTokens->auto_,
UsdMayaJobExportArgsTokens->explicit_
})),
exportVisibility(
_Boolean(userArgs, UsdMayaJobExportArgsTokens->exportVisibility)),
materialCollectionsPath(
Expand Down Expand Up @@ -368,6 +376,7 @@ operator <<(std::ostream& out, const UsdMayaJobExportArgs& exportArgs)
<< "defaultMeshScheme: " << exportArgs.defaultMeshScheme << std::endl
<< "eulerFilter: " << TfStringify(exportArgs.eulerFilter) << std::endl
<< "excludeInvisible: " << TfStringify(exportArgs.excludeInvisible) << std::endl
<< "exportBlendShapes: " << TfStringify(exportArgs.exportBlendShapes) << std::endl
<< "exportCollectionBasedBindings: " << TfStringify(exportArgs.exportCollectionBasedBindings) << std::endl
<< "exportColorSets: " << TfStringify(exportArgs.exportColorSets) << std::endl
<< "exportDefaultCameras: " << TfStringify(exportArgs.exportDefaultCameras) << std::endl
Expand Down Expand Up @@ -455,6 +464,8 @@ UsdMayaJobExportArgs::GetDefaultDictionary()
d[UsdMayaJobExportArgsTokens->defaultMeshScheme] =
UsdGeomTokens->catmullClark.GetString();
d[UsdMayaJobExportArgsTokens->eulerFilter] = false;
d[UsdMayaJobExportArgsTokens->exportBlendShapes] =
UsdMayaJobExportArgsTokens->none.GetString();
d[UsdMayaJobExportArgsTokens->exportCollectionBasedBindings] = false;
d[UsdMayaJobExportArgsTokens->exportColorSets] = true;
d[UsdMayaJobExportArgsTokens->exportDisplayColor] = true;
Expand Down
2 changes: 2 additions & 0 deletions third_party/maya/lib/usdMaya/jobArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ TF_DECLARE_PUBLIC_TOKENS(
(defaultCameras) \
(defaultMeshScheme) \
(eulerFilter) \
(exportBlendShapes) \
(exportCollectionBasedBindings) \
(exportColorSets) \
(exportDisplayColor) \
Expand Down Expand Up @@ -138,6 +139,7 @@ struct UsdMayaJobExportArgs
const TfToken defaultMeshScheme;
const bool eulerFilter;
const bool excludeInvisible;
const TfToken exportBlendShapes;

/// If set to false, then direct per-gprim bindings are exported.
/// If set to true and if \p materialCollectionsPath is non-empty, then
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 70bbfde

Please sign in to comment.