Blender V4.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
5#include <ostream>
6
7#include "BLI_hash.hh"
8
10
11#include "DNA_ID.h"
12#include "DNA_modifier_types.h"
13
14namespace blender::bke::bake {
15
16BakeDataBlockID::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
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
31 : BakeDataBlockID(ID_Type(data_block.id_type),
32 StringRef(data_block.id_name),
33 StringRef(data_block.lib_name))
34{
35}
36
37std::ostream &operator<<(std::ostream &stream, const BakeDataBlockID &id)
38{
39 return stream << "(" << id.id_name << ", Lib: " << id.lib_name << ")";
40}
41
43{
44 return get_default_hash(this->type, this->id_name, this->lib_name);
45}
46
47} // namespace blender::bke::bake
ID and Library types, which are fundamental for SDNA.
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:654
ID_Type
std::string id_name(void *id)
#define GS(x)
Definition iris.cc:202
std::ostream & operator<<(std::ostream &stream, const BakeDataBlockID &id)
uint64_t get_default_hash(const T &v)
Definition BLI_hash.hh:219
unsigned __int64 uint64_t
Definition stdint.h:90
Definition DNA_ID.h:413
BakeDataBlockID(ID_Type type, std::string id_name, std::string lib_name)