Blender V4.3
deg_eval_runtime_backup.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "DNA_ID.h"
12
19
20namespace blender::deg {
21
22struct Depsgraph;
23
25 public:
26 explicit RuntimeBackup(const Depsgraph *depsgraph);
27
28 /* NOTE: Will reset all runtime fields which has been backed up to nullptr. */
29 void init_from_id(ID *id);
30
31 /* Restore fields to the given ID. */
32 void restore_to_id(ID *id);
33
34 /* Denotes whether init_from_id did put anything into the backup storage.
35 * This will not be the case when init_from_id() is called for an ID which has never been
36 * copied-on-eval. In this case there is no need to backup or restore anything.
37 *
38 * It also allows to have restore() logic to be symmetrical to init() without need to worry
39 * that init() might not have happened.
40 *
41 * In practice this is used by audio system to lock audio while scene is going through
42 * copy-on-evaluation mechanism. */
44
45 /* Struct members of the ID pointer. */
46 struct {
49
58};
59
60} // namespace blender::deg
ID and Library types, which are fundamental for SDNA.
struct blender::deg::RuntimeBackup::@186 id_data
RuntimeBackup(const Depsgraph *depsgraph)
const Depsgraph * depsgraph
Definition DNA_ID.h:413