Created
September 2, 2015 18:17
-
-
Save zeffii/967e62fc3c6bddb0bcbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i_frame in range(n_frames): | |
block = obj.shape_key_add(name=str(i_frame), from_mix=False) # returns a key_blocks member | |
block.value = 1 | |
block.mute = True | |
for (vert, co) in zip(block.data, data[i_frame]): | |
vert.co = co | |
def make_frame_string(A): | |
DATA_PATH = "key_blocks[\"{0}\"].mute".format(str(A)) | |
return '''obj.keyframe_insert(data_path='{1}', frame={0}, index=-1)'''.format(A+1,DATA_PATH) | |
block.mute = False | |
F = make_frame_string(i_frame) | |
print(F) | |
exec(F) | |
block.mute = True | |
F = make_frame_string(i_frame + 1) | |
print(F) | |
exec(F) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or even this... this .. feels so close...