Blender
V3.3
source
blender
depsgraph
intern
eval
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
8
#include "
intern/eval/deg_eval_runtime_backup_volume.h
"
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
26
void
VolumeBackup::init_from_volume
(
Volume
*volume)
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
36
void
VolumeBackup::restore_to_volume
(
Volume
*volume)
37
{
38
if
(
grids
) {
39
BKE_volume_grids_backup_restore
(volume,
grids
,
filepath
);
40
grids
=
nullptr
;
41
}
42
}
43
44
}
// namespace blender::deg
BKE_volume.h
Volume data-block.
BKE_volume_grids_backup_restore
void BKE_volume_grids_backup_restore(struct Volume *volume, struct VolumeGridVector *grids, const char *filepath)
Definition:
volume.cc:1183
BLI_assert.h
BLI_STATIC_ASSERT
#define BLI_STATIC_ASSERT(a, msg)
Definition:
BLI_assert.h:83
BLI_string.h
STRNCPY
#define STRNCPY(dst, src)
Definition:
BLI_string.h:483
BLI_utildefines.h
DNA_volume_types.h
blender::deg::VolumeBackup::restore_to_volume
void restore_to_volume(Volume *volume)
Definition:
deg_eval_runtime_backup_volume.cc:36
blender::deg::VolumeBackup::grids
VolumeGridVector * grids
Definition:
deg_eval_runtime_backup_volume.h:25
blender::deg::VolumeBackup::VolumeBackup
VolumeBackup(const Depsgraph *depsgraph)
Definition:
deg_eval_runtime_backup_volume.cc:22
blender::deg::VolumeBackup::init_from_volume
void init_from_volume(Volume *volume)
Definition:
deg_eval_runtime_backup_volume.cc:26
blender::deg::VolumeBackup::filepath
char filepath[1024]
Definition:
deg_eval_runtime_backup_volume.h:26
deg_eval_runtime_backup_volume.h
blender::deg
Definition:
deg_builder.cc:40
Volume_Runtime::grids
struct VolumeGridVector * grids
Definition:
DNA_volume_types.h:20
Volume
Definition:
DNA_volume_types.h:52
Volume::filepath
char filepath[1024]
Definition:
DNA_volume_types.h:57
Volume::runtime
Volume_Runtime runtime
Definition:
DNA_volume_types.h:99
blender::deg::Depsgraph
Definition:
depsgraph.h:43
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1