-
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
Use data model undo framework for attribute undo. #1134
Conversation
@@ -140,6 +143,31 @@ void setUsdAttributeVectorFromUfe( | |||
UFE_ASSERT_MSG(b, kErrorMsgFailedSet); | |||
} | |||
|
|||
template <typename T, typename A = MayaUsd::ufe::TypedUsdAttribute<T>> | |||
class SetUndoableCommand : public Ufe::UndoableCommand |
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.
Simple class that uses the new UsdUndoableItem support.
@@ -557,3 +557,50 @@ def testObservation(self): | |||
self.assertEqual(ball34Obs.notifications, 3) | |||
self.assertEqual(ball35Obs.notifications, 3) | |||
self.assertEqual(globalObs.notifications, 7) | |||
|
|||
# Run last to avoid file new disturbing other tests. | |||
def testZAttrChangeRedoAfterPrimCreateRedo(self): |
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.
Test-Driven Development: wrote test first, it failed (crashed), coded fix, test now passes.
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.
Great work with the test.
All Windows Python 2 builds failed because of lack of disk space errors, but other builds succeeded. I therefore believe this pull request is good to go. |
UsdAttribute derived classes were not overriding the Ufe::Attribute::setCmd() virtual. This meant that we were using the implementation from UFE, rather than our new, data model correct undo system. This was bad in two ways:
Now fixed, with an automated test to validate the fix.