I recently started studying Maya API. When I tried to write in C++ with reference to the Sample Command Plug-in, it did not work well Build did well, but I don't know exactly what is wrong. Could you help me?
#include <maya/MFnPlugin.h>
#include <maya/MPxCommand.h>
#include <maya/MArgList.h>
class myCommandName : public MPxCommand
{
public:
MStatus doIt(const MArgList&) override;
static void* creator();
};
MStatus myCommandName::doIt(const MArgList& args)
{
return MS::kSuccess;
}
void* myCommandName::creator()
{
return new myCommandName();
}
MStatus initializePlugin(MObject obj)
{
MStatus status;
MFnPlugin plugin(obj, PLUGIN_COMPANY, "3.0");
status = plugin.registerCommand("myCommandName", myCommandName::creator);
if (!status) {
status.perror("registerCommand");
return status;
}
return status;
}
MStatus uninitializePlugin(MObject obj)
{
MStatus status;
MFnPlugin plugin(obj);
status = plugin.deregisterCommand("myCommandName");
if (!status) {
status.perror("deregisterCommand");
return status;
}
return status;
}
Error:
// Error: file: C:/Program Files/Autodesk/Maya2019/scripts/others/pluginWin.mel line 317: initializePlugin function failed (myCommandName)