Puis-je utiliser un MProgressWindow
à l'intérieur de la méthode MPxNode::compute
? Mon implémentation de plug-in ne réserve pas MProgressWindow
même s'il n'est pas utilisé par un autre processus.Utilisation de MProgressWindow dans MPxNode :: compute
MStatus Node::compute(const MPlug & plug, MDataBlock & data) {
if (!MProgressWindow::reserve())
return MS::kFailure;
MProgressWindow::setTitle(this->typeName);
MProgressWindow::setInterruptable(true);
MProgressWindow::setProgressRange(0, 100);
MProgressWindow::setProgressStatus("Initializing: 0%");
MProgressWindow::setProgress(0);
MProgressWindow::startProgress();
// Some expensive operation.
// If the user presses ESC key, this ends the progress window and returns failure.
MProgressWindow::endProgress();
return MS::kSuccess;
}
Note: Lorsque le nœud est supprimé, MProgressWindow
est affiché (comportement étrange).
J'apprécie toute aide.