Set the name of the shape-key datablock to the model name.

Note that this is the data block that holds the list of actual shape-keys,
rather than the shape-keys themselves. I'm not sure what it's correct name
is (it's just "Key" in RNA).

I really dislike this method of setting the name, but the use of "Key" as
the datablock name is actually hard-coded into blender's C code :/
This commit is contained in:
Bill Currie 2012-04-16 13:33:45 +09:00
parent 0952e918dd
commit 4b29510bfd

View file

@ -146,6 +146,7 @@ def make_shape_key(mdl, framenum, subframenum=0):
def build_shape_keys(mdl): def build_shape_keys(mdl):
mdl.keys = [] mdl.keys = []
mdl.obj.shape_key_add("Basis") mdl.obj.shape_key_add("Basis")
mdl.mesh.shape_keys.name = mdl.name
mdl.obj.active_shape_key_index = 0 mdl.obj.active_shape_key_index = 0
for i, frame in enumerate(mdl.frames): for i, frame in enumerate(mdl.frames):
frame = mdl.frames[i] frame = mdl.frames[i]