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-128473 - Move UFE to its own Project #3109

Merged
merged 1 commit into from
May 25, 2023

Conversation

seando-adsk
Copy link
Collaborator

MAYA-128473 - Move UFE to its own Project

MAYA-128474 - UFE for USD: Remove Maya from UFE implementation

  • Initial usdUfe library creation.

  • ufeUsd library won't support Ufe v1. Remove Ufe v2 checks - it is minimum supported.

  • Moved following items to UsdUfe. ** UsdSceneItem

    • UfeVersionCompat.h
    • UsdUndoSetKindCommand
    • Functions: "isEditTargetLayerModifiable",
      • "getUsdRunTimeId", "uniqueName", "uniqueChildName", "UsdUndoAddNewPrimCommand"
    • UsdUndoCreateGroupCommand & UsdUndoUngroupCommand
    • UsdUndoReorderCommand
    • Edit routing (tokens, editRouter, editRouterContext)
    • Edit router python bindings (from mayaUsd.lib)
      • Kept Maya specific edit router (registered with new service) in new file mayaEditorRouter.{h/cpp}.
      • Added basic editing routing doc to UsdUfe.
    • UsdUndoInsertChildCommand
    • UsdRootChildHierarchy and split out MayaUsdRootChildHierarchy.
    • UsdHierarchy and split out MayaUsdHierarchy.
      • Both of these MayaXXX versions use the new childrenHook for the pulled objects.** UsdHierarchyHandler and split out MayaUsdHierarchyHandler.
    • Registration of USD hierarchyHandler
    • sendNotification() / duplicateLoadRules() / removeRulesForPath()
    • Util functions stripInstanceIndexFromUfePath, ufePathToInstanceIndex and isRootChild and the associated python wrappers.
  • Remove "private" folder from mayaUsd/ufe and use one in usdUfe instead.

  • Copied ufe/Utils.{h/cpp} - initially mostly commented out

  • Copied "Global.{h/cpp} to usdUfe (mostly empty for now).

  • Created 'usdUfe' python module.

    • Copied wrapGlobal & wrapUtils to usdUfe.
    • Imported into mayaUsd.ufe.
    • Moved python bindings for "getUsdRunTimeId" and "isEditTargetLayerModifiable".
  • Moved ufe/Utils helpers: applyCommandRestriction and applyCommandRestrictionNoThrow to UsdUfe.

  • Moved lib/mayaUsd/utils/layers.{h/cpp} to lib/usdUfe/utils.

  • Moved lib/usd/utils/util.{h/cpp} to lib/usdUfe/utils/usdUtils.

  • New ability to set Ufe path to prim function (setUfePathToPrimFn) which is a DCC specific operation. Set this in MayaUsd during ufe initialization.

  • Code review comments: use special "TEMP (UsdUfe)" tag to make them easier to find.

MAYA-128475 - UFE: Undo refactor for UFE USD implementation

MAYA-128474 - UFE for USD: Remove Maya from UFE implementation

  • Move "undo/UsdUndo*" (with debugCodes) to UsdUfe
  • Split UsdUndoBlock with new MayaUsdUndoBlock
  • Added new UsdUndoManagerAccessor to access UsdUndoManager private method
  • Move "UsdUndoableCommand" to UsdUfe

MAYA-128474 - UFE for USD: Remove Maya from UFE implementation

* Initial usdUfe library creation.
* ufeUsd library won't support Ufe v1.
  Remove Ufe v2 checks - it is minimum supported.

* Moved following items to UsdUfe.
** UsdSceneItem
** UfeVersionCompat.h
** UsdUndoSetKindCommand
** Functions: "isEditTargetLayerModifiable",
**   "getUsdRunTimeId", "uniqueName", "uniqueChildName",
     "UsdUndoAddNewPrimCommand"
** UsdUndoCreateGroupCommand & UsdUndoUngroupCommand
** UsdUndoReorderCommand
** Edit routing (tokens, editRouter, editRouterContext)
** Edit router python bindings (from mayaUsd.lib)
*** Kept Maya specific edit router (registered with new service)
    in new file mayaEditorRouter.{h/cpp}.
*** Added basic editing routing doc to UsdUfe.
** UsdUndoInsertChildCommand
** UsdRootChildHierarchy and split out MayaUsdRootChildHierarchy.
** UsdHierarchy and split out MayaUsdHierarchy.
*** Both of these MayaXXX versions use the new childrenHook for the
    pulled objects.** UsdHierarchyHandler and split out MayaUsdHierarchyHandler.
** Registration of USD hierarchyHandler
** sendNotification() / duplicateLoadRules() / removeRulesForPath()
** Util functions stripInstanceIndexFromUfePath, ufePathToInstanceIndex
   and isRootChild and the associated python wrappers.

* Remove "private" folder from mayaUsd/ufe and use one in
  usdUfe instead.
* Copied ufe/Utils.{h/cpp} - initially mostly commented out
* Copied "Global.{h/cpp} to usdUfe (mostly empty for now).
* Created 'usdUfe' python module.
  * Copied wrapGlobal & wrapUtils to usdUfe.
  * Imported into mayaUsd.ufe.
  * Moved python bindings for "getUsdRunTimeId" and
    "isEditTargetLayerModifiable".
* Moved ufe/Utils helpers: applyCommandRestriction and
  applyCommandRestrictionNoThrow to UsdUfe.
* Moved lib/mayaUsd/utils/layers.{h/cpp} to lib/usdUfe/utils.
* Moved lib/usd/utils/util.{h/cpp} to lib/usdUfe/utils/usdUtils.
* New ability to set Ufe path to prim function (setUfePathToPrimFn) which is
  a DCC specific operation. Set this in MayaUsd during ufe initialization.

* Code review comments: use special "TEMP (UsdUfe)" tag to make
  them easier to find.

MAYA-128475 - UFE: Undo refactor for UFE USD implementation
MAYA-128474 - UFE for USD: Remove Maya from UFE implementation

* Move "undo/UsdUndo*" (with debugCodes) to UsdUfe
* Split UsdUndoBlock with new MayaUsdUndoBlock
* Added new UsdUndoManagerAccessor to access UsdUndoManager
  private method
* Move "UsdUndoableCommand" to UsdUfe
@seando-adsk seando-adsk requested a review from ppt-adsk May 19, 2023 16:02
@seando-adsk seando-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label May 19, 2023
# 7. C++ standard library headers
# 8. C system headers
# 9. Conditional includes
# 4. UsdUfe headers
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added new section for the UsdUfe headers. Running clang-format locally moved all of them to this section.

Comment on lines +70 to +72
MayaUsdHierarchy.cpp
MayaUsdHierarchyHandler.cpp
MayaUsdRootChildHierarchy.cpp
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed put these files here since they need the pulledinfo which requires path mapping which is Ufe v3.

Comment on lines +181 to +183
#ifdef UFE_V3_FEATURES_AVAILABLE
usdUfeHandlers.hierarchyHandler = MayaUsdHierarchyHandler::create();
#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.

Only need this one in Ufe v3 (or greater). Otherwise the UsdHierarchyHandler registered by UsdUfe is fine.

auto usdTrans3dHandler = UsdTransform3dHandler::create();
auto usdSceneItemOpsHandler = UsdSceneItemOpsHandler::create();
g_USDRtid = runTimeMgr.register_(
kUSDRunTimeName, usdHierHandler, usdTrans3dHandler, usdSceneItemOpsHandler);
#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.

Ufe v1 - not supported anymore.

Comment on lines +23 to +28
// clang-format off
void wrapGlobal()
{
def("getMayaRunTimeId", ufe::getMayaRunTimeId);

def("getUsdRunTimeId", ufe::getUsdRunTimeId);
}
// clang-format on
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added clang-format off/on to stop it from creating a single line out of all of this.

@dgovil
Copy link
Collaborator

dgovil commented May 19, 2023

Hi @seando-adsk
Would you be able to provide a few details about the implications and decisions for this? Or is it purely around internal work that won't affect the open source project materially?

Some questions off the top of my head that I know I'll have to answer if it does affect the Maya USD project materially:

What portion of the maya USD UFE is transitioning to a new project?

Would that new project require a new CLA, and be on GitHub too?

Does the license remain the same?

There's just a lot of legal ramifications that I'm sure every contributor will need to prep for, so having the details before hand would help get ahead of those.

@ppt-adsk
Copy link
Collaborator

Hi @seando-adsk Would you be able to provide a few details about the implications and decisions for this? Or is it purely around internal work that won't affect the open source project materially?

Some questions off the top of my head that I know I'll have to answer if it does affect the Maya USD project materially:

What portion of the maya USD UFE is transitioning to a new project?

Would that new project require a new CLA, and be on GitHub too?

Does the license remain the same?

There's just a lot of legal ramifications that I'm sure every contributor will need to prep for, so having the details before hand would help get ahead of those.

I'll let @seando-adsk give the definitive answer, and I'm not a lawyer, but this should not affect the nature of the maya-usd open source project.

It is really an attempt to factor out of maya-usd those parts that are not Maya-dependent, for better re-use. Much of the USD implementation of UFE interfaces has nothing to do with Maya, but unfortunately over time some spurious or unnecessary Maya dependencies crept in.

With the new usdUfe library, these Maya dependencies have been removed, and we now have a library with the USD implementation of UFE interfaces where we cannot introduce new and incorrect Maya dependencies, so reuse will be much easier. Hope this helps.

Comment on lines +69 to +75
message(STATUS "MAYA_HAS_DISPLAY_LAYER_API is ${MAYA_HAS_DISPLAY_LAYER_API}")
if (MAYA_HAS_DISPLAY_LAYER_API)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
MAYA_HAS_DISPLAY_LAYER_API=1
)
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is Maya-specific. Do we need it? Hopefully the answer is no, otherwise we should make plans on how to get rid of it.

@neilh-adsk
Copy link
Collaborator

Hi @seando-adsk Would you be able to provide a few details about the implications and decisions for this? Or is it purely around internal work that won't affect the open source project materially?

Some questions off the top of my head that I know I'll have to answer if it does affect the Maya USD project materially:

What portion of the maya USD UFE is transitioning to a new project?

Would that new project require a new CLA, and be on GitHub too?

Does the license remain the same?

There's just a lot of legal ramifications that I'm sure every contributor will need to prep for, so having the details before hand would help get ahead of those.

Hi, @dgovil For now this is more a case of starting the process to allow the USD UFE runtime to be shareable across other projects, nothing should change in the functionality of MayaUSD at this stage. Some of these projects are internals for example MaxUSD is starting to look at UFE and it made sense to make this code as shareable as possible. The longer term direction of whether this becomes its own official project has not yet been decided and when the discussion starts in more seriousness I will will reach out to the community.

@dgovil
Copy link
Collaborator

dgovil commented May 23, 2023

Thanks, that does help me understand the implications somewhat.

@seando-adsk
Copy link
Collaborator Author

Hi @seando-adsk Would you be able to provide a few details about the implications and decisions for this? Or is it purely around internal work that won't affect the open source project materially?
Some questions off the top of my head that I know I'll have to answer if it does affect the Maya USD project materially:
What portion of the maya USD UFE is transitioning to a new project?
Would that new project require a new CLA, and be on GitHub too?
Does the license remain the same?
There's just a lot of legal ramifications that I'm sure every contributor will need to prep for, so having the details before hand would help get ahead of those.

Hi, @dgovil For now this is more a case of starting the process to allow the USD UFE runtime to be shareable across other projects, nothing should change in the functionality of MayaUSD at this stage. Some of these projects are internals for example MaxUSD is starting to look at UFE and it made sense to make this code as shareable as possible. The longer term direction of whether this becomes its own official project has not yet been decided and when the discussion starts in more seriousness I will will reach out to the community.

I should also mention that this is just the first pull-request in work that will continue in future PRs. This PR basically moved over everything required in order to move the UsdHierarchy interface. Next I'll probably focus on moving the UsdObject3d interface. I'm working in phases in order to not drift too far from dev branch and have to merge as other changes are made to the mayausd/ufe files.

@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label May 25, 2023
@seando-adsk seando-adsk merged commit 4d133df into dev May 25, 2023
@seando-adsk seando-adsk deleted the donnels/MAYA-128473/create_new_usdufe_project branch May 25, 2023 18:36
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-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants