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

PART V: clean up mayaUsdPlugin #392

Conversation

HamedSabri-adsk
Copy link
Contributor

  • mayaUsdPlugin promotion headers are now created under mayaUsdPlugin and not mayaUsd
  • clean up include order and directive

Hamed Sabri added 4 commits March 27, 2020 07:32
…eLists.txt.

- fix build/usage requirements for mayaUsdUtils and mayaUsd_Translators, testMayaUsdUI
- don't rely on ${PROJECT_NAME} because of the folder restructure.
… and not mayaUsd

- clean up include order and directive
Copy link
Contributor

@pmolodo pmolodo left a comment

Choose a reason for hiding this comment

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

So, as I discussed in part 4, I think that headers that aren't installed should be considered private, not promoted, and included with private-header syntax. Otherwise, what is considered a private header?

Also, as with last 2 parts, were associated header changes.

There's also the issue of what's considered 7. Your project’s headers vs 4. Other libraries’ headers - I go into more detail in one of my notes below.

plugin/adsk/plugin/ProxyShape.cpp Outdated Show resolved Hide resolved
plugin/adsk/plugin/ProxyShape.h Outdated Show resolved Hide resolved
plugin/adsk/plugin/CMakeLists.txt Outdated Show resolved Hide resolved

#include <mayaUsd/base/api.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

What requires this header? A quick search of the directory didn't show anything using MAYAUSD_CORE_*, MAYAUSD_MACROS_* or MAYAUSD_TEMPLATE_*.

plugin/adsk/plugin/exportTranslator.cpp Outdated Show resolved Hide resolved
plugin/adsk/plugin/plugin.cpp Outdated Show resolved Hide resolved
#include "importTranslator.h"
#include "exportTranslator.h"
#include "ProxyShape.h"
#include <mayaUsd/base/api.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed?

plugin/adsk/plugin/plugin.cpp Outdated Show resolved Hide resolved

#include <mayaUsd/utils/undoHelperCommand.h>
#if defined(WANT_QT_BUILD)
#include <mayaUsd/ui/cmds/USDImportDialogCmd.h>
#include <mayaUsdUI/ui/cmds/USDImportDialogCmd.h>
#endif

#if defined(WANT_UFE_BUILD)
#include <mayaUsd/ufe/Global.h>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Conditional includes at end

plugin/adsk/plugin/plugin.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

I agree with all of @elrond79's feedback.

If the private headers have to be promoted so that they end up in the build tree, then I'm ok with that, but we should definitely be including them using double-quotes and file-relative paths. Only publicly available headers should be in angle braces.

@HamedSabri-adsk
Copy link
Contributor Author

I read through all of the comments in all 5 PRs and hopefully I haven't missed anything.

Thank you @elrond79 @mattyjams @ppt-adsk @seando-adsk again for all the great and detailed feedback.

Header order, blank spaces

My original goal in this large PR was to eliminate things that clang-format couldn't handle (eliminating relative paths) and I honestly spent little on cosmetics and let clang-format later catch them. I do also understand that we have cases where clang-format can't be smart enough to handle certain ordering.

If people are Ok, I can spend a bit more time on some of the cosmetic ordering so at least it is as close as possible to the coding guideline since I am have some changes to make in this area anyways. Any thoughts?

Associated headers

I am glad we all have the same understanding/agreement. Internally we have an action item to clarify this a bit more in the coding guideline document.

Header promotion

I do agree with all the comments around not promoting private headers. One of the main reasons we have the private header files promoted is just so that they simply end up in the build tree and help including them using the full path inside their own project (both in associated cpp or any other files).

#include "mayaUsd/render/vp2RenderDelegate/draw_item.h"
vs simply
#include "draw_item.h"

To sum it up, we have 2 solutions:

A- don't promote private headers ( headers that don't installed ) and include them using quotes and no full-path which would also simplifies the CMakelists.txt
e.g

draw_item.cpp
#include "draw_item.h"

basisCurves.cpp
#include "draw_item.h"

B- promote private headers ( headers that don't installed ) and include them using quotes and full-path

#include "mayaUsd/render/vp2RenderDelegate/draw_item.h"

Any Thoughts?

@kxl-adsk
Copy link

kxl-adsk commented Apr 1, 2020

Re Header promotion - applying guidelines is always a great test and I agree we should reword the guideline for private header files to be more explicit about no full-path. Let's do this once we merge these 5 big PRs.

For your question, option A is aligned with our guidelines.

@pmolodo
Copy link
Contributor

pmolodo commented Apr 1, 2020

Sounds good - made a PR to clarify guideline: #400

@pmolodo
Copy link
Contributor

pmolodo commented Apr 3, 2020

The new changes look good - I marked most of my comments as resolved. Are still a few items left unadressed though - the use of <mayaUsd/base/api.h>, and the location of the conditional includes (which I don't think will be automatically moved by clang-format).

@HamedSabri-adsk
Copy link
Contributor Author

The new changes look good - I marked most of my comments as resolved. Are still a few items left unadressed though - the use of <mayaUsd/base/api.h>, and the location of the conditional includes (which I don't think will be automatically moved by clang-format).

Thanks. I will address whatever is left which shouldn't be as many once we have these 5 PRs merged.

@HamedSabri-adsk HamedSabri-adsk merged commit fc11cb0 into sabrih/MAYA-104002/clean_up_part_1 Apr 6, 2020
@HamedSabri-adsk HamedSabri-adsk deleted the sabrih/MAYA-104002/clean_up_part_5 branch April 6, 2020 20:25
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one cosmetic note, but likely addressed by clang-format.

Thanks @HamedSabri-adsk!

Comment on lines 22 to +25
#include <mayaUsd/fileio/jobs/jobArgs.h>
#include <mayaUsd/fileio/jobs/readJob.h>
#include <mayaUsd/fileio/shading/shadingModeRegistry.h>
#include <mayaUsd/fileio/jobs/writeJob.h>

#include "pxr/base/gf/interval.h"
#include "pxr/base/vt/dictionary.h"
#include <mayaUsd/fileio/shading/shadingModeRegistry.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

The mayaUsd group here should move to the bottom after the pxr group.

mattyjams added a commit to mattyjams/maya-usd that referenced this pull request Apr 9, 2020
Following the merge of PRs Autodesk#388 through Autodesk#392, the header reorganization created
some new sites where M3dView.h was being included earlier than sdf/types.h.

This change applies an existing pattern of including sdf/types.h early to work
around this issue and fix compiling for Maya 2019 (and earlier).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building maya-usd repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants