Maya API (C ++) - MayaApi для c ++ не работал хорошо - PullRequest
0 голосов
/ 24 января 2020

Я недавно начал изучать API Maya. Когда я пытался писать на C ++ со ссылкой на Sample Command Plug-in , он не работал хорошо, Build работал хорошо, но я не знаю точно, что не так. Не могли бы вы помочь мне?

#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: file: C:/Program Files/Autodesk/Maya2019/scripts/others/pluginWin.mel line 317: initializePlugin function failed (myCommandName)
...