diff --git a/source/blender/blenkernel/BKE_bake_items.hh b/source/blender/blenkernel/BKE_bake_items.hh index ac45121f226..41f2f07f0ce 100644 --- a/source/blender/blenkernel/BKE_bake_items.hh +++ b/source/blender/blenkernel/BKE_bake_items.hh @@ -6,7 +6,7 @@ #include "BKE_geometry_set.hh" -namespace blender::bke { +namespace blender::bke::bake { /** * A "bake item" contains the baked data of e.g. one node socket at one frame. Typically, multiple @@ -103,4 +103,4 @@ class StringBakeItem : public BakeItem { } }; -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/BKE_bake_items_paths.hh b/source/blender/blenkernel/BKE_bake_items_paths.hh index 787afa289ea..f93b42fabb1 100644 --- a/source/blender/blenkernel/BKE_bake_items_paths.hh +++ b/source/blender/blenkernel/BKE_bake_items_paths.hh @@ -11,7 +11,7 @@ #include "BLI_sub_frame.hh" #include "BLI_vector.hh" -namespace blender::bke::bake_paths { +namespace blender::bke::bake { struct MetaFile { SubFrame frame; @@ -40,4 +40,4 @@ std::optional file_name_to_frame(const StringRefNull file_name); Vector find_sorted_meta_files(const StringRefNull meta_dir); -} // namespace blender::bke::bake_paths +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/BKE_bake_items_serialize.hh b/source/blender/blenkernel/BKE_bake_items_serialize.hh index 606a54b2908..b008a6be601 100644 --- a/source/blender/blenkernel/BKE_bake_items_serialize.hh +++ b/source/blender/blenkernel/BKE_bake_items_serialize.hh @@ -9,7 +9,7 @@ #include "BKE_bake_items.hh" -namespace blender::bke { +namespace blender::bke::bake { /** * Reference to a slice of memory typically stored on disk. @@ -146,4 +146,4 @@ std::optional deserialize_bake(std::istream &stream, const BlobReader &blob_reader, const BlobSharing &blob_sharing); -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/BKE_bake_items_socket.hh b/source/blender/blenkernel/BKE_bake_items_socket.hh index d039e5747ab..07a62f459a3 100644 --- a/source/blender/blenkernel/BKE_bake_items_socket.hh +++ b/source/blender/blenkernel/BKE_bake_items_socket.hh @@ -11,7 +11,7 @@ #include "BKE_bake_items.hh" #include "BKE_geometry_fields.hh" -namespace blender::bke { +namespace blender::bke::bake { /** * Describes how bake items should be mapped to sockets. @@ -67,4 +67,4 @@ void copy_bake_items_to_socket_values( make_attribute_field, Span r_socket_values); -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/BKE_simulation_state.hh b/source/blender/blenkernel/BKE_simulation_state.hh index 95905577aa2..1d83dff16cc 100644 --- a/source/blender/blenkernel/BKE_simulation_state.hh +++ b/source/blender/blenkernel/BKE_simulation_state.hh @@ -32,13 +32,13 @@ enum class CacheState { struct SimulationZoneFrameCache { SubFrame frame; - BakeState state; + bake::BakeState state; /** Used when the baked data is loaded lazily. */ std::optional meta_path; }; struct SimulationZonePrevState { - BakeState state; + bake::BakeState state; SubFrame frame; }; @@ -47,7 +47,7 @@ struct SimulationZoneCache { std::optional prev_state; std::optional blobs_dir; - std::unique_ptr blob_sharing; + std::unique_ptr blob_sharing; bool failed_finding_bake = false; CacheState cache_state = CacheState::Valid; @@ -66,10 +66,10 @@ class ModifierSimulationCache { */ void scene_simulation_states_reset(Scene &scene); -std::optional get_simulation_zone_bake_path(const Main &bmain, - const Object &object, - const NodesModifierData &nmd, - int zone_id); +std::optional get_simulation_zone_bake_path(const Main &bmain, + const Object &object, + const NodesModifierData &nmd, + int zone_id); std::optional get_modifier_simulation_bake_path(const Main &bmain, const Object &object, const NodesModifierData &nmd); diff --git a/source/blender/blenkernel/intern/bake_items.cc b/source/blender/blenkernel/intern/bake_items.cc index 7a0dcc55b68..8a78d5563b4 100644 --- a/source/blender/blenkernel/intern/bake_items.cc +++ b/source/blender/blenkernel/intern/bake_items.cc @@ -20,7 +20,7 @@ #include "RNA_access.hh" #include "RNA_enum_types.hh" -namespace blender::bke { +namespace blender::bke::bake { using namespace io::serialize; using DictionaryValuePtr = std::shared_ptr; @@ -81,4 +81,4 @@ BakeStateRef::BakeStateRef(const BakeState &bake_state) } } -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/intern/bake_items_paths.cc b/source/blender/blenkernel/intern/bake_items_paths.cc index 3560bcd606f..2c7055fa494 100644 --- a/source/blender/blenkernel/intern/bake_items_paths.cc +++ b/source/blender/blenkernel/intern/bake_items_paths.cc @@ -9,7 +9,7 @@ #include "BLI_string.h" #include "BLI_string_utils.h" -namespace blender::bke::bake_paths { +namespace blender::bke::bake { std::string frame_to_file_name(const SubFrame &frame) { @@ -73,4 +73,4 @@ BakePath BakePath::from_single_root(StringRefNull root_dir) return bake_path; } -} // namespace blender::bke::bake_paths +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/intern/bake_items_serialize.cc b/source/blender/blenkernel/intern/bake_items_serialize.cc index 037351f4da1..70f14b51e40 100644 --- a/source/blender/blenkernel/intern/bake_items_serialize.cc +++ b/source/blender/blenkernel/intern/bake_items_serialize.cc @@ -22,7 +22,7 @@ #include -namespace blender::bke { +namespace blender::bke::bake { using namespace io::serialize; using DictionaryValuePtr = std::shared_ptr; @@ -1074,7 +1074,7 @@ void serialize_bake(const BakeState &bake_state, io::serialize::DictionaryValue &io_items = *io_root.append_dict("items"); for (auto item : bake_state.items_by_id.items()) { io::serialize::DictionaryValue &io_item = *io_items.append_dict(std::to_string(item.key)); - bke::serialize_bake_item(*item.value, blob_writer, blob_sharing, io_item); + serialize_bake_item(*item.value, blob_writer, blob_sharing, io_item); } io::serialize::JsonFormatter formatter; @@ -1128,4 +1128,4 @@ std::optional deserialize_bake(std::istream &stream, return bake_state; } -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/intern/bake_items_socket.cc b/source/blender/blenkernel/intern/bake_items_socket.cc index 1fb687de94a..b2d5772400a 100644 --- a/source/blender/blenkernel/intern/bake_items_socket.cc +++ b/source/blender/blenkernel/intern/bake_items_socket.cc @@ -10,7 +10,7 @@ #include "FN_field_cpp_type.hh" -namespace blender::bke { +namespace blender::bke::bake { static const CPPType &get_socket_cpp_type(const eNodeSocketDatatype socket_type) { @@ -288,4 +288,4 @@ void copy_bake_items_to_socket_values( rename_attributes(geometries, attribute_map); } -} // namespace blender::bke +} // namespace blender::bke::bake diff --git a/source/blender/blenkernel/intern/simulation_state.cc b/source/blender/blenkernel/intern/simulation_state.cc index 18028fb9df1..b1e0e3a5465 100644 --- a/source/blender/blenkernel/intern/simulation_state.cc +++ b/source/blender/blenkernel/intern/simulation_state.cc @@ -71,10 +71,10 @@ std::optional get_modifier_simulation_bake_path(const Main &bmain, return absolute_bake_dir; } -std::optional get_simulation_zone_bake_path(const Main &bmain, - const Object &object, - const NodesModifierData &nmd, - int zone_id) +std::optional get_simulation_zone_bake_path(const Main &bmain, + const Object &object, + const NodesModifierData &nmd, + int zone_id) { const std::optional modifier_bake_path = get_modifier_simulation_bake_path( bmain, object, nmd); @@ -87,7 +87,7 @@ std::optional get_simulation_zone_bake_path(const Main &bm sizeof(zone_bake_dir), modifier_bake_path->c_str(), std::to_string(zone_id).c_str()); - return bake_paths::BakePath::from_single_root(zone_bake_dir); + return bake::BakePath::from_single_root(zone_bake_dir); } /** diff --git a/source/blender/editors/object/object_bake_simulation.cc b/source/blender/editors/object/object_bake_simulation.cc index 8e17052539a..c7a4b9cec24 100644 --- a/source/blender/editors/object/object_bake_simulation.cc +++ b/source/blender/editors/object/object_bake_simulation.cc @@ -224,8 +224,8 @@ static bool bake_simulation_poll(bContext *C) struct ZoneBakeData { int zone_id; - bke::bake_paths::BakePath path; - std::unique_ptr blob_sharing; + bke::bake::BakePath path; + std::unique_ptr blob_sharing; }; struct ModifierBakeData { @@ -285,10 +285,9 @@ static void bake_simulation_job_startjob(void *customdata, for (const bNestedNodeRef &nested_node_ref : nmd->node_group->nested_node_refs_span()) { ZoneBakeData zone_bake_data; zone_bake_data.zone_id = nested_node_ref.id; - zone_bake_data.blob_sharing = std::make_unique(); - if (std::optional path = - bke::sim::get_simulation_zone_bake_path( - *job.bmain, *object, *nmd, nested_node_ref.id)) + zone_bake_data.blob_sharing = std::make_unique(); + if (std::optional path = bke::sim::get_simulation_zone_bake_path( + *job.bmain, *object, *nmd, nested_node_ref.id)) { zone_bake_data.path = std::move(*path); modifier_bake_data.zones.append(std::move(zone_bake_data)); @@ -322,7 +321,7 @@ static void bake_simulation_job_startjob(void *customdata, BKE_scene_graph_update_for_newframe(job.depsgraph); - const std::string frame_file_name = bke::bake_paths::frame_to_file_name(frame); + const std::string frame_file_name = bke::bake::frame_to_file_name(frame); for (ObjectBakeData &object_bake_data : objects_to_bake) { for (ModifierBakeData &modifier_bake_data : object_bake_data.modifiers) { @@ -342,7 +341,7 @@ static void bake_simulation_job_startjob(void *customdata, continue; } - const bke::bake_paths::BakePath path = zone_bake_data.path; + const bke::bake::BakePath path = zone_bake_data.path; const std::string blob_file_name = frame_file_name + ".blob"; @@ -357,9 +356,9 @@ static void bake_simulation_job_startjob(void *customdata, BLI_file_ensure_parent_dir_exists(meta_path); BLI_file_ensure_parent_dir_exists(blob_path); fstream blob_file{blob_path, std::ios::out | std::ios::binary}; - bke::DiskBlobWriter blob_writer{blob_file_name, blob_file, 0}; + bke::bake::DiskBlobWriter blob_writer{blob_file_name, blob_file, 0}; fstream meta_file{meta_path, std::ios::out}; - bke::serialize_bake( + bke::bake::serialize_bake( frame_cache.state, blob_writer, *zone_bake_data.blob_sharing, meta_file); } } @@ -635,7 +634,7 @@ static int delete_baked_simulation_exec(bContext *C, wmOperator *op) for (auto item : nmd->runtime->simulation_cache->cache_by_zone_id.items()) { item.value->reset(); - const std::optional bake_path = + const std::optional bake_path = bke::sim::get_simulation_zone_bake_path(*bmain, *object, *nmd, item.key); if (!bake_path) { continue; diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index d0ec6ccfeea..ed9daedb331 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -753,23 +753,23 @@ class NodesModifierSimulationParams : public nodes::GeoNodesSimulationParams { /* Try load baked data. */ if (!zone_cache.failed_finding_bake) { if (zone_cache.cache_state != CacheState::Baked) { - if (std::optional zone_bake_path = - get_simulation_zone_bake_path(*bmain_, *ctx_.object, nmd_, zone_id)) + if (std::optional zone_bake_path = get_simulation_zone_bake_path( + *bmain_, *ctx_.object, nmd_, zone_id)) { - Vector meta_files = bke::bake_paths::find_sorted_meta_files( + Vector meta_files = bke::bake::find_sorted_meta_files( zone_bake_path->meta_dir); if (!meta_files.is_empty()) { zone_cache.reset(); - for (const bke::bake_paths::MetaFile &meta_file : meta_files) { + for (const bke::bake::MetaFile &meta_file : meta_files) { auto frame_cache = std::make_unique(); frame_cache->frame = meta_file.frame; frame_cache->meta_path = meta_file.path; zone_cache.frame_caches.append(std::move(frame_cache)); } zone_cache.blobs_dir = zone_bake_path->blobs_dir; - zone_cache.blob_sharing = std::make_unique(); + zone_cache.blob_sharing = std::make_unique(); zone_cache.cache_state = CacheState::Baked; } } @@ -899,15 +899,16 @@ class NodesModifierSimulationParams : public nodes::GeoNodesSimulationParams { { auto &store_and_pass_through_info = zone_behavior.output.emplace(); - store_and_pass_through_info.store_fn = [simulation_cache = simulation_cache_, - zone_cache = &zone_cache, - current_frame = current_frame_](bke::BakeState state) { - std::lock_guard lock{simulation_cache->mutex}; - auto frame_cache = std::make_unique(); - frame_cache->frame = current_frame; - frame_cache->state = std::move(state); - zone_cache->frame_caches.append(std::move(frame_cache)); - }; + store_and_pass_through_info.store_fn = + [simulation_cache = simulation_cache_, + zone_cache = &zone_cache, + current_frame = current_frame_](bke::bake::BakeState state) { + std::lock_guard lock{simulation_cache->mutex}; + auto frame_cache = std::make_unique(); + frame_cache->frame = current_frame; + frame_cache->state = std::move(state); + zone_cache->frame_caches.append(std::move(frame_cache)); + }; } void store_as_prev_items(bke::sim::SimulationZoneCache &zone_cache, @@ -915,16 +916,17 @@ class NodesModifierSimulationParams : public nodes::GeoNodesSimulationParams { { auto &store_and_pass_through_info = zone_behavior.output.emplace(); - store_and_pass_through_info.store_fn = [simulation_cache = simulation_cache_, - zone_cache = &zone_cache, - current_frame = current_frame_](bke::BakeState state) { - std::lock_guard lock{simulation_cache->mutex}; - if (!zone_cache->prev_state) { - zone_cache->prev_state.emplace(); - } - zone_cache->prev_state->state = std::move(state); - zone_cache->prev_state->frame = current_frame; - }; + store_and_pass_through_info.store_fn = + [simulation_cache = simulation_cache_, + zone_cache = &zone_cache, + current_frame = current_frame_](bke::bake::BakeState state) { + std::lock_guard lock{simulation_cache->mutex}; + if (!zone_cache->prev_state) { + zone_cache->prev_state.emplace(); + } + zone_cache->prev_state->state = std::move(state); + zone_cache->prev_state->frame = current_frame; + }; } void read_from_cache(const FrameIndices &frame_indices, @@ -1009,9 +1011,9 @@ class NodesModifierSimulationParams : public nodes::GeoNodesSimulationParams { if (!frame_cache.meta_path) { return; } - bke::DiskBlobReader blob_reader{*zone_cache.blobs_dir}; + bke::bake::DiskBlobReader blob_reader{*zone_cache.blobs_dir}; fstream meta_file{*frame_cache.meta_path}; - std::optional bake_state = bke::deserialize_bake( + std::optional bake_state = bke::bake::deserialize_bake( meta_file, blob_reader, *zone_cache.blob_sharing); if (!bake_state.has_value()) { return; diff --git a/source/blender/nodes/NOD_geometry_nodes_lazy_function.hh b/source/blender/nodes/NOD_geometry_nodes_lazy_function.hh index f6b5e5d398e..54b7b2bd50c 100644 --- a/source/blender/nodes/NOD_geometry_nodes_lazy_function.hh +++ b/source/blender/nodes/NOD_geometry_nodes_lazy_function.hh @@ -57,7 +57,7 @@ struct PassThrough { */ struct OutputCopy { float delta_time; - bke::BakeStateRef state; + bke::bake::BakeStateRef state; }; /** @@ -66,7 +66,7 @@ struct OutputCopy { */ struct OutputMove { float delta_time; - bke::BakeState state; + bke::bake::BakeState state; }; using Behavior = std::variant; @@ -88,14 +88,14 @@ struct PassThrough { * This allows the caller of geometry nodes (e.g. the modifier), to cache the new simulation state. */ struct StoreAndPassThrough { - std::function store_fn; + std::function store_fn; }; /** * The inputs are not evaluated, instead the given cached items are output directly. */ struct ReadSingle { - bke::BakeStateRef state; + bke::bake::BakeStateRef state; }; /** @@ -104,8 +104,8 @@ struct ReadSingle { struct ReadInterpolated { /** Factor between 0 and 1 that determines the influence of the two simulation states. */ float mix_factor; - bke::BakeStateRef prev_state; - bke::BakeStateRef next_state; + bke::bake::BakeStateRef prev_state; + bke::bake::BakeStateRef next_state; }; using Behavior = std::variant; diff --git a/source/blender/nodes/geometry/node_geometry_util.hh b/source/blender/nodes/geometry/node_geometry_util.hh index 2b1edaeee71..b922922839a 100644 --- a/source/blender/nodes/geometry/node_geometry_util.hh +++ b/source/blender/nodes/geometry/node_geometry_util.hh @@ -137,16 +137,16 @@ void socket_declarations_for_simulation_items(Span items, const CPPType &get_simulation_item_cpp_type(eNodeSocketDatatype socket_type); const CPPType &get_simulation_item_cpp_type(const NodeSimulationItem &item); -bke::BakeState move_values_to_simulation_state( +bke::bake::BakeState move_values_to_simulation_state( const Span node_simulation_items, const Span input_values); void move_simulation_state_to_values(const Span node_simulation_items, - bke::BakeState zone_state, + bke::bake::BakeState zone_state, const Object &self_object, const ComputeContext &compute_context, const bNode &sim_output_node, Span r_output_values); void copy_simulation_state_to_values(const Span node_simulation_items, - const bke::BakeStateRef &zone_state, + const bke::bake::BakeStateRef &zone_state, const Object &self_object, const ComputeContext &compute_context, const bNode &sim_output_node, diff --git a/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc b/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc index eb1044a3b0f..1d495cee006 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_simulation_input.cc @@ -106,7 +106,7 @@ class LazyFunctionForSimulationInputNode final : public LazyFunction { void output_simulation_state_copy(lf::Params ¶ms, const GeoNodesLFUserData &user_data, - const bke::BakeStateRef &zone_state) const + const bke::bake::BakeStateRef &zone_state) const { Array outputs(simulation_items_.size()); for (const int i : simulation_items_.index_range()) { @@ -125,7 +125,7 @@ class LazyFunctionForSimulationInputNode final : public LazyFunction { void output_simulation_state_move(lf::Params ¶ms, const GeoNodesLFUserData &user_data, - bke::BakeState zone_state) const + bke::bake::BakeState zone_state) const { Array outputs(simulation_items_.size()); for (const int i : simulation_items_.index_range()) { @@ -155,7 +155,8 @@ class LazyFunctionForSimulationInputNode final : public LazyFunction { /* Instead of outputting the initial values directly, convert them to a simulation state and * then back. This ensures that some geometry processing happens on the data consistently (e.g. * removing anonymous attributes). */ - bke::BakeState bake_state = move_values_to_simulation_state(simulation_items_, input_values); + bke::bake::BakeState bake_state = move_values_to_simulation_state(simulation_items_, + input_values); this->output_simulation_state_move(params, user_data, std::move(bake_state)); } }; diff --git a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc index 5da869b1202..3030686253c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_simulation_output.cc @@ -149,10 +149,10 @@ const CPPType &get_simulation_item_cpp_type(const NodeSimulationItem &item) return get_simulation_item_cpp_type(eNodeSocketDatatype(item.socket_type)); } -static bke::BakeSocketConfig make_bake_socket_config( +static bke::bake::BakeSocketConfig make_bake_socket_config( const Span node_simulation_items) { - bke::BakeSocketConfig config; + bke::bake::BakeSocketConfig config; const int items_num = node_simulation_items.size(); config.domains.resize(items_num); config.types.resize(items_num); @@ -186,20 +186,20 @@ static std::shared_ptr make_attribute_field( } void move_simulation_state_to_values(const Span node_simulation_items, - bke::BakeState zone_state, + bke::bake::BakeState zone_state, const Object &self_object, const ComputeContext &compute_context, const bNode &node, Span r_output_values) { - const bke::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); - Vector bake_items; + const bke::bake::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); + Vector bake_items; for (const NodeSimulationItem &item : node_simulation_items) { auto *bake_item = zone_state.items_by_id.lookup_ptr(item.identifier); bake_items.append(bake_item ? bake_item->get() : nullptr); } - bke::move_bake_items_to_socket_values( + bke::bake::move_bake_items_to_socket_values( bake_items, config, [&](const int i, const CPPType &type) { @@ -210,20 +210,21 @@ void move_simulation_state_to_values(const Span node_simulat } void copy_simulation_state_to_values(const Span node_simulation_items, - const bke::BakeStateRef &zone_state, + const bke::bake::BakeStateRef &zone_state, const Object &self_object, const ComputeContext &compute_context, const bNode &node, Span r_output_values) { - const bke::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); - Vector bake_items; + const bke::bake::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); + Vector bake_items; for (const NodeSimulationItem &item : node_simulation_items) { - const bke::BakeItem *const *bake_item = zone_state.items_by_id.lookup_ptr(item.identifier); + const bke::bake::BakeItem *const *bake_item = zone_state.items_by_id.lookup_ptr( + item.identifier); bake_items.append(bake_item ? *bake_item : nullptr); } - bke::copy_bake_items_to_socket_values( + bke::bake::copy_bake_items_to_socket_values( bake_items, config, [&](const int i, const CPPType &type) { @@ -233,18 +234,18 @@ void copy_simulation_state_to_values(const Span node_simulat r_output_values); } -bke::BakeState move_values_to_simulation_state( +bke::bake::BakeState move_values_to_simulation_state( const Span node_simulation_items, const Span input_values) { - const bke::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); + const bke::bake::BakeSocketConfig config = make_bake_socket_config(node_simulation_items); - Array> bake_items = bke::move_socket_values_to_bake_items( - input_values, config); + Array> bake_items = + bke::bake::move_socket_values_to_bake_items(input_values, config); - bke::BakeState bake_state; + bke::bake::BakeState bake_state; for (const int i : node_simulation_items.index_range()) { const NodeSimulationItem &item = node_simulation_items[i]; - std::unique_ptr &bake_item = bake_items[i]; + std::unique_ptr &bake_item = bake_items[i]; if (bake_item) { bake_state.items_by_id.add_new(item.identifier, std::move(bake_item)); } @@ -591,7 +592,7 @@ class LazyFunctionForSimulationOutputNode final : public LazyFunction { void output_cached_state(lf::Params ¶ms, GeoNodesLFUserData &user_data, - const bke::BakeStateRef &state) const + const bke::bake::BakeStateRef &state) const { Array output_values(simulation_items_.size()); for (const int i : simulation_items_.index_range()) { @@ -611,8 +612,8 @@ class LazyFunctionForSimulationOutputNode final : public LazyFunction { void output_mixed_cached_state(lf::Params ¶ms, const Object &self_object, const ComputeContext &compute_context, - const bke::BakeStateRef &prev_state, - const bke::BakeStateRef &next_state, + const bke::bake::BakeStateRef &prev_state, + const bke::bake::BakeStateRef &next_state, const float mix_factor) const { Array output_values(simulation_items_.size()); @@ -650,7 +651,7 @@ class LazyFunctionForSimulationOutputNode final : public LazyFunction { /* Instead of outputting the initial values directly, convert them to a simulation state and * then back. This ensures that some geometry processing happens on the data consistently (e.g. * removing anonymous attributes). */ - std::optional bake_state = this->get_bake_state_from_inputs(params); + std::optional bake_state = this->get_bake_state_from_inputs(params); if (!bake_state) { /* Wait for inputs to be computed. */ return; @@ -675,7 +676,7 @@ class LazyFunctionForSimulationOutputNode final : public LazyFunction { GeoNodesLFUserData &user_data, const sim_output::StoreAndPassThrough &info) const { - std::optional bake_state = this->get_bake_state_from_inputs(params); + std::optional bake_state = this->get_bake_state_from_inputs(params); if (!bake_state) { /* Wait for inputs to be computed. */ return; @@ -684,7 +685,7 @@ class LazyFunctionForSimulationOutputNode final : public LazyFunction { info.store_fn(std::move(*bake_state)); } - std::optional get_bake_state_from_inputs(lf::Params ¶ms) const + std::optional get_bake_state_from_inputs(lf::Params ¶ms) const { Array input_values(inputs_.size()); for (const int i : inputs_.index_range()) {