I have some x3d files made by ParaView. I need to write a script to import these objects sequentially to Blender and make an animation. When each object is imported to 3D View Editor, a keyframe should be created. Then this object is deleted and the next object needs to be imported to make the next keyframe. After doing the same for all objects, the made animation will be played. There are some scripts to make jpeg files as each frame of animation and save it as mpeg or avi format. But,I need to export the above made animation as an Alembic file and import it to Unity. I would be grateful if anybody can help. Thank you so much.

  • $\begingroup$ Method suggested looks unsound. Please add more detail, eg are imported objects different or could they be considered shapekeys of each other. ... are you mixing keyframe with shapekey above? $\endgroup$
    – batFINGER
    Jul 17, 2020 at 11:23
  • $\begingroup$ The imported objects are the time dependent CFD simulation results. They are velocity vectors at different time steps which have been post processed using ParaView and exported as x3d files to Blender. They are different and cannot be shapekeys of each other. $\endgroup$
    – Sima
    Jul 23, 2020 at 3:48

1 Answer 1


I have the same problem. I somehow managed importing the .x3d files. However I couldn't animate it. Here is my detail information: I have 11 .x3d files representing a simulation at time of 0 second, 10 seconds up to 100 seconds. I want to set frame 0 to the file at 0 seconds, frame 1 for the file at 10 seconds and so on. I hope the importing scripts will help. My importing script is:

    import bpy
    import os
    import sys
    from mathutils import Vector

    importFolder = "./x3d" #the relative path of the folder containing the files
   # Fixed parameters
    geoName = "imported_geometry1"
    blenderVersion = bpy.app.version
    if blenderVersion[1] >= 79:
      x3dImportString = 'Shape_IndexedFaceSet'
       x3dImportString = 'ShapeIndexedFaceSet'

      # Turn relative into absolute paths
      importFolder=os.path.join(os.getcwd(), importFolder)
       # Get a list of all files in this directory - these are going to be the files we 
       #import and visualize
      importFiles = os.listdir(importFolder)
      # Start the rendering loop over all import files
      for frame in range(len(importFiles)):
    importFile = os.path.join(importFolder,importFiles[frame])
    print("Processing frame ",frame+1," importing ",importFile)


    # Import the current object, either supplied as a .ply or a .x3d file
    # The geometry will always be renamed so it can be easily used later on
    bpy.ops.import_scene.x3d(filepath=importFile, filter_glob="*.x3d;*.wrl", axis_forward='Y', axis_up='Z')
     # check for geometries / meshes, lamps and cameras
    imported_geo_exists = [item.name for item in bpy.data.objects if x3dImportString in item.name]
    nImportedGeo = len(imported_geo_exists)
    imported_lights_exists = [item.name for item in bpy.data.objects if ("TODO" in item.name or "DirectLight" in item.name)]
    imported_cameras_exists = [item.name for item in bpy.data.objects if "Viewpoint" in item.name]
    # rename geometry
    if imported_geo_exists:
        for i in range(0,nImportedGeo):
        # delete lights and cameras that blender creates after import
        if imported_lights_exists:
        if imported_cameras_exists:

  • $\begingroup$ Thank you for the script, but I had imported the files but I still have the animation problem. $\endgroup$
    – Sima
    Nov 4, 2020 at 17:30

You must log in to answer this question.

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