-
Notifications
You must be signed in to change notification settings - Fork 198
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-131348 - Adapt to Maya Ufe world node change #3842
base: dev
Are you sure you want to change the base?
Conversation
3a75125
to
524ab90
Compare
… breaks USD workflow * Incorrect to create Ufe::Path for Maya (hidden) world node using Ufe::PathString::path(). * Let DuplicateCommand accept empty destination path which means Maya (hidden) world node. * Let CreateStageWithNewLayer command accept null input parent which means Maya world node. * Use ufe.PathString.string() instead of str()
524ab90
to
0bfe9f9
Compare
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.
The code wasn't "incorrect" before its just that we were relying on knowledge of the Maya hidden
world node (which is the root). Removed all that world knowledge except in very special cases. These changes are required now before I make a fix in Maya which will allow users to create their own top-level "world" node and use that with Ufe. Currently they cannot because of a bug in Maya.
|
||
status = parseUfePathArg(argParser, 0, _srcPath); | ||
if (status != MS::kSuccess) | ||
return reportError(status); | ||
|
||
status = parseUfePathArg(argParser, 1, _dstPath); | ||
status = parseUfePathArg(argParser, 1, _dstPath, true /*allowEmpty*/); |
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.
I set new allowEmpty
bool here to be able to accept as command input "" which means Maya "world" node.
Ufe::Path childPath; | ||
if (_srcPath.runTimeId() == getMayaRunTimeId()) { | ||
// Maya duplicate to USD | ||
_dstPath + Ufe::PathSegment(_srcPath.back(), getUsdRunTimeId(), '/') | ||
auto ps = Ufe::PathSegment(_srcPath.back(), getUsdRunTimeId(), '/'); | ||
childPath = _dstPath.empty() ? ps : _dstPath + ps; | ||
} else { | ||
// USD duplicate to Maya | ||
: _dstPath + _srcPath.back(); | ||
if (_dstPath.empty()) { | ||
childPath = Ufe::PathString::path("|" + _srcPath.back().string()); | ||
} else { | ||
childPath = _dstPath + _srcPath.back(); | ||
} | ||
} |
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.
Had to rework logic to handle when _dstPath is empty.
const Ufe::Path& ufePulledPath, | ||
const MObject& mayaObject, | ||
const UsdMayaPrimUpdaterContext& context) | ||
PushCustomizeSrc pushExport(const MObject& mayaObject, const UsdMayaPrimUpdaterContext& context) |
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.
Removed unused input var ufePullPath
MayaUsdProxyShapeBase* srcProxyShape | ||
= srcPath.empty() ? nullptr : MayaUsd::ufe::getProxyShape(srcPath); | ||
MayaUsdProxyShapeBase* dstProxyShape | ||
= dstPath.empty() ? nullptr : MayaUsd::ufe::getProxyShape(dstPath); |
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.
Either of these is now allowed to be null.
MString script; | ||
script.format( | ||
"^1s \"^2s\" \"|world\"", | ||
"^1s \"^2s\" \"\"", |
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.
Replace "world" with empty string which is now handled in command.
MAYA-131348 - Nothing prevents users from naming nodes "world", which breaks USD workflow