3
$\begingroup$

I have a Mesh Sequence Cache modifier that references a .abc file. Is there any way I could bake the modifiers' motion to the object so it doesn't have to reference the .abc file?

I'm doing this so that I can give the .blend file to SheepIt for rendering.

$\endgroup$

3 Answers 3

1
$\begingroup$

Realized I can't do this, keyframes won't work for geometry and shape keys require each frame to have the same polycount.

$\endgroup$
0
$\begingroup$

You actually can achieve this by creating a shape key on each frame with modifiers applied and animating those shape keys:

import bpy

ob = bpy.context
obAc = ob.active_object
    mesh_data = obAc.data

start_frame = bpy.context.scene.frame_start
end_frame = bpy.context.scene.frame_end

if not obAc.data.shape_keys:
    obAc.shape_key_add(name="Basis")

# Create shape keys for each frame
for frame in range(start_frame, end_frame + 1):
    bpy.context.scene.frame_set(frame)
    
    # Evaluate the mesh with modifiers
    depsgraph = bpy.context.evaluated_depsgraph_get()
    object_eval = obAc.evaluated_get(depsgraph)
    mesh_eval = object_eval.data
    
    # Create a new shape key and set its points based on the current frame
    shape_key = obAc.shape_key_add(name=str(frame))
    
    # Collect vertex positions for the current frame
    vertices = [vertex.co for vertex in mesh_eval.vertices]
    
    # Set shape key data
    shape_key.data.foreach_set('co', [c for v in vertices for c in v])
    
if obAc.data.shape_keys:
    shape_keys = obAc.data.shape_keys.key_blocks
    
    # Iterate through shape keys and set keyframes
    for frame in range(start_frame, end_frame + 1):
        ob.scene.frame_set(frame)
        
        for shape_key in shape_keys:
            if shape_key.name.isdigit(): 
                value = 1.0 if int(shape_key.name) == frame else 0.0
                shape_key.value = value
                shape_key.keyframe_insert(data_path='value', index=-1)
$\endgroup$
0
$\begingroup$

You can render using external files. Collect external files with blend file in one folder. Make sure that the path is relative in the MeshSequence modifier and looks like //name.abc Relative path started with //.

Zip them to an archive and send it to Sheepit.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .