-
Notifications
You must be signed in to change notification settings - Fork 203
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
MAYA-128473 - Move UFE to its own Project #3109
Conversation
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
# 7. C++ standard library headers | ||
# 8. C system headers | ||
# 9. Conditional includes | ||
# 4. UsdUfe headers |
There was a problem hiding this comment.
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.
MayaUsdHierarchy.cpp | ||
MayaUsdHierarchyHandler.cpp | ||
MayaUsdRootChildHierarchy.cpp |
There was a problem hiding this comment.
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.
#ifdef UFE_V3_FEATURES_AVAILABLE | ||
usdUfeHandlers.hierarchyHandler = MayaUsdHierarchyHandler::create(); | ||
#endif |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
// clang-format off | ||
void wrapGlobal() | ||
{ | ||
def("getMayaRunTimeId", ufe::getMayaRunTimeId); | ||
|
||
def("getUsdRunTimeId", ufe::getUsdRunTimeId); | ||
} | ||
// clang-format on |
There was a problem hiding this comment.
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.
Hi @seando-adsk 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. |
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() |
There was a problem hiding this comment.
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.
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. |
Thanks, that does help me understand the implications somewhat. |
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 |
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
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.
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