// ==========================================================================
// Copyright 2015 Autodesk, Inc. All rights reserved.
// Use of this software is subject to the terms of the Autodesk
// license agreement provided at the time of installation or download,
// or which otherwise accompanies this software in either electronic
// or hard copy form.
// ==========================================================================
// Example plugin: adjacentTrianglesPrimitiveGenerator.cpp
// This plug-in is an example of a custom MPxIndexBufferMutator.
// It provides custom primitives based on shader requirements coming from
// an MPxShaderOverride. The name() in the MIndexBufferDescriptor is used
// to signify a unique identifier for a custom buffer.
#include <maya/MPxIndexBufferMutator.h>
#include <maya/MGeometry.h>
class MDagPath;
class MObject;
namespace MHWRender
class MComponentDataIndexingList;
class AdjacentTrianglesPrimitiveGenerator : public MHWRender::MPxIndexBufferMutator
virtual ~AdjacentTrianglesPrimitiveGenerator();
const MHWRender::MVertexBufferArray& vertexBuffers,
MHWRender::MIndexBuffer& mutatedBuffer,
int& primitiveStride) const;
// This will allow cleaning up the swatch for PNAEN geometries:
static void mutateIndexBuffer( const MUintArray& originalBufferIndices,
const float* positionBufferFloat,
MHWRender::MGeometry::DataType indexBufferDataType,
void* indexData );
static MHWRender::MPxIndexBufferMutator* createAdjacentTrianglesPrimitiveGenerator();