Skip to content

Commit

Permalink
JsonSetData
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Apr 9, 2024
1 parent 1efa639 commit 4d1a89e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zeno/src/nodes/JsonProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ struct JsonSetData : zeno::INode {
auto dict = get_input<DictObject>("dict");
for (auto &path: paths) {
auto strings = zeno::split_str(path, ':');
auto names = split_str(strings[0], '/');
auto names = split_str(strings[1], '/');

Json *tmp_json = &in_json->json;
for (auto & name : names) {
Expand All @@ -221,7 +221,7 @@ struct JsonSetData : zeno::INode {
tmp_json = &tmp_json->operator[](name);
}
}
std::string new_name = zeno::trim_string(strings[1]);
std::string new_name = zeno::trim_string(strings[0]);
*tmp_json = iobject_to_json(dict->lut[new_name]);
}

Expand All @@ -232,7 +232,7 @@ struct JsonSetData : zeno::INode {
ZENDEFNODE(JsonSetData, {
{
{"json"},
{"string", "path"},
{"multiline_string", "paths", "input_name:json_path"},
{"dict", "dict"},
},
{
Expand Down Expand Up @@ -655,7 +655,7 @@ struct JsonGetData : zeno::INode {
ZENDEFNODE(JsonGetData, {
{
{"json"},
{"multiline_string", "paths"},
{"multiline_string", "paths", "json_path:vec3f:output_name"},
},
{
{"DictObject", "outs"}
Expand Down

0 comments on commit 4d1a89e

Please sign in to comment.