In my scene I use multiple different object hair stands in the same scene, the problem though is then I have to bake each one individually which becomes incredibly tedious with large amounts of strands.

Is there a plugin, or simple script I can run that will go through each selected object and bake the hair dynamics?

  • $\begingroup$ In the Cache tab, click on the "Bake All Dynamics" instead of the Bake button. It will bake all hairs particles, and everything else like Fluids, on every object and particle system. $\endgroup$
    – james_t
    Commented Jan 20 at 16:55

1 Answer 1


Eventually i found some code that works for this, so enter this code into the scripting tab, selected the strands you want to bake, and run

in the code you'll also see towards the bottom, Frame Start and Frame end, this will automatically change the frames to the desired frame start/end dependent on the value.

import bpy

def print(data):
    for window in bpy.context.window_manager.windows:
        screen = window.screen
        for area in screen.areas:
            if area.type == 'CONSOLE':
                override = {'window': window, 'screen': screen, 'area': area}
                bpy.ops.console.scrollback_append(override, text=str(data), type="OUTPUT")

# Check if there is an active object

obj = bpy.context.object

for scene in bpy.data.scenes:
    for object in bpy.context.selected_objects:
        for modifier in object.modifiers:
            if modifier.type == 'FLUID':
                #if modifier.fluid_type == 'DOMAIN':
                    #print("Baking fluid")
                    #bpy.context.view_layer.objects.active = object
            elif modifier.type == 'CLOTH':
                print("Baking cloth")
                #override = {'scene': scene, 'active_object': object, 'point_cache': modifier.point_cache}
                #bpy.ops.ptcache.bake(override, bake=True)
            elif modifier.type == 'PARTICLE_SYSTEM':
                print("Baking particles")
                strands = bpy.context.selected_objects
                for x in strands:x.modifiers["ParticleSystem"].particle_system.point_cache.frame_start=10
                for x in strands:x.modifiers["ParticleSystem"].particle_system.point_cache.frame_end=14

                override = {'scene': scene, 'active_object': object, 'point_cache':                  modifier.particle_system.point_cache}
                bpy.ops.ptcache.bake(override, bake=True)



You must log in to answer this question.

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