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 crash on usdImport of geo with creased edges #47

Closed
BSalem opened this issue Sep 7, 2016 · 7 comments
Closed

Maya crash on usdImport of geo with creased edges #47

BSalem opened this issue Sep 7, 2016 · 7 comments

Comments

@BSalem
Copy link

BSalem commented Sep 7, 2016

As in the subject, importing a usd with edge creases into maya crashes maya.. (the same USDs work fine in katana and viewed properly in usdview)

Stack trace:
Tarray::changeLogicalSizeBy(int)
MFnMesh::setUVs(MFloatArray const&, MFloatArray const&, MString const_)
PxrUsdMayaTranslatorMesh::AssignUVSetPrimvarToMesh(UsdGeomPrimvar const&, MFnMesh&)
PxrUsdMayaTranslatorMesh::Create(UsdGeomMesh const&, MObject, PxrUsdMayaPrimReaderArgs const&, PxrUsdMayaPrimReaderContext
)
/opt/pixar/usd/third_party/maya/lib/libusdMaya.so(+0x7cf98) [0x7f66bded8f98]
usdReadJob::DoImport(UsdTreeIterator&, UsdPrim const&)
usdReadJob::doIt(std::vector<MDagPath, std::allocator >
)
usdTranslatorImport::reader(MFileObject const&, MString const&, MPxFileTranslator::FileAccessMode)
THfileConverter::reader(TsceneFile&)
TfileTranslator::read(TsceneFile&)
TglobalTranslator::doReadFile(TsceneFile&, bool, bool)
TfileUtil::readFile(TsceneFile_, bool, bool, bool)
TfileImporter::importFileToSceneFile(TsceneFile_, TsceneFile&, bool, bool, Tstring const_, TnamespaceSwapper_, TfileTranslator_, Tnamespace*)
TfileImporter::importFile(TsceneFile
, bool, bool, TglobalTranslatorBase::TrefIOMode, Tstring const_, TnamespaceSwapper_, bool)
TfileCmd::handleFileImportFlag(TargDatabase&, TsceneFile_, TnamespaceSwapper_)
TfileCmd::handleFlags(TargDatabase&, TsceneFile_, TnamespaceSwapper_, TgraphDiff_)
TfileCmd::handleFlags(TargDatabase&, Tstring const&)
TfileCmd::doCommand(TargList&)
Mel_Command_Dispatch(SphNode_)
node_exec
sophia_call_executable
SophiaExecutable::evaluate(void_)
TcommandEngine::executeCommand(SophiaExecutable_, void_)
TevalEchoCmd::doCommand(TargList&)
Mel_Command_Dispatch(SphNode_)
node_exec

@jtran56
Copy link

jtran56 commented Sep 7, 2016

Filed as internal issue #136986.

@spiffmon
Copy link
Member

spiffmon commented Sep 7, 2016

Thanks, Belal! Any chance you can attach a small usda file that demoes the behavior?

@BSalem
Copy link
Author

BSalem commented Sep 9, 2016

Please find here a maya scene with a simple creased cube and the same cube exported into usda out of this scene.
crashing_creased_geo.tar.gz

@BSalem
Copy link
Author

BSalem commented Sep 11, 2016

One more thing I noticed regarding to this issue here that should minimize the area where the bug lives:
** if you import the USD using the usdImport command directly, then the file gets imported properly and maya doesn't crash (I didn't test passing optional flags but just used the defaults as this):
cmd.usdImport(f=usdFilePath)

But if you use the maya import method (file->import), then maya will crash even when trying different options for the import.

@spiffmon
Copy link
Member

Thanks, Belal - we'll be looking into this soon!

@sdao
Copy link
Contributor

sdao commented Sep 22, 2016

Looks like the crash is Maya-side (we'll be reporting this to Autodesk, but we have a workaround in the meantime).

The crash occurs on a call to MFnMesh.setUVs() but if I set the UVs by hardcoding some dummy values into the code, the crash still occurs. The crash only occurs if we add a crease set in _AddCreaseSet() first before setting UVs.

There's a workaround that appears to work by manually calling MFnMesh.setCurrentUVSetName() before setting the UVs.

The attached crash_maya.py replicates some of what the importer is doing, and it will also trigger the crash. Create an empty scene with a single cube (pCube1) and then run the script; Maya will
crash (checked with 2016.sp6).

crash_maya.py.tar.gz

@sunyab
Copy link
Contributor

sunyab commented May 3, 2017

Closing out old issue -- this workaround was released in 0.7.2 in commit 6a8803f.

@sunyab sunyab closed this as completed May 3, 2017
touraill-adobe added a commit to touraill-adobe/USD that referenced this issue Mar 21, 2023
The file uses `std::find` so it needs <algorithm>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants