-
Notifications
You must be signed in to change notification settings - Fork 202
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
EMSUSD-717: USD Prefs: "Use Display Color" preferences are maintained when user cancels change #3553
EMSUSD-717: USD Prefs: "Use Display Color" preferences are maintained when user cancels change #3553
Conversation
…tained when user cancels change * Fix cancel case and optimize when to call 'ogs -reset'
|
||
// Set a temporary optionVar saying that we have changed the untextured mode | ||
// so in case user cancels, we can do reset again. | ||
optionVar -transient -iv mayaUsd_PrefUntexturedModeChanged 1; |
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.
transient optionvars are not saved when exiting Maya. ogs -reset is not a cheap operation so we should not just call it unless needed (such as when opening the pref dialog we don't need to call it). Use this optionvar to keep track of when the untextured mode pref changes and only call ogs -reset when needed.
optionVar -remove mayaUsd_PrefUntexturedModeChanged; | ||
} | ||
|
||
if ($mode == "restore") { |
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.
Indentation seems off here..
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.
Sorry it is a mix of tabs/spaces. I'll fix it.
if ($mode == "restore") { | ||
if (`optionVar -q mayaUsd_PrefUntexturedModeChanged`) { | ||
// Need to refresh the viewport for display mayaUsd_ShowDisplayColorTextureOff | ||
ogs -reset; |
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.
Should we remove the mayaUsd_PrefUntexturedModeChanged
optionVar once the viewport is reset?
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.
That is covered by the "restore" case just below. when you click cancel on the prefs dialog this function will be called twice (restore, then remove). When you click save from the prefs dialog it will be called with "remove".
…tained when user cancels change * Fix indentation (code review comment)
EMSUSD-717: USD Preferences: "Use Display Color" preferences are maintained when user cancels change