Currently you can retrieve a mutable array from a const CustomData. That makes code unsafe since the compiler can't check for correctness itself. Fix that by introducing a separate function to retrieve mutable arrays from CustomData. The new functions have the `_for_write` suffix that make the code's intention clearer. Because it makes retrieving write access an explicit step, this change also makes proper copy-on-write possible for attributes. Notes: - The previous "duplicate referenced layer" functions are redundant with retrieving layers with write access - The custom data functions that give a specific index only have `for_write` to simplify the API Differential Revision: https://developer.blender.org/D14140
23 KiB
23 KiB