Blender
V3.3
source
blender
depsgraph
intern
eval
deg_eval_runtime_backup_gpencil.cc
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2022 Blender Foundation. All rights reserved. */
3
8
#include "
intern/eval/deg_eval_runtime_backup_gpencil.h
"
9
#include "
intern/depsgraph.h
"
10
11
#include "
BKE_gpencil.h
"
12
#include "
BKE_gpencil_update_cache.h
"
13
14
#include "
DNA_gpencil_types.h
"
15
16
namespace
blender::deg
{
17
18
GPencilBackup::GPencilBackup
(
const
Depsgraph
*
depsgraph
) :
depsgraph
(
depsgraph
)
19
{
20
}
21
22
void
GPencilBackup::init_from_gpencil
(
bGPdata
*
UNUSED
(gpd))
23
{
24
}
25
26
void
GPencilBackup::restore_to_gpencil
(
bGPdata
*gpd)
27
{
28
bGPdata
*gpd_orig =
reinterpret_cast<
bGPdata
*
>
(gpd->
id
.
orig_id
);
29
30
/* We check for the active depsgraph here to avoid freeing the cache on the original object
31
* multiple times. This free is only needed for the case where we tagged a full update in the
32
* update cache and did not do an update-on-write. */
33
if
(
depsgraph
->
is_active
) {
34
BKE_gpencil_free_update_cache
(gpd_orig);
35
}
36
/* Doing a copy-on-write copies the update cache pointer. Make sure to reset it
37
* to NULL as we should never use the update cache from eval data. */
38
gpd->
runtime
.
update_cache
=
nullptr
;
39
/* Make sure to update the original runtime pointers in the eval data. */
40
BKE_gpencil_data_update_orig_pointers
(gpd_orig, gpd);
41
}
42
43
}
// namespace blender::deg
BKE_gpencil.h
BKE_gpencil_data_update_orig_pointers
void BKE_gpencil_data_update_orig_pointers(const struct bGPdata *gpd_orig, const struct bGPdata *gpd_eval)
BKE_gpencil_update_cache.h
BKE_gpencil_free_update_cache
void BKE_gpencil_free_update_cache(struct bGPdata *gpd)
Definition:
gpencil_update_cache.c:249
UNUSED
#define UNUSED(x)
Definition:
BLI_utildefines.h:671
DNA_gpencil_types.h
blender::deg::GPencilBackup::init_from_gpencil
void init_from_gpencil(bGPdata *gpd)
Definition:
deg_eval_runtime_backup_gpencil.cc:22
blender::deg::GPencilBackup::restore_to_gpencil
void restore_to_gpencil(bGPdata *gpd)
Definition:
deg_eval_runtime_backup_gpencil.cc:26
blender::deg::GPencilBackup::GPencilBackup
GPencilBackup(const Depsgraph *depsgraph)
Definition:
deg_eval_runtime_backup_gpencil.cc:18
blender::deg::GPencilBackup::depsgraph
const Depsgraph * depsgraph
Definition:
deg_eval_runtime_backup_gpencil.h:24
depsgraph
const Depsgraph * depsgraph
Definition:
deg_eval_copy_on_write.cc:499
deg_eval_runtime_backup_gpencil.h
depsgraph.h
blender::deg
Definition:
deg_builder.cc:40
ID::orig_id
struct ID * orig_id
Definition:
DNA_ID.h:419
bGPdata_Runtime::update_cache
struct GPencilUpdateCache * update_cache
Definition:
DNA_gpencil_types.h:655
bGPdata
Definition:
DNA_gpencil_types.h:670
bGPdata::id
ID id
Definition:
DNA_gpencil_types.h:674
bGPdata::runtime
bGPdata_Runtime runtime
Definition:
DNA_gpencil_types.h:754
blender::deg::Depsgraph
Definition:
depsgraph.h:43
blender::deg::Depsgraph::is_active
bool is_active
Definition:
depsgraph.h:148
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1