Skip to content

Animate#50

Merged
mottosso merged 12 commits intomasterfrom
animate
Jan 23, 2021
Merged

Animate#50
mottosso merged 12 commits intomasterfrom
animate

Conversation

@mottosso
Copy link
Owner

  • Refactor DGContext to be a context manager only in Maya 2018 and above
  • Add node["attr"] = {1: 0.0} for animation
  • Add Plug.animate

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})

Each of which creates an appropriate curve type, e.g. animCurveTL for translateX versus animCurveTA for rotateY.

- Refactor DGContext to be a context manager only in Maya 2018 and above
- Add node["attr"] = {1: 0.0} for animation
- Add Plug.animate
That was a bad idea anyway, better handled by application code
This is really something Maya should guard against internally
@mottosso mottosso merged commit ee73d07 into master Jan 23, 2021
@mottosso mottosso deleted the animate branch January 22, 2022 09:57
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