Using a baked position as new start position My problem: I have a (probably insane) model with about 30000 shapes. I want to drop the entire thing using rigid body physics. I am not really interested in the animation as such, nor is it important that the simulation is 100% correct, I just want the final pile of shapes.

The problem is that I can't bake all of it in one go (blender crashes far before the bake is finished).

I am currently trying to bake some frames, then use the baked position as my new starting position, and bake again from there.
I use the following script, and it seemed to work when I tried it on just a few objects, but it does nothing as far as I can see when I run it on my big model.
Script:

import bpy

def usebake(frame = 20):
  bpy.context.scene.frame_set(frame)
  i = 0
  for obj in bpy.data.objects:
    i = i+1
    obj.location = obj.matrix_world.to_translation()
    obj.rotation_quaternion = obj.matrix_world.to_quaternion()
    #obj.rotation_euler = obj.matrix_world.to_euler()
  print(i)


The process I have used is as follows:
Bake -> run script -> free bake -> bake new

Am I doing something wrong?
Alternatively, is there another way to achieve what I'm trying to do?
It turned out all my objects had an animation linked to them for some reason (I'm guessing it is because I had been experimenting with keyframes as another way to solve my question, but I'm not sure). I reverted to a backup file without the linked animations, and it works just fine now.