Skip to content

Commit 0ce4eae

Browse files
authored
Merge pull request #71 from mottosso/animcurve
Undoable Animation
2 parents e61f30e + b8906c2 commit 0ce4eae

File tree

3 files changed

+239
-137
lines changed

3 files changed

+239
-137
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
nose-exclude==0.5.0 \
5151
coverage==5.5 \
5252
flaky==3.7.0 \
53+
docutils==0.17.1 \
5354
sphinx==1.8.5 \
5455
sphinxcontrib-napoleon==0.7
5556

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ On average, `cmdx` is **140x faster** than [PyMEL](https://github.com/LumaPictur
3232

3333
##### Status
3434

35-
[![](https://img.shields.io/pypi/v/cmdx?color=steelblue&label=PyPI)](https://github.com/mottosso/cmdx/) [![](https://img.shields.io/pypi/pyversions/cmdx?color=steelblue)](https://pypi.org/project/cmdx)
35+
[![](https://img.shields.io/pypi/v/cmdx?color=steelblue&label=PyPI)](https://pypi.org/project/cmdx/) [![](https://img.shields.io/pypi/pyversions/cmdx?color=steelblue)](https://pypi.org/project/cmdx)
3636

3737
| Maya | Status
3838
|:----------|:----
@@ -66,6 +66,37 @@ $ pip install cmdx
6666

6767
<br>
6868

69+
### Vendoring
70+
71+
> Note: Advanced topic, you can skip this
72+
73+
Unlike PyMEL and cmds, `cmdx` is designed to be distributed alongside your tool. That means multiple copies of `cmdx` can coincide within the same Maya/Python session. But because the way [Undo/Redo](#undo) is handled, the `cmdx.py` module is also loaded as a Maya command plug-in.
74+
75+
You can either ignore this, things to look out for is errors during undo coming from another tool or global module directory, even though the command came from your tool. Alternatively, you can follow this recommendation.
76+
77+
```bash
78+
mytool/
79+
vendor/
80+
__init__.py
81+
cmdx_mytool.py
82+
```
83+
84+
From here, you can either `from .vendor import cmdx_mytool as cmdx` or you can put the following into the `__init__.py` of the `vendor/` package.
85+
86+
```py
87+
from . import cmdx_mytool as cmdx
88+
```
89+
90+
This would then allow your users to call..
91+
92+
```py
93+
from mytool.vendor import cmdx
94+
```
95+
96+
..as though the module was called just `cmdx.py`.
97+
98+
<br>
99+
69100
### What is novel?
70101

71102
With [so many options](#comparison) for interacting with Maya, when or why should you choose `cmdx`?
@@ -1093,6 +1124,20 @@ v = Vector(1, 2, 3)
10931124
assert isinstance(q * v, Vector)
10941125
```
10951126

1127+
##### Conversions
1128+
1129+
Python's `math` library provides a few convenience functions for converting `math.degrees` to `math.radians`. `cmdx` extends this with `cmdx.time` and `cmdx.frame`.
1130+
1131+
```py
1132+
radians = cmdx.radians(5)
1133+
degrees = cmdx.degrees(radians)
1134+
assert degrees = 5
1135+
1136+
time = cmdx.time(frame=10)
1137+
frame = cmdx.frame(time=time)
1138+
assert frame == 10
1139+
```
1140+
10961141
##### Available types
10971142

10981143
- `asDouble()` -> `float`

0 commit comments

Comments
 (0)