diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 9907dcb9a..d48ff1711 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1629,6 +1629,7 @@ struct OptionDesc { {"disable-rembrandt", false, OPTION_BOOL, "/sim/rendering/rembrandt/enabled", false, "", 0 }, {"enable-rembrandt", false, OPTION_BOOL, "/sim/rendering/rembrandt/enabled", true, "", 0 }, {"renderer", true, OPTION_STRING, "/sim/rendering/rembrandt/renderer", false, "", 0 }, + {"compositor", true, OPTION_STRING, "/sim/rendering/default-compositor", false, "", 0 }, {"disable-splash-screen", false, OPTION_BOOL, "/sim/startup/splash-screen", false, "", 0 }, {"enable-splash-screen", false, OPTION_BOOL, "/sim/startup/splash-screen", true, "", 0 }, {"disable-mouse-pointer", false, OPTION_STRING, "/sim/startup/mouse-pointer", false, "disabled", 0 }, diff --git a/src/Viewer/CameraGroup_compositor.cxx b/src/Viewer/CameraGroup_compositor.cxx index 388292e8a..255f843bb 100644 --- a/src/Viewer/CameraGroup_compositor.cxx +++ b/src/Viewer/CameraGroup_compositor.cxx @@ -27,6 +27,7 @@ #include #include #include // for copyProperties +#include #include #include #include @@ -682,16 +683,20 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode) // If no width or height has been specified, fill the entire window viewportNode->getDoubleValue("width", window->gc->getTraits()->width), viewportNode->getDoubleValue("height",window->gc->getTraits()->height)); - std::string comp_path = cameraNode->getStringValue("compositor", - "Compositor/default"); + std::string default_compositor = + fgGetString("/sim/rendering/default-compositor", "Compositor/default"); + std::string compositor_path = + cameraNode->getStringValue("compositor", default_compositor.c_str()); Compositor *compositor = Compositor::create(_viewer, window->gc, viewport, - comp_path); - if (compositor) + compositor_path); + if (compositor) { info->compositor = compositor; - else - SG_LOG(SG_INPUT, SG_WARN, "Unable to build Compositor"); + } else { + throw sg_exception(std::string("Failed to create Compositor in path '") + + compositor_path + "'"); + } // Distortion camera needs the viewport which is created by addCamera(). if (psNode) {