Blender V5.3
BKE_bake_values.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
14
16#include "BLI_map.hh"
17
18#include "DNA_node_types.h"
19
20namespace blender::bke::bake {
21
30 public:
31 struct Item {
33 std::optional<std::string> name;
34 };
35
36 private:
37 Map<int, Item> values_by_id_;
38
39 public:
40 struct InputValue {
41 int id;
42 std::string name;
48 std::optional<AttrDomain> field_domain;
49 };
54
55 BakeValues() = default;
56 explicit BakeValues(Map<int, Item> values_by_id) : values_by_id_(std::move(values_by_id)) {}
57
66 BakeDataBlockMap *data_block_map,
67 bool is_for_cache = true);
68
74 const ComputeContext &compute_context,
75 BakeDataBlockMap *data_block_map) const;
76
77 bool is_empty() const
78 {
79 return values_by_id_.is_empty();
80 }
81
82 void clear()
83 {
84 values_by_id_.clear();
85 }
86
88 {
89 return values_by_id_;
90 }
91};
92
93} // namespace blender::bke::bake
static BakeValues from_runtime_values(Vector< InputValue > runtime_values, BakeDataBlockMap *data_block_map, bool is_for_cache=true)
const Map< int, Item > & values_by_id() const
BakeValues(Map< int, Item > values_by_id)
Vector< SocketValueVariant > to_runtime_values(const Span< OutputKey > keys, const ComputeContext &compute_context, BakeDataBlockMap *data_block_map) const
std::optional< std::string > name