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-102330 Add UI to display the number of selected prims and changed variants #675

Merged
merged 3 commits into from
Aug 4, 2020

Conversation

fowlertADSK
Copy link
Contributor

  1. Help menu in the Hierarchy View dialog.

  2. Might not be called from anywhere, but noticed a typo in ImportData::hasVariantSelections that I fixed.

  3. I think we were leaking every ItemDelegate we created. Qt docs say that QAbstractItemView::setItemDelegate does not take ownership of the delegate you pass to it but we were calling it like it would.

  4. Made the checkbox column not resizable.

  5. Main part:
    Adding UI to display a couple counts as information to the user. One is the total number of prims that are checked, and the other is the number of variants that have been modified and are checked. This info is displayed both in the Hierarchy View and also the file dialog import options after exiting the HV.

In the file dialog import options we also added a button to reset the import data.

The model is responsible for doing all of the counting.
The model sends signals to the dialog when it has updated the counts and the dialog will update the labels that display the info.
The delegate is where the editing of the variants happens so I connect it to the model with a signal/slot so that updating a variant will trigger the model to update the count.

The file dialog options UI just needs to display the same #’s that the Hierarchy View was displaying, so I store those two #’s in the ImportData and then added a couple query flags to the command so the options UI can get at it.

… of modified variants in both the Hierarchy View and the Import dialog options UI.

MAYA-102330 Add reset button to the file dialog
MAYA-105783 Adding Help menu for the Hierarchy View
Comment on lines +90 to +94
rowLayout -numberOfColumns 3 -cw 1 $cw1 -cat 1 "right" 0 -cal 1 "right" mayaUsd_NBPrimsInScopeRL;
text -label "";
text -label $nbPrimsInScopeLabel;
text -label "---" mayaUsd_NBPrimsInScopeLabel;
setParent ..;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an empty text label at the start of these rowLayouts because it was just easier to line up with the UI above it.

@@ -118,6 +118,7 @@ void ItemDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, cons
if (nullptr != treeItem)
{
treeItem->setVariantSelectionModified();
Q_EMIT variantModified();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could have cast the model pointer that is passed into this function to a TreeModel and told it directly to update its count (which is what this signal will end up triggering), but I was already hooking up signal/slots to make sure all the UI gets updated correctly so also doing this with a signal made sense.

lib/mayaUsd/fileio/importData.h Outdated Show resolved Hide resolved
lib/usd/ui/TreeItem.h Show resolved Hide resolved
lib/usd/ui/USDImportDialog.cpp Show resolved Hide resolved
plugin/adsk/scripts/mayaUsdTranslatorImport.mel Outdated Show resolved Hide resolved
@kxl-adsk kxl-adsk added the import-export Related to Import and/or Export label Jul 23, 2020
@fowlertADSK fowlertADSK added the ready-for-merge Development process is finished, PR is ready for merge label Aug 4, 2020
@kxl-adsk kxl-adsk merged commit 2abce79 into dev Aug 4, 2020
@kxl-adsk kxl-adsk deleted the fowlert/MAYA-105783/hierarchy_view_updates branch August 4, 2020 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants