0
$\begingroup$

I have an alembic file. Is it possible to export the individual frame data to OBJ files with blender script?

$\endgroup$

1 Answer 1

0
$\begingroup$
import os
import sys
import bpy

filepath = sys.argv[1]

# https://blender.stackexchange.com/a/220016/165060
while bpy.data.objects:
    bpy.data.objects.remove(bpy.data.objects[0], do_unlink=True)

# Loading alembic file

bpy.ops.wm.alembic_import(filepath=filepath)
scene = bpy.context.scene
startFrame = scene.frame_start
endFrame = scene.frame_end

for frame in range(startFrame, endFrame + 1):
    scene.frame_current = frame
    filename = (sys.argv[1] + str(frame).zfill(4) + ".abc")
    bpy.ops.export_scene.obj(filepath=filename[:-3] + "obj")
```
$\endgroup$

You must log in to answer this question.

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