keyframeReduction package¶
48 |Keyframe Reduction for Maya using least-squares method.
49 |
51 | Installation¶
54 |-
55 |
- Extract the content of the .rar file anywhere on disk. 56 |
- Drag the keyframeReduction.mel file in Maya to permanently install the script. 57 |
Usage¶
61 |A button on the MiscTools shelf will be created that will allow easy access to 62 | the ui, this way the user doesn’t need to worry about any of the code. If user 63 | wishes to not use the shelf button the following commands can be used.
64 |The ui responds to the current selection where it finds all of the suitable 65 | animation curves for reduction. You will be able to filter the animation 66 | curves based on the plug it is connected to. This will make it easier to 67 | target exactly the curves you want to reduce.
68 |After an animation curve is reduced the reduction percentage will be printed 69 | to the console. This can give you an idea if you would like to increase or 70 | decrease the error rate to get the desired results.
71 |UI¶
73 |
75 | Display the UI with the following code.
77 |import keyframeReduction.ui
78 | keyframeReduction.ui.show()
79 | Command Line¶
84 |Use the KeyframeReduction class on individual animation curves.
85 |from keyframeReduction import KeyframeReduction
86 | obj = KeyframeReduction(pathToAnimCurve)
87 | obj.reduce(error=0.1)
88 | Options¶
93 |-
94 |
- error: The maximum amount the reduced curve is allowed to deviate from the sampled curve. 95 |
- step: The step size to sample the curve, default is set to one. 96 |
- weightedTangents: Reduce curve using weighted tangents, using weighted tangents will result in less keyframes. 97 |
- tangentSplitAuto: Automatically split tangents. 98 |
- tangentSplitExisting: Use existing keyframes that have split tangents. 99 |
- tangentSplitAngleThreshold: Split tangents based on an angle threshold. 100 |
- tangentSplitAngleThresholdValue: Split tangent angle value. 101 |
Note¶
106 |The fitting algorithm is ported from Paper.js - The Swiss Army Knife of Vector Graphics Scripting. 107 | http://paperjs.org/
108 |Subpackages¶
111 |-
113 |
- keyframeReduction.classes package
-
114 |
- Submodules 120 | 121 |
123 |
Submodules¶
128 |-
130 |
- keyframeReduction.install module 131 |
- keyframeReduction.ui module 132 |
- keyframeReduction.utils module 133 |


