maya.core.plug ============== .. py:module:: maya.core.plug .. autoapi-nested-parse:: Plug module for Maya core functionalities. Classes ------- .. autoapisummary:: maya.core.plug.Plug Module Contents --------------- .. py:class:: Plug(node, attr: str) Represents an attribute plug on a Maya node. .. py:method:: connect(other: Plug, force: bool = True) -> None Connect this plug to another plug. Args: other (Plug): The plug to connect to. force (bool): Whether to force the connection, breaking existing connections if necessary. .. py:method:: create(**kwargs) Add a new attribute to the node. Args: **kwargs: Additional keyword arguments to pass to cmds.addAttr. .. py:method:: delete() Delete an attribute from the node. .. py:method:: disconnect(other=None) Disconnect this plug from another plug, or from its source if no plug is given. Args: other (Plug, optional): The plug to disconnect from. If None, disconnects from the source connection. .. py:method:: exists() Check if the attribute exists. Returns: bool: True if the attribute exists on the node, False otherwise. .. py:method:: get(**kwargs) Get the value of the attribute. Args: **kwargs: Additional keyword arguments to pass to cmds.getAttr. .. py:method:: get_input(plug=False) List incoming connections to this plug. Returns: list of Plug: A list of Plug instances representing the incoming connections. .. py:method:: list_inputs(plugs=False) List incoming connections to this plug. Returns: list of Plug: A list of Plug instances representing the incoming connections. .. py:method:: list_outputs(plugs=False) List outgoing connections from this plug. Returns: list of Plug: A list of Plug instances representing the outgoing connections. .. py:method:: lock() Lock the attribute. .. py:method:: rename(new_attr_name) Rename the attribute. Args: new_attr_name (str): The new name for the attribute. .. py:method:: set(value, **kwargs) Set the value of the attribute. Args: value: The value to set. Can be a single value or a list/tuple for multi-value attributes. **kwargs: Additional keyword arguments to pass to cmds.setAttr. .. py:method:: unlock() Unlock the attribute. .. py:property:: attr The attribute name. Returns: str: The name of the attribute. .. py:property:: children If the plug is a compound attribute, return its child plugs. Returns: list: List of child Plug instances, or empty list if not compound. .. py:property:: keyable :type: bool Check if the attribute is keyable. Returns: bool: True if keyable, False otherwise. .. py:property:: locked :type: bool Check if the attribute is locked. Returns: bool: True if locked, False otherwise. .. py:property:: mplug The MPlug representation of this attribute. Returns: OpenMaya.MPlug: The Maya API plug object. Raises: RuntimeError: If the attribute cannot be found or is invalid. .. py:property:: node The node this plug belongs to. Returns: Node: The node wrapper owning this attribute. .. py:property:: path The full attribute path (node.attribute). Returns: str: The full path to this attribute. .. py:property:: type The attribute type as a string. Returns: str: The API type string of the attribute. .. py:property:: value Get the value of the attribute. Returns: The current value of the attribute. .. py:property:: visible :type: bool Check if the attribute is visible in the channelbox. An attribute is visible if it's either keyable or shown in the channel box. Returns: bool: True if visible, False otherwise.