本文整理汇总了Python中addon_utils.enable方法的典型用法代码示例。如果您正苦于以下问题:Python addon_utils.enable方法的具体用法?Python addon_utils.enable怎么用?Python addon_utils.enable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon_utils
的用法示例。
在下文中一共展示了addon_utils.enable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_addons
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def _setup_addons(self):
import sys
import os
sys_path = []
if self.addon_paths is not None:
for path in self.addon_paths():
if path not in sys.path:
sys.path.append(path)
import addon_utils
addons = []
if self.addons is not None:
addons.extend(self.addons())
for addon in addons:
addon_utils.enable(addon)
self._addon_store = {
"sys_path": sys_path,
"addons": addons,
}
示例2: execute
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def execute(self, context):
Common.remove_unused_objects()
# Make sure that the first layer is visible
if hasattr(context.scene, 'layers'):
context.scene.layers[0] = True
# Enable fbx if it isn't enabled yet
fbx_is_enabled = addon_utils.check('io_scene_fbx')[1]
if not fbx_is_enabled:
addon_utils.enable('io_scene_fbx')
try:
bpy.ops.import_scene.fbx('INVOKE_DEFAULT',
automatic_bone_orientation=False,
use_prepost_rot=False,
use_anim=False)
except (TypeError, ValueError):
bpy.ops.import_scene.fbx('INVOKE_DEFAULT')
return {'FINISHED'}
示例3: draw
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
# row = col.row(align=True)
# row.label(text="The plugin 'XPS Tools' is required for this function.")
col.separator()
row = col.row(align=True)
row.label(text="If it is not enabled please enable it in your User Preferences.")
row = col.row(align=True)
row.label(text="If it is not installed please download and install it manually.")
col.separator()
col.separator()
row = col.row(align=True)
row.label(text="Make sure to install the version for Blender " + current_blender_version, icon="INFO")
col.separator()
row = col.row(align=True)
row.operator(XpsToolsButton.bl_idname, icon=globs.ICON_URL)
示例4: execute
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def execute(self, context):
import addon_utils
err_str = ""
def err_cb(ex):
import traceback
nonlocal err_str
err_str = traceback.format_exc()
print(err_str)
mod = addon_utils.enable(self.module, default_set=True, handle_error=err_cb)
if mod:
info = addon_utils.module_bl_info(mod)
info_ver = info.get("blender", (0, 0, 0))
if info_ver > bpy.app.version:
self.report({'WARNING'},
("This script was written Blender "
"version %d.%d.%d and might not "
"function (correctly), "
"though it is enabled" %
info_ver))
return {'FINISHED'}
else:
if err_str:
self.report({'ERROR'}, err_str)
return {'CANCELLED'}
示例5: setUp
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def setUp(self):
self._reports = []
bpy.ops.wm.read_homefile()
addon_utils.enable('animation_retarget', default_set=True)
示例6: remesh
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def remesh(self, context):
lr = self.copiedobject
hr = self.initialobject
if self.manifold_method == "print3d":
isloaded = addon_utils.check("object_print3d_utils")[0]
if not isloaded:
addon_utils.enable("object_print3d_utils")
bpy.ops.mesh.print3d_clean_non_manifold()
if not isloaded:
addon_utils.disable("object_print3d_utils")
elif self.manifold_method == "fill":
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_mode(type="EDGE")
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.mesh.select_non_manifold()
bpy.ops.mesh.fill()
bpy.ops.object.editmode_toggle()
elif self.manifold_method == "manifold":
self.report({"ERROR"}, "Manifold is not implemented yet")
return {"CANCELLED"}
elif self.manifold_method == "meshlab":
self.report({"ERROR"}, "Meshlab manifolding is not implemented yet")
return {"CANCELLED"}
return {"FINISHED"}
示例7: __init__
# 需要导入模块: import addon_utils [as 别名]
# 或者: from addon_utils import enable [as 别名]
def __init__(self, config):
Module.__init__(self, config)
self._avoid_rendering = config.get_bool("avoid_rendering", False)
addon_utils.enable("render_auto_tile_size")