Skip to content

Commit

Permalink
MAYA-128513 fix merge resolution errors and minor issues.
Browse files Browse the repository at this point in the history
- Fix some incorrect ifdef in Global.cpp. They were currently harmless because all UFE V4 if were always satisfied simultaneously, but the code was still not theoretically  correct.
- Fix some useUfe vs mayaUSD include issues.
- Move an anonymous namespace.
- Remove a debug print in a test.
  • Loading branch information
pierrebai-adsk committed May 30, 2023
1 parent e03935a commit 7e9af76
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 28 deletions.
23 changes: 5 additions & 18 deletions lib/mayaUsd/ufe/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,20 @@
#endif

#ifdef UFE_V4_FEATURES_AVAILABLE
#include <mayaUsd/ufe/ProxyShapeCameraHandler.h>
#include <mayaUsd/ufe/UsdConnectionHandler.h>
#include <mayaUsd/ufe/UsdShaderNodeDefHandler.h>
#include <mayaUsd/ufe/UsdTransform3dRead.h>
#include <mayaUsd/ufe/UsdUINodeGraphNodeHandler.h>

#if UFE_PREVIEW_BATCHOPS_SUPPORT
#include <mayaUsd/ufe/UsdBatchOpsHandler.h>
#endif

#if UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#include <mayaUsd/ufe/UsdCodeWrapperHandler.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>
#ifdef UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#include <mayaUsd/ufe/UsdCodeWrapperHandler.h>
#endif

#if UFE_SCENE_SEGMENT_SUPPORT
Expand Down Expand Up @@ -220,7 +213,7 @@ MStatus initialize()
handlers.connectionHandler = UsdConnectionHandler::create();
handlers.uiNodeGraphNodeHandler = UsdUINodeGraphNodeHandler::create();

#if UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#ifdef UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
handlers.batchOpsHandler = UsdCodeWrapperHandler::create();
#elif UFE_PREVIEW_BATCHOPS_SUPPORT
handlers.batchOpsHandler = UsdBatchOpsHandler::create();
Expand Down Expand Up @@ -333,12 +326,6 @@ MStatus initialize()
runTimeMgr.setUIInfoHandler(g_MayaRtid, uiInfoHandler);
#endif

#else /* UFE_V2_FEATURES_AVAILABLE */
auto usdHierHandler = UsdHierarchyHandler::create();
auto usdTrans3dHandler = UsdTransform3dHandler::create();
auto usdSceneItemOpsHandler = UsdSceneItemOpsHandler::create();
g_USDRtid = runTimeMgr.register_(
kUSDRunTimeName, usdHierHandler, usdTrans3dHandler, usdSceneItemOpsHandler);
#endif /* UFE_V2_FEATURES_AVAILABLE */

#if !defined(NDEBUG)
Expand Down
4 changes: 2 additions & 2 deletions lib/mayaUsd/ufe/UsdBatchOpsHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <pxr/usd/sdf/types.h>
#include <pxr/usd/usd/stage.h>

#if UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#ifdef UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#include <ufe/codeWrapperHandler.h>
#else
#include <ufe/batchOpsHandler.h>
Expand All @@ -33,7 +33,7 @@ namespace MAYAUSD_NS_DEF {
namespace ufe {

//! \brief Interface to create a UsdBatchOpsHandler interface object.
#if UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
#ifdef UFE_PREVIEW_CODE_WRAPPER_HANDLER_SUPPORT
class MAYAUSD_CORE_PUBLIC UsdBatchOpsHandler : public Ufe::CodeWrapperHandler
#else
class MAYAUSD_CORE_PUBLIC UsdBatchOpsHandler : public Ufe::BatchOpsHandler
Expand Down
7 changes: 3 additions & 4 deletions lib/mayaUsd/ufe/UsdCodeWrapperHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
#include <UsdUfe/ufe/UsdSceneItem.h>
#include <UsdUfe/utils/editRouterContext.h>

#include <ufe/sceneItem.h>
#include <ufe/selection.h>

namespace MAYAUSD_NS_DEF {
namespace ufe {

namespace {

// A code wrapper that does edit routing for a command name by its operation.
Expand Down Expand Up @@ -80,6 +76,9 @@ class UsdEditRoutingCodeWrapper : public Ufe::CodeWrapper

} // namespace

namespace MAYAUSD_NS_DEF {
namespace ufe {

/*static*/
std::shared_ptr<UsdCodeWrapperHandler> UsdCodeWrapperHandler::create()
{
Expand Down
2 changes: 0 additions & 2 deletions lib/usdUfe/ufe/UsdUndoInsertChildCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#include "private/UfeNotifGuard.h"

#include <mayaUsd/utils/layers.h>

#include <usdUfe/base/tokens.h>
#include <usdUfe/ufe/Utils.h>
#include <usdUfe/undo/UsdUndoBlock.h>
Expand Down
2 changes: 0 additions & 2 deletions test/lib/ufe/testGroupCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ def testGroupPreserveLoadRules(self):
groupHierarchy = ufe.Hierarchy.hierarchy(groupItem)
self.assertEqual(len(groupHierarchy.children()), 3)

print(stage.GetLoadRules())

self.assertEqual(loadRules.NoneRule, stage.GetLoadRules().GetEffectiveRuleForPath('/group1/Sphere1'))
self.assertEqual(loadRules.AllRule, stage.GetLoadRules().GetEffectiveRuleForPath('/group1/Sphere2'))

Expand Down

0 comments on commit 7e9af76

Please sign in to comment.