Hello all,

I’m still trying to screipt a wizard to cconvert a bezier spline to IPO graphs, and while I have locations working, the rotation part isn’t, and its just bonkers, that and realizing some weeks ago that I need to divide my angle by 10 to commply with silly Euler notation.

Anyway, I realize that I need to do an arc tangent, and have that working based on two vectors, doing basic trig, my current problem is that when playing back the animation it doesn’t rotate as it follows the path, and I am really lost as to what I can do, any ideas?

Ps Please don’t post complex math notation equations, I can’t read them:spin:

```
def Plot_Rot(myCurrentPathLen, myBezPointNumber, myPathIter):
Radian = 6.283185307179586476925286766559
print "function."
SideA = H2_X - P_X
SideB = H2_Y - P_Y
print "Side A: %s Side B: %s" % (SideA, SideB)
AngleC = atan2 (SideA, SideB)
AngleC = (AngleC * Radian)
print "Arc tan: %s" % AngleC
SideD = H1_X - P_X
SideE = H1_Y - P_Y
print "Side D: %s Side E: %s" % (SideD, SideE)
AngleF = atan2 (SideD, SideE)
AngleF = (AngleF * Radian)
print "Arc tan: %s" % AngleF
AngleG = (AngleC + AngleF) / 2
#AngleF = 180 +AngleF
#AngleC = (90 * myBezPointNumber)
#Angle = Blender.Mathutils.AngleBetweenVecs (SideA, SideB)
#print"BezNumber: %s" % myBezPointNumber
#print"AngleC: %s" % AngleC
# make 3 BezTriples, and mke sure their handles are FREE
# pass eacch of these 3 new BezTriples for X, Y and Z
# to their relevant IPO's
#myIPOCurvePitch = Blender.BezTriple.New(myCurrentPathLen - myHandleIter, Angle, 0, myCurrentPathLen, Angle, 0, myCurrentPathLen + myHandleIter, Angle, 0)
#myIPOCurveRoll = Blender.BezTriple.New(myCurrentPathLen - myHandleIter, Angle, 0, myCurrentPathLen, Angle, 0, myCurrentPathLen + myHandleIter, Angle, 0)
myIPOCurveYaw = Blender.BezTriple.New(myCurrentPathLen - myHandleIter, AngleF / 10, 0, myCurrentPathLen, AngleG / 10, 0, myCurrentPathLen + myHandleIter, AngleC / 10, 0)
#myIPOCurvePitch.handleTypes = (Blender.BezTriple.HandleTypes.FREE, Blender.BezTriple.HandleTypes.FREE)
#myIPOCurveRoll.handleTypes = (Blender.BezTriple.HandleTypes.FREE, Blender.BezTriple.HandleTypes.FREE)
myIPOCurveYaw.handleTypes = (Blender.BezTriple.HandleTypes.FREE, Blender.BezTriple.HandleTypes.FREE)
#myIPOCurveRot_X.append(myIPOCurvePitch)
#myIPOCurveRot_Y.append(myIPOCurveRoll)
myIPOCurveRot_Z.append(myIPOCurveYaw)
print "function."
myCurrentPathLen = myPathIter * myBezPointNumber
#myIPOCurveRot_Z.append((myCurrentPathLen, Angle2 / 10))
```