Skip to content

Releases: mottosso/cmdx

0.6.4

27 Feb 17:17
Compare
Choose a tag to compare

Nodes and Plugs now look much nicer and tell you much more about them, thanks to #78!

>>> decompose = cmdx.createNode("decomposeMatrix", name="decompose")

# str() still outputs the name of the node
>>> str(decompose)
'decompose'

>>> transform = cmdx.createNode("transform")

# repr() on the other hand shows you whether it's a DagNode or Node
>>> transform
cmdx.DagNode("transform1")

>>> transform["tx"] = 5
>>> transform["worldMatrix"][0] >> decompose["inputMatrix"]

# Plugs show you both the type and value
>>> decompose["outputTranslate"]
cmdx.Plug("decompose", "outputTranslate") == (5.0, 0.0, 0.0)
>>> decompose["outputTranslate"].read()
(5.0, 0.0, 0.0)

0.6.3

14 Dec 16:30
ddf276a
Compare
Choose a tag to compare

Up to par with Ragdoll Dynamics.

  • See #73 for lots of details

0.6.2

22 Jan 13:17
0ce4eae
Compare
Choose a tag to compare

Added support for undoable animation.

with cmdx.DagModifier() as mod:
  node = mod.create_node("transform", name="animatedNode")

# Set some keys
with cmdx.DagModifier() as mod:
  mod.set_attr(node["tx"], {1: 0.0, 5: 2.0, 10: 0.0 })

# Set some more keys
with cmdx.DagModifier() as mod:
  mod.set_attr(node["tx"], {20: 0.0, 25: 2.0, 30: 0.0 })

cmds.undo()  # Keys 2 bye-bye
cmds.undo()  # Keys 1 bye-bye
cmds.undo()  # Node bye-bye

Notice that it both creates the (correct!) animation curve node (linear for translation, angular for rotation, for example), depending on the plug type, or edits it if one already exists.

And more:

  • Support for tangents and AnimCurve
  • AnimCurve.key(interpolation) was renamed tangents
  • Support for plug.connection(plugs=("name1", "name2") to match by name
  • Add Tm.setRotatePivot and setRotatePivotTranslate
  • Add Tm.setScalePivot and setScaleivotTranslate
  • Add cmdx.time() and cmdx.frame() conversion functions, like math.degrees() and math.radians()
  • Support matching array-plugs by name
  • Repair cmdx.lookAt()

See #71 for details.

0.6.1

16 Nov 19:50
8c2f849
Compare
Choose a tag to compare

Been a while since a release was made, even though commits have been rolling in. Here's just a taste.

  • Added cmdx.clone()
  • Added indices to printed plugs, e.g. worldMatrix[0]
  • Added pretty-printed cmdx.Matrix4
  • Added pretty-printed cmdx.TransformationMatrix
  • Added plug.asTime() to return a MTime type
  • Fool-proof load of cmdx as a plug-in (for undo/redo)
  • Added cmdx.exists(strict=True)
  • Return native Quaternion types for asQuaternion() and inverse()
  • Make Divider attributes non-keyable per default
  • Append to existing animation cuves if they exist
  • Add minTime(), maxTime(), animationStartTime(), animationEndTime()
  • Add Vector.isEquivalent
  • Add Quaternion.asEulerRotation
  • Add Quaternion.inverse
  • Add TransformationMatrix.setRotatePivot
  • Print rotation of TransformationMatrix in degrees rather than radians

See 0.6.0...0.6.1 for a full list!

0.6.0

11 Apr 12:04
503b064
Compare
Choose a tag to compare

Strong undo/redo support and a lot less reasons to crash Maya.

  • See #56 for details

0.5.1

25 Mar 07:35
4a6284c
Compare
Choose a tag to compare

Added support for Maya 2022

0.5.0

20 Mar 20:03
Compare
Choose a tag to compare

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

23 Jan 06:58
ee73d07
Compare
Choose a tag to compare
  • Added .animate
  • Fixed #49, Using Multiple Versions Simultaneously

Animate

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

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

06 Dec 08:46
2781089
Compare
Choose a tag to compare
  • Fix for #45, namely protection against disconnecting unconnected attributes
  • See #46 for details

0.4.9

30 Nov 13:15
c112597
Compare
Choose a tag to compare
  • 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

Exists

if cmdx.exists(someNode):
  say_hello()

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

Debugging

This one is useful for debugging.

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

Before

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

After

# 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

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

As a convenience function for..

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.