Hi,
You might want to look into making a setup where joint scaling drives geo scaling via some kind of math equation and joint parenting drives the locations of the geos.
Maybe an animator control can drive an overall length and that length is used to figure out how to scale each of the joints. Check out Jason Schleifer, Aaron Holly stretchy rigs
Here is some rough math i did there probably are some mistakes but hope its helpful. There probably are builtin easier ways to get a number between two extremes that meets those extremes depending on another number (maybe remap value nodes, hermite, clamp
)
How to get a number x between scale 0 and 2 that depends on curveLength y between 0 and 10.
call lengths l1 = 0, l2 = 10. scales s1=0, s2 = 2,
x = s2 when y = l2
x = s1 when y = l1
equation for line
x = my + b
s2 = ml2 + b
s1 = ml1 + b
m*(l2-l1) = (s2-s1)
m = (s2-s1)/(l2-l1)
b = s2 - (s2-s1)*l2/(l2-l1)
plugin in the m and b from above
x = my + b ( l1 < y < l2 )
x = s2 ( y >= l2 )
x = s1 ( y <= l1 )
is one way to get a number x between 0 and 2 that depends on curveLength y between 0 and 10 (call lengths l1 = 0, l2 = 10. scales s1=0, s2 = 2)
Here is some Python code i wrote to do this
"""
getScaleInBoundUsingLengthBound(curveLength = 13.0, lengthBound = [10.0,15.0], scaleBound = [0.0,2.0] )slope 0.4, intercept -4.0
# Result: 1.2 #
getScaleInBoundUsingLengthBound(curveLength = 15.5, lengthBound = [10.0,15.0], scaleBound = [0.0,2.0] )slope 0.4, intercept -4.0
# Result: 2.0 #
"""
#one way to get a number x between scale 0 and 2 that depends on curveLength y between 0 and 10.
#should get linear interpolation between scale bounds with zeroes outside of length bound
#ex: call lengths l1 = 0, l2 = 10. scales s1=0, s2 = 2,
def getScaleInBoundUsingLengthBound( curveLength = 0.0, lengthBound = [0.0,10.0], scaleBound = [0.0,2.0] ):
l1 = lengthBound[0]
l2 = lengthBound[1]
s1 = scaleBound[0]
s2 = scaleBound[1]
if( (l2 - l1) > 0 ):
m = (s2-s1)/(l2 - l1) #would error if no length
b = s2 - (s2-s1)*l2/(l2-l1)
print 'slope %s, intercept %s
' %(m,b)
y = curveLength
if( y < l2 and y > l1):
x = m*y + b
elif( y >= l2):
x = s2
elif( y <= l1):
x = s1
return x