Add rendering flags to the studio UI.
PiperOrigin-RevId: 812649785 Change-Id: I47c6f974b7336bdd63c088ccfd06b5835e77ebff
This commit is contained in:
committed by
Copybara-Service
parent
8de86c9944
commit
e1c7e19780
@@ -1519,6 +1519,8 @@ void App::VisualizationGui() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void App::RenderingGui() {
|
void App::RenderingGui() {
|
||||||
|
mjvScene& scene = renderer_->GetScene();
|
||||||
|
|
||||||
// Generate a list of camera names dynamically.
|
// Generate a list of camera names dynamically.
|
||||||
std::vector<const char*> camera_names;
|
std::vector<const char*> camera_names;
|
||||||
camera_names.push_back("Free");
|
camera_names.push_back("Free");
|
||||||
@@ -1540,7 +1542,7 @@ void App::RenderingGui() {
|
|||||||
SetCamera(ui_.camera_idx);
|
SetCamera(ui_.camera_idx);
|
||||||
}
|
}
|
||||||
if (ImGui::Button("Copy Camera")) {
|
if (ImGui::Button("Copy Camera")) {
|
||||||
std::string camera_string = toolbox::CameraToString(&renderer_->GetScene());
|
std::string camera_string = toolbox::CameraToString(&scene);
|
||||||
toolbox::MaybeSaveToClipboard(camera_string);
|
toolbox::MaybeSaveToClipboard(camera_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1556,6 +1558,19 @@ void App::RenderingGui() {
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing() / 2);
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::TreeNodeEx("Render Flags", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||||
|
ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing() / 2);
|
||||||
|
|
||||||
|
for (int i = 0; i < mjNRNDFLAG; ++i) {
|
||||||
|
Toggle(mjRNDSTRING[i][0], scene.flags[i]);
|
||||||
|
if (i % 2 == 0 && i != mjNRNDFLAG - 1) {
|
||||||
|
ImGui::SameLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing() / 2);
|
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing() / 2);
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
|
|||||||
Reference in New Issue
Block a user