sceneAssembly/assemblyReferenceInitialRep.cpp
#include "assemblyReferenceInitialRep.h"
#include <maya/MGlobal.h>
#include <maya/MFnAssembly.h>
namespace {
const MString pyPreamble1(
"import maya.app.sceneAssembly.assemblyReferenceInitialRep as iRep\n");
const MString pyPreamble2(
"ir=iRep.assemblyReferenceInitialRep()\n");
bool fsEnable = true;
}
assemblyReferenceInitialRep::assemblyReferenceInitialRep()
{
}
assemblyReferenceInitialRep::~assemblyReferenceInitialRep()
{
}
bool assemblyReferenceInitialRep::reader(
const MObject &rootAssembly)
{
if (!fsEnable)
return true;
pyCmd += pyPreamble1;
pyCmd += pyPreamble2;
pyCmd += "ir.reader(\'";
pyCmd += aFn.name();
pyCmd += "\')\n";
}
bool assemblyReferenceInitialRep::writer(
const MObject &rootAssembly)
const
{
if (!fsEnable)
return true;
pyCmd += pyPreamble1;
pyCmd += pyPreamble2;
pyCmd += "ir.writer(\'";
pyCmd += aFn.name();
pyCmd += "\')\n";
}
MString assemblyReferenceInitialRep::getInitialRep(
const MObject &targetAssembly,
bool &hasInitialRep)
const
{
if (!fsEnable)
pyCmd1 = "def tempGetInitialRepProc():\n";
pyCmd1 += "\t" + pyPreamble1;
pyCmd1 += "\t" + pyPreamble2;
pyCmd1 += "\treturn ir.getInitialRep(\'";
pyCmd1 += aFn.name();
pyCmd1 += "\')\n";
pyCmd2 = "tempGetInitialRepProc()";
hasInitialRep = stringArrayResult[1] == "True";
return stringArrayResult[0];
}
bool assemblyReferenceInitialRep::clear(
const MObject &rootAssembly)
const
{
if (!fsEnable)
return true;
pyCmd += pyPreamble1;
pyCmd += pyPreamble2;
pyCmd += "ir.clear(\'";
pyCmd += aFn.name();
pyCmd += "\')\n";
}