#ifndef ABCIMPORT_UTIL_H_
#define ABCIMPORT_UTIL_H_
#include <cmath>
#include <vector>
#include <set>
#include <string>
#include <Alembic/AbcGeom/All.h>
#include "NodeIteratorVisitorHelper.h"
#include <maya/MGlobal.h>
#include <maya/MPlug.h>
#include <maya/MDagPath.h>
#include <maya/MObject.h>
#include <maya/MString.h>
#include <maya/MFnDependencyNode.h>
std::vector<Prop> & iSampledPropList,
std::size_t iFirstProp);
std::vector<MDagPath> & dagPathList);
bool getDagPathByChildName(
MDagPath & ioDagPath,
const std::string & iChildName);
std::string stripPathAndNamespace(const std::string & iPath);
MStatus setPlayback(
double min,
double max);
double getWeightAndIndex(double iFrame,
Alembic::AbcCoreAbstract::TimeSamplingPtr iTime, size_t numSamps,
Alembic::AbcCoreAbstract::index_t & oIndex,
Alembic::AbcCoreAbstract::index_t & oCeilIndex);
bool isColorSet(const Alembic::AbcCoreAbstract::PropertyHeader & iHeader,
bool iUnmarkedFaceVaryingColors);
template<typename T>
void clamp(T & min, T & max, T & cur)
{
if (min > max)
std::swap(min, max);
cur = std::max(cur, min);
cur = std::min(cur, max);
}
template<typename T>
T simpleLerp(double alpha, T val1, T val2)
{
double dv = static_cast<double>( val1 );
return static_cast<T>( dv + alpha * (static_cast<double>(val2) - dv) );
}
template<typename T>
void vectorLerp(double alpha, std::vector<T> & vec,
std::vector<T> & vec1, std::vector<T> & vec2)
{
vec.clear();
if (vec1.size() != vec2.size())
return;
unsigned int size = vec1.size();
vec.reserve(size);
for (unsigned int i = 0; i < size; i++)
{
T v1 = vec1[i];
T val = v1 + alpha * (vec2[i] - vec1[i]);
vec.push_back(val);
}
}
{
MString theError(
"Return status: ");
return theError;
}
inline void printError(
const MString & theError)
{
}
inline void printWarning(
const MString & theWarning)
{
}
#endif // ABCIMPORT_UTIL_H_