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

Method UpdateFilmProperties

src/slg/renderconfig.cpp:168–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void RenderConfig::UpdateFilmProperties(const luxrays::Properties &props) {
169 // I can not use GetProperty() here because it triggers a ToProperties() and it can
170 // be a problem with OpenCL disabled (PATHOCL is not defined, etc.)
171 if (cfg.Get(Property("debug.renderconfig.parse.print")(false)).Get<bool>()) {
172 SDL_LOG("=============RenderConfig::UpdateFilmProperties()==============" << endl <<
173 props);
174 SDL_LOG("===============================================================");
175 }
176
177 //--------------------------------------------------------------------------
178 // Check if there was a new image pipeline definition
179 //--------------------------------------------------------------------------
180
181 if (props.HaveNamesRE("film\\.imagepipeline\\.[0-9]+\\.type") ||
182 props.HaveNamesRE("film\\.imagepipelines\\.[0-9]+\\.[0-9]+\\.type")) {
183 // Delete the old image pipeline properties
184 cfg.DeleteAll(cfg.GetAllNamesRE("film\\.imagepipeline\\.[0-9]+\\..*"));
185 cfg.DeleteAll(cfg.GetAllNamesRE("film\\.imagepipelines\\.[0-9]+\\.[0-9]+\\..*"));
186
187 // Update the RenderConfig properties with the new image pipeline definition
188 boost::regex reOldSyntax("film\\.imagepipeline\\.[0-9]+\\..*");
189 boost::regex reNewSyntax("film\\.imagepipelines\\.[0-9]+\\.[0-9]+\\..*");
190 BOOST_FOREACH(string propName, props.GetAllNames()) {
191 if (boost::regex_match(propName, reOldSyntax) ||
192 boost::regex_match(propName, reNewSyntax))
193 cfg.Set(props.Get(propName));
194 }
195
196 // Reset the properties cache
197 propsCache.Clear();
198 }
199
200 //--------------------------------------------------------------------------
201 // Check if there are new radiance group scales
202 //--------------------------------------------------------------------------
203
204 if (props.HaveNames("film.imagepipeline.radiancescales.") ||
205 props.HaveNamesRE("film\\.imagepipelines\\.[0-9]+\\.radiancescales\\..*")) {
206 // Delete the old image pipeline properties
207 cfg.DeleteAll(cfg.GetAllNames("film.imagepipeline.radiancescales."));
208 cfg.DeleteAll(cfg.GetAllNamesRE("film\\.imagepipelines\\.[0-9]+\\.radiancescales\\..*"));
209
210 // Update the RenderConfig properties with the new image pipeline definition
211 boost::regex reNewSyntax("film\\.imagepipelines\\.[0-9]+\\.radiancescales\\..*");
212 BOOST_FOREACH(string propName, props.GetAllNames()) {
213 if (boost::starts_with(propName, "film.imagepipeline.radiancescales.") ||
214 boost::regex_match(propName, reNewSyntax))
215 cfg.Set(props.Get(propName));
216 }
217
218 // Reset the properties cache
219 propsCache.Clear();
220 }
221
222 //--------------------------------------------------------------------------
223 // Check if there were new outputs definition
224 //--------------------------------------------------------------------------
225

Callers 1

ParseMethod · 0.80

Calls 10

Get<bool>Method · 0.80
GetMethod · 0.80
HaveNamesREMethod · 0.80
DeleteAllMethod · 0.80
GetAllNamesREMethod · 0.80
HaveNamesMethod · 0.80
GetAllNamesMethod · 0.80
IsDefinedMethod · 0.80
SetMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected