Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate #50

Merged
merged 12 commits into from
Jan 23, 2021
Merged

Animate #50

merged 12 commits into from
Jan 23, 2021

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