Last active
January 19, 2020 22:18
-
-
Save bohdon/9be89db103234bede5e9b5003c0b120b to your computer and use it in GitHub Desktop.
Maya 2020 offsetParentMatrix shelf commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create opm connection (select leader then follower) | |
| # > opm | |
| import pulse.nodes | |
| wm = pulse.nodes.getWorldMatrix(pm.selected()[1]) | |
| pm.selected()[0].wm >> pm.selected()[1].opm | |
| pm.selected()[1].inheritsTransform.set(False) | |
| pulse.nodes.setWorldMatrix(pm.selected()[1], wm) | |
| # break opm connection | |
| # x opm | |
| import pulse.nodes | |
| for s in pm.selected(): | |
| wm = pulse.nodes.getWorldMatrix(s) | |
| s.opm.disconnect() | |
| s.opm.set(pm.dt.Matrix()) | |
| s.inheritsTransform.set(True) | |
| pulse.nodes.setWorldMatrix(s, wm) | |
| # freeze anim control | |
| for s in pm.selected(): | |
| localMtx = s.m.get() | |
| offsetMtx = s.opm.get() | |
| newOffsetMtx = localMtx * offsetMtx | |
| s.opm.set(newOffsetMtx) | |
| s.setMatrix(pm.dt.Matrix()) | |
| # unfreeze anim control | |
| for s in pm.selected(): | |
| localMtx = s.m.get() | |
| offsetMtx = s.opm.get() | |
| newLocalMtx = localMtx * offsetMtx | |
| s.setMatrix(newLocalMtx) | |
| s.opm.set(pm.dt.Matrix()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment