-
Notifications
You must be signed in to change notification settings - Fork 203
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
Matrix op, common API undo / redo. #1586
Matrix op, common API undo / redo. #1586
Conversation
@@ -247,7 +252,7 @@ void StagesSubject::stageChanged( | |||
const TfToken nameToken = changedPath.GetNameToken(); | |||
auto usdPrimPathStr = changedPath.GetPrimPath().GetString(); | |||
auto ufePath = stagePath(sender) + Ufe::PathSegment(usdPrimPathStr, g_USDRtid, '/'); | |||
if (nameToken == UsdGeomTokens->xformOpOrder) { | |||
if (isTransformChange(nameToken)) { |
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.
Info-only changes had a different test from resync changes, which caused a bug during development of this branch, as we were missing a notification on undo. Factored out the correct notification test into a function, and used in in both places.
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.
@ppt-adsk To be clear, the bug was due to the fact that the check for UsdGeomXformOp::IsXformOp(nameToken)
was missing?
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.
Correct.
} | ||
|
||
void undo() override { _commonAPI.SetScale(_prevS, _time); } | ||
void redo() override { _commonAPI.SetScale(_s, _time); } | ||
void setValue(const GfVec3f& v) override { _commonAPI.SetScale(v, writeTime()); } | ||
|
||
// Executes the command by setting the rotation onto the transform op. |
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.
@ppt-adsk typo: "setting the rotation" ----> "setting the scale"
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.
Darned copy-paste... Good catch! Actually, this comment and the ones in the other classes were really low value, I just removed them locally.
While testing this PR, I noticed getting an error message when doing group undo/redo. The data model looks fine but the error message annoys me. I wonder if it is something to do with my recent group changes or if it is something else. I am going to look into today.
|
@@ -40,6 +41,8 @@ namespace { | |||
using namespace MayaUsd; | |||
using namespace MayaUsd::ufe; | |||
|
|||
void warnUnimplemented(const char* msg) { TF_WARN("Illegal call to unimplemented %s", msg); } |
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.
@ppt-adsk I don't see warnUnimplemented is being used?
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.
Another good catch! Refactored to UsdSetXformOpUndoableCommandBase.cpp, but forgot to remove the original. Removed locally.
O.K., that sounds great, as the assert says this really should not happen: a call to undo() is being generated while we're already in the undone state. |
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.
LGTM!
Pre-flight failed only on macOS Python 3 master, on a bizarre licensing error: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 97, in copyfile This is clearly a build infrastructure issue, so this branch is ready to merge. |
The goal of this pull request is to bring matrix op and common API Transform3d interfaces to the new UndoManager undo / redo capability. This will completely remove on undo any attrSpec's and primSpec's added during Transform3d edits. This capability was already present in Maya transform stacks and Maya fallback transform stacks.