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

Cleanup UI folder #1037

Merged
merged 2 commits into from
Jan 8, 2021
Merged

Cleanup UI folder #1037

merged 2 commits into from
Jan 8, 2021

Conversation

seando-adsk
Copy link
Collaborator

Cleanup UI folder

  • Suppress TBB deprecated messages.
  • Find proper debug TBB lib.
  • When Layer Editor is not built (i.e. Qt not found) do not add the menu or register command.
  • Moved importDialog into subfolder.

* Suppress TBB deprecated messages.
* Find proper debug TBB lib.
* When Layer Editor is not built (i.e. Qt not found)
  do not add the menu or register command.
* Moved importDialog into subfolder.
@seando-adsk seando-adsk added adsk Related to Autodesk plugin build Related to building maya-usd repository labels Jan 5, 2021
Comment on lines +112 to +115
target_compile_definitions(${TARGET}
PRIVATE
TBB_SUPPRESS_DEPRECATED_MESSAGES
)
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 got tired of seeing hundreds of TBB warnings polluting our build log. This started with the update of TBB in Maya.

clew
)
if (CMAKE_BUILD_TYPE MATCHES Debug)
list(APPEND MAYA_LIBS_TO_FIND tbb_debug)
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 compile in debug all the time and just happened to notice one day that this one wasn't being found correctly in debug. We aren't using it in MayaUsd, which is why it never caused a problem.

Comment on lines 53 to 56
#ifdef WANT_QT_BUILD
static constexpr char kUSDLayerEditorItem[] = "USD Layer Editor";
static constexpr char kUSDLayerEditorLabel[] = "USD Layer Editor...";
#endif
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When we don't have Qt, we don't build the Layer Editor so it should not be available in any menu.

@@ -23,23 +23,14 @@ set(CMAKE_AUTOUIC ON)
add_library(${PROJECT_NAME} SHARED)

add_subdirectory(layerEditor)
add_subdirectory(importDialog)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With the addition of the Layer Editor, the "ui" folder now contains more than just the import dialog. So I moved the import dialog code to a sub-folder.

@@ -143,5 +125,5 @@ install(FILES ${HEADERS}
# -----------------------------------------------------------------------------
if (BUILD_TESTS)
# A simple executable used to test the import dialog.
add_subdirectory(demo)
add_subdirectory(importDialogDemo)
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 just renamed this folder to make it more obvious what it is.

Comment on lines +211 to +213
#if defined(WANT_QT_BUILD)
registerCommandCheck<MayaUsd::LayerEditorWindowCommand>(plugin);
#endif
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When no Qt, don't register the command that is used to open the Layer Editor (since we didn't build the layer editor). Note: I left the two commands above in since they are built even when no Qt (they are in a different folder from the "ui/layerEditor"

Comment on lines +104 to +114
if (`exists mayaUsdLayerEditorWindow`) {
if (!`runTimeCommand -exists mayaUsdOpenUsdLayerEditor`) {
runTimeCommand -default true
-label "USD Layer Editor"
-annotation "Organize and edit USD data in layers"
-category "Menu items.Common.Windows.General Editors"
-command "mayaUsdLayerEditorWindow mayaUsdLayerEditor"
-image "USD_generic.png"
mayaUsdOpenUsdLayerEditor;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't create the runtime command to open the LE if there is no command for the LE window.

Copy link
Contributor

Choose a reason for hiding this comment

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

All of these "exists" checks are for the existence of the command and not the UI right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. One of my other changes is only register the "mayaUsdLayerEditorWindow" command when the Layer Editor was built (i.e. Qt is found). So if we don't have this command we won't create the runtime command to open the LE either.

@@ -165,7 +167,7 @@ global proc mayaUsdMenu_windowMenuCallback() {
// mayaUsdMenu_windowMenuCallback
// setup the items in Maya's "Window->General Editors" menu
global proc mayaUsdMenu_generalEditorsMenuCallback() {
if (!(`menuItem -query -exists wmUsdLayerEditorMenuitem`))
if (`exists mayaUsdLayerEditorWindow` && !(`menuItem -query -exists wmUsdLayerEditorMenuitem`))
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 makes sure to not add the "USD Layer Editor" under the Maya "Windows" menu.

@seando-adsk
Copy link
Collaborator Author

Note: this will fix the issue discovered in #1005 where they had built without Qt (so no Layer Editor), but the Layer Editor menu item was there and they got an error when clicking on it.

Copy link
Contributor

@HamedSabri-adsk HamedSabri-adsk left a comment

Choose a reason for hiding this comment

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

Looking good. Thank you for doing this.

Copy link
Contributor

@fowlertADSK fowlertADSK left a comment

Choose a reason for hiding this comment

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

LGTM

@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 8, 2021
@kxl-adsk kxl-adsk merged commit 6f9cf2a into dev Jan 8, 2021
@kxl-adsk kxl-adsk deleted the donnels/cleanup_ui_folder branch January 8, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin build Related to building maya-usd repository 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.

5 participants