Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
760 stars 202 forks source link

[MAYA-121937] Crash when renaming 2 nodes to a name that contains an invalid character #2150

Closed gracekumagai closed 2 years ago

gracekumagai commented 2 years ago

Describe the bug Maya crashes when renaming 2 nodes to a name that contains an invalid character.

Here's the top of the stack trace

rename redo failed
    File: /home/gracek/local/open_source_projects/maya-usd/lib/mayaUsd/ufe/UsdUndoRenameCommand.cpp
    Line: 215
    Function: redo
Stack trace:
  Ufe_v2::SelectionAppendItem::SelectionAppendItem(std::shared_ptr<Ufe_v2::ObservableSelection> const&, std::shared_ptr<Ufe_v2::SceneItem> const&)
  Ufe_v2::SelectionAppendItem::createAndExecute(std::shared_ptr<Ufe_v2::ObservableSelection> const&, std::shared_ptr<Ufe_v2::SceneItem> const&)
  /dist/sw/maya/2022.update3/lib2/libShared.so(+0x40db3c) [0x7f3d69b88b3c]
  TmetaCommand::doCommand(TargList&)
  /dist/sw/maya/2022.update3/lib2/libCommandEngine.so(+0x9e5b4) [0x7f3d65fac5b4]
  /dist/sw/maya/2022.update3/lib2/libCommandEngine.so(+0xc8779) [0x7f3d65fd6779]
  /dist/sw/maya/2022.update3/lib2/libCommandEngine.so(+0xc8911) [0x7f3d65fd6911]
  SophiaExecutable::evaluate(void*)
  TcommandEngine::executeCommand(Tstring const&, bool, bool, TmelCmdResult*, unsigned int)

Steps to reproduce Steps to reproduce the behavior:

  1. Open a new file in Maya 2022
  2. Navigate to Create -> Universal Scene Description (USD) -> Stage with new layer
  3. Right click on the proxy shape -> Add new prim -> Capsule
  4. Right click on the proxy shape -> Add new prim -> Capsule
  5. Rename the first Capsule to "Capsule." This renames the node to "Capsule_"
  6. Rename the second Capsule to "Capsule." This triggers the crash.

rename_crash

Expected behavior We would expect it to behave like native maya. We would expect "#" to inform Maya to figure out the suffix. We would expect invalid characters to return as "_" and "_1" and not crash.

Specs (if applicable):

Logged internally as Pixar MAYA-3223

santosg87 commented 2 years ago

thanks for logging this @gracekumagai I see the issue on our side as well. I logged it internally as MAYA-121937

santosd commented 2 years ago

Hi @gracekumagai, This has been resolved in the latest if you would like to build the latest and test again. I checked it out on my end and all is working well.

gracekumagai commented 2 years ago

Hi @santosd, thanks for the fix! I tested it on my end too and it is working as expected. Have a great weekend!