Blender V5.3
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
8
9#include <ostream>
10
12
13#include "BLI_hash.hh"
14
15#include "DNA_ID.h"
16#include "DNA_modifier_types.h"
17
18namespace blender::bke::bake {
19
21 : type(type), id_name(std::move(id_name)), lib_name(std::move(lib_name))
22{
23}
24
26{
27 this->type = GS(id.name);
28 this->id_name = id.name + 2;
29 if (ID_IS_LINKED(&id)) {
30 this->lib_name = id.lib->id.name + 2;
31 }
32}
33
35 : BakeDataBlockID(ID_Type(data_block.id_type),
36 StringRef(data_block.id_name),
37 StringRef(data_block.lib_name))
38{
39}
40
41std::ostream &operator<<(std::ostream &stream, const BakeDataBlockID &id)
42{
43 return stream << "(" << id.id_name << ", Lib: " << id.lib_name << ")";
44}
45
47{
48 return get_default_hash(this->type, this->id_name, this->lib_name);
49}
50
51} // namespace blender::bke::bake
ID and Library types, which are fundamental for SDNA.
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:697
unsigned __int64 uint64_t
Definition BKE_text.h:91
ID_Type GS(const char *name)
Definition DNA_ID.h:410
constexpr uint64_t get_default_hash(const T &v, const Args &...args)
Definition BLI_hash.hh:252
friend std::ostream & operator<<(std::ostream &stream, const BakeDataBlockID &id)
BakeDataBlockID(ID_Type type, std::string id_name, std::string lib_name)