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

Remove/replace all UFE_PREVIEW_VERSION_NUM #3020

Merged
merged 6 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cmake/modules/FindUFE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ if(UFE_INCLUDE_DIR AND EXISTS "${UFE_INCLUDE_DIR}/ufe/ufe.h")

if(UFE_MAJOR_VERSION VERSION_EQUAL "0")
math(EXPR UFE_PREVIEW_VERSION_NUM "${UFE_MINOR_VERSION} * 1000 + ${UFE_PATCH_LEVEL}")
elseif(UFE_VERSION VERSION_EQUAL "4.0.0")
# Temporary. Once next Maya PR is released with UFE v4.0.0 this should
# be removed (along with all the UFE_PREVIEW_VERSION_NUM checks).
set(UFE_PREVIEW_VERSION_NUM 4045)
elseif(UFE_VERSION VERSION_EQUAL "4.1.0")
# Temporary. Once next Maya PR is released with UFE v4.1.0 this should
# be removed (along with all the UFE_PREVIEW_VERSION_NUM checks).
Expand Down
143 changes: 31 additions & 112 deletions lib/mayaUsd/ufe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,66 +145,22 @@ if (v4_BatchOps IN_LIST UFE_PREVIEW_FEATURES)
endif()

if(CMAKE_UFE_V4_FEATURES_AVAILABLE)
if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4001)
target_sources(${PROJECT_NAME}
PRIVATE
UsdShaderNodeDef.cpp
UsdShaderNodeDefHandler.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4010)
target_sources(${PROJECT_NAME}
PRIVATE
UsdShaderAttributeDef.cpp
UsdShaderAttributeHolder.cpp
UsdUndoCreateFromNodeDefCommand.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4013)
target_sources(${PROJECT_NAME}
PRIVATE
ProxyShapeCameraHandler.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4020)
target_sources(${PROJECT_NAME}
PRIVATE
UsdConnections.cpp
UsdConnectionHandler.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4023)
target_sources(${PROJECT_NAME}
PRIVATE
UsdUINodeGraphNode.cpp
UsdUINodeGraphNodeHandler.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4024)
target_sources(${PROJECT_NAME}
PRIVATE
UsdUndoAttributesCommands.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4025)
target_sources(${PROJECT_NAME}
PRIVATE
UsdTransform3dRead.cpp
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4043)
target_sources(${PROJECT_NAME}
PRIVATE
UsdUndoConnectionCommands.cpp
)
endif()
target_sources(${PROJECT_NAME}
PRIVATE
UsdShaderNodeDef.cpp
UsdShaderNodeDefHandler.cpp
UsdShaderAttributeDef.cpp
UsdShaderAttributeHolder.cpp
UsdUndoCreateFromNodeDefCommand.cpp
ProxyShapeCameraHandler.cpp
UsdConnections.cpp
UsdConnectionHandler.cpp
UsdUINodeGraphNode.cpp
UsdUINodeGraphNodeHandler.cpp
UsdUndoAttributesCommands.cpp
UsdTransform3dRead.cpp
UsdUndoConnectionCommands.cpp
)
endif()

if(PXR_VERSION GREATER_EQUAL 2108 AND CMAKE_UFE_V2_FEATURES_AVAILABLE)
Expand Down Expand Up @@ -325,58 +281,21 @@ if (v4_BatchOps IN_LIST UFE_PREVIEW_FEATURES)
endif()

if(CMAKE_UFE_V4_FEATURES_AVAILABLE)
if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4001)
list(APPEND HEADERS
UsdShaderNodeDef.h
UsdShaderNodeDefHandler.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4010)
list(APPEND HEADERS
UsdShaderAttributeDef.h
UsdShaderAttributeHolder.h
UsdUndoCreateFromNodeDefCommand.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4013)
list(APPEND HEADERS
ProxyShapeCameraHandler.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4020)
list(APPEND HEADERS
UsdConnections.h
UsdConnectionHandler.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4023)
list(APPEND HEADERS
UsdUINodeGraphNode.h
UsdUINodeGraphNodeHandler.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4024)
list(APPEND HEADERS
UsdUndoAttributesCommands.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4025)
list(APPEND HEADERS
UsdTransform3dRead.h
)
endif()

if (${UFE_PREVIEW_VERSION_NUM} GREATER_EQUAL 4043)
list(APPEND HEADERS
UsdUndoConnectionCommands.h
)
endif()
list(APPEND HEADERS
UsdShaderNodeDef.h
UsdShaderNodeDefHandler.h
UsdShaderAttributeDef.h
UsdShaderAttributeHolder.h
UsdUndoCreateFromNodeDefCommand.h
ProxyShapeCameraHandler.h
UsdConnections.h
UsdConnectionHandler.h
UsdUINodeGraphNode.h
UsdUINodeGraphNodeHandler.h
UsdUndoAttributesCommands.h
UsdTransform3dRead.h
UsdUndoConnectionCommands.h
)
endif()

if(PXR_VERSION GREATER_EQUAL 2108 AND CMAKE_UFE_V2_FEATURES_AVAILABLE)
Expand Down
26 changes: 3 additions & 23 deletions lib/mayaUsd/ufe/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
#include <mayaUsd/ufe/UsdTransform3dMatrixOp.h>
#include <mayaUsd/ufe/UsdTransform3dMayaXformStack.h>
#include <mayaUsd/ufe/UsdTransform3dPointInstance.h>
#ifdef UFE_V4_FEATURES_AVAILABLE
#if (UFE_PREVIEW_VERSION_NUM >= 4025)
#include <mayaUsd/ufe/UsdTransform3dRead.h>
#endif
#endif
#include <mayaUsd/ufe/UsdUIInfoHandler.h>
#include <mayaUsd/ufe/UsdUIUfeObserver.h>
#endif
Expand All @@ -56,21 +51,14 @@
#include <mayaUsd/ufe/UsdMaterialHandler.h>
#endif
#ifdef UFE_V4_FEATURES_AVAILABLE
#if (UFE_PREVIEW_VERSION_NUM >= 4020)
#include <mayaUsd/ufe/UsdConnectionHandler.h>
#endif
#if (UFE_PREVIEW_VERSION_NUM >= 4023)
#include <mayaUsd/ufe/UsdTransform3dRead.h>
#include <mayaUsd/ufe/UsdUINodeGraphNodeHandler.h>
#endif
#if UFE_PREVIEW_BATCHOPS_SUPPORT
#include <mayaUsd/ufe/UsdBatchOpsHandler.h>
#endif
#if (UFE_PREVIEW_VERSION_NUM >= 4001)
#include <mayaUsd/ufe/UsdShaderNodeDefHandler.h>
#endif
#endif
#if defined(UFE_V4_FEATURES_AVAILABLE) && (UFE_PREVIEW_VERSION_NUM >= 4013)
#include <mayaUsd/ufe/ProxyShapeCameraHandler.h>
#include <mayaUsd/ufe/UsdShaderNodeDefHandler.h>
#endif
#if UFE_SCENE_SEGMENT_SUPPORT
#include <mayaUsd/ufe/ProxyShapeSceneSegmentHandler.h>
Expand Down Expand Up @@ -204,19 +192,13 @@ MStatus initialize()
#if UFE_MATERIALS_SUPPORT
handlers.materialHandler = UsdMaterialHandler::create();
#endif
#if (UFE_PREVIEW_VERSION_NUM >= 4020)
handlers.connectionHandler = UsdConnectionHandler::create();
#endif
#if (UFE_PREVIEW_VERSION_NUM >= 4023)
handlers.uiNodeGraphNodeHandler = UsdUINodeGraphNodeHandler::create();
#endif
#if UFE_PREVIEW_BATCHOPS_SUPPORT
handlers.batchOpsHandler = UsdBatchOpsHandler::create();
#endif
#if (UFE_PREVIEW_VERSION_NUM >= 4001)
handlers.nodeDefHandler = UsdShaderNodeDefHandler::create();
#endif
#endif

#if UFE_SCENE_SEGMENT_SUPPORT
// set up the SceneSegmentHandler
Expand All @@ -225,7 +207,7 @@ MStatus initialize()
= ProxyShapeSceneSegmentHandler::create(g_MayaSceneSegmentHandler);
Ufe::RunTimeMgr::instance().setSceneSegmentHandler(g_MayaRtid, proxyShapeSceneSegmentHandler);
#endif
#if defined(UFE_V4_FEATURES_AVAILABLE) && (UFE_PREVIEW_VERSION_NUM >= 4013)
#ifdef UFE_V4_FEATURES_AVAILABLE
// set up the ProxyShapeCameraHandler
g_MayaCameraHandler = Ufe::RunTimeMgr::instance().cameraHandler(g_MayaRtid);
auto proxyShapeCameraHandler = ProxyShapeCameraHandler::create(g_MayaCameraHandler);
Expand Down Expand Up @@ -253,9 +235,7 @@ MStatus initialize()
lastHandler = MayaUsd::ufe::UsdTransform3dMayaXformStackHandler::create(lastHandler);
lastHandler = MayaUsd::ufe::UsdTransform3dPointInstanceHandler::create(lastHandler);
#ifdef UFE_V4_FEATURES_AVAILABLE
#if (UFE_PREVIEW_VERSION_NUM >= 4025)
lastHandler = MayaUsd::ufe::UsdTransform3dReadHandler::create(lastHandler);
#endif
#endif
handlers.transform3dHandler = lastHandler;

Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/MayaUIInfoHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Ufe::UIInfoHandler::Icon MayaUIInfoHandler::treeViewIcon(const Ufe::SceneItem::P
Ufe::UIInfoHandler::Icon icon;
if (isOrphaned(mayaItem)) {
icon = Ufe::UIInfoHandler::Icon("", "orphaned_node_badge", Ufe::UIInfoHandler::LowerRight);
#if (UFE_PREVIEW_VERSION_NUM >= 4029)
#ifdef UFE_V4_FEATURES_AVAILABLE
icon.mode = UIInfoHandler::Disabled;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/ProxyShapeHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const UsdPrim& ProxyShapeHierarchy::getUsdRootPrim() const

Ufe::SceneItem::Ptr ProxyShapeHierarchy::sceneItem() const { return fItem; }

#if (UFE_PREVIEW_VERSION_NUM >= 4004)
#ifdef UFE_V4_FEATURES_AVAILABLE

bool ProxyShapeHierarchy::hasChildren() const
{
Expand Down
4 changes: 1 addition & 3 deletions lib/mayaUsd/ufe/ProxyShapeHierarchy.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ class MAYAUSD_CORE_PUBLIC ProxyShapeHierarchy : public Ufe::Hierarchy
Ufe::SceneItem::Ptr sceneItem() const override;
bool hasChildren() const override;
Ufe::SceneItemList children() const override;
#if (UFE_PREVIEW_VERSION_NUM >= 4004)
bool hasFilteredChildren(const ChildFilter&) const override;
#endif
UFE_V4(bool hasFilteredChildren(const ChildFilter&) const override;)
UFE_V2(Ufe::SceneItemList filteredChildren(const ChildFilter&) const override;)
Ufe::SceneItem::Ptr parent() const override;
#ifndef UFE_V2_FEATURES_AVAILABLE
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/ProxyShapeSceneSegmentHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Ufe::Selection ProxyShapeSceneSegmentHandler::findGatewayItems_(const Ufe::Path&
return result;
}

#if (UFE_PREVIEW_VERSION_NUM >= 4035)
#ifdef UFE_V4_FEATURES_AVAILABLE
Ufe::Selection
ProxyShapeSceneSegmentHandler::findGatewayItems_(const Ufe::Path& path, Ufe::Rtid nestedRtid) const
{
Expand Down
6 changes: 3 additions & 3 deletions lib/mayaUsd/ufe/ProxyShapeSceneSegmentHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#pragma once

#include <mayaUsd/base/api.h>
#include <mayaUsd/ufe/UfeVersionCompat.h>

#include <ufe/sceneSegmentHandler.h>

Expand Down Expand Up @@ -48,9 +49,8 @@ class MAYAUSD_CORE_PUBLIC ProxyShapeSceneSegmentHandler : public Ufe::SceneSegme

// Ufe::SceneSegmentHandler overrides
Ufe::Selection findGatewayItems_(const Ufe::Path& path) const override;
#if (UFE_PREVIEW_VERSION_NUM >= 4035)
Ufe::Selection findGatewayItems_(const Ufe::Path& path, Ufe::Rtid nestedRtid) const override;
#endif
UFE_V4(Ufe::Selection findGatewayItems_(const Ufe::Path& path, Ufe::Rtid nestedRtid)
const override;)
bool isGateway_(const Ufe::Path& path) const override;

private:
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/PulledObjectHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PulledObjectHierarchy::Ptr PulledObjectHierarchy::create(

Ufe::SceneItem::Ptr PulledObjectHierarchy::sceneItem() const { return _mayaHierarchy->sceneItem(); }

#if (UFE_PREVIEW_VERSION_NUM >= 4004)
#ifdef UFE_V4_FEATURES_AVAILABLE
bool PulledObjectHierarchy::hasFilteredChildren(const ChildFilter& childFilter) const
{
return _mayaHierarchy->hasFilteredChildren(childFilter);
Expand Down
2 changes: 1 addition & 1 deletion lib/mayaUsd/ufe/PulledObjectHierarchy.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MAYAUSD_CORE_PUBLIC PulledObjectHierarchy : public Ufe::Hierarchy
Ufe::SceneItem::Ptr sceneItem() const override;
bool hasChildren() const override;
Ufe::SceneItemList children() const override;
#if (UFE_PREVIEW_VERSION_NUM >= 4004)
#ifdef UFE_V4_FEATURES_AVAILABLE
bool hasFilteredChildren(const ChildFilter&) const override;
#endif
Ufe::SceneItemList filteredChildren(const ChildFilter&) const override;
Expand Down
Loading