A deformer to limit NURBS curve length. Why have such a deformer? Well, it can be used in some scenarios where you don’t want to set up a whole spline IK rig or in situations where a spline IK or a motion path hack is not a practical solution. For example, you have a scene with many curves, you definitely wouldn’t want to set up complex rigs when your end goal is just to limit the curve length. Maya includes a curve lock length feature, however, it is not animatable. That is where this deformer might shine some light.
Defomer node name is bbxLimitCurveLength. Made in C++, tested in Maya 2018, 2019, 2020 (Windows and Linux).
Why is it called “limit curve length” and not “fixed curve length”? There might be differences in the resulting length depending on the curvature.
Works on non-periodic Linear and Cubic curves. Haven’t tested on any other curve orders. The result on a periodic/closed curve is undefined since it can’t slide curve through a specific direction.
There might be a major performance hit if the deformer is applied to way too many curves or if applied to curves with too many spans. This is a major drawback since Maya’s NURBS API is not thread-safe and curve evaluation is very expensive in general (For example, try using a curve with 100 CVs for a spline IK, or try creating too many spline IKs). (Disclaimer: This is my understanding of Maya API, I might be wrong!)
This deformer should ideally be positioned at the end of the deformer stack. (All other deformations should happen before this, or you will the benefit of limiting length)
|baseCurve (bc)||nurbsCurve ||N/A||null||Define rest pose of the affecting curve. |
This attribute is automatically set when you apply this deformer to curve(s)
|globalScale (gs)||double||N/A||Defines scale ratio.|
If a base curve is not connected, this attribute is used for re-scaling cached base curve.
Can be used for scaling down curve along the curvature.
|pinStartEnd (pse)||double||0.0 – 1.0||0.0||Slide the resulting original curve along the stretched curve.|
|allowStretch (ast)||double||0.0 – 1.0||0.0||If the curve is longer than initial length, disabling this option would keep resulting curve to match initial length. Enabling would stretch it along the stretched curve.|
Note: this attribute does not have any effect when pinStartEnd is not zero.
|allowSquash (asq)||double||0.0 – 1.0||0.0||If the curve is shorter than initial length, disabling this attribute would extend curve along the last tangent to match initial length (Default behavior)|
|showWarning (sw)||bool||N/A||True||If enabled, evaluation will show warnings when the base curve does not match input curve or if when the deformer is assigned to non-curve objects|
How to use?
- Create/Select any number of curves
- With the curves selected and run the below in the script editor
deformer -typ "bbxLimitCurveLength";
import maya.cmds as cmds
- Make sure bbxLimitCurveLength is end of chain deformer;
- That’s it
Since my expertise in WordPress is sub-par, I had to host downloads on gumroad. This plugin is available for 2018, 2019, 2020 versions of Maya on Windows and Linux platforms.
To make everyone’s life easier, no licenses are enforced within the plugin. Since it is up for a fair price, do consider getting more copies if possible. Thank you