Blender  V3.3
deg_eval_runtime_backup_volume.cc
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 
9 
10 #include "BLI_assert.h"
11 #include "BLI_string.h"
12 #include "BLI_utildefines.h"
13 
14 #include "DNA_volume_types.h"
15 
16 #include "BKE_volume.h"
17 
18 #include <cstdio>
19 
20 namespace blender::deg {
21 
22 VolumeBackup::VolumeBackup(const Depsgraph * /*depsgraph*/) : grids(nullptr)
23 {
24 }
25 
27 {
28  STRNCPY(filepath, volume->filepath);
29  BLI_STATIC_ASSERT(sizeof(filepath) == sizeof(volume->filepath),
30  "VolumeBackup filepath length wrong");
31 
32  grids = volume->runtime.grids;
33  volume->runtime.grids = nullptr;
34 }
35 
37 {
38  if (grids) {
40  grids = nullptr;
41  }
42 }
43 
44 } // namespace blender::deg
Volume data-block.
void BKE_volume_grids_backup_restore(struct Volume *volume, struct VolumeGridVector *grids, const char *filepath)
Definition: volume.cc:1183
#define BLI_STATIC_ASSERT(a, msg)
Definition: BLI_assert.h:83
#define STRNCPY(dst, src)
Definition: BLI_string.h:483
VolumeBackup(const Depsgraph *depsgraph)
struct VolumeGridVector * grids
char filepath[1024]
Volume_Runtime runtime