Bmesh script
Select the profile mesh, run script. Creates a copy for each frame from scene frame start to scene frame end.
A simple edge loop animated with follow path constraint, scale, and a mix of two shape keys. BMesh.from_object
gives a mesh snapshot at that frame (Apologies for low quality gif)
import bpy
import bmesh
from mathutils import Vector, Matrix
from math import radians, degrees
context = bpy.context
dg = context.evaluated_depsgraph_get()
scene = context.scene
ob = context.object
me = ob.data
bm = bmesh.new()
f = scene.frame_start
step = 1
while f <= scene.frame_end:
scene.frame_set(f)
bm.from_object(ob, dg)
rme = bpy.data.meshes.new("Rib")
bm.to_mesh(rme)
copy = bpy.data.objects.new("Rib", rme)
copy.matrix_world = ob.matrix_world
scene.objects.link(copy)
bm.clear() # interesting without.
f += step
Skinning the thing.
Rather than having an object per rib, could also make one object. Taking advantage of the order each rib ring is added, can bridge these edgeloops with bmesh.ops.bridge_loops
Could be done on a lower level by creating faces.
import bpy
import bmesh
from mathutils import Vector, Matrix
from math import radians, degrees
context = bpy.context
dg = context.evaluated_depsgraph_get()
scene = context.scene
coll = context.collection
ob = context.object
mw = ob.matrix_world.copy()
me = ob.data
nverts = len(me.vertices)
nedges = len(me.edges)
bm = bmesh.new()
f = scene.frame_start
step = 1
rings = []
while f <= scene.frame_end:
scene.frame_set(f)
bm.from_object(ob, dg)
bmesh.ops.transform(bm, verts=bm.verts[-nverts:], matrix=ob.matrix_world)
rings.append(bm.edges[-nedges:])
f += step
# build from rings
next = rings.pop()
while rings:
ring = rings.pop()
bmesh.ops.bridge_loops(bm, edges=ring + next)
next = ring
rme = bpy.data.meshes.new("Rib")
bm.to_mesh(rme)
copy = bpy.data.objects.new("Rib", rme)
#copy.matrix_world = mw
coll.objects.link(copy)