System Information
Operating system: Linux-5.15.23-76051523-generic-x86_64-with-glibc2.34 64 Bits
Graphics card: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 510.54
Blender Version
Broken: version: 3.2.0 Alpha, branch: master
Worked: 3.1
Caused by rB7ca13eef7c33: Improve multi-user gpencil data performance with modifiers
Short description of error
Blender crashes on opening a file that was saved with layer transforms.
Exact steps for others to reproduce the error
- Open Blender with the 2D Animation template.
- Change the layer transform in the object data properties panel under "Transform".
- Save the file and reopen it -> Blender crashes.
or
- Open test file -> Blender crashes.
Investigation
The crash occurs when a grease pencil data-block is expanded for the first time and then tries to access the gpf->runtime.gpf_orig pointer in copy_frame_to_eval_cb from BKE_gpencil_prepare_eval_data. That pointer is NULL.
This is because in deg_update_copy_on_write_datablock when we do a copy on write, we only call BKE_gpencil_data_update_orig_pointers in GPencilBackup::restore_to_gpencil if a backup has been created. But RuntimeBackup::init_from_id returns early if deg_copy_on_write_is_expanded is false.
Maybe the solution is to add some logic to update_id_after_copy to make sure the runtime orig pointers are updated.