Skip to content

Commit

Permalink
Addressed UFE v1 interface comments feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt-adsk committed Oct 13, 2020
1 parent 626d796 commit 7b4ed39
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdRotatePivotTranslateUndoableCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void UsdRotatePivotTranslateUndoableCommand::redo()
//------------------------------------------------------------------------------

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool UsdRotatePivotTranslateUndoableCommand::set(double x, double y, double z)
#else
bool UsdRotatePivotTranslateUndoableCommand::translate(double x, double y, double z)
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdRotatePivotTranslateUndoableCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class MAYAUSD_CORE_PUBLIC UsdRotatePivotTranslateUndoableCommand : public Ufe::T
void undo() override;
void redo() override;
#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool set(double x, double y, double z) override;
#else
bool translate(double x, double y, double z) override;
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdRotateUndoableCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void UsdRotateUndoableCommand::performImp(double x, double y, double z)
//------------------------------------------------------------------------------

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool UsdRotateUndoableCommand::set(double x, double y, double z)
#else
bool UsdRotateUndoableCommand::rotate(double x, double y, double z)
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdRotateUndoableCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class MAYAUSD_CORE_PUBLIC UsdRotateUndoableCommand : public Ufe::RotateUndoableC
void undo() override;
void redo() override;
#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool set(double x, double y, double z) override;
#else
bool rotate(double x, double y, double z) override;
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdScaleUndoableCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void UsdScaleUndoableCommand::performImp(double x, double y, double z)
//------------------------------------------------------------------------------

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool UsdScaleUndoableCommand::set(double x, double y, double z)
#else
bool UsdScaleUndoableCommand::scale(double x, double y, double z)
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdScaleUndoableCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class MAYAUSD_CORE_PUBLIC UsdScaleUndoableCommand : public Ufe::ScaleUndoableCom
void undo() override;
void redo() override;
#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool set(double x, double y, double z) override;
#else
bool scale(double x, double y, double z) override;
Expand Down
2 changes: 2 additions & 0 deletions lib/mayaUsd/ufe/UsdTransform3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ void UsdTransform3d::scale(double x, double y, double z)
}

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
Ufe::TranslateUndoableCommand::Ptr UsdTransform3d::rotatePivotCmd(double, double, double)
{
// As of 12-Oct-2020, setting rotate pivot on command creation
Expand Down Expand Up @@ -265,6 +266,7 @@ Ufe::Vector3d UsdTransform3d::rotatePivot() const
}

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
Ufe::TranslateUndoableCommand::Ptr UsdTransform3d::scalePivotCmd(double, double, double)
{
throw std::runtime_error("UsdTransform3d::scalePivotCmd() not implemented");
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdTransform3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class MAYAUSD_CORE_PUBLIC UsdTransform3d : public Ufe::Transform3d
void rotate(double x, double y, double z) override;
void scale(double x, double y, double z) override;
#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
Ufe::TranslateUndoableCommand::Ptr rotatePivotCmd(double x, double y, double z) override;
void rotatePivot(double x, double y, double z) override;
Ufe::TranslateUndoableCommand::Ptr scalePivotCmd(double x, double y, double z) override;
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdTranslateUndoableCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void UsdTranslateUndoableCommand::performImp(double x, double y, double z)
//------------------------------------------------------------------------------

#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool UsdTranslateUndoableCommand::set(double x, double y, double z)
#else
bool UsdTranslateUndoableCommand::translate(double x, double y, double z)
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdTranslateUndoableCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class MAYAUSD_CORE_PUBLIC UsdTranslateUndoableCommand : public Ufe::TranslateUnd
void undo() override;
void redo() override;
#if UFE_PREVIEW_VERSION_NUM >= 2025
//#ifdef UFE_V2_FEATURES_AVAILABLE
bool set(double x, double y, double z) override;
#else
bool translate(double x, double y, double z) override;
Expand Down
4 changes: 4 additions & 0 deletions test/lib/ufe/testRotatePivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def testRotatePivot(self):
usdSphereItem = ufe.Hierarchy.createItem(usdSpherePath)
t3d = ufe.Transform3d.transform3d(usdSphereItem)

# if (ufeUtils.ufeFeatureSetVersion() >= 2):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2025'):
t3d.rotatePivotTranslate(pivot[0], pivot[1], pivot[2])
else:
Expand All @@ -113,6 +114,7 @@ def testRotatePivot(self):
sphereMatrix = om.MMatrix(t3d.inclusiveMatrix().matrix)
self.checkPos(sphereMatrix, [xyWorldValue, xyWorldValue, 0])

# if (ufeUtils.ufeFeatureSetVersion() >= 2):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2025'):
t3d.rotatePivotTranslate(0, 0, 0)
else:
Expand All @@ -124,6 +126,7 @@ def testRotatePivot(self):
self.checkPos(sphereMatrix, [10, 0, 0])

# Use a UFE undoable command to set the pivot.
# if (ufeUtils.ufeFeatureSetVersion() >= 2):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2025'):
rotatePivotCmd = t3d.rotatePivotTranslateCmd()
rotatePivotCmd.translate(pivot[0], pivot[1], pivot[2])
Expand Down Expand Up @@ -172,6 +175,7 @@ def testRotatePivotCmd(self):
# Start with a non-zero initial rotate pivot. This is required to test
# MAYA-105345, otherwise a zero initial rotate pivot produces the
# correct result through an unintended code path.
# if (ufeUtils.ufeFeatureSetVersion() >= 2):
if(os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') < '2025'):
t3d.rotatePivotTranslate(2, 0, 0)
else:
Expand Down

0 comments on commit 7b4ed39

Please sign in to comment.