Skip to content

Commit

Permalink
Fix per object settings not sent to plugin. Added "mesh_name" field s…
Browse files Browse the repository at this point in the history
…o that the objects can be later identified.
  • Loading branch information
ThomasRahm committed Nov 9, 2023
1 parent 64467ec commit 404c35d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/plugins/converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@ broadcast_settings_request::value_type broadcast_settings_request::operator()(co
}

auto* object_settings = message.mutable_object_settings();
for (const auto& object : slice_message.object_lists())
for (const auto& mesh_group : slice_message.object_lists())
{
auto* settings = object_settings->Add()->mutable_settings();
for (const auto& setting : object.settings())
std::unordered_map<std::string, std::string> mesh_group_settings;
for (const auto& setting : mesh_group.settings())
{
settings->emplace(setting.name(), setting.value());
mesh_group_settings[setting.name()] = setting.value();
}
for (const auto& object : mesh_group.objects())
{
std::unordered_map<std::string, std::string> per_object_settings = mesh_group_settings;
for (const auto& setting : object.settings())
{
per_object_settings[setting.name()] = setting.value();
}

per_object_settings["mesh_name"] = object.name();

auto* settings = object_settings->Add()->mutable_settings();
for (const auto& key_value_pair : per_object_settings)
{
settings->emplace(key_value_pair.first, key_value_pair.second);
}
}
}

Expand Down

0 comments on commit 404c35d

Please sign in to comment.