Hellos,
This is my first ever attempt to patch a simple python script for Blender 2.9 that could import a series of of svg files that conform an animation. Perhaps of use to someone else here.
I want to be able to enable and disable their visibility so to simulate an animation, this is to be sent to a software called OsciStudio that generates sound from the objects on the viewport.
What I have tried is this:
##################
import bpy
import glob
import os
# path to your folder
importDir = "/Volumes/250GB/16mm/rotoscope/stillsprecol/select/"
print("Importing all SVG from this directory", importDir)
os.chdir(importDir)
for files in glob.glob("*.svg"):
print( files, "... imported!" )
bpy.ops.import_curve.svg(filepath=files)
bpy.ops.object.select_all(action='SELECT')
for i, obj in enumerate(bpy.context.selected_objects, 1):
bpy.context.view_layer.objects.active = obj
obj.name = "Curve" + str(i)
obj.location = (3.0, 4.0, 10.0)
obj.keyframe_insert(data_path="location", frame=1)
Importing works fine, i get all the files layered and selected but have no idea on how to add a keyframe to each layer, progressively and separated by 10 frames.
I’m using blender 2.9 under OS X
TIA for any, really any, help