コード例 #1
0
def initializePlugin(plugin):

    vendor = "Ben van de Laar"
    version = "1.0.0"

    om.MFnPlugin(plugin, vendor, version)
コード例 #2
0
def initializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    for cmd in CMD_CLASSES:
        pluginFn.registerCommand(cmd.cmdName, cmd.createCmd, cmd.createSyntax)
コード例 #3
0
def initializePlugin(mobj):
    plugin = api.MFnPlugin(mobj, __author__, __version__, 'Any')
    _registerNode(plugin, DecomposeRotate)
    _registerNode(plugin, ComposeRotate)
コード例 #4
0
def initializePlugin(mobject):
    mplugin = om.MFnPlugin(mobject)
    try:
        mplugin.registerCommand(kPluginCmdName, cmdCreator, syntaxCreator)
    except:
        sys.stderr.write("Failed to register command: " + kPluginCmdName)
コード例 #5
0
def initializePlugin(plugin):
    fnPlugin = om.MFnPlugin(plugin, vendor='Mukai Lab.', version='v.2019.1.21')
    try:
        createUI()
    except:
        raise
コード例 #6
0
ファイル: apiundo.py プロジェクト: xileflig/apiundo
def initializePlugin(plugin):
    """Plug-in boilerplate"""
    om.MFnPlugin(plugin).registerCommand(command, _apiUndo)
コード例 #7
0
def initializePlugin(mobject):
    mplugin = OpenMaya.MFnPlugin(mobject)
    mplugin.registerCommand(ShowTcbnAutoRigWindowCommand.kPluginCmdName,
                            ShowTcbnAutoRigWindowCommand.cmdCreateor)
コード例 #8
0
def initializePlugin(obj):
    fnPlugin = om2.MFnPlugin(obj, 'Fangmin Chen', '1.0')
    fnPlugin.registerNode(Vectors2Matrix.node_name, Vectors2Matrix.node_id,
                          Vectors2Matrix.creator, Vectors2Matrix.initialize)
コード例 #9
0
def uninitializePlugin(obj):
    fnPlugin = om2.MFnPlugin(obj)
    fnPlugin.deregisterNode(Vectors2Matrix.node_id)
コード例 #10
0
def initializePlugin(plugin):
    plugin_fn = om.MFnPlugin(plugin)
    try:
        plugin_fn.registerCommand(ZooSurgeonCommand.cmd_name, ZooSurgeonCommand.creator)
    except:
        sys.stderr.write("Failed to register command: " + ZooSurgeonCommand.cmd_name)
コード例 #11
0
def uninitializePlugin(mobject):
    plugin_fn = om.MFnPlugin(mobject)
    try:
        plugin_fn.deregisterCommand(ZooSurgeonCommand.cmd_name)
    except:
        sys.stderr.write("Failed to un-register command: " + ZooSurgeonCommand.cmd_name)
コード例 #12
0
def uninitializePlugin(mobject):
    plugin = omapi.MFnPlugin(mobject)
    remove_scene_callback()
コード例 #13
0
def initializePlugin(mobject):
    plugin = omapi.MFnPlugin(mobject, 'scene_callback', '1.0', 'panyu')
    add_scene_callback()
コード例 #14
0
ファイル: pySkyShader.py プロジェクト: edart76/edPlugin
def uninitializePlugin(mobject):
    plugin = om.MFnPlugin(mobject)
    plugin.deregisterNode(apiMeshCreator.id)
    omr.MRenderer.unregisterOverride(fragmentRenderer)
    fragmentRenderer = None
コード例 #15
0
def initializePlugin(obj):
    plugin = om.MFnPlugin(obj, 'bd', '1.0', 'Any')
    try:
        plugin.registerNode('bezierPoints', BezierPoints.kPluginNodeId, BezierPoints.creator, BezierPoints.initialize)
    except:
        raise RuntimeError, 'Failed to register node'
コード例 #16
0
def initializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    try:
        pluginFn.registerCommand(CrossSectionExtractCmd.kPluginName, CrossSectionExtractCmd.creator, CrossSectionExtractCmd.newSyntax)
    except:
        raise
コード例 #17
0
def uninitializePlugin(obj):
    plugin = om.MFnPlugin(obj)
    try:
        plugin.deregisterNode(BezierPoints.kPluginNodeId)
    except:
        raise RuntimeError, 'Failed to deregister node'
コード例 #18
0
def uninitializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    try:
        pluginFn.deregisterCommand(CrossSectionExtractCmd.kPluginName)
    except:
        raise
コード例 #19
0
ファイル: apiundo.py プロジェクト: xileflig/apiundo
def uninitializePlugin(plugin):
    """Plug-in boilerplate"""
    om.MFnPlugin(plugin).deregisterCommand(command)
コード例 #20
0
def initializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    pluginFn.registerCommand(PyMetaDataCmd.cmdName, PyMetaDataCmd.creator,
                             PyMetaDataCmd.createSyntax)
コード例 #21
0
def uninitializePlugin(mobject):
    mplugin = OpenMaya.MFnPlugin(mobject)
    mplugin.deregisterCommand(ShowTcbnAutoRigWindowCommand.kPluginCmdName)
コード例 #22
0
def uninitializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    pluginFn.deregisterCommand(PyMetaDataCmd.cmdName)
コード例 #23
0
def uninitializePlugin(mobject):
    mplugin = om.MFnPlugin(mobject)
    try:
        mplugin.deregisterCommand(kPluginCmdName)
    except:
        sys.stderr.write("Failed to unregister command: " + kPluginCmdName)
コード例 #24
0
def initializePlugin(mobject):
    """
    Registers the plug-in services with Maya when this plug-in is loaded.

    :param mobject: Maya plug-in MObject.
    :raises: Exception raised by maya.api.OpenMaya.MFnPlugin registerCommand method.
    """
    # Make sure the plug-in is running in Maya 2014 or later.
    maya_version = mel.eval("getApplicationVersionAsFloat()")
    if maya_version < 2014:
        msg = "The Shotgun plug-in is not compatible with version %s of Maya; it requires Maya 2014 or later."
        OpenMaya2.MGlobal.displayError(msg % maya_version)
        # Ask Maya to unload the plug-in after returning from here.
        maya.utils.executeDeferred(cmds.unloadPlugin, PLUGIN_FILENAME)
        # Use the plug-in version to indicate that uninitialization should not be done when unloading it,
        # while keeping in mind that this version can be displayed in Maya Plug-in Information window.
        OpenMaya2.MFnPlugin(mobject, version="Unknown")
        # Return to Maya without further initializing the plug-in.
        return

    # We currently don't support running multiple engines
    # if an engine is already running, exit with an error.
    try:
        import sgtk

        if sgtk.platform.current_engine():
            msg = "The Shotgun plug-in cannot be loaded because Shotgun Toolkit is already running."
            OpenMaya2.MGlobal.displayError(msg)
            # Ask Maya to unload the plug-in after returning from here.
            maya.utils.executeDeferred(cmds.unloadPlugin, PLUGIN_FILENAME)
            # Use the plug-in version to indicate that uninitialization should not be done when unloading it,
            # while keeping in mind that this version can be displayed in Maya Plug-in Information window.
            OpenMaya2.MFnPlugin(mobject, version="Unknown")
            # Return to Maya without further initializing the plug-in.
            return
    except ImportError:
        # no sgtk available
        pass

    # Retrieve the plug-in root directory path, set by the module
    plugin_root_path = os.environ.get("TK_MAYA_BASIC_ROOT")

    # Prepend the plug-in python package path to the python module search path.
    plugin_python_path = os.path.join(plugin_root_path, "python")
    if plugin_python_path not in sys.path:
        sys.path.insert(0, plugin_python_path)

    # --- Import Core ---
    #
    # - If we are running the plugin built as a stand-alone unit,
    #   try to retrieve the path to sgtk core and add that to the pythonpath.
    #   When the plugin has been built, there is a sgtk_plugin_basic_maya
    #   module which we can use to retrieve the location of core and add it
    #   to the pythonpath.
    # - If we are running toolkit as part of a larger zero config workflow
    #   and not from a standalone workflow, we are running the plugin code
    #   directly from the engine folder without a bundle cache and with this
    #   configuration, core already exists in the pythonpath.

    try:
        from sgtk_plugin_basic_maya import manifest
        running_as_standalone_plugin = True
    except ImportError:
        running_as_standalone_plugin = False

    if running_as_standalone_plugin:
        # Retrieve the Shotgun toolkit core included with the plug-in and
        # prepend its python package path to the python module search path.
        tkcore_python_path = manifest.get_sgtk_pythonpath(plugin_root_path)
        sys.path.insert(0, tkcore_python_path)
        import sgtk

    else:
        # Running as part of the the launch process and as part of zero
        # config. The launch logic that started maya has already
        # added sgtk to the pythonpath.
        import sgtk

    # as early as possible, start up logging to the backend file
    sgtk.LogManager().initialize_base_file_handler("tk-maya")

    # Set the plug-in root directory path constant of the plug-in python package.
    from tk_maya_basic import constants
    from tk_maya_basic import plugin_logic

    # Set the plug-in vendor name and version number to display in Maya Plug-in Information window
    # alongside the plug-in name set by Maya from the name of this file minus its '.py' extension.
    OpenMaya2.MFnPlugin(mobject,
                        vendor=constants.PLUGIN_AUTHOR,
                        version=constants.PLUGIN_VERSION)

    # Bootstrap the plug-in logic once Maya has settled.
    maya.utils.executeDeferred(plugin_logic.bootstrap)
コード例 #25
0
def uninitializePlugin(plugin):
    fnPlugin = om.MFnPlugin(plugin)
    try:
        deleteUI()
    except:
        raise
コード例 #26
0
def _toplugin(mobject):
    return om.MFnPlugin(mobject, 'Gustavo E. Boehs', '1.00')
コード例 #27
0
def uninitializePlugin(plugin):
    pluginFn = om.MFnPlugin(plugin)
    for cmd in CMD_CLASSES:
        pluginFn.deregisterCommand(cmd.cmdName)
コード例 #28
0
def uninitializePlugin(mob):
    fnPlugin = om2.MFnPlugin(mob)
    fnPlugin.deregisterCommand(CMD_NAME_SET_NCLOTH_PER_VERTEX)
    fnPlugin.deregisterCommand(CMD_NAME_GET_NCLOTH_PER_VERTEX)
コード例 #29
0
def uninitializePlugin(mobj):
    plugin = api.MFnPlugin(mobj)
    _deregisterNode(plugin, DecomposeRotate)
    _deregisterNode(plugin, ComposeRotate)
コード例 #30
0
def uninitializePlugin(mObject):
    OpenMaya.MFnPlugin(mObject).deregisterCommand(
        ToolSeq_Displacement_Apply.pluginName)