blend shape from python


I am sure this question has been answered before but I could not find it.

I have created 2 blend shapes and the Basis shape and now I want to add Bezier
Curves from a python script to animate them. I have an old script that did something similar.

Basically I just got the curves from:


and then added Beziers with

for some reason this has stopped working with the new releases. I have written this pre 2.3.

this is there error it gives me:
‘NoneType’ object has no attribute ‘getCurves’

I have added keyframes for each shape key but it still doesn’t work.

Does anyone have any ideas?


I add curves to shape keys all the time.

Looks like the mesh key doesn’t have an Ipo object associated to it and you are not checking whether it really exists.

Before attempting to add curves I always use something like this:

if not mesh.key.ipo: # is None
    mesh.key.ipo = Blender.Ipo.New('Key','KeyIpo')

By the way, getKey(), getIpo() and addBezier() are all deprecated methods.