Page MenuHome

Fix T84935: Boolean custom data layers not saved correctly.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jan 25 2021, 1:49 PM.

Details

Summary

The issue was that boolean custom data layers were not written to files, because the dna struct name bool does not exist. Adding a struct that just contains a bool/uint8_t does not seem to be possible, it looks like the minimum dna struct size is 4 bytes.
The proposed solution has two parts:

  1. Write the custom data layer using BLO_write_raw instead of BLO_write_struct_array_by_name.
  2. When loading a file, reinitialize any custom data layer that was not saved correctly (this is just a fix for existing files).

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jan 25 2021, 1:49 PM
Jacques Lucke (JacquesLucke) created this revision.

Interesting, I figured it wouldn't need to be saved in files since it's always evaluated data. But of course undo / redo complicates this. Lesson learned. Thanks.

This revision is now accepted and ready to land.Jan 25 2021, 6:08 PM