Bendy bone easein and easout factor to match a bezier?


is there a way to calculate easein and easeout to match a bezier curve or is this not possible ?.
This is what is used based on the following blogpost.

ease_in = hlength1/(length*0.350464)
ease_out = hlength2/(length*0.350464)

A small script to test if the bezier and bendy bone match but unfortunatly not successful.

import bpy

# try to match bezier curve

armature =['Armature']
bendy_bone = armature.pose.bones['bendy_bone']

start_handle = armature.pose.bones['h1']
end_handle = armature.pose.bones['h2']

# get custom bendy_bone handle 

v1 = start_handle.head
v2 = start_handle.tail
v3 = end_handle.head
v4 = end_handle.tail

hlength1 = start_handle.length
hlength2 = end_handle.length
length = bendy_bone.length    # or (v2-v3).length ?

# hlength1 = ease_in  * length * 0.350464f
# hlength2 = ease_out * length * 0.350464f

# tried to calculate easein and -out

ease_in = hlength1/(length*0.350464)
ease_out = hlength2/(length*0.350464)

bendy_bone.bbone_easein = ease_in
bendy_bone.bbone_easeout = ease_out

# match bezier handle to bendy_bone handle

bezier =['BezierCurve'].data.splines[0]

bezier.bezier_points[0].co = v1
bezier.bezier_points[1].co = v4
bezier.bezier_points[0].handle_right = v2
bezier.bezier_points[1].handle_left = v3

Here is a simple setup to test the script.
Just scale the handle bones in y direction or rotate them around the start and endpoint of the bendy bone and run the script.

I hope someone can point me in the right direction to achieve what i am looking for.

I’ve been meaning to do this for some time, but I haven’t done it yet. Take a look at my addon, it may have some functions you can use to help figure it out. It can extract data from a curve such as: point in 3D space, normal, radius.

Also, if and when I decide to work on this, it’ll be in ChainTools, too.