LoginSignup
8
8

More than 5 years have passed since last update.

シーン内の不明なプラグインを除去する

Posted at

不明なプラグインが存在する際、シーンを開くと
Errors have occurred while reading this scene that may result in data loss.
と出てしまいます。

2016で新規に追加されたコマンドのunknownPluginを使用すれば照会、除去することができ、シーンを開く際にエラーを吐くことがなくなります。

複数の不明プラグインがあることを想定しコードを書きました。

DeleteUnknownPlugin.py
import maya.cmds as cmds

add=0

#シーン内の不明なプラグインをリストします。
unPl = cmds.unknownPlugin( q=True, l=True )

try:
    for i in unPl:
        print unPl[add]+' is Remove.'

        #指定された不明なプラグインをシーンから除去します
        cmds.unknownPlugin( unPl[add], r=True )
        add += 1
except:
    print 'UnknowPlugin is none.'

これで不明なプラグインをシーンから除去することができます。

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8