我已将python脚本ODS_Studio.py放入/home/$user/Downloads/script_addon_2-7x/addons/
但是Blender无法加载ODS模块。
File "/home/$user/Downloads/script_addon_2-7x/addons/ODS_Studio.py", line 65, in <module>
from ODS import register, unregister
zipimport.ZipImportError: can't find module 'ODS'
如果模块位于正确位置,为什么无法找到该模块呢?
###########################################################
# Blender Modelling Environment for Architecture
# ODS_Studio.py
import bpy
import os
import sys
def load_depends(depends):
for depend in depends:
# sys.modules[depend].__addon_enabled__
if not depend in bpy.context.user_preferences.addons:
bpy.ops.wm.addon_enable(module=depend)
def import_lib(path):
lib = path.split("/")[-1]
mod = lib.replace("ODS_Studio","ODS")
mod = mod.replace(".a","")
try:
M = __import__(mod)
except ImportError:
print("Unable to import module %s"%mod)
return None
def load_libraries(paths):
for path in paths:
for sPath in bpy.utils.script_paths():
absPath = '%s/%s'%(sPath, path)
if not os.path.exists(absPath):
print("%s not found"%path)
continue
if not absPath in sys.path:
print("Found library: %s"%path)
sys.path.insert(0, absPath)
import_lib(path)
break
bpy.utils.refresh_script_paths()
return None
load_libraries(['addons/ODS_Studio.a'])
from ODS import register, unregister
if __name__ == "__main__":
register()
答案 0 :(得分:1)
Blender的ODS Studio模块目前仅适用于Blender版本2.63a。最新版Blender的更新将在未来几周内发布。
确保您已从here下载了最新的模块。
确保将所有*.py
和*.a
文件提取到2.63/scripts/addons
文件夹中,而不是提取到子目录中。
重新启动Blender,你应该能够在任何平台上都没有问题地激活模块。