-
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
Changes from 3 commits
45ced7b
e29867b
defd003
9e432c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,9 @@ endif() | |
# modules and definitions | ||
#------------------------------------------------------------------------------ | ||
include(cmake/utils.cmake) | ||
find_package(Maya 2018 REQUIRED) | ||
if (BUILD_MAYAUSD_LIBRARY) | ||
find_package(Maya 2018 REQUIRED) | ||
endif() | ||
|
||
if(APPLE AND BUILD_UB2 AND NOT MAYA_MACOSX_BUILT_WITH_UB2) | ||
message(WARNING "Maya was NOT built with Universal Binary 2") | ||
|
@@ -117,9 +119,16 @@ message(STATUS " PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}") | |
message(STATUS " PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}") | ||
message(STATUS " Python_EXECUTABLE = ${Python_EXECUTABLE}") | ||
|
||
include(cmake/jinja.cmake) | ||
if (BUILD_MAYAUSD_LIBRARY) | ||
include(cmake/jinja.cmake) | ||
endif() | ||
|
||
find_package(USD 0.21.11 REQUIRED) | ||
if (BUILD_MAYAUSD_LIBRARY OR BUILD_AL_PLUGIN OR BUILD_TESTS) | ||
if(NOT USD_GENSCHEMA) | ||
message(FATAL_ERROR "Building MayaUsd requires usdGenSchema (from USD)") | ||
endif() | ||
endif() | ||
if (CMAKE_WANT_MATERIALX_BUILD) | ||
# Requires at least USD 21.08 for hdMtlx module and USD must have been built with MaterialX: | ||
if(NOT TARGET hdMtlx) | ||
|
@@ -129,11 +138,13 @@ if (CMAKE_WANT_MATERIALX_BUILD) | |
endif() | ||
include(cmake/usd.cmake) | ||
|
||
if(${MAYA_APP_VERSION} STRLESS "2019" AND CMAKE_WANT_UFE_BUILD) | ||
set(CMAKE_WANT_UFE_BUILD OFF) | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. If we don't call |
||
if (${MAYA_APP_VERSION} STRLESS "2019" AND CMAKE_WANT_UFE_BUILD) | ||
set(CMAKE_WANT_UFE_BUILD OFF) | ||
message(AUTHOR_WARNING "========================================================================================= \ | ||
UFE is not available in Maya${MAYA_MAJOR_VERSION}. Maya2019 and later are supported only. \ | ||
========================================================================================= ") | ||
endif() | ||
endif() | ||
|
||
if(CMAKE_WANT_UFE_BUILD) | ||
|
@@ -163,15 +174,16 @@ if(DEFINED QT_LOCATION) | |
if(BUILD_WITH_QT_6) | ||
set(QT_VERSION "6.5") | ||
message(STATUS "Setting Qt version to Qt ${QT_VERSION}") | ||
elseif(${MAYA_APP_VERSION} STRLESS_EQUAL "2019") | ||
set(QT_VERSION "5.6") | ||
message(STATUS "Setting Qt version to Qt ${QT_VERSION}") | ||
elseif(${MAYA_APP_VERSION} STRLESS_EQUAL "2020") | ||
set(QT_VERSION "5.12") | ||
message(STATUS "Setting Qt version to Qt ${QT_VERSION}") | ||
else() # 2022, 2023, 2024 | ||
set(QT_VERSION "5.15") | ||
message(STATUS "Setting Qt version to Qt ${QT_VERSION}") | ||
else() | ||
set(QT_VERSION "5.15") # default version Maya 2022/2023/2024 | ||
if(DEFINED MAYA_APP_VERSION) | ||
if(${MAYA_APP_VERSION} STRLESS_EQUAL "2019") | ||
set(QT_VERSION "5.6") | ||
elseif(${MAYA_APP_VERSION} STRLESS_EQUAL "2020") | ||
set(QT_VERSION "5.12") | ||
endif() | ||
message(STATUS "Setting Qt version to Qt ${QT_VERSION}") | ||
endif() | ||
endif() | ||
endif() | ||
set(CMAKE_PREFIX_PATH "${QT_LOCATION}") | ||
|
@@ -198,7 +210,9 @@ include(cmake/compiler_config.cmake) | |
#------------------------------------------------------------------------------ | ||
# gulrak filesystem | ||
#------------------------------------------------------------------------------ | ||
include(cmake/gulrak.cmake) | ||
if (BUILD_MAYAUSD_LIBRARY OR BUILD_AL_PLUGIN) | ||
include(cmake/gulrak.cmake) | ||
endif() | ||
|
||
#------------------------------------------------------------------------------ | ||
# test | ||
|
@@ -215,9 +229,7 @@ endif() | |
#------------------------------------------------------------------------------ | ||
# lib | ||
#------------------------------------------------------------------------------ | ||
if (BUILD_MAYAUSD_LIBRARY) | ||
add_subdirectory(lib) | ||
endif() | ||
add_subdirectory(lib) | ||
|
||
#------------------------------------------------------------------------------ | ||
# plugins | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,9 @@ | |
|
||
#include "private/UfeNotifGuard.h" | ||
|
||
#include <mayaUsd/ufe/MayaStagesSubject.h> | ||
#include <mayaUsd/ufe/ProxyShapeHandler.h> | ||
#include <mayaUsd/ufe/ProxyShapeHierarchyHandler.h> | ||
#include <mayaUsd/ufe/StagesSubject.h> | ||
#include <mayaUsd/ufe/UsdSceneItemOpsHandler.h> | ||
#include <mayaUsd/ufe/UsdTransform3dHandler.h> | ||
#include <mayaUsd/ufe/Utils.h> | ||
|
@@ -29,7 +29,6 @@ | |
#include <mayaUsd/ufe/MayaUsdObject3dHandler.h> | ||
#include <mayaUsd/ufe/ProxyShapeContextOpsHandler.h> | ||
#include <mayaUsd/ufe/UsdAttributesHandler.h> | ||
#include <mayaUsd/ufe/UsdCameraHandler.h> | ||
#include <mayaUsd/ufe/UsdContextOpsHandler.h> | ||
#include <mayaUsd/ufe/UsdTransform3dCommonAPI.h> | ||
#include <mayaUsd/ufe/UsdTransform3dFallbackMayaXformStack.h> | ||
|
@@ -145,9 +144,6 @@ Ufe::PathMappingHandler::Ptr g_MayaPathMappingHandler; | |
Ufe::UIInfoHandler::Ptr g_MayaUIInfoHandler; | ||
#endif | ||
|
||
// Subject singleton for observation of all USD stages. | ||
StagesSubject::Ptr g_StagesSubject; | ||
|
||
//------------------------------------------------------------------------------ | ||
// Functions | ||
//------------------------------------------------------------------------------ | ||
|
@@ -162,6 +158,8 @@ MStatus initialize() | |
|
||
// Set the Maya specific functions required for the UsdUfe plugin to work correctly. | ||
UsdUfe::DCCFunctions dccFunctions; | ||
dccFunctions.stageAccessorFn = MayaUsd::ufe::getStage; | ||
dccFunctions.stagePathAccessorFn = MayaUsd::ufe::stagePath; | ||
Comment on lines
+161
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two new required DCC functions for the StagesSubject. |
||
dccFunctions.ufePathToPrimFn = MayaUsd::ufe::ufePathToPrim; | ||
dccFunctions.timeAccessorFn = MayaUsd::ufe::getTime; | ||
dccFunctions.isAttributeLockedFn = MayaUsd::Editability::isAttributeLocked; | ||
|
@@ -203,7 +201,6 @@ MStatus initialize() | |
usdUfeHandlers.object3dHandler = MayaUsdObject3dHandler::create(); | ||
handlers.contextOpsHandler = UsdContextOpsHandler::create(); | ||
handlers.uiInfoHandler = UsdUIInfoHandler::create(); | ||
handlers.cameraHandler = UsdCameraHandler::create(); | ||
|
||
#ifdef UFE_V4_FEATURES_AVAILABLE | ||
|
||
|
@@ -269,7 +266,8 @@ MStatus initialize() | |
|
||
// Initialize UsdUfe which will register all the default handlers | ||
// and the overrides we provide. | ||
auto usdRtid = UsdUfe::initialize(dccFunctions, usdUfeHandlers); | ||
auto ss = MayaStagesSubject::create(); | ||
auto usdRtid = UsdUfe::initialize(dccFunctions, usdUfeHandlers, ss); | ||
Comment on lines
+269
to
+270
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
// TEMP (UsdUfe) | ||
// Can only call Ufe::RunTimeMgr::register_() once for a given runtime name. | ||
|
@@ -287,8 +285,6 @@ MStatus initialize() | |
runTimeMgr.setContextOpsHandler(usdRtid, handlers.contextOpsHandler); | ||
if (handlers.uiInfoHandler) | ||
runTimeMgr.setUIInfoHandler(usdRtid, handlers.uiInfoHandler); | ||
if (handlers.cameraHandler) | ||
runTimeMgr.setCameraHandler(usdRtid, handlers.cameraHandler); | ||
Comment on lines
-290
to
-291
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CameraHandler was moved to UsdUfe and we have no Maya derived version |
||
#ifdef UFE_V4_FEATURES_AVAILABLE | ||
if (handlers.lightHandler) | ||
runTimeMgr.setLightHandler(usdRtid, handlers.lightHandler); | ||
|
@@ -336,8 +332,6 @@ MStatus initialize() | |
if (usdRtid == 0) | ||
return MS::kFailure; | ||
|
||
g_StagesSubject = StagesSubject::create(); | ||
|
||
// Register for UFE string to path service using path component separator '/' | ||
UFE_V2(Ufe::PathString::registerPathComponentSeparator(usdRtid, '/');) | ||
|
||
|
@@ -389,8 +383,6 @@ MStatus finalize(bool exiting) | |
g_MayaUIInfoHandler.reset(); | ||
#endif | ||
|
||
g_StagesSubject.Reset(); | ||
|
||
MMessage::removeCallback(gExitingCbId); | ||
|
||
return MS::kSuccess; | ||
|
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).