svn merge -r37793:37865 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Mon, 18 Jul 2011 14:15:02 +0000 (14:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 18 Jul 2011 14:15:02 +0000 (14:15 +0000)
Merge info was  /trunk/blender:36835-37793,37865-38157
so this should merge in missing files.

1  2 
CMakeLists.txt
intern/ghost/intern/GHOST_SystemCocoa.mm
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/intern/paint.c
source/blender/blenlib/intern/math_geom.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/editarmature.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/python/generic/mathutils_geometry.c

diff --cc CMakeLists.txt
@@@ -53,6 -53,6 +53,7 @@@ if(NOT EXECUTABLE_OUTPUT_PATH
        set(FIRST_RUN "TRUE")
  endif()
  
++
  # this starts out unset
  list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
  
@@@ -141,7 -144,7 +145,7 @@@ option(WITH_IMAGE_HDR           "Enabl
  option(WITH_IMAGE_REDCODE       "Enable RedCode Image Support" OFF)
  
  # Audio/Video format support
--option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
++option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu)" OFF)
  option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
  if(APPLE OR (WIN32 AND NOT UNIX))
        option(WITH_CODEC_QUICKTIME     "Enable Quicktime Support" OFF)
@@@ -239,24 -242,24 +243,11 @@@ TEST_SSE_SUPPORT(
  set(WITH_BINRELOC OFF)
  
  # MAXOSX only, set to avoid uninitialized 
--set(EXETYPE)
--
--# C/C++ flags
--set(PLATFORM_CFLAGS)
++set(EXETYPE "")
  
  # these are added to later on.
--set(C_WARNINGS)
--set(CXX_WARNINGS)
--
--# libraries to link the binary with passed to target_link_libraries()
--# known as LLIBS to scons
--set(PLATFORM_LINKLIBS)
--
--# Added to linker flags in setup_liblinks
--# - CMAKE_EXE_LINKER_FLAGS
--# - CMAKE_EXE_LINKER_FLAGS_DEBUG
--set(PLATFORM_LINKFLAGS)
--set(PLATFORM_LINKFLAGS_DEBUG)
++set(C_WARNINGS "")
++set(CXX_WARNINGS "")
  
  
  # disabled for now, not supported
@@@ -359,7 -362,7 +350,7 @@@ if(UNIX AND NOT APPLE
        endif()
  
        if(WITH_CODEC_FFMPEG)
--              set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
++              set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
                mark_as_advanced(FFMPEG)
                set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
                set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
        endif()
  
        if(WITH_OPENCOLLADA)
--              set(OPENCOLLADA /usr/local/opencollada CACHE PATH "OpenCollada Directory")
++              set(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
                mark_as_advanced(OPENCOLLADA)
                set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
                set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2)
                set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA})
  
--              set(PCRE /usr CACHE PATH "PCRE Directory")
++              set(PCRE /usr CACHE FILEPATH "PCRE Directory")
                mark_as_advanced(PCRE)
                set(PCRE_LIBPATH ${PCRE}/lib)
                set(PCRE_LIB pcre)
  
--              set(EXPAT /usr CACHE PATH "Expat Directory")
++              set(EXPAT /usr CACHE FILEPATH "Expat Directory")
                mark_as_advanced(EXPAT)
                set(EXPAT_LIBPATH ${EXPAT}/lib)
                set(EXPAT_LIB expat)
        endif()
  
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
--      set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
++      set(LLIBS "-lutil -lc -lm -lpthread -lstdc++")
  
        if(NOT WITH_HEADLESS)
                find_package(X11 REQUIRED)
                find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
                mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
  
--              list(APPEND PLATFORM_LINKLIBS ${X11_X11_LIB})
++              list(APPEND LLIBS ${X11_X11_LIB})
  
                if(WITH_X11_XINPUT)
--                      list(APPEND PLATFORM_LINKLIBS ${X11_Xinput_LIB})
++                      list(APPEND LLIBS ${X11_Xinput_LIB})
                endif()
        endif()
  
        if(CMAKE_SYSTEM_NAME MATCHES "Linux")
                if(NOT WITH_PYTHON_MODULE)
                        # BSD's dont use libdl.so
--                      list(APPEND PLATFORM_LINKLIBS -ldl)
++                      list(APPEND LLIBS -ldl)
                        # binreloc is linux only
                        set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
                        set(WITH_BINRELOC ON)
@@@ -556,15 -559,15 +547,13 @@@ elseif(WIN32
  
        if(MSVC)
                if(CMAKE_CL_64)
--                      set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
++                      set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                else()
--                      set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
++                      set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                endif()
--
--              add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB)
--
--              set(CMAKE_CXX_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
--              set(CMAKE_C_FLAGS   "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
++              
++              set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
++              set(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
  
                if(CMAKE_CL_64)
                        set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
                endif()
                set(JPEG_LIBRARIES libjpeg)
  
--              set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
++              set(ZLIB ${LIBDIR}/zlib)
++              set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
++              set(ZLIB_LIBPATH ${ZLIB}/lib)
                if(CMAKE_CL_64)
--                      set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz.lib)
++                      set(ZLIB_LIBRARIES libz)
                else()
--                      set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/zlib.lib)
++                      set(ZLIB_LIBRARIES zlib)
                endif()
  
--              set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
--              set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
--
++              set(PTHREADS ${LIBDIR}/pthreads)
++              set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
++              set(PTHREADS_LIBPATH ${PTHREADS}/lib)
++              set(PTHREADS_LIBRARIES pthreadVC2)
++              
                set(FREETYPE ${LIBDIR}/freetype)
--              set(FREETYPE_INCLUDE_DIRS
--                      ${LIBDIR}/freetype/include
--                      ${LIBDIR}/freetype/include/freetype2
--              )
--              set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
++              set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
++              set(FREETYPE_LIBPATH ${FREETYPE}/lib)
++              set(FREETYPE_LIBRARY freetype2ST)
  
                if(WITH_FFTW3)
                        set(FFTW3 ${LIBDIR}/fftw3)
                endif()
  
                if(WITH_CODEC_FFMPEG)
--                      set(FFMPEG_INCLUDE_DIRS
--                              ${LIBDIR}/ffmpeg/include
--                              ${LIBDIR}/ffmpeg/include/msvc
--                      )
--                      set(FFMPEG_LIBRARIES
--                              ${LIBDIR}/ffmpeg/lib/avcodec-52.lib
--                              ${LIBDIR}/ffmpeg/lib/avformat-52.lib
--                              ${LIBDIR}/ffmpeg/lib/avdevice-52.lib
--                              ${LIBDIR}/ffmpeg/lib/avutil-50.lib
--                              ${LIBDIR}/ffmpeg/lib/swscale-0.lib
--                      )
++                      set(FFMPEG ${LIBDIR}/ffmpeg)
++                      set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include/msvc)
++                      set(FFMPEG_LIBRARIES avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
++                      set(FFMPEG_LIBPATH ${FFMPEG}/lib)
                endif()
  
                if(WITH_IMAGE_OPENEXR)
                endif()
  
                if(WITH_IMAGE_TIFF)
--                      set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
--                      set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
++                      set(TIFF ${LIBDIR}/tiff)
++                      set(TIFF_LIBRARY libtiff)
++                      set(TIFF_INCLUDE_DIR ${TIFF}/include)
++                      set(TIFF_LIBPATH ${TIFF}/lib)
                endif()
  
                if(WITH_JACK)
--                      set(JACK_INCLUDE_DIRS
--                              ${LIBDIR}/jack/include/jack
--                              ${LIBDIR}/jack/include
--                      )
--                      set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib)
++                      set(JACK ${LIBDIR}/jack)
++                      set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
++                      set(JACK_LIBRARIES libjack)
++                      set(JACK_LIBPATH ${JACK}/lib)
                endif()
  
                if(WITH_PYTHON)
                        set(PYTHON_LIBRARIES ${LIBDIR}/python/lib/python32.lib)
                endif()
  
--              set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
--
                # MSVC only, Mingw doesnt need
                if(CMAKE_CL_64)
--                      set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
++                      set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:X64 /STACK:2097152 /OPT:NOREF /INCREMENTAL:NO /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
                else()
--                      set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
++                      set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:IX86 /STACK:2097152 /INCREMENTAL:NO /LARGEADDRESSAWARE /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
                endif()
  
--              set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
++              set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
  
        else()
                # keep GCC spesific stuff here
                if(CMAKE_COMPILER_IS_GNUCC)
--                      set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
++                      set(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
                        set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
  
--                      add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
++                      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
++                      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
                endif()
  
                add_definitions(-DFREE_WINDOWS)
@@@ -938,7 -941,7 +922,7 @@@ elseif(APPLE
                set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
        endif()
  
--      set(PLATFORM_LINKLIBS stdc++ SystemStubs)
++      set(LLIBS stdc++ SystemStubs)
  
        if(WITH_COCOA)
                set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
@@@ -1162,18 -1165,18 +1146,6 @@@ elseif(CMAKE_C_COMPILER_ID MATCHES "Int
  
  endif()
  
--# MSVC2010 fails to links C++ libs right
--if(MSVC10)
--      if(WITH_IMAGE_OPENEXR)
--              message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
--              set(WITH_IMAGE_OPENEXR OFF)
--      endif()
--      if(WITH_OPENCOLLADA)
--              message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
--              set(WITH_OPENCOLLADA OFF)
--      endif()
--endif()
--
  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        if(WITH_IK_ITASC OR WITH_MOD_FLUID)
                message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.")
@@@ -1544,18 -1498,18 +1498,15 @@@ GHOST_TSuccess GHOST_SystemCocoa::handl
                                                GHOST_TInt32 x_mouse= mousePos.x;
                                                GHOST_TInt32 y_mouse= mousePos.y;
                                                GHOST_TInt32 x_accum, y_accum, x_cur, y_cur, x, y;
--                                              GHOST_Rect bounds, windowBounds, correctedBounds;
++                                              GHOST_Rect bounds, correctedBounds;
                                                
                                                /* fallback to window bounds */
                                                if(window->getCursorGrabBounds(bounds)==GHOST_kFailure)
                                                        window->getClientBounds(bounds);
                                                
                                                //Switch back to Cocoa coordinates orientation (y=0 at botton,the same as blender internal btw!), and to client coordinates
--                                              window->getClientBounds(windowBounds);
--                                              window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_t);
--                                              window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_b);
--                                              correctedBounds.m_b = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_b;
--                                              correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t;
++                                              window->screenToClient(bounds.m_l, bounds.m_b, correctedBounds.m_l, correctedBounds.m_b);
++                                              window->screenToClient(bounds.m_r, bounds.m_t, correctedBounds.m_r, correctedBounds.m_t);
                                                
                                                //Update accumulation counts
                                                window->getCursorGrabAccum(x_accum, y_accum);
@@@ -432,7 -430,7 +430,7 @@@ int isect_line_sphere_v2(const float l1
            l2[1] - l1[1]
        };
  
--      const float a= dot_v2v2(ldir, ldir);
++      const float a= dot_v3v3(ldir, ldir);
  
        const float b= 2.0f *
                (ldir[0] * (l1[0] - sp[0]) +
@@@ -269,7 -265,7 +265,7 @@@ void ED_keymap_armature(wmKeyConfig *ke
        
                /* set flags */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
--      WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
++      WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
                
                /* armature/bone layers */
        
                /* set flags */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
--      WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
++      WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
  
                /* armature/bone layers */
@@@ -680,7 -680,7 +680,7 @@@ static PyObject *M_Geometry_intersect_l
  
                PyObject *ret= PyTuple_New(2);
  
--              switch(isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
++              switch(isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
                case 1:
                        if(!(!clip || (((lambda= line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a= FALSE;
                        use_b= FALSE;