當前位置: 首頁>>代碼示例>>Python>>正文


Python addon_utils.enable方法代碼示例

本文整理匯總了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,
        } 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:23,代碼來源:helpers.py

示例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'} 
開發者ID:GiveMeAllYourCats,項目名稱:cats-blender-plugin,代碼行數:23,代碼來源:importer.py

示例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) 
開發者ID:GiveMeAllYourCats,項目名稱:cats-blender-plugin,代碼行數:20,代碼來源:importer.py

示例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'} 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:34,代碼來源:wm.py

示例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) 
開發者ID:igelbox,項目名稱:blender-retarget,代碼行數:6,代碼來源:utils.py

示例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"} 
開發者ID:norgeotloic,項目名稱:BakeMyScan,代碼行數:31,代碼來源:op_REMESHERS_POST.py

示例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") 
開發者ID:DLR-RM,項目名稱:BlenderProc,代碼行數:6,代碼來源:Renderer.py


注:本文中的addon_utils.enable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。