Files
Nexus/plug-ins/ARTv2/clear_maya_cache.py
2025-12-07 23:00:40 +08:00

39 lines
927 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
清理 Maya 中 ARTv2 相关的 Python 模块缓存
在 Maya Script Editor 中运行此脚本
"""
from __future__ import print_function
import sys
# 需要清理的模块前缀
modules_to_clear = [
'Interfaces',
'System',
'RigModules',
'ThirdParty',
'ART_',
]
cleared_count = 0
cleared_modules = []
# 清理所有相关模块
for module_name in list(sys.modules.keys()):
for prefix in modules_to_clear:
if prefix in module_name:
del sys.modules[module_name]
cleared_modules.append(module_name)
cleared_count += 1
break
print("=== ARTv2 Cache Cleared ===")
print("Total modules cleared: {0}".format(cleared_count))
if cleared_count > 0:
print("\nCleared modules:")
for mod in sorted(cleared_modules):
print(" - {0}".format(mod))
print("\nPlease reload the ARTv2 plugin now.")