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 - Part 9 #3161

Merged
merged 4 commits into from
Jun 15, 2023

Conversation

seando-adsk
Copy link
Collaborator

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.

* 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.
Comment on lines +88 to +90
if (BUILD_MAYAUSD_LIBRARY)
find_package(Maya 2018 REQUIRED)
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.

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)
Copy link
Collaborator Author

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.

Comment on lines +161 to +162
dccFunctions.stageAccessorFn = MayaUsd::ufe::getStage;
dccFunctions.stagePathAccessorFn = MayaUsd::ufe::stagePath;
Copy link
Collaborator Author

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.

Comment on lines -290 to -291
if (handlers.cameraHandler)
runTimeMgr.setCameraHandler(usdRtid, handlers.cameraHandler);
Copy link
Collaborator Author

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

Comment on lines +269 to +270
auto ss = MayaStagesSubject::create();
auto usdRtid = UsdUfe::initialize(dccFunctions, usdUfeHandlers, ss);
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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.

Comment on lines +185 to +187
#if !defined(NDEBUG)
assert(gUfePathToPrimFn != nullptr);
#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.

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.

@seando-adsk seando-adsk requested review from ppt-adsk and deboisj June 14, 2023 20:22
@seando-adsk seando-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Jun 14, 2023
* Build fix for older Maya (accidentally removed ufe version compat include).
Copy link
Collaborator

@ppt-adsk ppt-adsk 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 Jun 15, 2023
@seando-adsk seando-adsk merged commit 358a667 into dev Jun 15, 2023
@seando-adsk seando-adsk deleted the donnels/MAYA-128473/move_ufe_into_own_project_part9 branch June 15, 2023 14:58
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.

3 participants