[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59670] trunk/blender: Cycles / Standalone :

Thomas Dinges blender at dingto.org
Fri Aug 30 19:34:27 CEST 2013


Revision: 59670
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59670
Author:   dingto
Date:     2013-08-30 17:34:27 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
Cycles / Standalone:
* Standalone can now be compiled without the GUI, making the glut dependency optional. 

Added WITH_CYCLES_STANDALONE_GUI cmake flag. 

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/intern/cycles/app/CMakeLists.txt
    trunk/blender/intern/cycles/app/cycles_standalone.cpp
    trunk/blender/intern/cycles/cmake/external_libs.cmake
    trunk/blender/intern/cycles/util/CMakeLists.txt

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2013-08-30 17:18:15 UTC (rev 59669)
+++ trunk/blender/CMakeLists.txt	2013-08-30 17:34:27 UTC (rev 59670)
@@ -262,6 +262,7 @@
 # Cycles
 option(WITH_CYCLES					"Enable cycles Render Engine" ON)
 option(WITH_CYCLES_STANDALONE		"Build cycles standalone application" OFF)
+option(WITH_CYCLES_STANDALONE_GUI	"Build cycles standalone with GUI" OFF)
 option(WITH_CYCLES_OSL				"Build Cycles with OSL support" OFF)
 option(WITH_CYCLES_CUDA_BINARIES	"Build cycles CUDA binaries" OFF)
 set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 CACHE STRING "CUDA architectures to build binaries for")

Modified: trunk/blender/intern/cycles/app/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/app/CMakeLists.txt	2013-08-30 17:18:15 UTC (rev 59669)
+++ trunk/blender/intern/cycles/app/CMakeLists.txt	2013-08-30 17:34:27 UTC (rev 59670)
@@ -27,7 +27,7 @@
 
 link_directories(${OPENIMAGEIO_LIBPATH} ${BOOST_LIBPATH})
 
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
 	list(APPEND LIBRARIES ${GLUT_LIBRARIES})
 endif()
 

Modified: trunk/blender/intern/cycles/app/cycles_standalone.cpp
===================================================================
--- trunk/blender/intern/cycles/app/cycles_standalone.cpp	2013-08-30 17:18:15 UTC (rev 59669)
+++ trunk/blender/intern/cycles/app/cycles_standalone.cpp	2013-08-30 17:34:27 UTC (rev 59670)
@@ -29,7 +29,10 @@
 #include "util_progress.h"
 #include "util_string.h"
 #include "util_time.h"
+
+#ifdef WITH_CYCLES_STANDALONE_GUI
 #include "util_view.h"
+#endif
 
 #include "cycles_xml.h"
 
@@ -100,8 +103,10 @@
 	
 	if(options.session_params.background && !options.quiet)
 		options.session->progress.set_update_callback(function_bind(&session_print_status));
+#ifdef WITH_CYCLES_STANDALONE_GUI
 	else
 		options.session->progress.set_update_callback(function_bind(&view_redraw));
+#endif
 
 	options.session->start();
 
@@ -136,6 +141,7 @@
 	}
 }
 
+#ifdef WITH_CYCLES_STANDALONE_GUI
 static void display_info(Progress& progress)
 {
 	static double latency = 0.0;
@@ -186,6 +192,7 @@
 	else if(key == 27) // escape
 		options.session->progress.set_cancel("Cancelled");
 }
+#endif
 
 static int files_parse(int argc, const char *argv[])
 {
@@ -271,8 +278,14 @@
 	else if(ssname == "svm")
 		options.scene_params.shadingsystem = SceneParams::SVM;
 		
-	/* Progressive rendering */
-	options.session_params.progressive = true;
+#ifdef WITH_CYCLES_STANDALONE_GUI
+	/* Progressive rendering for GUI */
+	if(!options.session_params.background)
+		options.session_params.progressive = true;
+#else
+	/* When building without GUI, set background */
+	options.session_params.background = true;
+#endif
 
 	/* find matching device */
 	DeviceType device_type = Device::type_from_string(devicename.c_str());
@@ -325,13 +338,15 @@
 int main(int argc, const char **argv)
 {
 	path_init();
-
 	options_parse(argc, argv);
-
+	
+#ifdef WITH_CYCLES_STANDALONE_GUI
 	if(options.session_params.background) {
+#endif
 		session_init();
 		options.session->wait();
 		session_exit();
+#ifdef WITH_CYCLES_STANDALONE_GUI
 	}
 	else {
 		string title = "Cycles: " + path_filename(options.filepath);
@@ -340,6 +355,7 @@
 		view_main_loop(title.c_str(), options.width, options.height,
 			session_init, session_exit, resize, display, keyboard);
 	}
+#endif
 
 	return 0;
 }

Modified: trunk/blender/intern/cycles/cmake/external_libs.cmake
===================================================================
--- trunk/blender/intern/cycles/cmake/external_libs.cmake	2013-08-30 17:18:15 UTC (rev 59669)
+++ trunk/blender/intern/cycles/cmake/external_libs.cmake	2013-08-30 17:34:27 UTC (rev 59670)
@@ -2,7 +2,7 @@
 ###########################################################################
 # GLUT
 
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
 	set(GLUT_ROOT_PATH ${CYCLES_GLUT})
 
 	find_package(GLUT)

Modified: trunk/blender/intern/cycles/util/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/util/CMakeLists.txt	2013-08-30 17:18:15 UTC (rev 59669)
+++ trunk/blender/intern/cycles/util/CMakeLists.txt	2013-08-30 17:34:27 UTC (rev 59670)
@@ -22,7 +22,7 @@
 	util_transform.cpp
 )
 
-if(WITH_CYCLES_STANDALONE)
+if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
 	list(APPEND SRC
 		util_view.cpp
 	)




More information about the Bf-blender-cvs mailing list