Skip to content

Blender Cycles high memory usage for baking multiple objects workaround - edit this problem no longer exists in blender 2.8

License

Notifications You must be signed in to change notification settings

Mateusz-Grzelinski/cycles-bake-workaround

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I faced this problem in Blender 2.7 series, it has been probably solved arleady by developers. This code is probably not relevant in 2.8 series

Blender cycles bake high memory usage workaround

Problem

Cycles baking process consumes too much memory, especially when it comes to baking multiple objects, that can not be joined together into one.

Workaround

Bake objects one by one. After each bake blender must be restarted, because memory is not freed after bake is completed (even after image is saved). To achive this, script file sequential_bake_main.py runs Blender with script bpy_bake.py in loop untill all selected objects are baked. One by one.

Usage & examples

Files sequential_bake_main.py and bpy_bake.py sould be in the same folder.

bpy_* files are meant to be used inside blender.

Bpy_prepare_bake.py is used to automate preparation for baking. Look inside for details.

Sequential_bake_main.py calls bpy_bake.py with command

blender /path/to/my_file.blend --background --factory-startup --python ./bpy_bake.py -- 

Tempfile is used to communicate to sequential_bake_main.py when to stop calling instances of blender (created automatically)

Examples:

  1. Bake selected object in file: "/path/to/file.blend" (remember to properly escape path)
    python sequential_bake_main.py "/path/to/file.blend"

Contact

Post an issue.

About

Blender Cycles high memory usage for baking multiple objects workaround - edit this problem no longer exists in blender 2.8

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages