fcurve - random y keyframe location

import bpy import random reset_to = 1.0 for object in bpy.context.selected_objects: # In case the object isn't animated, we should also reset it's y-coord. object.location.y = random.uniform(-4,4) if not object.animation_data or not object.animation_data.action: # No action, so nothing to do. continue action = object.animation_data.action fcurve = action.fcurves.find('location', index=1) if not fcurve: # y-lo0cation not animated, so nothing to do. continue for keypoint in fcurve.keyframe_points: keypoint.co.y = random.uniform(-4,4) fcurve.update()

batch rendering obj files:

import bpy import pathlib #Adjust this for where you have the OBJ files. obj_root = pathlib.Path('D:/BLENDER/training/python/Objs') # Before we start, make sure nothing is selected. The importer will select # imported objects, whcih allows us to delete them after rendering. bpy.ops.object.select_all(action='DESELECT') render = bpy.context.scene.render for obj_fname in obj_root.glob('*.obj'): bpy.ops.import_scene.obj(filepath=str(obj_fname)) render.filepath = '//renders/obj-' + obj_fname.stem bpy.ops.render.render(write_still=True) # Remember which meshes were just imported meshes_to_remove = [] for ob in bpy.context.selected_objects: meshes_to_remove.append(ob.data) bpy.ops.object.delete() # Remove the meshes from memory too for mesh in meshes_to_remove: bpy.data.meshes.remove(mesh) #break #while testing