I am currently using Blender 2.80, and am attempting to follow along with the tutorial at this link on animating mesh objects (https://medium.com/@behreajj/creative-coding-in-blender-a-primer-53e79ff71e)
Specifically, I am referring to the section where the author morphs the shape of Suzanne.
I am attempting to do the same for the grid object, and while the graph editor clearly shows the vertices are moving to where I want, the animation shows that the mesh does not change whatsoever.
I am puzzled as to how the tutorial works for Suzanne, but this does not. I see that there is an alternate method using shape keys, but the code below should still work right?
import bpy import numpy as np pi = np.pi #Clear out the objects on the screen scene = bpy.context.scene for obj in bpy.data.objects: bpy.data.objects.remove(obj, do_unlink=True) #Make a grid object to animate bpy.ops.mesh.primitive_grid_add(x_subdivisions=20, y_subdivisions=20,size=10) obj = bpy.context.active_object mesh = obj.data frames = np.arange(0,250,20) T =15*6 for fram_num in frames: scene.frame_set(fram_num) t = fram_num * 2*pi/T #Move all vertices and add keyframes to each one for i,v in enumerate(mesh.vertices): x,y,_ = v.co z = np.sin(x+y-t) v.co = (x,y,z) v.keyframe_insert(data_path="co", index=-1)
Edit: Curiously this code works in Blender 2.79, but not in 2.80! Is this a bug, or intended?