Page MenuHome

Refactor `BKE_blender`

Authored by Campbell Barton (campbellbarton) on Apr 24 2016, 2:57 PM.



BKE_blender has become a mix of unrelated functions. This commit splits it into: version, undo, copybuffer & file-io, keeping BKE_blender.h to handle globals and userdef's.

This has the advantage that changing BKE_blender.h isn't rebuilding so many files, and the purpose of the includes are clearer.

  • BKE_blender_version.h (only version defines & versionstr)
  • BKE_blender_copybuffer.h (currently only used for view3d copy/paste)
  • BKE_blender_undo.h (global undo functions)
  • BKE_blendfile.h (high level blend file read/write API).

Also avoids having to comment why we need the include, eg: #include "BKE_blender.h" // version info

Some functions were renamed to make it more explicit which part of the API they come from.

Otherwise the only chage to structure is clear_global, which was static has been renamed to BKE_blender_globals_clear exposed so it can remain next to BKE_blender_globals_init, and be called from blendfile.c.

Diff Detail

rB Blender