【发布时间】:2017-10-14 21:29:23
【问题描述】:
我可以在MPxNode::compute 方法中使用MProgressWindow 吗?我的插件实现不会保留MProgressWindow,即使它没有被另一个进程使用。
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;
}
注意:删除节点时,会显示MProgressWindow(奇怪的行为)。
感谢您的帮助。
【问题讨论】:
标签: progress-bar nodes maya-api