Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-124459 import as anim cache #2829

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/mayaUsd/fileio/translators/translatorMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ MStatus TranslatorMeshRead::setPointBasedDeformerForMayaNode(
status = MGlobal::clearSelectionList();
CHECK_MSTATUS(status);

const MFnDagNode dagNodeFn(mayaObj, &status);
CHECK_MSTATUS(status);

#if MAYA_API_VERSION >= 20220000
status = MGlobal::selectByName(dagNodeFn.fullPathName().asChar());
CHECK_MSTATUS(status);
#endif

// Create the point based deformer node for this prim.
const std::string pointBasedDeformerNodeName = TfStringPrintf(
"usdPointBasedDeformerNode%s",
Expand Down Expand Up @@ -443,6 +451,10 @@ MStatus TranslatorMeshRead::setPointBasedDeformerForMayaNode(
status = dgMod.doIt();
CHECK_MSTATUS(status);

// The deformer command changed in Maya 2022 to no longer add a tweak,
// so only modify the tweak when in Maya 2020 or earlier.
#if MAYA_API_VERSION < 20220000

// Add the Maya object to the point based deformer node's set.
const MFnGeometryFilter geomFilterFn(m_pointBasedDeformerNode, &status);
CHECK_MSTATUS(status);
Expand All @@ -464,8 +476,6 @@ MStatus TranslatorMeshRead::setPointBasedDeformerForMayaNode(
// *after* the point based deformer. To do this, we need to dig for the
// name of the tweak deformer node that Maya created to be able to pass it
// to the reorderDeformers command.
const MFnDagNode dagNodeFn(mayaObj, &status);
CHECK_MSTATUS(status);

// XXX: This seems to be the "most sane" way of finding the tweak deformer
// node's name...
Expand All @@ -486,6 +496,7 @@ MStatus TranslatorMeshRead::setPointBasedDeformerForMayaNode(
dagNodeFn.fullPathName().asChar());
status = MGlobal::executePythonCommand(reorderDeformersCmd.c_str());
CHECK_MSTATUS(status);
#endif

return status;
}
Expand Down
1 change: 1 addition & 0 deletions test/lib/usd/translators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set(TEST_SCRIPT_FILES
testUsdImportLight.py
testUsdImportMayaReference.py
testUsdImportMesh.py
testUsdImportPointCache.py
testUsdImportPreviewSurface.py
# XXX: This test is disabled by default since it requires the RenderMan for Maya plugin.
# testUsdImportRfMLight.py
Expand Down
Loading