Adding Shape Keys to a Curve

Hi guys,

I’m trying to add some shape keys to a curve using a python script. But I can’t find the right way to do this. Is this possible in Blender 2.44?
I think there is no function like insertKey() which I can use to add a key and the following does not work:

curve.key = Key.New(); # or
curve.key = Key();

Did anyone use shape key for curves via python and can help me now ???
I think it’s the last problem before I can finish me script.

Thanks,
KoRn

Can anybody help me with this problem, please ???
Is it possible to use shape keys with curves ?

Hello,
Forgive me for intruding, but have you looked at using a lattice modifier on your curve? I just tried it, and if you make a lattice and set a lattice modifier to your curve naming that lattice, then you can create shape keys for the lattice. Not as specific as I hoped, but it was interesting stuff on lattice deform to the BevelObject, and using hooks for the root curve.

Craigo

Thanks.
I tried this before but I need to move the points of a bezier curve to exact coordinates and if I use a lattice this doesn’t work very well I think.
If I use the same coordinates for lattice points the curve moves to another position and the points of the curve do not exactly follow the lattice points if I move them.

I worked around the back way, I guess, with vertex parenting. I made a curve circle and made hooks for the control points, then made a subdivided plane. I used empties for the hooks, and vertex parented the empties to the corners of the plane. I then made shape keys for the plane, and moved the plane to another layer. The shape keys affected the curve circle this way, but with tweaking I could probably get better results. Depending on what you want to do, you could actually get a lot from making a complicated rig of several primitives as the hooks , and assigning positions of those primitives as your shape keys - to select the primitives, just make vert groups for each primitive in the mesh, naming it to the coordinate it represents. Almost like rigging, but with a mesh :slight_smile:

I hope this is better than bailing on the python - I’m sorry, but I can’t read python to understand what it’s doing.

I guess you won’t benefit from the previous post, since you are trying to code something to do what I did manually. You would have to code something to assign a vertex to each control point and to each curve vertex, and then assign a basis and multiple keys to the basis. Like I said, I don’t know python, so I apologize for running your thread over.:o