paya.pools#

class ClassPoolBrowser(pool)#

Browsing wrapper for a class pool instance. Classes can be retrieved using dotted or keyed syntax.

class ClassPool#

Abstract base class for collections of custom Paya classes.

browse()#
Returns

A browser object for this pool.

Return type

ClassPoolBrowser.

dirPath()#
Returns

The full directory path for the template package.

Return type

str

longName()#
Returns

The long name of this pool, for example ‘nodetypes’.

Return type

str

shortName()#
Returns

The short name of this pool, for example ‘nodes’.

Return type

str

purge(quiet=False)#

Purges cached information.

readClass(clsname)#

Locates, sources and returns a class by name. No rebuilding or cache management is performed.

Parameters

clsname (str) – the name of the class to retrieve

Returns

The retrieved class.

Return type

str

getByName(clsname)#

Retrieves a class by name. Lookups are cached.

Parameters

clsname (str) – The name of the class to retrieved.

Returns

The retrieved class.

Return type

str

class RebuiltClassPool#

Inheritance

ClassPool

getMeta(clsname)#
Parameters

clsname (str) – the name of the class being retrieved

Returns

An appropriate metaclass for the requested class.

Return type

type

inventBasesDict(clsname)#
Parameters

clsname – the name of the class being retrieved

Raises

NotImplementedError – Invention is not implemented for this pool.

Returns

Bases and a dict that can be used to construct a stand-in class in the absence of a template.

Return type

(tuple, dict)

conformBases(clsname, bases)#

Given a tuple of bases, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • bases (tuple) – either an empty tuple, or bases retrieved from a template class

Returns

The bases.

Return type

(type,)

conformDict(clsname, dct)#

Given a class dictionary, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • dct (dict) – either an empty dictionary, or the dictionary of a template class

Returns

The dictionary.

Return type

dict

buildClass(clsname)#

Builds a final class. If a template is available, it is used. Otherwise, if this pool implements invention, the class is invented. If this pool doesn’t implement invention, an exception is raised.

Parameters

clsname (str) – the name of the class to build

Raises

MissingTemplateError – A template couldn’t be found, and this pool doesn’t implement invention.

Returns

The built class.

Return type

type

getByName(clsname)#

Retrieves a class by name. Lookups are cached.

Parameters

clsname (str) – The name of the class to retrieved.

Returns

The retrieved class.

Return type

str

class ShadowPool#

Inheritance

RebuiltClassPool ClassPool

Abstract base class for pools that directly shadow PyMEL namesakes.

getFromPyMELInstance(inst)#

Given a PyMEL instance, returns an appropriate Paya class for reassignment.

inventBasesDict(clsname)#
Parameters

clsname – the name of the class being retrieved

Raises

NotImplementedError – Invention is not implemented for this pool.

Returns

Bases and a dict that can be used to construct a stand-in class in the absence of a template.

Return type

(tuple, dict)

conformDict(clsname, dct)#

Given a class dictionary, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • dct (dict) – either an empty dictionary, or the dictionary of a template class

Returns

The dictionary.

Return type

dict

conformBases(clsname, bases)#

Given a tuple of bases, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • bases (tuple) – either an empty tuple, or bases retrieved from a template class

Returns

The bases.

Return type

(type,)

getMeta(clsname)#
Parameters

clsname (str) – the name of the class being retrieved

Returns

An appropriate metaclass for the requested class.

Return type

type

getPmBase(clsname)#
Parameters

clsname (str) – the class being retrieved

Returns

A PyMEL base for the requested class.

Return type

type

class NodeClassPool#

Inheritance

ShadowPool RebuiltClassPool ClassPool

Administers custom Paya classes for nodes. A browser for this pool can be accessed on paya.runtime as .nodes.

conformDict(clsname, dct)#

Given a class dictionary, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • dct (dict) – either an empty dictionary, or the dictionary of a template class

Returns

The dictionary.

Return type

dict

class CompClassPool#

Inheritance

ShadowPool RebuiltClassPool ClassPool

Administers custom Paya classes for components. A browser for this pool can be accessed on paya.runtime as .comps.

class PlugClassPool#

Inheritance

ShadowPool RebuiltClassPool ClassPool

Administers custom Paya classes for plugs (attributes). Relies on pluginfo. A browser for this pool can be accessed on paya.runtime as .plugs.

getFromPyMELInstance(inst)#

Given a PyMEL instance, returns an appropriate Paya class for reassignment.

getByName(clsname)#

Retrieves a class by name. Lookups are cached.

Parameters

clsname (str) – The name of the class to retrieved.

Returns

The retrieved class.

Return type

str

getPmBase(clsname)#
Parameters

clsname (str) – the class being retrieved

Returns

A PyMEL base for the requested class.

Return type

type

conformBases(clsname, bases)#

Given a tuple of bases, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • bases (tuple) – either an empty tuple, or bases retrieved from a template class

Returns

The bases.

Return type

(type,)

getRootDataClasses()#
Returns

Terminating classes detected from pymel.core.datatypes.

class DataClassPool#

Inheritance

ShadowPool RebuiltClassPool ClassPool

Administers custom Paya classes for data types (e.g. vectors). An instance of this pool can be accessed on paya.runtime as .data.

class ParsedNodeSubtypePoolMeta(clsname, bases, dct)#

Inheritance

type

class ParsedNodeSubtypePool#

Inheritance

NodeClassPool ShadowPool RebuiltClassPool ClassPool

inventBasesDict(clsname)#
Raises

NotImplementedError – Not supported on parsed-subtype pools.

getCrossPoolRoot()#
Returns

A class from a ‘base’ class pool, to be used as the basis for all classes returned by this one.

Return type

type

attrName()#
Returns

The name of the string node attribute that will be inspected for the type name.

Return type

str

buildClass(clsname)#

Builds a final class. If a template is available, it is used. Otherwise, if this pool implements invention, the class is invented. If this pool doesn’t implement invention, an exception is raised.

Parameters

clsname (str) – the name of the class to build

Raises

MissingTemplateError – A template couldn’t be found, and this pool doesn’t implement invention.

Returns

The built class.

Return type

type

conformDict(clsname, dct)#

Given a class dictionary, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • dct (dict) – either an empty dictionary, or the dictionary of a template class

Returns

The dictionary.

Return type

dict

conformBases(clsname, bases)#

Given a tuple of bases, returns a modified, where necessary, version that can be used to construct a final class.

Parameters
  • clsname (str) – the name of the class being retrieved

  • bases (tuple) – either an empty tuple, or bases retrieved from a template class

Returns

The bases.

Return type

(type,)

class ParsedNetworkSubtypePool#

Inheritance

ParsedNodeSubtypePool NodeClassPool ShadowPool RebuiltClassPool ClassPool

Administers subtypes for ‘network’ nodes.

class PartClassPool#

Inheritance

ClassPool

class RigClassPool#

Inheritance

ClassPool