Cmdx

Latest version: v0.6.4

Safety actively analyzes 629639 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.5.1

Added support for Maya 2022

0.5.0

This is a big one!

- New CI platform, from Azure -> GitHub actions
- Basic support for Containers (Maya 2017+)
- Lock and modify keyable state of attributes from a modifier
- Added tests for editing locked and keyable states of attributes
- Added lots more tests
- Added `multiply_vectors`
- Added `divide_vectors`
- Added `HashableTime` which as the name suggests enables time to be stored in a `dict` or `set`
- Added `DGModifier.setKeyable`
- Added `DGModifier.setLocked`
- Added `DGModifier.setNiceName`
- Added `DGModifier.tryConnect`
- Added `DGModifier.connectAttrs` for connecting newly created attributes, before calling `doIt`
- `DGModifier.setAttr` can now set matrices too
- Added `disconnectBehavior` to new attributes
- Added `DagNode.translation` for quick access to local or worldpace translation
- Added `DagNode.rotation` likewise but for rotation
- Added `DagNode.scale` and scale
- Added `DagNode.lineage` to walk *up* a hierarchy, i.e. all parents
- Added `DagNode.niceName`
- Added `Color`
- delete() now supports being passed a list of lists
- Extended `clear()` to also clear undo and cached commands, to enable unload of C++ plug-in
- `DGModifier` now isn't calling `doIt` if there's an exception during a context manager

0.4.11

- Added `.animate`
- Fixed 49, Using Multiple Versions Simultaneously

Animate

Here's what you can do, to more easily add animation to any plug.

python
node = createNode("transform")
node["tx"] = {1: 0.0, 5: 1.0, 10: 0.0}
node["rx"] = {1: 0.0, 5: 1.0, 10: 0.0}
node["sx"] = {1: 0.0, 5: 1.0, 10: 0.0}
node["v"] = {1: True, 5: False, 10: True}

Alternatively
node["v"].animate({1: False, 5: True, 10: False})


- See 50 for details

0.4.10

- Fix for 45, namely protection against disconnecting unconnected attributes
- See 46 for details

0.4.9

- Added `cmdx.exists` to quickly query existence 44
- Added `cmdx.connect` convenience function 44
- Updated `cmdx.DagModifier` improved debugging 44
- Fixed `cmdx.Compound` now supports **nested compound** attributes, see 5. Go nuts. Thanks for benblo for this fix. 38

<br>

Exists

py
if cmdx.exists(someNode):
say_hello()

if someNode.childCount() > 1:
print("This joint has multiple children, yo")


Debugging

This one is useful for debugging.

py
with cmdx.DagModifier() as mod:
tm = mod.create_node("transform")
mod.doIt()
mod.connect(tm["translateX"], tm["message"])


**Before**

bash
I had issues with `create_node` and `connect`


**After**

bash
I had issues with `connect`


Since we've already successfully done the prior with an explicit call to `doIt`. This helps when there's tons of things being done, but most of which have already been `doIt`.

Connect

py
cmdx.connect(a["plug1"], b["plug1"])


As a convenience function for..

py
with cmdx.DagModifier() as mod:
mod.connect(a["plug1"], b["plug2"])


To help with readability when most of the commands don't need/use a modifier, but just this one `connect` does.

0.4.8

- `Node.dump()` now preserves the order in which attributes are present on a node 42
- Added the [MYPY](http://mypy-lang.org/) [token](https://mypy.readthedocs.io/en/stable/common_issues.html#import-cycles) to avoid false positives in some static analyzers (eg Pylance from VsCode is Python3-only, so it doesn't know about Python2 types like `basestring`). 41
- Also imports [`typing`](https://docs.python.org/3/library/typing.html) to add support for type hinting (IDE-only as `typing` is not included in Maya's Python distribution). #41

Thanks to benblo for all of these!

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.