A Python library for creating Maya Attributes
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maya_attribs-0.1.0.tar.gz.
File metadata
- Download URL: maya_attribs-0.1.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dbddcb291ac0b0c8d3683ef29506843475b9b410428aded42a2b0b651a18e5c
|
|
| MD5 |
22daa32effa5ca43f2abe41b8fde2289
|
|
| BLAKE2b-256 |
dbffd3a814ff9f36bbbfffa94e92954bc4dedb4c4eecc542d00098fdbc328188
|
Provenance
The following attestation bundles were made for maya_attribs-0.1.0.tar.gz:
Publisher:
release.yml on tahv/attribs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maya_attribs-0.1.0.tar.gz -
Subject digest:
6dbddcb291ac0b0c8d3683ef29506843475b9b410428aded42a2b0b651a18e5c - Sigstore transparency entry: 157358744
- Sigstore integration time:
-
Permalink:
tahv/attribs@6cff9b46b10165446e6f6d024f1dead56d41bab8 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/tahv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6cff9b46b10165446e6f6d024f1dead56d41bab8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file maya_attribs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maya_attribs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a8539f5a8f45847c74a1c12378f5c592f2723e35dab680aabcef55cb88f406b
|
|
| MD5 |
395c15d9788f02190c830838749365dd
|
|
| BLAKE2b-256 |
8d8268a695cf84e94a9de94eb76ca0542e8d9798d3479b756b0903386894ed45
|
Provenance
The following attestation bundles were made for maya_attribs-0.1.0-py3-none-any.whl:
Publisher:
release.yml on tahv/attribs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maya_attribs-0.1.0-py3-none-any.whl -
Subject digest:
7a8539f5a8f45847c74a1c12378f5c592f2723e35dab680aabcef55cb88f406b - Sigstore transparency entry: 157358746
- Sigstore integration time:
-
Permalink:
tahv/attribs@6cff9b46b10165446e6f6d024f1dead56d41bab8 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/tahv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6cff9b46b10165446e6f6d024f1dead56d41bab8 -
Trigger Event:
push
-
Statement type: