attribs
An experimental Python library for creating Maya Attributes.
Installation
Install attribs with pip:
pip install maya-attribs
Quickstart
Use attribs.add_attribute to create an new attributes
on an OpenMaya.MFnDependencyNode.
This function also returns the newly created OpenMaya.MPlug.
from maya import cmds
from maya.api import OpenMaya
import attribs
def create_node(node_type: str) -> OpenMaya.MObject:
name = cmds.createNode(node_type)
return OpenMaya.MSelectionList().add(name).getDependNode(0)
node = OpenMaya.MFnDependencyNode(create_node("transform"))
modifier = OpenMaya.MDGModifier()
attribute = attribs.Bool("foo", default=False)
plug = attribs.add_attribute(node, attribute, modifier=modifier)
Set attribute flags either as keyword argument or later as properties.
from maya import cmds
from maya.api import OpenMaya
import attribs
def create_node(node_type: str) -> OpenMaya.MObject:
name = cmds.createNode(node_type)
return OpenMaya.MSelectionList().add(name).getDependNode(0)
node = OpenMaya.MFnDependencyNode(create_node("transform"))
modifier = OpenMaya.MDGModifier()
attribute = attribs.Double3(
"MyDouble",
default=(1.0, 2.0, 3.0),
channel_box=True,
)
attribute.keyable = True
plug = attribs.add_attribute(node, attribute, modifier=modifier)
Compounds are also supported.
from maya import cmds
from maya.api import OpenMaya
import attribs
def create_node(node_type: str) -> OpenMaya.MObject:
name = cmds.createNode(node_type)
return OpenMaya.MSelectionList().add(name).getDependNode(0)
node = OpenMaya.MFnDependencyNode(create_node("transform"))
modifier = OpenMaya.MDGModifier()
attribute = attribs.Compound("foo")
attribute.append(attribs.Bool("bar"))
attribute.append(attribs.String("baz"))
plug = attribs.add_attribute(node, attribute, modifier=modifier)
Metadata
Release files for maya-attribs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maya_attribs-0.1.0.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maya_attribs-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / maya_attribs-0.1.0.tar.gz
| Download URL | maya_attribs-0.1.0.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6dbddcb291ac0b0c8d3683ef29506843475b9b410428aded42a2b0b651a18e5c
|
|
BLAKE2b-256 checksum How to use checksums |
dbffd3a814ff9f36bbbfffa94e92954bc4dedb4c4eecc542d00098fdbc328188
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.
Transparency logRelease files / maya_attribs-0.1.0-py3-none-any.whl
| Download URL | maya_attribs-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a8539f5a8f45847c74a1c12378f5c592f2723e35dab680aabcef55cb88f406b
|
|
BLAKE2b-256 checksum How to use checksums |
8d8268a695cf84e94a9de94eb76ca0542e8d9798d3479b756b0903386894ed45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.
Transparency log