六六の魔法世界

注册

技术分享 - 2021年8月6日

大佬们 mel 有没有 清理未知节点的命令呀


六六

“收集于万能群友-我东/菜狗.”

— 六六

import pymel.core as pm
unknownPlugin_list = pm.unknownPlugin( query=True, list=True )
unknownPlugin_num = len(unknownPlugin_list)
if unknownPlugin_list:
    print u"unknownPlugin个数为%s" % unknownPlugin_num
    for plugin_name in unknownPlugin_list:
        try:
            pm.unknownPlugin( plugin_name, remove=True )
        except Exception as e:
            print e
            print plugin_name, u"无法清理"
    print u"清理完成!"
else:
    print u"unknownPlugin个数为0,不需要清理"
string $unknownNodes[] = `ls -type "unknown"`;

    for($node in $unknownNodes) {
    lockNode -lock 0 $node;
    delete $node;
}