Cycles Merge
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 8 Nov 2011 17:00:40 +0000 (17:00 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 8 Nov 2011 17:00:40 +0000 (17:00 +0000)
Documentation:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles

Cycles is available is an extra render engine from the top header. It's not
feature complete, consider this as a first preview release. Known bugs:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/KnownIssues

Building currently only works with CMake, SCons support is being worked on
and should be available soon.

Also missing still is precompiled OpenImageIO and Boost for Linux, these will
be added later in lib/linux*, if you do not have these installed on your
system, Cycles will simply not be available.

1  2 
CMakeLists.txt
intern/cycles/CMakeLists.txt
source/blender/blenkernel/BKE_blender.h
source/blender/editors/interface/resources.c

diff --combined CMakeLists.txt
index 4ed7eab8b4ebca09938b24d0dfb57aa02cad32f4,14c9c8c867914e4eb96bd2e9268f12acdec13e4c..17ea5cf249dd28aae75ae98b4b5a25f1b45b6a84
@@@ -213,6 -213,10 +213,10 @@@ if(UNIX AND NOT APPLE
  endif()
  option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
  
+ # Cycles
+ option(WITH_CYCLES                    "Enable Cycles Render Engine" ON)
+ OPTION(WITH_CYCLES_TEST               "Build cycles test application" OFF)
  # disable for now, but plan to support on all platforms eventually
  option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
  mark_as_advanced(WITH_MEM_JEMALLOC)
@@@ -284,6 -288,12 +288,12 @@@ if(WITH_PYTHON_MODULE
        set(WITH_HEADLESS ON)
  endif()
  
+ # auto enable openimageio and boost for cycles
+ if(WITH_CYCLES)
+       set(WITH_OPENIMAGEIO ON)
+       set(WITH_BOOST ON)
+ endif()
  TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
  
  # don't store paths to libs for portable distrobution
@@@ -497,7 -507,7 +507,7 @@@ if(UNIX AND NOT APPLE
                if(NOT BOOST_CUSTOM)
                        set(BOOST_ROOT ${BOOST})
                        set(Boost_USE_MULTITHREADED ON)
--                      find_package(Boost 1.34 REQUIRED COMPONENTS filesystem regex system thread)
++                      find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
                endif()
  
                set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
                set(OPENIMAGEIO "/usr" CACHE PATH "OpenImageIO Directory")
  
                set(OPENIMAGEIO_ROOT_DIR ${OPENIMAGEIO})
--              find_package(OpenImageIO REQUIRED)
++              find_package(OpenImageIO)
  
                set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
                set(OPENIMAGEIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
  
                if(NOT OPENIMAGEIO_FOUND)
                        set(WITH_OPENIMAGEIO OFF)
++                      set(WITH_CYCLES OFF)
++                      message(STATUS "OpenImageIO not found, disabling WITH_CYCLES")
                endif()
        endif()
  
@@@ -939,6 -949,9 +951,6 @@@ elseif(WIN32
                        set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
                endif()
  
 -              # disable for now, not building yet
 -              set(WITH_CYCLES OFF)
 -
                if(WITH_BOOST)
                        set(BOOST ${LIBDIR}/gcc/boost)
                        set(BOOST_INCLUDE_DIR ${BOOST}/include)
@@@ -1480,6 -1493,7 +1492,7 @@@ if(FIRST_RUN
        info_cfg_option(WITH_FFTW3)
        info_cfg_option(WITH_INTERNATIONAL)
        info_cfg_option(WITH_INPUT_NDOF)
+       info_cfg_option(WITH_CYCLES)
  
        info_cfg_text("Compiler Options:")
        info_cfg_option(WITH_BUILDINFO)
index 0000000000000000000000000000000000000000,0debe10747b45d625cd51c1c1a491a8a44365cfc..8bb99e4e4f3a3e3d551bc8654b41fce1725149e8
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,77 +1,76 @@@
 -SET(WITH_CYCLES_BLENDER ON)
 -
+ set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
++SET(WITH_CYCLES_BLENDER ON)
+ # External Libraries
+ include(cmake/external_libs.cmake)
+ # Build Flags
+ set(GCC_WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-long-long")
+ set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3 -mtune=native")
+ if(APPLE)
+       set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
+       set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+ endif(APPLE)
+ if(WIN32)
+       if(MSVC)
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast")
+               set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+       elseif(CMAKE_COMPILER_IS_GNUCC)
+               set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
+               set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+       endif()
+ endif(WIN32)
+ if(UNIX AND NOT APPLE)
+       set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
+       set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
+ endif(UNIX AND NOT APPLE)
+ # Definitions and Includes
+ add_definitions(${BOOST_DEFINITIONS} ${OPENIMAGEIO_DEFINITIONS})
+ add_definitions(-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {)
+ add_definitions(-DCCL_NAMESPACE_END=})
+ if(WITH_CYCLES_NETWORK)
+   add_definitions(-DWITH_NETWORK)
+ endif()
+ if(WITH_CYCLES_OSL)
+   add_definitions(-DWITH_OSL)
+ endif()
+ if(WITH_CYCLES_PARTIO)
+   add_definitions(-DWITH_PARTIO)
+ endif()
+ add_definitions(-DWITH_OPENCL)
+ add_definitions(-DWITH_CUDA)
+ add_definitions(-DWITH_MULTI)
+ include_directories(
+       ${BOOST_INCLUDE_DIR}
+       ${OPENIMAGEIO_INCLUDE_DIRS}
+       ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO)
+ # Subdirectories
+ if(WITH_CYCLES_BLENDER)
+       add_subdirectory(blender)
+ endif(WITH_CYCLES_BLENDER)
+ add_subdirectory(app)
+ add_subdirectory(bvh)
+ add_subdirectory(device)
+ add_subdirectory(doc)
+ add_subdirectory(kernel)
+ add_subdirectory(render)
+ add_subdirectory(subd)
+ add_subdirectory(util)
index ac56cd02eb0ec19f165674970c2d2fe277d1aa9d,ac56cd02eb0ec19f165674970c2d2fe277d1aa9d..b150c403b871f6bd721c8a42b387b0f9a99ead4e
@@@ -42,7 -42,7 +42,7 @@@ extern "C" 
   * and keep comment above the defines.
   * Use STRINGIFY() rather than defining with quotes */
  #define BLENDER_VERSION                       260
--#define BLENDER_SUBVERSION            2
++#define BLENDER_SUBVERSION            3
  
  #define BLENDER_MINVERSION            250
  #define BLENDER_MINSUBVERSION 0
index 5f392daeec67217ca55373d628ac59b8fc3352bc,5f392daeec67217ca55373d628ac59b8fc3352bc..104cf18ebdfde24083363b56dd990bfd2968c689
@@@ -1634,8 -1634,8 +1634,9 @@@ void init_userdef_do_versions(void
                }
        }
  
--      {
++      if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 3)) {
                bTheme *btheme;
++
                for(btheme= U.themes.first; btheme; btheme= btheme->next) {
                        if(btheme->tv3d.bundle_solid[3] == 0)
                                SETCOL(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
                                btheme->tclip.handle_vertex_size= 4;
                        }
                }
++
++              /* enable addon by default */
++              if(!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) {
++                      bAddon *baddon= MEM_callocN(sizeof(bAddon), "bAddon");
++                      BLI_strncpy(baddon->module, "cycles", sizeof(baddon->module));
++                      BLI_addtail(&U.addons, baddon);
++              }
        }
  
        /* GL Texture Garbage Collection (variable abused above!) */