MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / DrawObjectGUI

Method DrawObjectGUI

samples/luxcoreui/filmradiancegroupswindow.cpp:55–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool FilmRadianceGroupsWindow::DrawObjectGUI(Properties &props, bool &modifiedProps) {
56 const unsigned int radianceGroupCount = app->session->GetFilm().GetRadianceGroupCount();
57
58 for (unsigned int radianceGroupIndex = 0; radianceGroupIndex < radianceGroupCount; ++radianceGroupIndex) {
59 const string radianceGroupIndexStr = ToString(radianceGroupIndex);
60 ImGui::PushID(radianceGroupIndexStr.c_str());
61
62 ImGui::SetNextTreeNodeOpened(true, ImGuiSetCond_Appearing);
63 if (ImGui::TreeNode(("Radiance group: #" + radianceGroupIndexStr).c_str())) {
64 // Check the properties include a definition for this group
65
66 const string prefix = "film.imagepipelines." + ToString(app->imagePipelineIndex) + ".radiancescales." + radianceGroupIndexStr;
67
68 //------------------------------------------------------------------
69 // Enable widget
70 //------------------------------------------------------------------
71
72 bool enabled = props.Get(Property(prefix + ".enabled")(true)).Get<bool>();
73 const bool enabledChanged = ImGui::Checkbox("Enabled", &enabled);
74 LuxCoreApp::HelpMarker((prefix + ".globalscale").c_str());
75
76 if (enabledChanged) {
77 props.Set(Property(prefix + ".enabled")(enabled));
78 modifiedProps = true;
79 }
80
81 if (enabled) {
82 //--------------------------------------------------------------
83 // Global scale widget
84 //--------------------------------------------------------------
85
86 float globalScale = props.Get(Property(prefix + ".globalscale")(1.f)).Get<float>();
87 if (ImGui::InputFloat("Global scale", &globalScale)) {
88 props.Set(Property(prefix + ".globalscale")(globalScale));
89 modifiedProps = true;
90 }
91 LuxCoreApp::HelpMarker((prefix + ".globalscale").c_str());
92
93 //--------------------------------------------------------------
94 // Temperature widget
95 //--------------------------------------------------------------
96
97 float temperature = props.Get(Property(prefix + ".temperature")(0.f)).Get<float>();
98 bool showTemperature = (temperature > 0.f);
99 if (ImGui::Checkbox("Use temperature", &showTemperature)) {
100 temperature = showTemperature ? 6500.f : 0.f;
101 props.Set(Property(prefix + ".temperature")(temperature));
102 modifiedProps = true;
103 }
104
105 if (showTemperature) {
106 if (ImGui::SliderFloat("Temperature", &temperature, 1000.f, 11000.f)) {
107 props.Set(Property(prefix + ".temperature")(temperature));
108 modifiedProps = true;
109 }
110 }
111
112 LuxCoreApp::HelpMarker((prefix + ".temperature").c_str());

Callers

nothing calls this directly

Calls 7

c_strMethod · 0.80
Get<bool>Method · 0.80
GetMethod · 0.80
SetMethod · 0.80
Get<float>Method · 0.80
ToStringFunction · 0.50
GetRadianceGroupCountMethod · 0.45

Tested by

no test coverage detected