Skip to content
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

Merged
merged 3 commits into from
Apr 29, 2021

Conversation

seando-adsk
Copy link
Collaborator

MAYA-110489 - Prim AE template: categories persist their expand/collapse 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.

@seando-adsk seando-adsk added the ufe Related to UFE component in Maya label Apr 28, 2021
@seando-adsk seando-adsk requested a review from ppt-adsk April 28, 2021 17:00
Comment on lines +486 to +495
sectionsToCollapse = ['Curves', 'Point Based', 'Geometric Prim', 'Boundable',
'Imageable', 'Field Asset', 'Light']
collapse = sectionName in sectionsToCollapse
self.createSection(sectionName, attrsToAdd, collapse)
Copy link
Collaborator Author

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).

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Comment on lines +486 to +495
sectionsToCollapse = ['Curves', 'Point Based', 'Geometric Prim', 'Boundable',
'Imageable', 'Field Asset', 'Light']
collapse = sectionName in sectionsToCollapse
self.createSection(sectionName, attrsToAdd, collapse)
Copy link
Collaborator

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?

@@ -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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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);
Copy link
Collaborator

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);
Copy link
Collaborator

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.
@seando-adsk seando-adsk force-pushed the donnels/MAYA-110489/ufe_ae_keep_expand_collapse_state branch from dc8ce0e to 394ef98 Compare April 29, 2021 13:40
@seando-adsk
Copy link
Collaborator Author

@ppt-adsk As discussed I removed all the UFE_ASSERT_MSG and replaced them with TF_XXX (from USD).

@seando-adsk seando-adsk requested a review from ppt-adsk April 29, 2021 13:43
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 29, 2021
@kxl-adsk kxl-adsk merged commit 689e418 into dev Apr 29, 2021
@kxl-adsk kxl-adsk deleted the donnels/MAYA-110489/ufe_ae_keep_expand_collapse_state branch April 29, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe Related to UFE component in Maya
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants