21 lines
638 B
Python
21 lines
638 B
Python
import sys
|
|
import bpy
|
|
|
|
# Paste this variable in the blender.py
|
|
dependency = {
|
|
# 'moderlab_plugin': ['moderlab_plugin.zip', 'Moderlab-Production/BlenderPlugin'],
|
|
'moderlab_type': ['moderlab_type.zip', 'Moderlab-Production/BlenderObjectType'],
|
|
# 'uv-packer': ['uv-packer.zip', 'Moderlab-Production/UvPacker'],
|
|
}
|
|
|
|
|
|
def b3d_install_addon(addon_path: str):
|
|
for key, value in dependency.items():
|
|
bpy.ops.preferences.addon_install(filepath=f'{addon_path}/{value[0]}')
|
|
bpy.ops.preferences.addon_enable(module=key)
|
|
bpy.ops.wm.save_userpref()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
b3d_install_addon(sys.argv[-1])
|