Releases: mottosso/cmdx
0.6.4
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
0.6.2
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 renamedtangents
- Support for
plug.connection(plugs=("name1", "name2")
to match by name - Add
Tm.setRotatePivot
andsetRotatePivotTranslate
- Add
Tm.setScalePivot
andsetScaleivotTranslate
- 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
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 aMTime
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
0.5.1
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 adict
orset
- Added
DGModifier.setKeyable
- Added
DGModifier.setLocked
- Added
DGModifier.setNiceName
- Added
DGModifier.tryConnect
- Added
DGModifier.connectAttrs
for connecting newly created attributes, before callingdoIt
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 callingdoIt
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.
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
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
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.