paya.trunk#

class Trunk#

A subclass of Trunk is aware of the directory it was defined in. This is useful for sourcing inherited dependencies (e.g. control shape templates, weight files etc.) in rig or rig part construction.

classmethod getDir()#
Returns

The directory this class was defined in.

Return type

Path

classmethod getDirs()#
Returns

The home directory of every Trunk subclass in the MRO.

Return type

[Path]

classmethod findFiles(pattern, first=False, inherited=True)#
Parameters
  • pattern (str) – a glob-style matching pattern, e.g. '*.json'

  • first (bool) – return the first matching file; defaults to False

  • inherited/i (bool) – look inside the home directory of every Trunk subclass in the MRO; defaults to True

Returns

Either a single file path, or a list of file paths.

Return type

Path, [Path]

classmethod findFile(pattern, inherited=True)#

Equivalent to findFiles(pattern, first=True [...]).