mApplication


This package;

  • Offers abstract classes to define applications in production pipeline, which are automatically discovered by its APIs.
  • Contains utility and enum classes to offer flexibility in API development.
  • Contains useful commands to operate on applications.

Python Packages

Name Description
mApplication Primary Python package

Python API

Meco™ API Reference

This package provides several classes to operate on applications and make them reachable within the ecosystem.

ApplicationInfo Class

This class allows you to provide information about the applications you develop. An application could be a tool with or without a GUI. Meco™ Ecosystem uses these classes to do plenty of work under the hood to automate virtually everything about them. A typical implementation example is given below and it's been taken directly from mMayaNode.utilitiesApp module. As you can see DeleteUnknownNodes class inherits mApplication.applicationInfoAbs.ApplicationInfo abstract class in order to provide a tool in Maya that deletes unknown nodes when it's run.

#
## @brief [ APPLICATION INFO CLASS ] - Class provides application information for the application.
class DeleteUnknownNodes(mApplication.applicationInfoAbs.ApplicationInfo):
    #
    # ------------------------------------------------------------------------------------------------
    # BUILT-IN METHODS
    # ------------------------------------------------------------------------------------------------
    #
    ## @brief Constructor.
    #
    #  @exception N/A
    #
    #  @return None - None.
    def __init__(self):

        ## [ str ] - Name of the application.
        self._name                  = 'Delete Unknown Nodes'

        ## [ int ] - Major version.
        self._versionMajor          = 1

        ## [ int ] - Minor version.
        self._versionMinor          = 0

        ## [ int ] - Fix version.
        self._versionFix            = 0

        ## [ str ] - Description about the application.
        self._description           = 'Delete all unknown nodes.'

        ## [ list of enum ] - Parent applications which this application designed to work in @see mApplication.parentApplicationLib.Application
        self._parentApplications    = [mApplication.parentApplicationLib.Application.kMaya]

        ## [ list of str ] - Keywords.
        self._keywords              = ['node', 'delete', 'unknown']

        ## [ list of dict ] - Documentations, keys of dict instances are: title, url.
        self._documents             = [{'title':'Web Site...', 'url':'https://www.safakoner.com'}]

        ## [ str ] - Python command to run the application.
        self._pythonCommand         = 'import mMayaNode.utilitiesLib;mMayaNode.utilitiesLib.deleteUnknownNodes()'

        ## [ str ] - Menu path. Use / as separator to give a complete path.
        self._menuPath              = 'Node'

        ## [ list of dict ] - Developers, keys of dict instances are userName, name, email, web.
        self._developers            = [mDeveloper.developers.sonerLib.INFO]

        mApplication.applicationInfoAbs.ApplicationInfo.__dict__['__init__'](self)

Class Members

_parentApplications

Member of the class is a list, which contains relevant enum values from mApplication.parentApplicationLib.Application enum class. This information is used to determine whether the application should be available for any given parent application, such as Maya, Nuke, etc. This information is important to be provided since Meco™ automates menu creation for Maya and Nuke based on the provided values.

_pythonCommand

Member is the Python command, which would be invoked in order to run this application, whether its a GUI application or not.

_menuPath

Member can be used if this application needs to be in a menu in given parent application, such as Maya. You can use / as separator to create sub menus, like;

self._menuPath              = 'Rigging/Skeleton/Place Joint'

_developers

Member is a list instance that contains dict instances. These dict instances hold developer information, which would be displayed on relevant GUI and used throughout the ecosystem. As you can see in the example above, the developer information (dict instance) INFO is used from mDeveloper.developers.sonerLib module. You can check mDeveloper.developers.sonerLib.INFO for the keys required by the dict instance.

App Python Modules

Any class that inherits mApplication.applicationInfoAbs.ApplicationInfo class must be in a Python module ends with App suffix, like utilitiesApp.py so Meco Ecosystem™ would recognize your custom app classes. By doing so, Meco™ creates menus for these application in DCCs.

Creating Menu Items in Maya

Often times we need to create menu items in parent applications such as Maya for the applications we develop (we refer to tools as well). This is normally a manual process, which Meco™ Ecosystem addresses swiftly.

Make sure that mApplication.parentApplicationLib.Application.kMaya enum is added to _parentApplications member of your application class, and also a valid menu path is provided in _menuPath member. You must use / to separate the menu paths.

Once you launch Maya with the command below, mMayaCore and mMayaGUI packages will initialize the menus for your applications by invoking relevant utility functions provided by the API. This is done since Meco™ recognizes your application classes via mApplication.applicationInfoAbs.ApplicationInfo API class.

# Linux and Mac OS
meco --development main --app maya2020

# Windows OS
meco -de main -a maya2020

Entry point to initialize menus in Maya is userSetup.py module provided by mMayaCore package.

Creating Menu Items in Nuke

Meco™ also creates menu items automatically in Nuke for your apps, just like it does in Maya. You just need to add mApplication.parentApplicationLib.Application.kNuke in _parentApplications member if you want your application to be available in Nuke.

Entry point to initialize menus in Nuke is init.py module provided by mNukeCore package.

Creating Menu Items in Other Application

Meco™ supports automatic menu creation in Maya and Nuke out of the box. You can implement similar solutions for other DCCs that your pipeline requires. You can take a look at the following examples for reference purposes.

  • mMayaGUI.menuLib
  • mNukeGUI.menuLib

Commands

mapplication-list

List all available applications in the environment.

Flags

Flag Flag Type Default Example Description
d detail bool false N/A Display detail.
pa parent-application str N/A maya Parent application, which the application developed to run in.
p package str N/A mMayaNode Name of the package, which the application contained by.
k keyword str N/A node Keyword to find applications.
li list-inactive bool false N/A List inactive applications as well.

Examples

mapplication-list

# Example Result

You can also use "-pa maya" in order to filter applications for the parent application, which this environment is initialized for.

Delete On Channel Box                             1.0.0     maya
Delete Unknown Nodes                              1.0.0     maya
Display Node Type                                 1.0.0     maya
Duplicate Selected Nodes                          1.0.0     maya
Reload Selected Nodes                             1.0.0     maya
Remove Selected Nodes                             1.0.0     maya

6 application(s) listed.
mapplication-list -d

# Example Result

You can also use "-pa maya" in order to filter applications for the parent application, which this environment is initialized for.

Name                : Delete On Channel Box
Version             : 1.0.0
Description         : Delete selected node on channel box.
Icon File Name      : None
Parent Applications : maya
Keywords            : node, delete, channel
GUI                 : False
Python Command      : import mMayaNode.utilitiesLib;mMayaNode.utilitiesLib.deleteOnChannelBox(confirmDeletion=False)
Command             : None
Menu Path           : Node
Full Menu Path      : Meco/Node/Delete On Channel Box - 1.0.0
Package Path        : /<PATH>/meco/master/developers/soner/development/main/mMayaCore
Documents           :
                      Web Site...     : https://www.safakoner.com
Developers          :
                      Username        : soner
                      Name            : Safak Oner
                      Position        : Lead Software Engineer
                      Email           : developer@company.com
                      Url             : https://www.safakoner.com

more info displayed...

Search available applications in the environment by given keyword.

Flags

Flag Flag Type Default Example Description
keyword keyword str N/A node Keyword to find applications.
d detail bool false N/A Display detail.
pa parent-application str N/A maya Parent application, which the application developed to run in.
p package str N/A mMayaNode Name of the package, which the application contained by.
li list-inactive bool false N/A List inactive applications as well.

Examples

mapplication-search node

# Example Result

You can also use "-pa maya" in order to filter applications for the parent application, which this environment is initialized for.

Delete On Channel Box                             1.0.0     maya
Delete Unknown Nodes                              1.0.0     maya
Display Node Type                                 1.0.0     maya
Duplicate Selected Nodes                          1.0.0     maya
Reload Selected Nodes                             1.0.0     maya
Remove Selected Nodes                             1.0.0     maya


6 application(s) listed.
mapplication-search node -d

# Example Result

You can also use "-pa maya" in order to filter applications for the parent application, which this environment is initialized for.

Name                : Delete On Channel Box
Version             : 1.0.0
Description         : Delete selected node on channel box.
Icon File Name      : None
Parent Applications : maya
Keywords            : node, delete, channel
GUI                 : False
Python Command      : import mMayaNode.utilitiesLib;mMayaNode.utilitiesLib.deleteOnChannelBox(confirmDeletion=False)
Command             : None
Menu Path           : Node
Full Menu Path      : Meco/Node/Delete On Channel Box - 1.0.0
Package Path        : /<PATH>/meco/master/developers/soner/development/main/mMayaCore
Documents           :
                      Web Site...     : https://www.safakoner.com
Developers          :
                      Username        : soner
                      Name            : Safak Oner
                      Position        : Lead Software Engineer
                      Email           : developer@company.com
                      Url             : https://www.safakoner.com

more info displayed...