Blender
V4.3
source
blender
blenkernel
intern
bake_data_block_map.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2005 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#include <ostream>
6
7
#include "
BLI_hash.hh
"
8
9
#include "
BKE_bake_data_block_map.hh
"
10
11
#include "
DNA_ID.h
"
12
#include "
DNA_modifier_types.h
"
13
14
namespace
blender::bke::bake
{
15
16
BakeDataBlockID::BakeDataBlockID
(
ID_Type
type
, std::string
id_name
, std::string
lib_name
)
17
:
type
(
type
),
id_name
(std::move(
id_name
)),
lib_name
(std::move(
lib_name
))
18
{
19
}
20
21
BakeDataBlockID::BakeDataBlockID
(
const
ID
&
id
)
22
{
23
this->
type
=
GS
(
id
.name);
24
this->
id_name
=
id
.name + 2;
25
if
(
ID_IS_LINKED
(&
id
)) {
26
this->
lib_name
=
id
.lib->id.name + 2;
27
}
28
}
29
30
BakeDataBlockID::BakeDataBlockID
(
const
NodesModifierDataBlock
&data_block)
31
:
BakeDataBlockID
(
ID_Type
(data_block.id_type),
32
StringRef
(data_block.
id_name
),
33
StringRef
(data_block.
lib_name
))
34
{
35
}
36
37
std::ostream &
operator<<
(std::ostream &stream,
const
BakeDataBlockID
&
id
)
38
{
39
return
stream <<
"("
<<
id
.id_name <<
", Lib: "
<<
id
.lib_name <<
")"
;
40
}
41
42
uint64_t
BakeDataBlockID::hash
()
const
43
{
44
return
get_default_hash
(this->
type
, this->
id_name
, this->
lib_name
);
45
}
46
47
}
// namespace blender::bke::bake
BKE_bake_data_block_map.hh
BLI_hash.hh
DNA_ID.h
ID and Library types, which are fundamental for SDNA.
ID_IS_LINKED
#define ID_IS_LINKED(_id)
Definition
DNA_ID.h:654
ID_Type
ID_Type
Definition
DNA_ID_enums.h:117
DNA_modifier_types.h
blender::StringRef
Definition
BLI_string_ref.hh:128
GS
#define GS(x)
Definition
iris.cc:202
blender::bke::bake
Definition
BKE_bake_data_block_id.hh:20
blender::bke::bake::operator<<
std::ostream & operator<<(std::ostream &stream, const BakeDataBlockID &id)
Definition
bake_data_block_map.cc:37
blender::get_default_hash
uint64_t get_default_hash(const T &v)
Definition
BLI_hash.hh:219
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:90
ID
Definition
DNA_ID.h:413
NodesModifierDataBlock
Definition
DNA_modifier_types.h:2388
blender::bke::bake::BakeDataBlockID::type
ID_Type type
Definition
BKE_bake_data_block_id.hh:28
blender::bke::bake::BakeDataBlockID::id_name
std::string id_name
Definition
BKE_bake_data_block_id.hh:32
blender::bke::bake::BakeDataBlockID::BakeDataBlockID
BakeDataBlockID(ID_Type type, std::string id_name, std::string lib_name)
Definition
bake_data_block_map.cc:16
blender::bke::bake::BakeDataBlockID::lib_name
std::string lib_name
Definition
BKE_bake_data_block_id.hh:38
blender::bke::bake::BakeDataBlockID::hash
uint64_t hash() const
Definition
bake_data_block_map.cc:42
Generated on Sat Oct 4 2025 05:32:23 for Blender by
doxygen
1.14.0