-
Notifications
You must be signed in to change notification settings - Fork 202
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 - Part 9 #3161
MAYA-128473 - Move UFE to its own Project - Part 9 #3161
Conversation
* Moved following to UsdUfe: ** UsdCamera / UsdCameraHandler ** Functions: usdPathToUfePathSegment, ConvertUnit
* Moved StagesSubject to UsdUfe. * Create new DCC functions for set/get of stage and stagePath.
* Make UsdUfe buildable on its own. * Remove double-checking of pointer for DCC mandatory functions.
if (BUILD_MAYAUSD_LIBRARY) | ||
find_package(Maya 2018 REQUIRED) | ||
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.
I added bunch of cmake changes to make UsdUfe buildable on its own. This library only needs Usd & Ufe (no Maya, etc).
message(AUTHOR_WARNING "========================================================================================= \ | ||
UFE is not available in Maya${MAYA_MAJOR_VERSION}. Maya2019 and later are supported only. \ | ||
========================================================================================= ") | ||
if(DEFINED MAYA_APP_VERSION) |
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.
If we don't call find_package(Maya)
above then MAYA_APP_VERSION
is not defined.
dccFunctions.stageAccessorFn = MayaUsd::ufe::getStage; | ||
dccFunctions.stagePathAccessorFn = MayaUsd::ufe::stagePath; |
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.
Two new required DCC functions for the StagesSubject.
if (handlers.cameraHandler) | ||
runTimeMgr.setCameraHandler(usdRtid, handlers.cameraHandler); |
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.
CameraHandler was moved to UsdUfe and we have no Maya derived version
auto ss = MayaStagesSubject::create(); | ||
auto usdRtid = UsdUfe::initialize(dccFunctions, usdUfeHandlers, ss); |
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.
We create the MayaStagesSubject (derived from StagesSubject in UsdUfe) and pass that to initialize. So UsdUfe won't created the base version it will save ours.
@@ -43,11 +44,17 @@ static const std::string kUSDRunTimeName("USD"); | |||
// with illegal 0 value. | |||
Ufe::Rtid g_USDRtid = 0; | |||
|
|||
// Subject singleton for observation of all USD stages. | |||
StagesSubject::Ptr g_StagesSubject; |
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.
UsdUfe will either create this or save the one passed to initialize.
#if !defined(NDEBUG) | ||
assert(gUfePathToPrimFn != nullptr); | ||
#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.
As discussed I've removed the double nullptr check since for all these required DCC functions the check is done when the set is called (from initialize). So it should never be null here.
* Build fix for older Maya (accidentally removed ufe version compat include).
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.
LGTM.
MAYA-128473 - Move UFE to its own Project - Part 9
Commit 1:
* Moved following to UsdUfe:
** UsdCamera / UsdCameraHandler
** Functions: usdPathToUfePathSegment, ConvertUnit
Commit 2:
* Moved StagesSubject to UsdUfe.
* Create new DCC functions for set/get of stage and stagePath.
Commit 3:
* Make UsdUfe buildable on its own.
* Remove double-checking of pointer for DCC mandatory functions.