#include "blindDataShaderOverride.h"
#include <maya/MShaderManager.h>
#include <maya/MDrawContext.h>
blindDataShaderOverride::blindDataShaderOverride(
const MObject& obj)
{
if (!renderer)
return;
if (!shaderMgr)
return;
}
blindDataShaderOverride::~blindDataShaderOverride()
{
if (!renderer)
return;
if (!shaderMgr)
return;
if(fCPVShaderInstance)
}
MString blindDataShaderOverride::initialize(
const MInitContext& initContext, MInitFeedback& initFeedback)
{
colorDesc.setSemanticName("blindDataColorStream");
addGeometryRequirement(positionDesc);
addGeometryRequirement(colorDesc);
return MString(
"Autodesk Maya blindDataShaderOverride");
}
{
}
{
return fCPVShaderInstance;
}
void blindDataShaderOverride::activateKey(MDrawContext& context,
const MString& key)
{
if(fCPVShaderInstance)
fCPVShaderInstance->
bind(context);
}
void blindDataShaderOverride::terminateKey(MDrawContext& context,
const MString& key)
{
if(fCPVShaderInstance)
fCPVShaderInstance->unbind(context);
}
{
bool handlePass = false;
for (
unsigned int i = 0; i<passSem.
length(); i++)
{
{
if (!hasOverrideShader)
{
handlePass = true;
}
}
}
return handlePass;
}
bool blindDataShaderOverride::draw(MDrawContext& context, const MRenderItemList& renderItemList)const
{
if(fCPVShaderInstance)
{
const unsigned int passCount = fCPVShaderInstance->getPassCount(context);
for (unsigned int i = 0; i < passCount; i++)
{
fCPVShaderInstance->activatePass(context, i);
}
}
return true;
}