paya.runtime.parts.PartGuide#

class PartGuide(groupNode)#

Inheritance

PartBase Trunk

addBuildSetting(name: str, defaultValue, **kwargs)#

Convenience method. Adds a settable-only attribute to a ‘BUILD_SETTINGS’ section on the group node. The attributeType can be omitted if defaultValue is float, bool or int.

Parameters
  • name (str) – the attribute name

  • defaultValue – the starting value for the attribute

  • **kwargs – forwarded to addAttr, except for channelBox / keyable, which will be overriden to True and False respectively

Returns

The attribute.

Return type

Attribute

getBuildSettings()#
Returns

A mapping of {attrName: attrValue} for each attribute created using addBuildSetting().

Return type

dict

classmethod getPartClass()#
Returns

The associated part subclass.

Return type

type

getPartCreateArgsKwargs()#
Raises

NotImplementedError – Not implemented on this class.

Returns

Positional and keyword arguments that can be passed along to the create() method on the associated Part subclass.

Return type

(tuple, dict)

createPart()#

Derives construction arguments from this guide and passed them along to create() on the associated Part subclass to build the part.

If there is no active Name block, this guide’s innermost namespace will be used for the name.

Returns

The constructed part.

Return type

Part

classmethod _getCreateNameContext()#

Called before a build wrapped by partCreator() to establish the naming environment.

Guides are named according to these rules:

  • The name element is always 'guide'; any enclosing blocks are ignored.

  • There must be a namespace; if one is not active at the time of build, one will be derived, either from active Name elements or from the calling class name.

Returns

A configured context manager.

Return type

Name