paya.runtime.plugs.Attribute#
- class Attribute(*args, **kwargs)#
- Inheritance - classmethod createAttr(attrName, node=None, **kwargs)#
- Creates an attribute. - Parameters
- attrName (str) – the name of the attribute 
- node ( - str,- DependNode) – the node on which to create the attribute; if omitted, a free-standing- networknode will be created to hold the attribute; defaults to- None
- **kwargs – forwarded to - addAttr()
 
- Returns
- The generated attribute. 
- Return type
- Attribute 
 
 - hasInputs(recursive=False)#
 - splitInputs()#
- Splits any compound-level input into per-child connections. The compound-level connection is maintained. - Returns
- self
 
 - createProxy(node, longName=None, shortName=None)#
- Creates a proxy of this attribute. - Parameters
- node ( - str,- DependNode) – the node on which to create the proxy
- longName/ln (str) – a long name for the proxy attribute; defaults this attribute’s long name 
- shortName/sn (str) – a short name for the proxy attribute; defaults this attribute’s short name 
 
- Returns
- The proxy attribute. 
- Return type
 
 - hasUnits()#
- Returns
- Trueif this is a linear, angle or time attribute, or a compound with any children for which this is- True, otherwise- False.
- Return type
 
 - isAnimatableDynamic()#
- Returns
- True if this is a dynamic attribute that can be exposed for keying. 
 
 - plugInfo()#
- Calls - paya.pluginfo.getInfoFromAttr()on this attribute and returns the result.
 - mathDimension()#
- Returns
- The math dimension of this plug (e.g. 16 for a matrix), if any. 
- Return type
- int,- None
 
 - plugType(inherited=False)#
- Returns abstract type information for this plug. 
 - setClass(cls)#
- Convenience method to enable chained dot notation when reassigning the plug class (sometimes necessary for ambiguous output types, e.g. on ‘choice’ nodes). Returns - self.- Equivalent to: - self.__class__ = cls 
 - get(plug=False, **kwargs)#
- Extends - pymel.core.general.Attribute.get()with the- plugkeyword argument, which is useful when the decision whether to work statically or dynamically rests with the end-user.
 - enable(recursive=False, force=False)#
- Equivalent to: - self.show() self.unlock() 
 - lock(recursive=False, **kwargs)#
- Overloads - Attributeto implement the recursive option and return- self.
 - hide(recursive=False)#
- Turns off keyable and channelBox for this attribute. 
 - unlock(recursive=False, force=False, **kwargs)#
- Overloads - Attributeto implement the recursive and force options and return- self.
 - show(recursive=False, force=False, keyable=True)#
- Unhides this attribute in the channel box. - Parameters
- recursive/r (bool) – if this is a compound, edit the children as well; defaults to False 
- force/f (bool) – if this is the child of a compound, edit the parent attribute too; defaults to False 
- keyable/k (bool) – reveal by making the attribute keyable; if this is False, the attribute will be made settable instead; defaults to True 
 
- Returns
- self
- Return type
 
 - release(recursive=False, force=False)#
- Unlocks this attribute and disconnects any inputs. 
 - put(source, plug=None)#
- Helper for mixed plug / value workflows. If ‘source’ is an attribute, it will be connected into this plug. Otherwise, this plug will be set to ‘source’. - Parameters
- source – the source value or plug 
- plug/p (bool or None) – if you know whether ‘source’ is a plug or not, specify if here; defaults to None 
 
- Returns
- self 
 
 - sendAbove(attrName)#
- Sends this attribute above another attribute in the channel box. 
 - sendBelow(attrName)#
- Sends this attribute below another attribute in the channel box.