mrv.maya.ui.typ

Epydoc: mrv.maya.ui.typ

Module containing helpers to create the UI types at runtime.

Functions

mrv.maya.ui.typ.initWrappers()
Create Standin Classes that will delay the creation of the actual class till the first instance is requested
mrv.maya.ui.typ.init_classhierarchy()
Read a simple hiearchy file and create an Indexed tree from it
mrv.maya.ui.typ.make_path(path)
Returns:A path instance of the correct type
Note:use this constructor if you use the Path.set_separator method at runtime to assure you will always create instances of the actual type, and not only of the type you imported last
mrv.maya.ui.typ.propertyQE(flag, methodName=None)
Shorthand for simple query and edit properties
mrv.maya.ui.typ.uncapitalize(s, preserveAcronymns=False)
Returns:s with first letter lower case
Parameter:preserveAcronymns – enabled ensures that ‘NTSC’ does not become ‘nTSC’
Note:from pymel

Classes

Epydoc: mrv.maya.ui.typ

class mrv.maya.ui.typ.EventSenderUI

Bases: mrv.util.EventSender

Allows registration of a typical UI callback It basically streamlines the registration for a callback such that any number of listeners can be called when an event occours - this works by keeping an own list of callbacks registered for a specific event, and calling them whenever the maya ui callback has been triggered

To use this class , see the documentation of EventSender, but use the Event instead. If you want to add your own events, use your own Signal s.

The class does NOT use weakreferences for the main callbacks to make it easier to use. Use the WeakFunction to properly and weakly bind an instance function

When registered for an event, the sender will be provided to each callback as first argument.

clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
classmethod listEventNames()
Returns:list of event ids that exist on our class
sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress

Epydoc: mrv.maya.ui.typ.MetaClassCreatorUI

class mrv.maya.ui.typ.MetaClassCreatorUI

Bases: mrv.maya.util.MetaClassCreator

Builds the base hierarchy for the given classname based on our typetree. Additional support for :

AUTOMATIC PROPERTY GENERATION:
  • if flags are simple get and set properties, these can be listed in the _properties_ attribute ( list ). These must be queriable and editable
  • Properties will be available as: inst.p_myProperty to access myProperty ( equivalent to cmd -q|e -myProperty
  • This only works if our class knows it’s mel command in the __melcmd__ member variable - inheritance for it does not work
AUTOMATIC UI-EVENT GENERATION:
  • define names of mel events in _events_ as list of names
  • these will be converted into Events sitting at attribute names like e_eventName ( for even called ‘eventName’
  • assign an event: windowinstance.e_restoreCommand = func whereas func takes: func( windowinstance, *args, **kwargs )
ADDITIONAL CONFIGURAITON:
  • strong_event_handlers:

    if True, events will use strong references to their handlers

mro
mro() -> list return a type’s method resolution order

Table Of Contents

Previous topic

mrv.maya.ui.base

Next topic

mrv.maya.ui.set

This Page