Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Params base64 #2083

Merged
merged 3 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/zenoedit/launch/corelaunch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct LAUNCH_PARAM {
QString zsgPath;
int projectFps = 24;
QString paramPath;
QString paramBase64;
};

void launchProgram(IGraphsModel *pModel, LAUNCH_PARAM param);
Expand Down
14 changes: 13 additions & 1 deletion ui/zenoedit/launch/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ static void serializeGraph(IGraphsModel* pGraphsModel, const QModelIndex& subgId
zeno::log_error("config file is corrupted");
}
}
if (!launchParam.paramBase64.isEmpty()) {
zeno::log_info("base64:{}", launchParam.paramBase64.toStdString());
QByteArray base64Encoded = launchParam.paramBase64.toUtf8();
QByteArray decodedByteArray = QByteArray::fromBase64(base64Encoded);
QString decodedString = QString::fromUtf8(decodedByteArray );
zeno::log_info("json: {}", decodedString.toStdString());
configDoc.Parse(decodedByteArray );

if (!configDoc.IsObject()) {
zeno::log_error("paramsBase64 is corrupted");
}
}

//scan all the nodes in the subgraph.
for (int i = 0; i < pGraphsModel->itemCount(subgIdx); i++)
Expand Down Expand Up @@ -302,7 +314,7 @@ static void serializeGraph(IGraphsModel* pGraphsModel, const QModelIndex& subgId
const QString& objPath = inSockIdx.data(ROLE_OBJPATH).toString();
if (commandParams.contains(objPath))
{
if (!launchParam.paramPath.isEmpty())
if (!launchParam.paramPath.isEmpty() || !launchParam.paramBase64.isEmpty())
{
const QString& command = commandParams[objPath].name;
if (configDoc.HasMember(command.toUtf8()))
Expand Down
5 changes: 5 additions & 0 deletions ui/zenoedit/recordmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ int record_main(const QCoreApplication& app)
{"subzsg", "subgraphzsg", "subgraph zsg file path", ""},
{"cacheautorm", "cacheautoremove", "remove cache after render"},
{"paramsPath", "paramsPath", "paramsPath"},
{"paramsBase64", "paramsBase64", "paramsBase64"},
{"paramsJson", "paramsJson", "paramsJson"},
});
cmdParser.process(app);
Expand Down Expand Up @@ -154,6 +155,10 @@ int record_main(const QCoreApplication& app)
{
launchparam.paramPath = cmdParser.value("paramsPath");
}
if (cmdParser.isSet("paramsBase64"))
{
launchparam.paramBase64 = cmdParser.value("paramsBase64");
}
if (cmdParser.isSet("exitWhenRecordFinish"))
param.exitWhenRecordFinish = cmdParser.value("exitWhenRecordFinish").toLower() == "true";
if (cmdParser.isSet("audio")) {
Expand Down
Loading