-
Notifications
You must be signed in to change notification settings - Fork 202
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
Pixar Mesh read translator/utilities refactoring #343
Changes from 1 commit
39ccba9
86980e1
64ccefa
684c5b4
7be630d
42500cc
11b49c5
230afb0
da213c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,18 +113,11 @@ MayaUsdPrimReaderMesh::Read(UsdMayaPrimReaderContext* context) | |
&status); | ||
CHECK_MSTATUS_AND_RETURN(status, false); | ||
|
||
// shape name | ||
const auto& primName = prim.GetName().GetString(); | ||
status = UsdMayaUtil::setName(meshRead.meshObject(), primName); | ||
CHECK_MSTATUS_AND_RETURN(status, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just wrong! UsdMayaUtil::setName was creating a new object of type MFnMesh and set it's name. |
||
|
||
// mesh is a shape, so read Gprim properties | ||
UsdMayaTranslatorGprim::Read(mesh, meshRead.meshObject(), context); | ||
|
||
// undo/redo mesh object | ||
const auto shapeName = TfStringPrintf("%sShape", primName.c_str()); | ||
const auto shapePath = prim.GetPath().AppendChild(TfToken(shapeName)); | ||
context->RegisterNewMayaNode(shapePath.GetString(), meshRead.meshObject()); | ||
context->RegisterNewMayaNode(meshRead.shapePath().GetString(), meshRead.meshObject()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now get the path from the meshRead and pass it in to be registered with the Maya mesh object. |
||
|
||
// undo/redo deformable mesh (blenshape, PointBasedDeformer) | ||
if (meshRead.pointsNumTimeSamples() > 0) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2031,18 +2031,3 @@ UsdMayaUtil::convert(const std::string& str) | |
{ | ||
return MString(str.data(), static_cast<int>(str.size())); | ||
} | ||
|
||
MStatus | ||
UsdMayaUtil::setName(const MObject& meshObj, const std::string& shapeName) | ||
{ | ||
if(meshObj.apiType() != MFn::kMesh){ | ||
return MS::kFailure; | ||
} | ||
|
||
MStatus status{MS::kSuccess}; | ||
|
||
MFnMesh meshFn(meshObj); | ||
meshFn.setName(MString(shapeName.c_str()), false, &status); | ||
|
||
return status; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was indeed a weird and almost useless function that I introduced. Sigh.... |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the mesh function set is created, we set it's name and then store the SdfPath that is created off of it.