Skip to content

Commit

Permalink
[plugin/al] remove code that is only for MAYA_API_VERSION earlier tha…
Browse files Browse the repository at this point in the history
…n 20180000
  • Loading branch information
mattyjams committed May 19, 2020
1 parent e1f829e commit 36caf73
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 103 deletions.
4 changes: 0 additions & 4 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/cmds/DebugCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

#include "maya/MPxCommand.h"

#if MAYA_API_VERSION < 201800
#include "maya/MArgDatabase.h"
#endif

#include "AL/maya/utils/Api.h"
#include "AL/maya/utils/MayaHelperMacros.h"

Expand Down
4 changes: 0 additions & 4 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/cmds/ListTranslators.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#include "AL/maya/utils/MayaHelperMacros.h"
#include "maya/MPxCommand.h"

#if MAYA_API_VERSION < 201800
#include "maya/MArgDatabase.h"
#endif

namespace AL {
namespace usdmaya {
namespace cmds {
Expand Down
4 changes: 0 additions & 4 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/cmds/RendererCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

#include "maya/MPxCommand.h"

#if MAYA_API_VERSION < 201800
#include "maya/MArgDatabase.h"
#endif

namespace AL {
namespace usdmaya {
namespace cmds {
Expand Down
4 changes: 0 additions & 4 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/cmds/SyncFileIOGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

#include "maya/MPxCommand.h"

#if MAYA_API_VERSION < 201800
#include "maya/MArgDatabase.h"
#endif

#include "AL/maya/utils/MayaHelperMacros.h"

namespace AL {
Expand Down
4 changes: 0 additions & 4 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/LayerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

#include "maya/MPxNode.h"

#if MAYA_API_VERSION < 201800
#include "maya/MDGModifier.h"
#endif

#include "pxr/usd/usd/stage.h"

#include <map>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ ProxyDrawOverride::ProxyDrawOverride(const MObject& obj)
: MHWRender::MPxDrawOverride(obj, draw, true)
#elif MAYA_API_VERSION >= 20180600
: MHWRender::MPxDrawOverride2(obj, draw, true)
#elif MAYA_API_VERSION >= 201700
: MHWRender::MPxDrawOverride(obj, draw, true)
#else
: MHWRender::MPxDrawOverride(obj, draw)
: MHWRender::MPxDrawOverride(obj, draw, true)
#endif
{
TF_DEBUG(ALUSDMAYA_DRAW).Msg("ProxyDrawOverride::ProxyDrawOverride\n");
Expand Down
2 changes: 0 additions & 2 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyDrawOverride.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,10 @@ class ProxyDrawOverride : public MHWRender::MPxDrawOverride
MHWRender::DrawAPI supportedDrawAPIs() const override
{ return MHWRender::kOpenGL | MHWRender::kOpenGLCoreProfile; }

#if MAYA_API_VERSION >= 201700
/// \brief ensure this draw override participates in post fx
/// \return false
bool excludedFromPostEffects() const override
{ return false; }
#endif

private:
static MUint64 s_lastRefreshFrameStamp;
Expand Down
6 changes: 0 additions & 6 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ bool ProxyShape::getRenderAttris(UsdImagingGLRenderParams& attribs, const MHWRen
attribs.drawMode = UsdImagingGLDrawMode::DRAW_WIREFRAME;
}
else
#if MAYA_API_VERSION >= 201600
if(displayStyle & MHWRender::MFrameContext::kFlatShaded) {
attribs.drawMode = UsdImagingGLDrawMode::DRAW_SHADED_FLAT;
if ((displayStatus == MHWRender::kActive) ||
Expand All @@ -453,7 +452,6 @@ bool ProxyShape::getRenderAttris(UsdImagingGLRenderParams& attribs, const MHWRen
}
}
else
#endif
if(displayStyle & MHWRender::MFrameContext::kGouraudShaded) {
attribs.drawMode = UsdImagingGLDrawMode::DRAW_SHADED_SMOOTH;
if ((displayStatus == MHWRender::kActive) ||
Expand All @@ -473,16 +471,12 @@ bool ProxyShape::getRenderAttris(UsdImagingGLRenderParams& attribs, const MHWRen
// set the time for the scene
attribs.frame = outTimePlug().asMTime().as(MTime::uiUnit());

#if MAYA_API_VERSION >= 201603
if(displayStyle & MHWRender::MFrameContext::kBackfaceCulling) {
attribs.cullStyle = UsdImagingGLCullStyle::CULL_STYLE_BACK;
}
else {
attribs.cullStyle = UsdImagingGLCullStyle::CULL_STYLE_NOTHING;
}
#else
attribs.cullStyle = Engine::CULL_STYLE_NOTHING;
#endif

const float complexities[] = {1.05f, 1.15f, 1.25f, 1.35f, 1.45f, 1.55f, 1.65f, 1.75f, 1.9f};
attribs.complexity = complexities[complexityPlug().asInt()];
Expand Down
8 changes: 0 additions & 8 deletions plugin/al/lib/AL_USDMaya/AL/usdmaya/nodes/ProxyShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#include "maya/MPxSurfaceShape.h"
#include "maya/MSelectionList.h"

#if MAYA_API_VERSION < 201800
#include "maya/MViewport2Renderer.h"
#endif

#include "pxr/usd/sdf/notice.h"
#include "pxr/usd/usd/notice.h"
#include "pxr/usd/usd/prim.h"
Expand Down Expand Up @@ -957,11 +953,7 @@ class ProxyShape
bool getInternalValue(const MPlug& plug, MDataHandle& dataHandle) override;
MStatus setDependentsDirty(const MPlug& plugBeingDirtied, MPlugArray& plugs) override;
bool isBounded() const override;
#if MAYA_API_VERSION < 201700
MPxNode::SchedulingType schedulingType() const override { return kSerialize; }
#else
MPxNode::SchedulingType schedulingType() const override { return kSerial; }
#endif
MStatus preEvaluation(const MDGContext & context, const MEvaluationNode& evaluationNode) override;
void CacheEmptyBoundingBox(MBoundingBox&) override;
UsdTimeCode GetOutputTime(MDataBlock) const override;
Expand Down
39 changes: 0 additions & 39 deletions plugin/al/mayautils/AL/maya/utils/ForwardDeclares.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@
#include <maya/MTypes.h>
#include <string>

#if MAYA_API_VERSION >= 201800

// Maya 2018 introduced a namespace for the maya api... this also forward declares
// the classes, and adds "using" directives
#include <maya/MApiNamespace.h>

#else // MAYA_API_VERSION >= 201800

// forward declare maya api types
class MAngle;
class MArgList;
class MArgDatabase;
class MBoundingBox;
class MColor;
class MDagPath;
class MDagModifier;
class MDataBlock;
class MDistance;
class MDGModifier;
class MEulerRotation;
class MFloatPoint;
class MFloatVector;
class MFloatMatrix;
class MMatrix;
class MFnDependencyNode;
class MFnDagNode;
class MFnMesh;
class MFnTransform;
class MMatrix;
class MObject;
class MPlug;
class MPoint;
class MPxData;
class MStatus;
class MString;
class MSyntax;
class MTime;
class MVector;
class MUserData;

#endif // MAYA_API_VERSION >= 201800

4 changes: 0 additions & 4 deletions plugin/al/mayautils/AL/maya/utils/NodeHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include "maya/MFloatVector.h"
#include "maya/MFnNumericAttribute.h"

#if MAYA_API_VERSION < 201800
#include "maya/MDataBlock.h"
#endif

#include <deque>
#include <vector>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,6 @@ UsdGeomPrimvar getDefaultUvSet(UsdGeomMesh mesh)

TEST(translators_MeshTranslator, constantUvExport)
{
// Ignore this test on Maya 2016. On other versions of maya, this test scales the
// UV's to a single point via the polyEditUV command. In the UV texture editor in 2016,
// echo all commands lists this exact command, however in 2016 this command
// does nothing when executed in MEL ???? (unlike 2017/2018 ???)
// I've disabled this test on 2016 as a result (if it passes on 2017/2018, the code itself
// works)
#if MAYA_API_VERSION >= 201700
MFileIO::newFile(true);

// create a cube, and shrink all of its UV's to a single point
Expand Down Expand Up @@ -320,7 +313,6 @@ TEST(translators_MeshTranslator, constantUvExport)
EXPECT_NEAR(0.5f, received[0][0], 1e-5f);
EXPECT_NEAR(0.5f, received[0][1], 1e-5f);
}
#endif
}


Expand Down
4 changes: 0 additions & 4 deletions plugin/al/usdmayautils/AL/usdmaya/utils/DgNodeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3726,11 +3726,7 @@ MStatus DgNodeHelper::getInt64(MObject node, MObject attr, int64_t& value)
return MS::kFailure;
}
MStatus status;
#if MAYA_API_VERSION >= 201800
value = plug.asInt64(&status);
#else
value = plug.asInt64(MDGContext::fsNormal, &status);
#endif
return status;
}

Expand Down
4 changes: 0 additions & 4 deletions plugin/al/usdmayautils/AL/usdmaya/utils/MeshUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,7 @@ void MeshImportContext::applyColourSetData()
continue;

MStatus status;
#if MAYA_API_VERSION >= 201800
colourSetName = fnMesh.createColorSetWithName(colourSetName, nullptr, nullptr, &status);
#else
colourSetName = fnMesh.createColorSetWithName(colourSetName, nullptr, &status);
#endif
if (status)
{
status = fnMesh.setCurrentColorSetName(colourSetName);
Expand Down
5 changes: 0 additions & 5 deletions plugin/al/usdmayautils/AL/usdmaya/utils/NurbsCurveUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

#include "maya/MFnNurbsCurve.h"

#if MAYA_API_VERSION < 201800
#include "maya/MFnDoubleArrayData.h"
#include "maya/MFnFloatArrayData.h"
#endif

#include "pxr/usd/usd/attribute.h"
#include "pxr/usd/usdGeom/nurbsCurves.h"

Expand Down

0 comments on commit 36caf73

Please sign in to comment.