Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc
| Show All 34 Lines | RuntimeBackup::RuntimeBackup(const Depsgraph *depsgraph) | ||||
| : have_backup(false), | : have_backup(false), | ||||
| id_data({nullptr}), | id_data({nullptr}), | ||||
| animation_backup(depsgraph), | animation_backup(depsgraph), | ||||
| scene_backup(depsgraph), | scene_backup(depsgraph), | ||||
| sound_backup(depsgraph), | sound_backup(depsgraph), | ||||
| object_backup(depsgraph), | object_backup(depsgraph), | ||||
| drawdata_ptr(nullptr), | drawdata_ptr(nullptr), | ||||
| movieclip_backup(depsgraph), | movieclip_backup(depsgraph), | ||||
| volume_backup(depsgraph) | volume_backup(depsgraph), | ||||
| gpencil_backup(depsgraph) | |||||
| { | { | ||||
| drawdata_backup.first = drawdata_backup.last = nullptr; | drawdata_backup.first = drawdata_backup.last = nullptr; | ||||
| } | } | ||||
| void RuntimeBackup::init_from_id(ID *id) | void RuntimeBackup::init_from_id(ID *id) | ||||
| { | { | ||||
| if (!deg_copy_on_write_is_expanded(id)) { | if (!deg_copy_on_write_is_expanded(id)) { | ||||
| return; | return; | ||||
| Show All 18 Lines | case ID_SO: | ||||
| sound_backup.init_from_sound(reinterpret_cast<bSound *>(id)); | sound_backup.init_from_sound(reinterpret_cast<bSound *>(id)); | ||||
| break; | break; | ||||
| case ID_MC: | case ID_MC: | ||||
| movieclip_backup.init_from_movieclip(reinterpret_cast<MovieClip *>(id)); | movieclip_backup.init_from_movieclip(reinterpret_cast<MovieClip *>(id)); | ||||
| break; | break; | ||||
| case ID_VO: | case ID_VO: | ||||
| volume_backup.init_from_volume(reinterpret_cast<Volume *>(id)); | volume_backup.init_from_volume(reinterpret_cast<Volume *>(id)); | ||||
| break; | break; | ||||
| case ID_GD: | |||||
| gpencil_backup.init_from_gpencil(reinterpret_cast<bGPdata *>(id)); | |||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| /* Note that we never free GPU draw data from here since that's not | /* Note that we never free GPU draw data from here since that's not | ||||
| * safe for threading and draw data is likely to be re-used. */ | * safe for threading and draw data is likely to be re-used. */ | ||||
| drawdata_ptr = DRW_drawdatalist_from_id(id); | drawdata_ptr = DRW_drawdatalist_from_id(id); | ||||
| if (drawdata_ptr != nullptr) { | if (drawdata_ptr != nullptr) { | ||||
| Show All 24 Lines | case ID_SO: | ||||
| sound_backup.restore_to_sound(reinterpret_cast<bSound *>(id)); | sound_backup.restore_to_sound(reinterpret_cast<bSound *>(id)); | ||||
| break; | break; | ||||
| case ID_MC: | case ID_MC: | ||||
| movieclip_backup.restore_to_movieclip(reinterpret_cast<MovieClip *>(id)); | movieclip_backup.restore_to_movieclip(reinterpret_cast<MovieClip *>(id)); | ||||
| break; | break; | ||||
| case ID_VO: | case ID_VO: | ||||
| volume_backup.restore_to_volume(reinterpret_cast<Volume *>(id)); | volume_backup.restore_to_volume(reinterpret_cast<Volume *>(id)); | ||||
| break; | break; | ||||
| case ID_GD: | |||||
| gpencil_backup.restore_to_gpencil(reinterpret_cast<bGPdata *>(id)); | |||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| if (drawdata_ptr != nullptr) { | if (drawdata_ptr != nullptr) { | ||||
| *drawdata_ptr = drawdata_backup; | *drawdata_ptr = drawdata_backup; | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::deg | } // namespace blender::deg | ||||