Blender  V2.93
deg_eval_runtime_backup_volume.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2019 Blender Foundation.
17  * All rights reserved.
18  */
19 
25 
26 #include "BLI_assert.h"
27 #include "BLI_string.h"
28 #include "BLI_utildefines.h"
29 
30 #include "DNA_volume_types.h"
31 
32 #include "BKE_volume.h"
33 
34 #include <cstdio>
35 
36 namespace blender::deg {
37 
38 VolumeBackup::VolumeBackup(const Depsgraph * /*depsgraph*/) : grids(nullptr)
39 {
40 }
41 
43 {
44  STRNCPY(filepath, volume->filepath);
45  BLI_STATIC_ASSERT(sizeof(filepath) == sizeof(volume->filepath),
46  "VolumeBackup filepath length wrong");
47 
48  grids = volume->runtime.grids;
49  volume->runtime.grids = nullptr;
50 }
51 
53 {
54  if (grids) {
56  grids = nullptr;
57  }
58 }
59 
60 } // namespace blender::deg
Volume datablock.
void BKE_volume_grids_backup_restore(struct Volume *volume, struct VolumeGridVector *grids, const char *filepath)
Definition: volume.cc:1089
#define BLI_STATIC_ASSERT(a, msg)
Definition: BLI_assert.h:86
#define STRNCPY(dst, src)
Definition: BLI_string.h:163
VolumeBackup(const Depsgraph *depsgraph)
struct VolumeGridVector * grids
char filepath[1024]
Volume_Runtime runtime