Blender  V3.3
deg_eval_runtime_backup.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2019 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 
19 
20 namespace blender::deg {
21 
22 struct 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-write. 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-write mechanism. */
44 
45  /* Struct members of the ID pointer. */
46  struct {
47  void *py_instance;
49 
59 };
60 
61 } // namespace blender::deg
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
ID and Library types, which are fundamental for sdna.
struct blender::deg::RuntimeBackup::@192 id_data
RuntimeBackup(const Depsgraph *depsgraph)
const Depsgraph * depsgraph
Definition: DNA_ID.h:368