Blender V4.3
deg_eval_runtime_backup_volume.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "BLI_assert.h"
12#include "BLI_string.h"
13#include "BLI_utildefines.h"
14
15#include "DNA_volume_types.h"
16
17#include "BKE_volume.hh"
18
19#include <cstdio>
20
21namespace blender::deg {
22
23VolumeBackup::VolumeBackup(const Depsgraph * /*depsgraph*/) : grids(nullptr) {}
24
26{
27 STRNCPY(filepath, volume->filepath);
28 BLI_STATIC_ASSERT(sizeof(filepath) == sizeof(volume->filepath),
29 "VolumeBackup filepath length wrong");
30
31 grids = volume->runtime->grids;
32 volume->runtime->grids = nullptr;
33}
34
36{
37 if (grids) {
39 grids = nullptr;
40 }
41}
42
43} // namespace blender::deg
Volume data-block.
void BKE_volume_grids_backup_restore(Volume *volume, VolumeGridVector *grids, const char *filepath)
#define BLI_STATIC_ASSERT(a, msg)
Definition BLI_assert.h:87
#define STRNCPY(dst, src)
Definition BLI_string.h:593
VolumeBackup(const Depsgraph *depsgraph)