diff options
Diffstat (limited to 'mayaPlug/shavePadCmd.cpp')
| -rw-r--r-- | mayaPlug/shavePadCmd.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mayaPlug/shavePadCmd.cpp b/mayaPlug/shavePadCmd.cpp new file mode 100644 index 0000000..225328d --- /dev/null +++ b/mayaPlug/shavePadCmd.cpp @@ -0,0 +1,47 @@ +// Shave and a Haircut +// (c) 2019 Epic Games +// US Patent 6720962 + +#include <maya/MArgList.h> +#include <maya/MGlobal.h> +#include <maya/MPxCommand.h> +#include <maya/MString.h> + +#include "shavePadCmd.h" + + +const MString shavePadCmd::commandName("shavePadCmd"); + + +shavePadCmd::shavePadCmd() {} +shavePadCmd::~shavePadCmd() {} + + +void* shavePadCmd::createCmd() +{ + return new shavePadCmd(); +} + + +MStatus shavePadCmd::doIt(const MArgList& argList) +{ + MStatus st; + + if (argList.length() < 2) return MS::kInvalidParameter; + + MString cmd = argList.asString(0); + unsigned int numArgsRequired = (unsigned int)argList.asInt(1); + + unsigned int i; + + for (i = 2; i < argList.length(); i++) + cmd = cmd + " \"" + argList.asString(i) + "\""; + + for (; i < numArgsRequired + 2; i++) + cmd = cmd + " \"\""; + + st = MGlobal::executeCommand(cmd, false, true); + + return st; +} + |