Skip to content

Undoable Animation#71

Merged
mottosso merged 10 commits intomasterfrom
animcurve
Jan 22, 2022
Merged

Undoable Animation#71
mottosso merged 10 commits intomasterfrom
animcurve

Conversation

@mottosso
Copy link
Owner

@mottosso mottosso commented Nov 16, 2021

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 boths 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()

- Support for tangents and AnimCurve
- AnimCurve.key(interpolation) was renmed tangents
- Support for `plug.connection(plugs=("name1", "name2")` to match by name
- Add Tm.setRotatePivot and setRotatePivotTranslate
- Add Tm.setScalePivot and setScaleivotTranslate
- More accurate cmdx.lookAt
- Add cmdx.time() and cmdx.frame() conversion functions, like math.degrees() and math.radians()
- Support matching array-plugs by name
- Repair cmdx.lookAt()
@mottosso mottosso merged commit 0ce4eae into master Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant