-
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
MAYA-110489 - Prim AE template: categories persist their expand/colla… #1372
MAYA-110489 - Prim AE template: categories persist their expand/colla… #1372
Conversation
sectionsToCollapse = ['Curves', 'Point Based', 'Geometric Prim', 'Boundable', | ||
'Imageable', 'Field Asset', 'Light'] | ||
collapse = sectionName in sectionsToCollapse | ||
self.createSection(sectionName, attrsToAdd, collapse) |
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.
This is a simple fix for another JIRA item (to collapse certain sections by default).
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 guess the hard-coded list is O.K. because it won't change much?
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.
Right it was a list given to me in the JIRA item. It would only change if Nat wants a change.
sectionsToCollapse = ['Curves', 'Point Based', 'Geometric Prim', 'Boundable', | ||
'Imageable', 'Field Asset', 'Light'] | ||
collapse = sectionName in sectionsToCollapse | ||
self.createSection(sectionName, attrsToAdd, collapse) |
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 guess the hard-coded list is O.K. because it won't change much?
lib/mayaUsd/ufe/UsdAttribute.cpp
Outdated
@@ -118,7 +117,11 @@ getUsdAttributeValueAsString(const PXR_NS::UsdAttribute& attr, const PXR_NS::Usd | |||
return os.str(); | |||
} | |||
|
|||
UFE_ASSERT_MSG(false, kErrorMsgFailedConvertToString); | |||
try { | |||
UFE_ASSERT_MSG(false, kErrorMsgFailedConvertToString); |
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.
Because this asserts on false, it will always assert --- and you never want it to assert. Just remove the line and return an empty string.
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 actually left this one here on purpose. Asserting here would mean that for some reason we were unable to get the attribute value as a string. So I wanted this to fire so that we would see it and possibly make a fix.
PXR_NS::TfToken tok(value); | ||
setUsdAttr<PXR_NS::TfToken>(fUsdAttr, tok); | ||
} | ||
|
||
Ufe::UndoableCommand::Ptr UsdAttributeEnumString::setCmd(const std::string& value) | ||
{ | ||
auto self = std::dynamic_pointer_cast<UsdAttributeEnumString>(shared_from_this()); | ||
UFE_ASSERT_MSG(self, kErrorMsgInvalidType); |
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.
If self is false just return a nullptr.
PXR_NS::TfToken tok(value); | ||
setUsdAttr<PXR_NS::TfToken>(fUsdAttr, tok); | ||
return; | ||
} | ||
|
||
// If we get here it means the USDAttribute type wasn't TfToken or string. | ||
UFE_ASSERT_MSG(false, kErrorMsgInvalidType); |
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.
Just remove the line.
…pse state * Set new forceRebuild flag true to keep our prim template always destroy/recreate itself. This is needed because we are dynmaically changing the transform section and we do not know the attributes to show and their order. * Fixed bug with xformOpOrder change where copied AE tabs were not freshing to show/remove updated transforms. * Fixed a bug in UsdAttribute where setting a value (that had no previous value) would throw error. MAYA-110215 - On AE template I'd like to see some categories collapsed * Simple logic to collapse (by default) certain categories.
…pse state * Code review feedback.
dc8ce0e
to
394ef98
Compare
@ppt-adsk As discussed I removed all the UFE_ASSERT_MSG and replaced them with TF_XXX (from USD). |
…pse state * Fix clang-format error.
MAYA-110489 - Prim AE template: categories persist their expand/collapse state
we are dynmaically changing the transform section and we do not know the attributes to show and their order.
MAYA-110215 - On AE template I'd like to see some categories collapsed