def initializePlugin(mobject):
	mplugin = OpenMayaMPx.MFnPlugin(mobject, "Autodesk", "1.0", "Any")
	try:
		mplugin.registerCommand(kPluginCmdName, cmdCreator)
	except:
		sys.stderr.write( "Failed to register command: %s\n" % kPluginCmdName)
		raise

	try:
		mplugin.registerNode(kPluginNodeTypeName, kPluginNodeId, nodeCreator, nodeInitializer)
	except:
		sys.stderr.write( "Failed to register node: %s" % kPluginNodeTypeName)
		raise
Exemple #2
0
def uninitializePlugin(mobject):
    mplugin = OpenMayaMPx.MFnPlugin(mobject)
    try:
        mplugin.deregisterContextCommand(contextCmdName)
    except:
        print "Failed to deregister context command: %s" % contextCmdName
        raise

    try:
        mplugin.deregisterNode(moveManipId)
    except:
        print "Failed to deregister node: %s" % nodeName
        raise
Exemple #3
0
def initializePlugin(mobject):
    """
    Entry point for a plugin. It is called once -- immediately after the plugin is loaded.
    This function registers all of the commands, nodes, contexts, etc... associated with the plugin.

    It is required by all plugins.

    :param plugin: MObject used to register the plugin using an MFnPlugin function set
    """
    vendor = "Steven Qiu"
    version = "2021.4.10.02"
    mplugin = ompx.MFnPlugin(mobject, vendor, version)
    mtor.initialize()
Exemple #4
0
def initializePlugin(mobject):
    """
    Initialize the script plug-in
    """
    mplugin = OpenMayaMPx.MFnPlugin(mobject, "Audrey Deschamps-Brower",
                                    "1.0.0")
    for cmd in CMD_CLASSES:
        try:
            mplugin.registerCommand(cmd.commandName, cmd.cmdCreator,
                                    cmd.syntaxCreator)
        except:
            sys.stderr.write("Failed to register command: {}\n".format(
                cmd.commandName))
Exemple #5
0
def initializePlugin(mobject):
    """ Initializes the plug-in. """
    mplugin = ompx.MFnPlugin(mobject)
    try:
        mplugin.registerTransform(
            TestTransform.kNODE_NAME, TestTransform.kNODE_ID,
            TestTransform.creator, TestTransform.initialize,
            TestTransformMatrix.creator, TestTransformMatrix.kMATRIX_ID,
            TestTransform.kNODE_CLASSIFY)
    except:
        sys.stderr.write("Failed to register node: " +
                         TestTransform.kNODE_NAME)
        raise
def uninitializePlugin(mobject):
    '''Deregister Plugin'''

    mplugin = OpenMayaMPx.MFnPlugin(mobject)
    try:
        mplugin.deregisterCommand('MeshInfo')
        mplugin.deregisterNode(twCheckCollision.TwCheckCollision.kPluginNodeId)
        mplugin.deregisterNode(twDrawBB.TwDrawBB.kPluginNodeId)
        mplugin.deregisterNode(twClothSolverIOPaperBlockout.
                               TwClothSolverIOPaperBlockout.kPluginNodeId)
    except:
        sys.stderr.write("Failed to deregister node: %s" % kPluginNodeName)
        raise
Exemple #7
0
def initializePlugin(plugin):
    pluginFn = OpenMayaMPx.MFnPlugin(plugin)
    try:
        pluginFn.registerURIFileResolver(
            adskHttpSchemeResolver.kPluginResolverName,
            adskHttpSchemeResolver.kPluginURIScheme,
            adskHttpSchemeResolver.theCreator)
    except:
        sys.stderr.write(
            "Failed to register custom resolver: %s for scheme: %s\n" %
            (adskHttpSchemeResolver.kPluginResolverName,
             adskHttpSchemeResolver.kPluginURIScheme))
        raise
Exemple #8
0
def uninitializePlugin(plugin):
    pluginFn = OpenMayaMPx.MFnPlugin(plugin)
    try:
        pluginFn.deregisterNode(kPluginNodeId)
        OpenMaya.MNodeMessage.removeCallback(kCallbackID)
        # pluginFn.deregisterCommand(kPluginNodeNameCommand)
        # pluginFn.deregisterNode(kPluginNodeNameManipId)

        # pm.callbacks(removeCallback=loadAETemplateCallback, hook='AETemplateCustomContent', owner=kPluginNodeName)

    except:
        sys.stderr.write('Failed to deregister node: ' + kPluginNodeName)
        raise
def initializePlugin(mobject):
	mplugin = OpenMayaMPx.MFnPlugin(mobject, "Autodesk", "1.0", "Any")
	try:
		mplugin.registerData(kPluginName, kPluginDataId, dataCreator)
	except:
		sys.stderr.write("Failed to register new data type: %s\n" % kPluginName)
		raise
		
	try:
		mplugin.registerCommand(kPluginName, cmdCreator)
	except:
		sys.stderr.write("Failed to register command: %s\n" % kPluginName)
		raise
Exemple #10
0
def uninitializePlugin(plugin):
    """
    Uninitialize the script plug-in
    :param plugin: OpenMayaMPx.MPxCommand
    """
    pluginFn = OpenMayaMPx.MFnPlugin(plugin)
    try:
        pluginFn.deregisterCommand(FitVertexCmd.kPluginCmdName)
    except:
        sys.stderr.write(
            "Failed to unregister command: %s\n" % FitVertexCmd.kPluginCmdName
        )
        raise
Exemple #11
0
def initializePlugin(obj):
    plugin = OpenMayaMPx.MFnPlugin(obj, 'wedgie', '0.1', 'zanefx')

    try:
        plugin.registerCommand('makewedgie', cmdCreator, syntaxCreator)
    except:
        raise RuntimeError, 'Failed to register command: makewedgie'

    try:
        plugin.registerNode('wedgie', WedgeNode.kPluginNodeId, creator,
                            initialize)
    except:
        raise RuntimeError, 'Failed to register node: wedgie'
Exemple #12
0
def uninitializePlugin(mObject):
    mPlugin = OpenMayaMPx.MFnPlugin(mObject, __author__, __version__)
    try:
        mPlugin.deregisterNode(MeshInfoNode.kPluginNodeId)
    except:
        raise RuntimeError("Failed to deregister : {0}".format(
            MeshInfoNode.kPluginNodeName))

    try:
        mPlugin.deregisterCommand(MeshInfoCommand.kPluginCommandName)
    except:
        raise RuntimeError("Failed to deregister : {0}".format(
            MeshInfoCommand.kPluginCommandName))
def uninitializePlugin(mobject):

	
	mplugin = OpenMayaMPx.MFnPlugin(mobject)
	
	try:
		
		mplugin.deregisterNode( kPluginNodeId )
	except:
		sys.stderr.write( "Failed to deregister command: %s" % kPluginNodeTypeName )
		raise

		
Exemple #14
0
def initializePlugin(mobject):
	'''
	registerCommand is the only thing that will change here.
	'''
	mplugin = OpenMayaMPx.MFnPlugin(mobject) #done before tyring to register the command.
	try:
		# registerCommand requires( commandName, creatorFunction
		# commandName normally is something like kPluginNodeTypeName
		# mplugin.registerCommmand( kMyCommandName, nodeCreator, nodeInitializer )
		mplugin.registerCommand( kMyCommandName, cmdCreator)
	except:
		sys.stderr.write( "Failed to register command: %s\n" %kMyCommandName )
		raise
def initializePlugin(mobject):
	mplugin = OpenMayaMPx.MFnPlugin(mobject, "Autodesk", "1.0", "Any")
	try:
		mplugin.registerCommand(kCmdName, cmdCreator, cmdSyntaxCreator)
	except:
		sys.stderr.write("Failed to register command: %s" % kCmdName)
		raise

	try:
		mplugin.registerNode(kNodeName, kNodeId, nodeCreator, nodeInitializer, OpenMayaMPx.MPxNode.kObjectSet)
	except:
		sys.stderr.write("Failed to register node: %s" % kNodeName)
		raise
def uninitializePlugin(mobject):
	mplugin = OpenMayaMPx.MFnPlugin(mobject)
	try:
		mplugin.deregisterCommand(kPluginName)
	except:
		sys.stderr.write("Failed to unregister command: %s\n" % kPluginName)
		raise

	try:
		mplugin.deregisterData(kPluginDataId)
	except:
		sys.stderr.write("Failed to unregister data type: %s\n" % kPluginName)
		raise
def uninitializePlugin(mobject):
	mplugin = OpenMayaMPx.MFnPlugin(mobject)
	try:
		mplugin.deregisterCommand(kCmdName)
	except:
		sys.stderr.write("Failed to deregister command: %s" % kCmdName)
		raise

	try:
		mplugin.deregisterNode(kNodeId)
	except:
		sys.stderr.write("Failed to deregister node: %s" % kNodeName)
		raise
def uninitializePlugin(mobject):
    mplugin = OpenMayaMPx.MFnPlugin(mobject)
    mplugin.deregisterNode(MirrorNode.NODE_ID)

    for cls in classesToRegister:
        cmdName = cls.CMD_NAME

        try:
            mplugin.deregisterCommand(cmdName)
            mplugin.deregisterCommand(cmdName.lower())
        except:
            self.displayError("Failed to unregister command: %s\n" % cmdName)
            raise
Exemple #19
0
def uninitializePlugin(mobject):

	# Remove the callback
	if IDs.length()!= 0:
		removeCallback( IDs )
		
	mplugin = OpenMayaMPx.MFnPlugin(mobject)
	try:
		mplugin.deregisterCommand( kPluginNodeTypeName )
	except:
		sys.stderr.write( "Failed to deregister node: %s" % kPluginNodeTypeName )
		raise
		
def initializePlugin(mobject):
    '''Register Plugin'''
    mplugin = OpenMayaMPx.MFnPlugin(mobject)  
    try:
        mplugin.registerCommand('MeshInfo', twMeshInfoCmd.createTwMeshInfoCmd)
        mplugin.registerNode( twCheckCollision.TwCheckCollision.kPluginNodeName, twCheckCollision.TwCheckCollision.kPluginNodeId, twCheckCollision.createTwCheckCollision, twCheckCollision.initializeTwCheckCollision, OpenMayaMPx.MPxNode.kLocatorNode)
        mplugin.registerNode( twDrawBB.TwDrawBB.kPluginNodeName, twDrawBB.TwDrawBB.kPluginNodeId, twDrawBB.createTwDrawBB, twDrawBB.initializeTwDrawBB, OpenMayaMPx.MPxNode.kLocatorNode)
        mplugin.registerNode( twClothSolverIOPaperBlockout.TwClothSolverIOPaperBlockout.kPluginNodeName, twClothSolverIOPaperBlockout.TwClothSolverIOPaperBlockout.kPluginNodeId, twClothSolverIOPaperBlockout.createTwClothSolverIOPaperBlockout, twClothSolverIOPaperBlockout.initializeTwClothSolverIOPaperBlockout, OpenMayaMPx.MPxNode.kLocatorNode)
        print('Successfully loaded plugin')
        gui.Menubar()
    except:
        sys.stderr.write( "Failed to register node: %s" % kPluginNodeName )
        raise
Exemple #21
0
def uninitializePlugin(mobject):
    global messageIdSet
    global messageId
    # Remove the callback
    if (messageIdSet):
        removeCallback(messageId)
    # Remove the plug-in command
    mplugin = OpenMayaMPx.MFnPlugin(mobject)
    try:
        mplugin.deregisterCommand(kPluginCmdName)
    except:
        sys.stderr.write("Failed to unregister command: %s\n" % kPluginCmdName)
        raise
Exemple #22
0
def initializePlugin(mobject):
    """ Initialize the script plug-in

    Args:
        mobject (OpenMaya.MObject):

    """
    mplugin = OpenMayaMPx.MFnPlugin(mobject, "Name", "1.0", "Any")
    try:
        mplugin.registerCommand(kPluginCmdName, cmdCreator, syntaxCreator)
    except:
        sys.stderr.write("Failed to register command: %s\n" % kPluginCmdName)
        raise
def initializePlugin(mobject):
    mplugin = OpenMayaMPx.MFnPlugin(mobject, "FXTD-odyssey", "1.0.0")
    try:
        mplugin.registerNode(nodeName, nodeId, deformerCreator,
                             nodeInitializer,
                             OpenMayaMPx.MPxNode.kDeformerNode)
        ''' This is to explicitly define that weights attribute of the deformer is paintable'''
        OpenMaya.MGlobal.executeCommand(
            "makePaintable -attrType \"multiFloat\" -sm deformer \"" +
            nodeName + "\" \"weights\";")
    except:
        sys.stderr.write("Failed to register node: %s" % nodeName)
        raise
Exemple #24
0
def uninitializePlugin(mobject):
    """ Uninitialize the script plug-in
    
    Args:
        mobject (OpenMaya.MObject):
    
    """
    mplugin = OpenMayaMPx.MFnPlugin(mobject)
    try:
        mplugin.deregisterCommand(kPluginCmdName)
    except:
        sys.stderr.write("Failed to unregister command: %s\n" % kPluginCmdName)
        raise
Exemple #25
0
def initializePlugin(mobject):
    plugin = OpenMayaMPx.MFnPlugin(mobject)
    plugin.registerNode('zFileSwitch', zFileSwitch.pluginNodeId,
                        zFileSwitch.creator, zFileSwitch.initialize,
                        OpenMayaMPx.MPxNode.kDependNode)

    # Register with the file path editor.
    pm.filePathEditor(temporary=True, registerType='zFileSwitch.lowResolution')
    pm.filePathEditor(temporary=True,
                      registerType='zFileSwitch.highResolution')

    menu.add_menu_items()
    copy_render_setup_template()
Exemple #26
0
def initializePlugin(mobject):
    mplugin = OpenMayaMPx.MFnPlugin(mobject, glueDeformer.AUTHOR,
                                    glueDeformer.PLUGIN_VERSION, "Any")

    try:
        mplugin.registerNode(glueDeformer.PLUGIN_NODE_NAME,
                             glueDeformer.PLUGIN_NODE_ID,
                             glueDeformer._createNode,
                             glueDeformer._addAttributes,
                             OpenMayaMPx.MPxNode.kDeformerNode)

    except:
        raise Exception(glueDeformer.REGISTER_FAILLURE_MESSAGE)
Exemple #27
0
def initializePlugin(mobject):
    mplugin = OMPx.MFnPlugin(mobject,"TDChannel", "1.0", "Any")
    try:
        # register node
        mplugin.registerNode(kTdcMddReadNodeName, tdcMddReadId,
                             nodeCreator, nodeInitializer, 
                             OMPx.MPxNode.kDeformerNode )
        # register command
        mplugin.registerCommand(kTdcMddReadCmdName, 
                                tdcMddReadCmdCreator,
                                tdcMddReadSyntaxCreator )
    except:
        sys.stderr.write("Failed to register node: %s\n"%kTdcMddReadNodeName)
def initializePlugin(obj):
    """
    Initialize the plug-in
    """
    plugin = ommpx.MFnPlugin(obj, 'Adam Mechtley & Ryan Trowbridge', '1.0',
                             'Any')
    try:
        plugin.registerCommand(AR_TransformCmd.kPluginCmdName,
                               AR_TransformCmd.cmdCreator,
                               AR_TransformCmd.syntaxCreator)
    except:
        raise Exception('Failed to register command: %s' %
                        AR_TransformCmd.kPluginCmdName)
Exemple #29
0
def initializePlugin(plugin):
    vendor = "AJ"
    version = "b.1.0.0"

    plugin_fn = ommpx.MFnPlugin(plugin, vendor, version)

    try:
        plugin_fn.registerNode(CarpetRoll.TYPE_NAME, CarpetRoll.TYPE_ID,
                               CarpetRoll.creator, CarpetRoll.initialize,
                               ommpx.MPxNode.kDeformerNode)
    except:
        pm.displayError("Failed to register node {0}".format(
            CarpetRoll.TYPE_NAME))
Exemple #30
0
def initializePlugin(obj):
    plugin = omMPx.MFnPlugin(obj, "Roy Nieterau", "0.1")

    # Register nodes
    for node in nodes:
        try:
            plugin.registerNode(node.pluginNodeTypeName,
                                node.id,
                                node.creator,
                                node.nodeInitialize)
        except RuntimeError, e:
            mc.warning("Can't register plug-in node "
                       "{0}: {1}".format(node.pluginNodeTypeName, e))