Merge with trunk r37849
This commit is contained in:
422
CMakeLists.txt
422
CMakeLists.txt
@@ -49,8 +49,13 @@ endif()
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
if(NOT EXECUTABLE_OUTPUT_PATH)
|
||||
set(FIRST_RUN "TRUE")
|
||||
endif()
|
||||
|
||||
|
||||
# this starts out unset
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
|
||||
|
||||
# quiet output for Makefiles, 'make -s' helps too
|
||||
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||
@@ -99,6 +104,9 @@ option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
|
||||
option(WITH_AUDASPACE "Build with blenders audio library" ON)
|
||||
mark_as_advanced(WITH_AUDASPACE)
|
||||
|
||||
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
|
||||
@@ -195,8 +203,8 @@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SAMPLERATE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
|
||||
message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK require WITH_SAMPLERATE")
|
||||
if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
|
||||
message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG require WITH_AUDASPACE")
|
||||
endif()
|
||||
|
||||
if(NOT WITH_IMAGE_OPENJPEG AND WITH_IMAGE_REDCODE)
|
||||
@@ -246,13 +254,12 @@ set(CXX_WARNINGS "")
|
||||
# On Unix:
|
||||
# cmake ../blender \
|
||||
# -D PYTHON_VERSION=3.2 \
|
||||
# -D PYTHON_INCLUDE_DIRS=/opt/py32/include/python3.2d \
|
||||
# -D PYTHON_LIBPATH=/opt/py32/lib \
|
||||
# -D PYTHON_LIBRARY=python3.2d
|
||||
# -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
|
||||
# -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
|
||||
#
|
||||
# On Macs:
|
||||
# cmake ../blender \
|
||||
# -D PYTHON_INCLUDE_DIRS=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
|
||||
# -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
|
||||
# -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \
|
||||
# -G Xcode
|
||||
#
|
||||
@@ -268,6 +275,43 @@ if(UNIX AND NOT APPLE)
|
||||
set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
|
||||
endif()
|
||||
|
||||
find_package(JPEG REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
|
||||
if(WITH_PYTHON)
|
||||
# No way to set py32. remove for now.
|
||||
# find_package(PythonLibs)
|
||||
|
||||
# Use our own instead, since wothout py is such a rare case,
|
||||
# require this package
|
||||
find_package(PythonLibsUnix REQUIRED)
|
||||
endif()
|
||||
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
find_package(OpenEXR) # our own module
|
||||
if(NOT OPENEXR_FOUND)
|
||||
set(WITH_IMAGE_OPENEXR OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENJPEG)
|
||||
find_package(OpenJPEG)
|
||||
if(NOT OPENJPEG_FOUND)
|
||||
set(WITH_IMAGE_OPENJPEG OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
set(WITH_IMAGE_TIFF OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Audio IO
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(NOT OPENAL_FOUND)
|
||||
@@ -275,18 +319,41 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
set(JACK /usr)
|
||||
set(JACK_INC ${JACK}/include/jack)
|
||||
set(JACK_LIB jack)
|
||||
set(JACK_LIBPATH ${JACK}/lib)
|
||||
if(WITH_SDL)
|
||||
find_package(SDL)
|
||||
mark_as_advanced(SDLMAIN_LIBRARY)
|
||||
mark_as_advanced(SDL_INCLUDE_DIR)
|
||||
mark_as_advanced(SDL_LIBRARY)
|
||||
mark_as_advanced(SDL_LIBRARY_TEMP)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
set(WITH_SDL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
find_package(Jack)
|
||||
if(NOT JACK_FOUND)
|
||||
set(WITH_JACK OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Codecs
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
set(SNDFILE /usr)
|
||||
set(SNDFILE_INC ${SNDFILE}/include)
|
||||
set(SNDFILE_LIB sndfile)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||
find_package(SndFile)
|
||||
if(NOT SNDFILE_FOUND)
|
||||
set(WITH_CODEC_SNDFILE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
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")
|
||||
mark_as_advanced(FFMPEG_LIBRARIES)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
@@ -309,88 +376,26 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Freetype)
|
||||
# unset(FREETYPE_INCLUDE_DIRS CACHE) # cant use
|
||||
|
||||
|
||||
if(WITH_PYTHON)
|
||||
# No way to set py32. remove for now.
|
||||
# find_package(PythonLibs)
|
||||
|
||||
# defines...
|
||||
|
||||
# PYTHON_VERSION
|
||||
# PYTHON_INCLUDE_DIRS
|
||||
# PYTHON_LIBRARY
|
||||
# PYTHON_LIBPATH
|
||||
# PYTHON_LINKFLAGS
|
||||
|
||||
include(build_files/cmake/FindPythonLibsUnix.cmake)
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
find_package(SDL)
|
||||
mark_as_advanced(SDLMAIN_LIBRARY)
|
||||
mark_as_advanced(SDL_INCLUDE_DIR)
|
||||
mark_as_advanced(SDL_LIBRARY)
|
||||
mark_as_advanced(SDL_LIBRARY_TEMP)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
set(WITH_SDL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
find_package(OpenEXR) # our own module
|
||||
if(NOT OPENEXR_FOUND)
|
||||
set(WITH_IMAGE_OPENEXR OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
set(WITH_IMAGE_TIFF OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(JPEG REQUIRED)
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
|
||||
mark_as_advanced(FFMPEG)
|
||||
set(FFMPEG_INC ${FFMPEG}/include)
|
||||
set(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
||||
mark_as_advanced(FFMPEG_LIB)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
set(FFTW3 /usr)
|
||||
set(FFTW3_INC ${FFTW3}/include)
|
||||
set(FFTW3_LIB fftw3)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
find_package(Fftw3)
|
||||
if(NOT FFTW3_FOUND)
|
||||
set(WITH_FFTW3 OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
set(LIBSAMPLERATE /usr)
|
||||
set(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
set(LIBSAMPLERATE_LIB samplerate)
|
||||
set(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
find_package(Samplerate)
|
||||
if(NOT SAMPLERATE_FOUND)
|
||||
set(WITH_SAMPLERATE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
set(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
|
||||
mark_as_advanced(OPENCOLLADA)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2)
|
||||
set(OPENCOLLADA_INC ${OPENCOLLADA})
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2)
|
||||
set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA})
|
||||
|
||||
set(PCRE /usr CACHE FILEPATH "PCRE Directory")
|
||||
mark_as_advanced(PCRE)
|
||||
@@ -404,12 +409,10 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
set(JEMALLOC /usr)
|
||||
set(JEMALLOC_LIBRARY jemalloc CACHE STRING "JeMalloc library")
|
||||
set(JEMALLOC_LIBPATH ${JEMALLOC}/lib CACHE FILEPATH "JeMalloc library path")
|
||||
# no use for this yet.
|
||||
# set(JEMALLOC_INCLUDE_DIR ${JEMALLOC}/include CACHE FILEPATH "JeMalloc include path")
|
||||
unset(JEMALLOC)
|
||||
find_package(JeMalloc)
|
||||
if(NOT JEMALLOC_FOUND)
|
||||
set(WITH_MEM_JEMALLOC OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
@@ -431,10 +434,8 @@ if(UNIX AND NOT APPLE)
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
# BSD's dont use libdl.so
|
||||
list(APPEND LLIBS -ldl)
|
||||
|
||||
# binreloc is linux only
|
||||
set(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
|
||||
set(BINRELOC_INC ${BINRELOC}/include)
|
||||
set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
|
||||
set(WITH_BINRELOC ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -487,16 +488,16 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
set(ICONV ${LIBDIR}/iconv)
|
||||
set(ICONV_INC ${ICONV}/include)
|
||||
set(ICONV_LIB iconv)
|
||||
set(ICONV_INCLUDE_DIRS ${ICONV}/include)
|
||||
set(ICONV_LIBRARIES iconv)
|
||||
set(ICONV_LIBPATH ${ICONV}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
set(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
set(LIBSAMPLERATE_LIB libsamplerate)
|
||||
set(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
set(SAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
|
||||
set(SAMPLERATE_LIBRARIES libsamplerate)
|
||||
set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
|
||||
endif()
|
||||
|
||||
set(PNG "${LIBDIR}/png")
|
||||
@@ -518,9 +519,9 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
set(SNDFILE ${LIBDIR}/sndfile)
|
||||
set(SNDFILE_INC ${SNDFILE}/include)
|
||||
set(SNDFILE_LIB libsndfile-1)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
|
||||
set(SNDFILE_LIBRARIES libsndfile-1)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
@@ -532,8 +533,8 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
set(QUICKTIME ${LIBDIR}/QTDevWin)
|
||||
set(QUICKTIME_INC ${QUICKTIME}/CIncludes)
|
||||
set(QUICKTIME_LIB qtmlClient)
|
||||
set(QUICKTIME_INCLUDE_DIRS ${QUICKTIME}/CIncludes)
|
||||
set(QUICKTIME_LIBRARIES qtmlClient)
|
||||
set(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
|
||||
endif()
|
||||
|
||||
@@ -543,13 +544,13 @@ elseif(WIN32)
|
||||
|
||||
if(MSVC)
|
||||
if(CMAKE_CL_64)
|
||||
set(LLIBS 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(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
|
||||
set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /we4013 /wd4018 /wd4800 /wd4244 /wd4305 /wd4065 /wd4267" 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 /we4013 /wd4018 /wd4800 /wd4244 /wd4305 /wd4065 /wd4267" 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)
|
||||
@@ -596,9 +597,9 @@ elseif(WIN32)
|
||||
endif()
|
||||
|
||||
set(PTHREADS ${LIBDIR}/pthreads)
|
||||
set(PTHREADS_INC ${PTHREADS}/include)
|
||||
set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
|
||||
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
|
||||
set(PTHREADS_LIB pthreadVC2)
|
||||
set(PTHREADS_LIBRARIES pthreadVC2)
|
||||
|
||||
set(FREETYPE ${LIBDIR}/freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
@@ -607,23 +608,36 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_FFTW3)
|
||||
set(FFTW3 ${LIBDIR}/fftw3)
|
||||
set(FFTW3_LIB libfftw)
|
||||
set(FFTW3_INC ${FFTW3}/include)
|
||||
set(FFTW3_LIBRARIES libfftw)
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
set(OPENCOLLADA ${LIBDIR}/opencollada)
|
||||
set(OPENCOLLADA_INC ${OPENCOLLADA}/include)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa UTF)
|
||||
set(PCRE_LIB pcre)
|
||||
set(OPENCOLLADA_INCLUDE_DIR
|
||||
${LIBDIR}/opencollada/include
|
||||
)
|
||||
set(OPENCOLLADA_LIBRARIES
|
||||
${LIBDIR}/opencollada/lib/OpenCOLLADASaxFrameworkLoader.lib
|
||||
${LIBDIR}/opencollada/lib/OpenCOLLADAFramework.lib
|
||||
${LIBDIR}/opencollada/lib/OpenCOLLADABaseUtils.lib
|
||||
${LIBDIR}/opencollada/lib/OpenCOLLADAStreamWriter.lib
|
||||
${LIBDIR}/opencollada/lib/MathMLSolver.lib
|
||||
${LIBDIR}/opencollada/lib/GeneratedSaxParser.lib
|
||||
${LIBDIR}/opencollada/lib/xml2.lib
|
||||
${LIBDIR}/opencollada/lib/buffer.lib
|
||||
${LIBDIR}/opencollada/lib/ftoa.lib
|
||||
${LIBDIR}/opencollada/lib/UTF.lib
|
||||
)
|
||||
set(PCRE_LIB
|
||||
${LIBDIR}/opencollada/lib/pcre.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
|
||||
set(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
|
||||
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()
|
||||
|
||||
@@ -667,25 +681,23 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_JACK)
|
||||
set(JACK ${LIBDIR}/jack)
|
||||
set(JACK_INC ${JACK}/include/jack ${JACK}/include)
|
||||
set(JACK_LIB libjack)
|
||||
set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
|
||||
set(JACK_LIBRARIES libjack)
|
||||
set(JACK_LIBPATH ${JACK}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
set(PYTHON ${LIBDIR}/python)
|
||||
set(PYTHON_VERSION 3.2)
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
set(PYTHON_INCLUDE_DIRS "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY python) # not used yet
|
||||
set(PYTHON_LIBRARY python32)
|
||||
set(PYTHON_LIBPATH ${PYTHON}/lib)
|
||||
set(PYTHON_LIBRARIES ${LIBDIR}/python/lib/python32.lib)
|
||||
endif()
|
||||
|
||||
# MSVC only, Mingw doesnt need
|
||||
if(CMAKE_CL_64)
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib /STACK:2097152 ")
|
||||
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 "/NODEFAULTLIB:libc.lib /STACK:2097152 ")
|
||||
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(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
|
||||
@@ -721,9 +733,9 @@ elseif(WIN32)
|
||||
set(ZLIB_LIBRARIES z)
|
||||
|
||||
set(PTHREADS ${LIBDIR}/pthreads)
|
||||
set(PTHREADS_INC ${PTHREADS}/include)
|
||||
set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
|
||||
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
|
||||
set(PTHREADS_LIB pthreadGC2)
|
||||
set(PTHREADS_LIBRARIES pthreadGC2)
|
||||
|
||||
set(FREETYPE ${LIBDIR}/gcc/freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
@@ -732,23 +744,23 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_FFTW3)
|
||||
set(FFTW3 ${LIBDIR}/gcc/fftw3)
|
||||
set(FFTW3_LIB fftw3)
|
||||
set(FFTW3_INC ${FFTW3}/include)
|
||||
set(FFTW3_LIBRARIES fftw3)
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
set(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
|
||||
set(OPENCOLLADA_INC ${OPENCOLLADA}/include)
|
||||
set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}/include)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
|
||||
set(PCRE_LIB pcre)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include)
|
||||
set(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
|
||||
set(FFMPEG_LIBRARIES avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
endif()
|
||||
|
||||
@@ -771,8 +783,8 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_JACK)
|
||||
set(JACK ${LIBDIR}/jack)
|
||||
set(JACK_INC ${JACK}/include/jack ${JACK}/include)
|
||||
set(JACK_LIB jack)
|
||||
set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
|
||||
set(JACK_LIBRARIES jack)
|
||||
set(JACK_LIBPATH ${JACK}/lib)
|
||||
|
||||
# TODO, gives linking errors, force off
|
||||
@@ -784,7 +796,7 @@ elseif(WIN32)
|
||||
set(PYTHON_VERSION 3.2)
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY python) # not used yet
|
||||
set(PYTHON_LIBRARY python32mw)
|
||||
set(PYTHON_LIBRARIES ${PYTHON}/lib/python32mw.lib)
|
||||
set(PYTHON_LIBPATH ${PYTHON}/lib)
|
||||
endif()
|
||||
|
||||
@@ -793,7 +805,7 @@ elseif(WIN32)
|
||||
endif()
|
||||
|
||||
# used in many places so include globally, like OpenGL
|
||||
blender_include_dirs("${PTHREADS_INC}")
|
||||
blender_include_dirs("${PTHREADS_INCLUDE_DIRS}")
|
||||
|
||||
elseif(APPLE)
|
||||
|
||||
@@ -824,16 +836,16 @@ elseif(APPLE)
|
||||
|
||||
if(WITH_JACK)
|
||||
set(JACK /usr)
|
||||
set(JACK_INC ${JACK}/include/jack)
|
||||
set(JACK_LIB jack)
|
||||
set(JACK_INCLUDE_DIRS ${JACK}/include/jack)
|
||||
set(JACK_LIBRARIES jack)
|
||||
set(JACK_LIBPATH ${JACK}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
set(SNDFILE ${LIBDIR}/sndfile)
|
||||
set(SNDFILE_INC ${SNDFILE}/include)
|
||||
set(SNDFILE_LIB sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)
|
||||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
|
||||
set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
set(PYTHON_VERSION 3.2)
|
||||
@@ -844,7 +856,7 @@ elseif(APPLE)
|
||||
set(PYTHON ${LIBDIR}/python)
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
|
||||
set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
||||
set(PYTHON_LIBRARIES python${PYTHON_VERSION})
|
||||
set(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
else()
|
||||
@@ -854,7 +866,7 @@ elseif(APPLE)
|
||||
set(PYTHON_VERSION 3.2)
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
|
||||
set(PYTHON_LIBRARY "")
|
||||
set(PYTHON_LIBRARIES "")
|
||||
set(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config)
|
||||
set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
|
||||
endif()
|
||||
@@ -868,8 +880,8 @@ elseif(APPLE)
|
||||
|
||||
if(WITH_FFTW3)
|
||||
set(FFTW3 ${LIBDIR}/fftw3)
|
||||
set(FFTW3_INC ${FFTW3}/include)
|
||||
set(FFTW3_LIB fftw3)
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
||||
set(FFTW3_LIBRARIES fftw3)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
endif()
|
||||
|
||||
@@ -894,17 +906,17 @@ elseif(APPLE)
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INC ${FFMPEG}/include)
|
||||
set(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
||||
set(FFMPEG_LIBRARIES avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
set(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
set(LIBSAMPLERATE_LIB samplerate)
|
||||
set(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
set(SAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
|
||||
set(SAMPLERATE_LIBRARIES samplerate)
|
||||
set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
|
||||
endif()
|
||||
|
||||
set(LLIBS stdc++ SystemStubs)
|
||||
@@ -929,9 +941,9 @@ elseif(APPLE)
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
set(OPENCOLLADA ${LIBDIR}/opencollada)
|
||||
set(OPENCOLLADA_INC ${OPENCOLLADA}/include)
|
||||
set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}/include)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
|
||||
set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
|
||||
#pcre is bundled with openCollada
|
||||
#set(PCRE ${LIBDIR}/pcre)
|
||||
#set(PCRE_LIBPATH ${PCRE}/lib)
|
||||
@@ -984,7 +996,7 @@ endif()
|
||||
# Common.
|
||||
|
||||
if(APPLE OR WIN32)
|
||||
if(NOT IS_DIRECTORY "${LIBDIR}")
|
||||
if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
endif()
|
||||
@@ -1007,13 +1019,9 @@ endif()
|
||||
|
||||
if(WITH_IMAGE_OPENJPEG)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(OPENJPEG /usr)
|
||||
set(OPENJPEG_INC ${OPENJPEG}/include)
|
||||
set(OPENJPEG_LIB openjpeg)
|
||||
set(OPENJPEG_LIBPATH ${OPENJPEG}/lib)
|
||||
# dealt with above
|
||||
else()
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1183,3 +1191,83 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# CPack for generating packages
|
||||
include(build_files/cmake/packaging.cmake)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Print Final Configuration
|
||||
|
||||
if(FIRST_RUN)
|
||||
set(_config_msg "\n* Blender Configuration *")
|
||||
macro(info_cfg_option
|
||||
_setting)
|
||||
set(_msg " * ${_setting}")
|
||||
string(LENGTH "${_msg}" _len)
|
||||
while("28" GREATER "${_len}")
|
||||
set(_msg "${_msg} ")
|
||||
math(EXPR _len "${_len} + 1")
|
||||
endwhile()
|
||||
|
||||
set(_config_msg "${_config_msg}\n${_msg}${${_setting}}")
|
||||
endmacro()
|
||||
|
||||
macro(info_cfg_text
|
||||
_text)
|
||||
set(_config_msg "${_config_msg}\n\n ${_text}")
|
||||
|
||||
|
||||
endmacro()
|
||||
|
||||
info_cfg_text("Build Options:")
|
||||
info_cfg_option(WITH_GAMEENGINE)
|
||||
info_cfg_option(WITH_PLAYER)
|
||||
info_cfg_option(WITH_BULLET)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
info_cfg_option(WITH_OPENCOLLADA)
|
||||
info_cfg_option(WITH_FFTW3)
|
||||
info_cfg_option(WITH_INTERNATIONAL)
|
||||
|
||||
info_cfg_text("Compiler Options:")
|
||||
info_cfg_option(WITH_BUILDINFO)
|
||||
info_cfg_option(WITH_OPENMP)
|
||||
info_cfg_option(WITH_RAYOPTIMIZATION)
|
||||
|
||||
info_cfg_text("System Options:")
|
||||
info_cfg_option(WITH_INSTALL_PORTABLE)
|
||||
info_cfg_option(WITH_X11_XINPUT)
|
||||
info_cfg_option(WITH_BUILTIN_GLEW)
|
||||
|
||||
info_cfg_text("Image Formats:")
|
||||
info_cfg_option(WITH_IMAGE_CINEON)
|
||||
info_cfg_option(WITH_IMAGE_DDS)
|
||||
info_cfg_option(WITH_IMAGE_HDR)
|
||||
info_cfg_option(WITH_IMAGE_OPENEXR)
|
||||
info_cfg_option(WITH_IMAGE_OPENJPEG)
|
||||
info_cfg_option(WITH_IMAGE_REDCODE)
|
||||
info_cfg_option(WITH_IMAGE_TIFF)
|
||||
|
||||
info_cfg_text("Audio:")
|
||||
info_cfg_option(WITH_OPENAL)
|
||||
info_cfg_option(WITH_SDL)
|
||||
info_cfg_option(WITH_JACK)
|
||||
info_cfg_option(WITH_CODEC_FFMPEG)
|
||||
info_cfg_option(WITH_CODEC_SNDFILE)
|
||||
info_cfg_option(WITH_SAMPLERATE)
|
||||
|
||||
info_cfg_text("Compression:")
|
||||
info_cfg_option(WITH_LZMA)
|
||||
info_cfg_option(WITH_LZO)
|
||||
|
||||
info_cfg_text("Python:")
|
||||
info_cfg_option(WITH_PYTHON_INSTALL)
|
||||
info_cfg_option(WITH_PYTHON_MODULE)
|
||||
info_cfg_option(WITH_PYTHON_SAFETY)
|
||||
|
||||
info_cfg_text("Modifiers:")
|
||||
info_cfg_option(WITH_MOD_BOOLEAN)
|
||||
info_cfg_option(WITH_MOD_DECIMATE)
|
||||
info_cfg_option(WITH_MOD_FLUID)
|
||||
|
||||
info_cfg_text("")
|
||||
|
||||
message("${_config_msg}")
|
||||
endif()
|
||||
|
@@ -306,6 +306,11 @@ if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
# TODO, make optional
|
||||
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
|
||||
env['CXXFLAGS'].append('-DWITH_AUDASPACE')
|
||||
env['CCFLAGS'].append('-DWITH_AUDASPACE')
|
||||
|
||||
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
|
||||
B.root_build_dir = env['BF_BUILDDIR']
|
||||
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
|
||||
|
@@ -74,6 +74,7 @@ def svn_step(branch=''):
|
||||
else:
|
||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
||||
|
||||
|
||||
def lib_svn_step(dir):
|
||||
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
||||
|
||||
|
@@ -64,6 +64,7 @@ def get_platform(filename):
|
||||
|
||||
return '-'.join(platform_tokens)
|
||||
|
||||
|
||||
def get_branch(filename):
|
||||
tokens = filename.split("-")
|
||||
branch = ""
|
||||
|
@@ -36,7 +36,7 @@ builder = sys.argv[1]
|
||||
branch = ''
|
||||
|
||||
if len(sys.argv) >= 3:
|
||||
branch = sys.argv[2]
|
||||
branch = sys.argv[2]
|
||||
|
||||
# scons does own packaging
|
||||
if builder.find('scons') != -1:
|
||||
|
@@ -1,89 +0,0 @@
|
||||
# - Find python libraries
|
||||
#
|
||||
# PYTHON_VERSION
|
||||
# PYTHON_INCLUDE_DIRS
|
||||
# PYTHON_LIBRARY
|
||||
# PYTHON_LIBPATH
|
||||
# PYTHON_LINKFLAGS
|
||||
|
||||
#=============================================================================
|
||||
|
||||
set(PYTHON_VERSION 3.2 CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_VERSION)
|
||||
|
||||
set(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
mark_as_advanced(PYTHON_LINKFLAGS)
|
||||
|
||||
set(_Python_ABI_FLAGS
|
||||
"m;mu;u; ")
|
||||
|
||||
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||
|
||||
set(_Python_PATHS
|
||||
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
"/usr"
|
||||
"/usr/local"
|
||||
)
|
||||
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIRS OR
|
||||
NOT DEFINED PYTHON_LIBRARY OR
|
||||
NOT DEFINED PYTHON_LIBPATH)
|
||||
|
||||
message(STATUS "Looking for include Python.h")
|
||||
set(_Found_PYTHON_H OFF)
|
||||
|
||||
foreach(_CURRENT_PATH ${_Python_PATHS})
|
||||
foreach(_CURRENT_ABI_FLAGS ${_Python_ABI_FLAGS})
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
|
||||
endif()
|
||||
string(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
|
||||
|
||||
set(_Python_HEADER "${_CURRENT_PATH}/include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}/Python.h")
|
||||
|
||||
if(EXISTS ${_Python_HEADER})
|
||||
message(STATUS "Checking for header: ${_Python_HEADER} - found")
|
||||
set(_Found_PYTHON_H ON)
|
||||
set(PYTHON ${_CURRENT_PATH})
|
||||
set(PYTHON_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
|
||||
break()
|
||||
else()
|
||||
message(STATUS "Checking for header: ${_Python_HEADER}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_Found_PYTHON_H)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT _Found_PYTHON_H)
|
||||
message(FATAL_ERROR "Python.h not found")
|
||||
endif()
|
||||
|
||||
unset(_Found_PYTHON_H)
|
||||
unset(_Python_HEADER)
|
||||
unset(_CURRENT_ABI_FLAGS)
|
||||
unset(_CURRENT_PATH)
|
||||
|
||||
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_INCLUDE_DIRS)
|
||||
set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBRARY)
|
||||
set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
|
||||
mark_as_advanced(PYTHON_LIBPATH)
|
||||
# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
endif()
|
||||
|
||||
unset(_Python_ABI_FLAGS)
|
||||
unset(_Python_PATHS)
|
||||
|
||||
#=============================================================================
|
||||
# now the python versions are found
|
||||
|
||||
|
||||
if(NOT EXISTS "${PYTHON_INCLUDE_DIRS}/Python.h")
|
||||
message(FATAL_ERROR " Missing python header: ${PYTHON_INCLUDE_DIRS}/Python.h")
|
||||
endif()
|
70
build_files/cmake/Modules/FindFftw3.cmake
Normal file
70
build_files/cmake/Modules/FindFftw3.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Find Fftw3 library
|
||||
# Find the native Fftw3 includes and library
|
||||
# This module defines
|
||||
# FFTW3_INCLUDE_DIRS, where to find fftw3.h, Set when
|
||||
# FFTW3_INCLUDE_DIR is found.
|
||||
# FFTW3_LIBRARIES, libraries to link against to use Fftw3.
|
||||
# FFTW3_ROOT_DIR, The base directory to search for Fftw3.
|
||||
# This can also be an environment variable.
|
||||
# FFTW3_FOUND, If false, do not try to use Fftw3.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# FFTW3_LIBRARY, where to find the Fftw3 library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If FFTW3_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT FFTW3_ROOT_DIR AND NOT $ENV{FFTW3_ROOT_DIR} STREQUAL "")
|
||||
SET(FFTW3_ROOT_DIR $ENV{FFTW3_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_fftw3_SEARCH_DIRS
|
||||
${FFTW3_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(FFTW3_INCLUDE_DIR
|
||||
NAMES
|
||||
fftw3.h
|
||||
HINTS
|
||||
${_fftw3_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(FFTW3_LIBRARY
|
||||
NAMES
|
||||
fftw3
|
||||
HINTS
|
||||
${_fftw3_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG
|
||||
FFTW3_LIBRARY FFTW3_INCLUDE_DIR)
|
||||
|
||||
IF(FFTW3_FOUND)
|
||||
SET(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
|
||||
SET(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
|
||||
ENDIF(FFTW3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
FFTW3_INCLUDE_DIR
|
||||
FFTW3_LIBRARY
|
||||
)
|
70
build_files/cmake/Modules/FindJack.cmake
Normal file
70
build_files/cmake/Modules/FindJack.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Find Jack library
|
||||
# Find the native Jack includes and library
|
||||
# This module defines
|
||||
# JACK_INCLUDE_DIRS, where to find jack.h, Set when
|
||||
# JACK_INCLUDE_DIR is found.
|
||||
# JACK_LIBRARIES, libraries to link against to use Jack.
|
||||
# JACK_ROOT_DIR, The base directory to search for Jack.
|
||||
# This can also be an environment variable.
|
||||
# JACK_FOUND, If false, do not try to use Jack.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# JACK_LIBRARY, where to find the Jack library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If JACK_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT JACK_ROOT_DIR AND NOT $ENV{JACK_ROOT_DIR} STREQUAL "")
|
||||
SET(JACK_ROOT_DIR $ENV{JACK_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_jack_SEARCH_DIRS
|
||||
${JACK_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(JACK_INCLUDE_DIR
|
||||
NAMES
|
||||
jack.h
|
||||
HINTS
|
||||
${_jack_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/jack
|
||||
)
|
||||
|
||||
FIND_LIBRARY(JACK_LIBRARY
|
||||
NAMES
|
||||
jack
|
||||
HINTS
|
||||
${_jack_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG
|
||||
JACK_LIBRARY JACK_INCLUDE_DIR)
|
||||
|
||||
IF(JACK_FOUND)
|
||||
SET(JACK_LIBRARIES ${JACK_LIBRARY})
|
||||
SET(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
|
||||
ENDIF(JACK_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JACK_INCLUDE_DIR
|
||||
JACK_LIBRARY
|
||||
)
|
70
build_files/cmake/Modules/FindJeMalloc.cmake
Normal file
70
build_files/cmake/Modules/FindJeMalloc.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Find JeMalloc library
|
||||
# Find the native JeMalloc includes and library
|
||||
# This module defines
|
||||
# JEMALLOC_INCLUDE_DIRS, where to find jemalloc.h, Set when
|
||||
# JEMALLOC_INCLUDE_DIR is found.
|
||||
# JEMALLOC_LIBRARIES, libraries to link against to use JeMalloc.
|
||||
# JEMALLOC_ROOT_DIR, The base directory to search for JeMalloc.
|
||||
# This can also be an environment variable.
|
||||
# JEMALLOC_FOUND, If false, do not try to use JeMalloc.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# JEMALLOC_LIBRARY, where to find the JeMalloc library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If JEMALLOC_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "")
|
||||
SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_jemalloc_SEARCH_DIRS
|
||||
${JEMALLOC_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(JEMALLOC_INCLUDE_DIR
|
||||
NAMES
|
||||
jemalloc.h
|
||||
HINTS
|
||||
${_jemalloc_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/jemalloc
|
||||
)
|
||||
|
||||
FIND_LIBRARY(JEMALLOC_LIBRARY
|
||||
NAMES
|
||||
jemalloc
|
||||
HINTS
|
||||
${_jemalloc_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
|
||||
JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
|
||||
|
||||
IF(JEMALLOC_FOUND)
|
||||
SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
|
||||
SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
|
||||
ENDIF(JEMALLOC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JEMALLOC_INCLUDE_DIR
|
||||
JEMALLOC_LIBRARY
|
||||
)
|
@@ -19,7 +19,7 @@
|
||||
# OPENEXR_LIBRARY, where to find the OpenEXR library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2002-2009 Kitware, Inc.
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
@@ -28,8 +28,6 @@
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# If OPENEXR_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "")
|
||||
@@ -52,7 +50,9 @@ SET(_openexr_SEARCH_DIRS
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(OPENEXR_INCLUDE_DIR ImfXdr.h
|
||||
FIND_PATH(OPENEXR_INCLUDE_DIR
|
||||
NAMES
|
||||
ImfXdr.h
|
||||
HINTS
|
||||
${_openexr_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
@@ -63,10 +63,14 @@ SET(_openexr_LIBRARIES)
|
||||
FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
|
||||
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY NAMES ${COMPONENT}
|
||||
HINTS ${_openexr_SEARCH_DIRS}
|
||||
PATH_SUFFIXES lib64 lib
|
||||
)
|
||||
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${COMPONENT}
|
||||
HINTS
|
||||
${_openexr_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
LIST(APPEND _openexr_LIBRARIES "${OPENEXR_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
@@ -79,7 +83,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG
|
||||
IF(OPENEXR_FOUND)
|
||||
SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES})
|
||||
SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR})
|
||||
ENDIF(OPENEXR_FOUND)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR)
|
||||
FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
|
||||
|
70
build_files/cmake/Modules/FindOpenJPEG.cmake
Normal file
70
build_files/cmake/Modules/FindOpenJPEG.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Find OpenJPEG library
|
||||
# Find the native OpenJPEG includes and library
|
||||
# This module defines
|
||||
# OPENJPEG_INCLUDE_DIRS, where to find openjpeg.h, Set when
|
||||
# OPENJPEG_INCLUDE_DIR is found.
|
||||
# OPENJPEG_LIBRARIES, libraries to link against to use OpenJPEG.
|
||||
# OPENJPEG_ROOT_DIR, The base directory to search for OpenJPEG.
|
||||
# This can also be an environment variable.
|
||||
# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If OPENJPEG_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENJPEG_ROOT_DIR AND NOT $ENV{OPENJPEG_ROOT_DIR} STREQUAL "")
|
||||
SET(OPENJPEG_ROOT_DIR $ENV{OPENJPEG_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_openjpeg_SEARCH_DIRS
|
||||
${OPENJPEG_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(OPENJPEG_INCLUDE_DIR
|
||||
NAMES
|
||||
openjpeg.h
|
||||
HINTS
|
||||
${_openjpeg_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENJPEG_LIBRARY
|
||||
NAMES
|
||||
openjpeg
|
||||
HINTS
|
||||
${_openjpeg_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG
|
||||
OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR)
|
||||
|
||||
IF(OPENJPEG_FOUND)
|
||||
SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
|
||||
SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
|
||||
ENDIF(OPENJPEG_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENJPEG_INCLUDE_DIR
|
||||
OPENJPEG_LIBRARY
|
||||
)
|
121
build_files/cmake/Modules/FindPythonLibsUnix.cmake
Normal file
121
build_files/cmake/Modules/FindPythonLibsUnix.cmake
Normal file
@@ -0,0 +1,121 @@
|
||||
# - Find Python libraries
|
||||
# Find the native Python includes and library
|
||||
#
|
||||
# Note:, This is not _yet_ intended to be a general python module for other
|
||||
# projects to use since its hard coded to python 3.2 as blender only supports
|
||||
# a single python version.
|
||||
# This is for blender/unix python only.
|
||||
#
|
||||
# This module defines
|
||||
# PYTHON_VERSION
|
||||
# PYTHON_INCLUDE_DIRS
|
||||
# PYTHON_LIBRARIES
|
||||
# PYTHON_LIBPATH, Used for installation
|
||||
# PYTHON_LINKFLAGS
|
||||
# PYTHON_ROOT_DIR, The base directory to search for Python.
|
||||
# This can also be an environment variable.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# PYTHON_LIBRARY, where to find the python library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If PYTHON_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
|
||||
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
IF(DEFINED PYTHON_VERSION)
|
||||
SET(PYTHON_VERSION "${PYTHON_VERSION}" CACHE STRING "")
|
||||
ELSE()
|
||||
SET(PYTHON_VERSION 3.2 CACHE STRING "")
|
||||
ENDIF()
|
||||
MARK_AS_ADVANCED(PYTHON_VERSION)
|
||||
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
||||
|
||||
SET(_python_ABI_FLAGS
|
||||
"m;mu;u; " # release
|
||||
"md;mud;ud;d" # debug
|
||||
)
|
||||
|
||||
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||
|
||||
SET(_python_SEARCH_DIRS
|
||||
${PYTHON_ROOT_DIR}
|
||||
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
|
||||
)
|
||||
|
||||
FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
|
||||
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
# SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
|
||||
#ENDIF()
|
||||
STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
|
||||
|
||||
FIND_PATH(PYTHON_INCLUDE_DIR
|
||||
NAMES
|
||||
Python.h
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(PYTHON_LIBRARY
|
||||
NAMES
|
||||
"python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
|
||||
break()
|
||||
ELSE()
|
||||
# ensure we dont find values from 2 different ABI versions
|
||||
UNSET(PYTHON_INCLUDE_DIR CACHE)
|
||||
UNSET(PYTHON_LIBRARY CACHE)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
UNSET(_CURRENT_ABI_FLAGS)
|
||||
UNSET(_CURRENT_PATH)
|
||||
|
||||
UNSET(_python_ABI_FLAGS)
|
||||
UNSET(_python_SEARCH_DIRS)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix DEFAULT_MSG
|
||||
PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF(PYTHONLIBSUNIX_FOUND)
|
||||
# Assign cache items
|
||||
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
|
||||
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
|
||||
|
||||
# we need this for installation
|
||||
GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
|
||||
|
||||
# not used
|
||||
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
PYTHON_INCLUDE_DIR
|
||||
PYTHON_LIBRARY
|
||||
)
|
||||
ENDIF()
|
70
build_files/cmake/Modules/FindSamplerate.cmake
Normal file
70
build_files/cmake/Modules/FindSamplerate.cmake
Normal file
@@ -0,0 +1,70 @@
|
||||
# - Find Samplerate library
|
||||
# Find the native Samplerate includes and library
|
||||
# This module defines
|
||||
# SAMPLERATE_INCLUDE_DIRS, where to find samplerate.h, Set when
|
||||
# SAMPLERATE_INCLUDE_DIR is found.
|
||||
# SAMPLERATE_LIBRARIES, libraries to link against to use Samplerate.
|
||||
# SAMPLERATE_ROOT_DIR, The base directory to search for Samplerate.
|
||||
# This can also be an environment variable.
|
||||
# SAMPLERATE_FOUND, If false, do not try to use Samplerate.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# SAMPLERATE_LIBRARY, where to find the Samplerate library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If SAMPLERATE_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT SAMPLERATE_ROOT_DIR AND NOT $ENV{SAMPLERATE_ROOT_DIR} STREQUAL "")
|
||||
SET(SAMPLERATE_ROOT_DIR $ENV{SAMPLERATE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_samplerate_SEARCH_DIRS
|
||||
${SAMPLERATE_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(SAMPLERATE_INCLUDE_DIR
|
||||
NAMES
|
||||
samplerate.h
|
||||
HINTS
|
||||
${_samplerate_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SAMPLERATE_LIBRARY
|
||||
NAMES
|
||||
samplerate
|
||||
HINTS
|
||||
${_samplerate_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Samplerate DEFAULT_MSG
|
||||
SAMPLERATE_LIBRARY SAMPLERATE_INCLUDE_DIR)
|
||||
|
||||
IF(SAMPLERATE_FOUND)
|
||||
SET(SAMPLERATE_LIBRARIES ${SAMPLERATE_LIBRARY})
|
||||
SET(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE_INCLUDE_DIR})
|
||||
ENDIF(SAMPLERATE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SAMPLERATE_INCLUDE_DIR
|
||||
SAMPLERATE_LIBRARY
|
||||
)
|
68
build_files/cmake/Modules/FindSndFile.cmake
Normal file
68
build_files/cmake/Modules/FindSndFile.cmake
Normal file
@@ -0,0 +1,68 @@
|
||||
# - Find SndFile library
|
||||
# Find the native SndFile includes and library
|
||||
# This module defines
|
||||
# SNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
|
||||
# SNDFILE_INCLUDE_DIR is found.
|
||||
# SNDFILE_LIBRARIES, libraries to link against to use SndFile.
|
||||
# SNDFILE_ROOT_DIR, The base directory to search for SndFile.
|
||||
# This can also be an environment variable.
|
||||
# SNDFILE_FOUND, If false, do not try to use SndFile.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# SNDFILE_LIBRARY, where to find the SndFile library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2011 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If SNDFILE_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT SNDFILE_ROOT_DIR AND NOT $ENV{SNDFILE_ROOT_DIR} STREQUAL "")
|
||||
SET(SNDFILE_ROOT_DIR $ENV{SNDFILE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_sndfile_SEARCH_DIRS
|
||||
${SNDFILE_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h
|
||||
HINTS
|
||||
${_sndfile_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SNDFILE_LIBRARY
|
||||
NAMES
|
||||
sndfile
|
||||
HINTS
|
||||
${_sndfile_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
|
||||
SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
|
||||
|
||||
IF(SNDFILE_FOUND)
|
||||
SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
|
||||
SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
|
||||
ENDIF(SNDFILE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SNDFILE_INCLUDE_DIR
|
||||
SNDFILE_LIBRARY
|
||||
)
|
@@ -23,28 +23,16 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
IGNORE = (
|
||||
"/test/",
|
||||
"/decimate_glut_test/",
|
||||
"/BSP_GhostTest/",
|
||||
"/release/",
|
||||
"/xembed/",
|
||||
"/decimation/intern/future/",
|
||||
"/TerraplayNetwork/",
|
||||
"/ik_glut_test/",
|
||||
)
|
||||
from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
|
||||
|
||||
import os
|
||||
from os.path import join, dirname, normpath, abspath, splitext
|
||||
|
||||
base = join(os.path.dirname(__file__), "..", "..")
|
||||
base = normpath(base)
|
||||
base = abspath(base)
|
||||
|
||||
print("Scanning:", base)
|
||||
print("Scanning:", SOURCE_DIR)
|
||||
|
||||
global_h = set()
|
||||
global_c = set()
|
||||
global_refs = {}
|
||||
|
||||
|
||||
def source_list(path, filename_check=None):
|
||||
@@ -147,11 +135,17 @@ def cmake_get_src(f):
|
||||
|
||||
if is_c_header(new_file):
|
||||
sources_h.append(new_file)
|
||||
global_refs.setdefault(new_file, []).append((f, i))
|
||||
elif is_c(new_file):
|
||||
sources_c.append(new_file)
|
||||
global_refs.setdefault(new_file, []).append((f, i))
|
||||
elif l in ("PARENT_SCOPE", ):
|
||||
# cmake var, ignore
|
||||
pass
|
||||
elif new_file.endswith(".list"):
|
||||
pass
|
||||
elif new_file.endswith(".def"):
|
||||
pass
|
||||
else:
|
||||
raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
|
||||
|
||||
@@ -176,7 +170,7 @@ def cmake_get_src(f):
|
||||
filen.close()
|
||||
|
||||
|
||||
for cmake in source_list(base, is_cmake):
|
||||
for cmake in source_list(SOURCE_DIR, is_cmake):
|
||||
cmake_get_src(cmake)
|
||||
|
||||
|
||||
@@ -186,39 +180,75 @@ def is_ignore(f):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
# First do stupid check, do these files exist?
|
||||
print("\nChecking for missing references:")
|
||||
import sys
|
||||
is_err = False
|
||||
errs = []
|
||||
for f in (global_h | global_c):
|
||||
if f.endswith("dna.c"):
|
||||
continue
|
||||
|
||||
if not os.path.exists(f):
|
||||
raise Exception("CMake referenced file missing: " + f)
|
||||
refs = global_refs[f]
|
||||
if refs:
|
||||
for cf, i in refs:
|
||||
errs.append((cf, i))
|
||||
else:
|
||||
raise Exception("CMake referenecs missing, internal error, aborting!")
|
||||
is_err = True
|
||||
|
||||
errs.sort()
|
||||
errs.reverse()
|
||||
for cf, i in errs:
|
||||
print("%s:%d" % (cf, i))
|
||||
# Write a 'sed' script, useful if we get a lot of these
|
||||
# print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
|
||||
|
||||
|
||||
if is_err:
|
||||
raise Exception("CMake referenecs missing files, aborting!")
|
||||
del is_err
|
||||
del errs
|
||||
|
||||
# now check on files not accounted for.
|
||||
print("\nC/C++ Files CMake doesnt know about...")
|
||||
for cf in sorted(source_list(base, is_c)):
|
||||
for cf in sorted(source_list(SOURCE_DIR, is_c)):
|
||||
if not is_ignore(cf):
|
||||
if cf not in global_c:
|
||||
print("missing_c: ", cf)
|
||||
|
||||
# check if automake builds a corrasponding .o file.
|
||||
'''
|
||||
if cf in global_c:
|
||||
out1 = os.path.splitext(cf)[0] + ".o"
|
||||
out2 = os.path.splitext(cf)[0] + ".Po"
|
||||
out2_dir, out2_file = out2 = os.path.split(out2)
|
||||
out2 = os.path.join(out2_dir, ".deps", out2_file)
|
||||
if not os.path.exists(out1) and not os.path.exists(out2):
|
||||
print("bad_c: ", cf)
|
||||
'''
|
||||
|
||||
print("\nC/C++ Headers CMake doesnt know about...")
|
||||
for hf in sorted(source_list(base, is_c_header)):
|
||||
for hf in sorted(source_list(SOURCE_DIR, is_c_header)):
|
||||
if not is_ignore(hf):
|
||||
if hf not in global_h:
|
||||
print("missing_h: ", hf)
|
||||
|
||||
# test encoding
|
||||
import traceback
|
||||
for files in (global_c, global_h):
|
||||
for f in sorted(files):
|
||||
if os.path.exists(f):
|
||||
# ignore outside of our source tree
|
||||
if "extern" not in f:
|
||||
i = 1
|
||||
try:
|
||||
for l in open(f, "r", encoding="utf8"):
|
||||
i += 1
|
||||
except:
|
||||
print("Non utf8: %s:%d" % (f, i))
|
||||
if i > 1:
|
||||
traceback.print_exc()
|
||||
if UTF8_CHECK:
|
||||
# test encoding
|
||||
import traceback
|
||||
for files in (global_c, global_h):
|
||||
for f in sorted(files):
|
||||
if os.path.exists(f):
|
||||
# ignore outside of our source tree
|
||||
if "extern" not in f:
|
||||
i = 1
|
||||
try:
|
||||
for l in open(f, "r", encoding="utf8"):
|
||||
i += 1
|
||||
except:
|
||||
print("Non utf8: %s:%d" % (f, i))
|
||||
if i > 1:
|
||||
traceback.print_exc()
|
||||
|
48
build_files/cmake/cmake_consistency_check_config.py
Normal file
48
build_files/cmake/cmake_consistency_check_config.py
Normal file
@@ -0,0 +1,48 @@
|
||||
import os
|
||||
|
||||
IGNORE = (
|
||||
"/test/",
|
||||
"/decimate_glut_test/",
|
||||
"/BSP_GhostTest/",
|
||||
"/release/",
|
||||
"/xembed/",
|
||||
"/decimation/intern/future/",
|
||||
"/TerraplayNetwork/",
|
||||
"/ik_glut_test/",
|
||||
|
||||
# specific source files
|
||||
"extern/Eigen2/Eigen/src/Cholesky/CholeskyInstantiations.cpp",
|
||||
"extern/Eigen2/Eigen/src/Core/CoreInstantiations.cpp",
|
||||
"extern/Eigen2/Eigen/src/QR/QrInstantiations.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp",
|
||||
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp",
|
||||
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
|
||||
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
|
||||
"extern/eltopo/common/meshes/ObjLoader.cpp",
|
||||
"extern/eltopo/common/meshes/meshloader.cpp",
|
||||
"extern/eltopo/common/openglutils.cpp",
|
||||
"extern/eltopo/eltopo3d/broadphase_blenderbvh.cpp",
|
||||
"source/blender/imbuf/intern/imbuf_cocoa.m",
|
||||
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h",
|
||||
"extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h",
|
||||
"extern/bullet2/src/BulletCollision/CollisionShapes/btConvex2dShape.h",
|
||||
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.h",
|
||||
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h",
|
||||
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h",
|
||||
"extern/eltopo/common/meshes/Edge.hpp",
|
||||
"extern/eltopo/common/meshes/ObjLoader.hpp",
|
||||
"extern/eltopo/common/meshes/TriangleIndex.hpp",
|
||||
"extern/eltopo/common/meshes/meshloader.h",
|
||||
"extern/eltopo/eltopo3d/broadphase_blenderbvh.h"
|
||||
)
|
||||
|
||||
UTF8_CHECK = True
|
||||
|
||||
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))))
|
@@ -1,6 +1,59 @@
|
||||
# -*- mode: cmake; indent-tabs-mode: t; -*-
|
||||
# $Id$
|
||||
|
||||
|
||||
# foo_bar.spam --> foo_barMySuffix.spam
|
||||
macro(file_suffix
|
||||
file_name_new file_name file_suffix
|
||||
)
|
||||
|
||||
get_filename_component(_file_name_PATH ${file_name} PATH)
|
||||
get_filename_component(_file_name_NAME_WE ${file_name} NAME_WE)
|
||||
get_filename_component(_file_name_EXT ${file_name} EXT)
|
||||
set(${file_name_new} "${_file_name_PATH}/${_file_name_NAME_WE}${file_suffix}${_file_name_EXT}")
|
||||
|
||||
unset(_file_name_PATH)
|
||||
unset(_file_name_NAME_WE)
|
||||
unset(_file_name_EXT)
|
||||
endmacro()
|
||||
|
||||
# usefil for adding debug suffix to library lists:
|
||||
# /somepath/foo.lib --> /somepath/foo_d.lib
|
||||
macro(file_list_suffix
|
||||
fp_list_new fp_list fn_suffix
|
||||
)
|
||||
|
||||
# incase of empty list
|
||||
set(_fp)
|
||||
set(_fp_suffixed)
|
||||
|
||||
set(fp_list_new)
|
||||
|
||||
foreach(_fp ${fp_list})
|
||||
file_suffix(_fp_suffixed "${_fp}" "${fn_suffix}")
|
||||
list(APPEND "${fp_list_new}" "${_fp_suffixed}")
|
||||
endforeach()
|
||||
|
||||
unset(_fp)
|
||||
unset(_fp_suffixed)
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(target_link_libraries_optimized TARGET LIBS)
|
||||
foreach(_LIB ${LIBS})
|
||||
target_link_libraries(${TARGET} optimized "${_LIB}")
|
||||
endforeach()
|
||||
unset(_LIB)
|
||||
endmacro()
|
||||
|
||||
macro(target_link_libraries_debug TARGET LIBS)
|
||||
foreach(_LIB ${LIBS})
|
||||
target_link_libraries(${TARGET} debug "${_LIB}")
|
||||
endforeach()
|
||||
unset(_LIB)
|
||||
endmacro()
|
||||
|
||||
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
|
||||
# use it instead of include_directories()
|
||||
macro(blender_include_dirs
|
||||
@@ -37,7 +90,7 @@ macro(blender_source_group
|
||||
|
||||
foreach(_SRC ${sources})
|
||||
get_filename_component(_SRC_EXT ${_SRC} EXT)
|
||||
if(${_SRC_EXT} MATCHES ".h" OR ${_SRC_EXT} MATCHES ".hpp")
|
||||
if((${_SRC_EXT} MATCHES ".h") OR (${_SRC_EXT} MATCHES ".hpp"))
|
||||
source_group("Header Files" FILES ${_SRC})
|
||||
else()
|
||||
source_group("Source Files" FILES ${_SRC})
|
||||
@@ -127,7 +180,7 @@ macro(SETUP_LIBDIRS)
|
||||
link_directories(${SNDFILE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_SAMPLERATE)
|
||||
link_directories(${LIBSAMPLERATE_LIBPATH})
|
||||
link_directories(${SAMPLERATE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_FFTW3)
|
||||
link_directories(${FFTW3_LIBPATH})
|
||||
@@ -163,11 +216,12 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${PYTHON_LINKFLAGS})
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
target_link_libraries(${target}
|
||||
debug ${PYTHON_LIBRARY}_d
|
||||
optimized ${PYTHON_LIBRARY})
|
||||
file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
|
||||
target_link_libraries_debug(${target} "${PYTHON_LIBRARIES_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${PYTHON_LIBRARIES}")
|
||||
unset(PYTHON_LIBRARIES_DEBUG)
|
||||
else()
|
||||
target_link_libraries(${target} ${PYTHON_LIBRARY})
|
||||
target_link_libraries(${target} ${PYTHON_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -186,7 +240,7 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${GETTEXT_LIB})
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
target_link_libraries(${target} ${ICONV_LIB})
|
||||
target_link_libraries(${target} ${ICONV_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -194,74 +248,72 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
if(WITH_FFTW3)
|
||||
target_link_libraries(${target} ${FFTW3_LIB})
|
||||
target_link_libraries(${target} ${FFTW3_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_JACK)
|
||||
target_link_libraries(${target} ${JACK_LIB})
|
||||
target_link_libraries(${target} ${JACK_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
target_link_libraries(${target} ${SNDFILE_LIB})
|
||||
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SAMPLERATE)
|
||||
target_link_libraries(${target} ${LIBSAMPLERATE_LIB})
|
||||
target_link_libraries(${target} ${SAMPLERATE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SDL)
|
||||
target_link_libraries(${target} ${SDL_LIBRARY})
|
||||
endif()
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
target_link_libraries(${target} ${QUICKTIME_LIB})
|
||||
target_link_libraries(${target} ${QUICKTIME_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_IMAGE_TIFF)
|
||||
target_link_libraries(${target} ${TIFF_LIBRARY})
|
||||
endif()
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
if(WIN32 AND NOT UNIX)
|
||||
foreach(_LOOP_VAR ${OPENEXR_LIBRARIES})
|
||||
string(REGEX REPLACE ".lib$" "_d.lib" _LOOP_VAR_DEBUG ${_LOOP_VAR})
|
||||
target_link_libraries(${target}
|
||||
debug ${_LOOP_VAR_DEBUG}
|
||||
optimized ${_LOOP_VAR})
|
||||
endforeach()
|
||||
unset(_LOOP_VAR)
|
||||
unset(_LOOP_VAR_DEBUG)
|
||||
file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
|
||||
target_link_libraries_debug(${target} "${OPENEXR_LIBRARIES_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${OPENEXR_LIBRARIES}")
|
||||
unset(OPENEXR_LIBRARIES_DEBUG)
|
||||
else()
|
||||
target_link_libraries(${target} ${OPENEXR_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
|
||||
target_link_libraries(${target} ${OPENJPEG_LIB})
|
||||
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
target_link_libraries(${target} ${FFMPEG_LIB})
|
||||
target_link_libraries(${target} ${FFMPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENCOLLADA)
|
||||
if(WIN32 AND NOT UNIX)
|
||||
foreach(_LOOP_VAR ${OPENCOLLADA_LIB})
|
||||
target_link_libraries(${target}
|
||||
debug ${_LOOP_VAR}_d
|
||||
optimized ${_LOOP_VAR})
|
||||
endforeach()
|
||||
unset(_LOOP_VAR)
|
||||
target_link_libraries(${target}
|
||||
debug ${PCRE_LIB}_d
|
||||
optimized ${PCRE_LIB})
|
||||
file_list_suffix(OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d")
|
||||
target_link_libraries_debug(${target} "${OPENCOLLADA_LIBRARIES_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${OPENCOLLADA_LIBRARIES}")
|
||||
unset(OPENCOLLADA_LIBRARIES_DEBUG)
|
||||
|
||||
file_list_suffix(PCRE_LIB_DEBUG "${PCRE_LIB}" "_d")
|
||||
target_link_libraries_debug(${target} "${PCRE_LIB_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${PCRE_LIB}")
|
||||
unset(PCRE_LIB_DEBUG)
|
||||
|
||||
if(EXPAT_LIB)
|
||||
target_link_libraries(${target}
|
||||
debug ${EXPAT_LIB}_d
|
||||
optimized ${EXPAT_LIB})
|
||||
file_list_suffix(EXPAT_LIB_DEBUG "${EXPAT_LIB}" "_d")
|
||||
target_link_libraries_debug(${target} "${EXPAT_LIB_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${EXPAT_LIB}")
|
||||
unset(EXPAT_LIB_DEBUG)
|
||||
endif()
|
||||
else()
|
||||
target_link_libraries(${target}
|
||||
${OPENCOLLADA_LIB}
|
||||
${OPENCOLLADA_LIBRARIES}
|
||||
${PCRE_LIB}
|
||||
${EXPAT_LIB})
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
target_link_libraries(${target} ${JEMALLOC_LIBRARY})
|
||||
target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
|
||||
endif()
|
||||
if(WIN32 AND NOT UNIX)
|
||||
target_link_libraries(${target} ${PTHREADS_LIB})
|
||||
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
@@ -76,11 +76,6 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettextpo intl'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_FTGL = 'false'
|
||||
BF_FTGL = '#extern/bFTGL'
|
||||
BF_FTGL_INC = '${BF_FTGL}/include'
|
||||
BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE='false'
|
||||
|
||||
WITH_BF_BULLET = 'true'
|
||||
|
@@ -93,7 +93,7 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
#BF_GETTEXT_LIB_STATIC = '${BF_GETTEXT}/lib/libgettextlib.a'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
WITH_BF_PLAYER = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
|
@@ -99,7 +99,7 @@ BF_GETTEXT_LIB = 'gnu_gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
WITH_BF_PLAYER = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
@@ -170,7 +170,7 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
|
||||
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CCFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CXXFLAGS = ['-O2', '-DNDEBUG']
|
||||
@@ -181,7 +181,7 @@ CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE']
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"']
|
||||
|
||||
# # Todo
|
||||
# BF_PROFILE_CCFLAGS = ['-pg', '-g ']
|
||||
|
@@ -101,7 +101,7 @@ BF_GETTEXT_LIB = 'gettext'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
WITH_BF_PLAYER = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
@@ -172,7 +172,7 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od']
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CCFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CXXFLAGS = ['-O2', '-DNDEBUG']
|
||||
@@ -188,7 +188,7 @@ if BF_DEBUG:
|
||||
else:
|
||||
BF_NUMJOBS=6
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO']
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:"msvcrt.lib"', '/NODEFAULTLIB:"msvcmrt.lib"', '/NODEFAULTLIB:"msvcurt.lib"', '/NODEFAULTLIB:"msvcrtd.lib"']
|
||||
|
||||
BF_BUILDDIR = '..\\build\\blender25-win64-vc'
|
||||
BF_INSTALLDIR='..\\install\\blender25-win64-vc'
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENCE BLOCK *****
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENCE BLOCK *****
|
||||
|
||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = Blender
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.57"
|
||||
PROJECT_NUMBER = "V2.58"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
{%- macro relbar() %}
|
||||
<div class="subnav boxheader">
|
||||
<ul class="noprint"><li><a href="http://www.blender.org/development/coding-guides/">Coding Guides</a></li><li>•</li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li>•</li><li><a href="http://www.blender.org/development/submit-a-patch/">Submit a Patch</a></li><li>•</li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li>•</li><li><a href="http://www.blender.org/development/current-projects/">Current Projects</a></li><li>•</li><li><a href="http://www.blender.org/development/architecture/">Architecture</a></li><li>•</li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li>•</li><li class="subnav-active"><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">PyAPI</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Main_Page">Wiki</a></li></ul>
|
||||
<ul class="noprint"><li><a href="http://wiki.blender.org/index.php/Dev:Contents">Documentation</a></li><li>•</li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Process/Patches">Submit a Patch</a></li><li>•</li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li>•</li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Projects">Current Projects</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Source/Architecture">Architecture</a></li><li>•</li><li><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">Python API</a></li><li>•</li><li><a href="http://wiki.blender.org">Wiki</a></li></ul>
|
||||
</div>
|
||||
<div class="related subnav">
|
||||
<h3>{{ _('Navigation') }}</h3>
|
||||
|
21
doc/python_api/examples/aud.py
Normal file
21
doc/python_api/examples/aud.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Basic Sound Playback
|
||||
++++++++++++++++++++
|
||||
This script shows how to use the classes: :class:`Device`, :class:`Factory` and
|
||||
:class:`Handle`.
|
||||
"""
|
||||
import aud
|
||||
|
||||
device = aud.device()
|
||||
# load sound file (it can be a video file with audio)
|
||||
factory = aud.Factory('music.ogg')
|
||||
|
||||
# play the audio, this return a handle to control play/pause
|
||||
handle = device.play(sound)
|
||||
# if the audio is not too big and will be used often you can buffer it
|
||||
factory_buffered = aud.Factory.buffer(sound)
|
||||
handle_buffered = device.play(buffered)
|
||||
|
||||
# stop the sounds (otherwise they play until their ends)
|
||||
handle.stop()
|
||||
handle_buffered.stop()
|
21
doc/python_api/examples/bpy.props.4.py
Normal file
21
doc/python_api/examples/bpy.props.4.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Update Example
|
||||
++++++++++++++
|
||||
|
||||
It can be useful to perform an action when a property is changed and can be
|
||||
used to update other properties or synchronize with external data.
|
||||
|
||||
All properties define update functions except for CollectionProperty.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
||||
|
||||
def update_func(self, context):
|
||||
print("my test function", self)
|
||||
|
||||
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
|
||||
|
||||
bpy.context.scene.testprop = 11.0
|
||||
|
||||
# >>> my test function <bpy_struct, Scene("Scene")>
|
@@ -696,3 +696,216 @@ Renamed
|
||||
* **force** -> :class:`bpy.types.MaterialPhysics.fh_force`
|
||||
* **use_normal_align** -> :class:`bpy.types.MaterialPhysics.use_fh_normal`
|
||||
|
||||
|
||||
2.57 to 2.58
|
||||
============
|
||||
|
||||
bpy_extras
|
||||
----------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :mod:`bpy_extras`
|
||||
* :mod:`bpy_extras.view3d_utils`
|
||||
|
||||
Moved
|
||||
^^^^^
|
||||
|
||||
* io_utils -> :mod:`bpy_extras.io_utils`
|
||||
* image_utils -> :mod:`bpy_extras.image_utils`
|
||||
* mesh_utils -> :mod:`bpy_extras.mesh_utils`
|
||||
* object_utils -> :mod:`bpy_extras.object_utils`
|
||||
|
||||
bpy.types.RenderSettings
|
||||
------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RenderSettings.use_bake_lores_mesh`
|
||||
* :class:`bpy.types.RenderSettings.use_bake_multires`
|
||||
|
||||
bpy.types.Camera
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Camera.show_guide`
|
||||
|
||||
bpy.types.SpaceImageEditor
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceImageEditor.zoom`
|
||||
|
||||
bpy.types.SpaceView3D
|
||||
---------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceView3D.lock_camera`
|
||||
|
||||
bpy.types.RegionView3D
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RegionView3D.is_perspective`
|
||||
|
||||
bpy.types.Scene
|
||||
---------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Scene.frame_subframe`
|
||||
|
||||
bpy.types.Area
|
||||
--------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **active_space**
|
||||
|
||||
bpy.types.DisplaceModifier
|
||||
--------------------------
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **texture_coordinate_object** -> :class:`bpy.types.DisplaceModifier.texture_coords_object`
|
||||
|
||||
bpy.types.UserPreferencesView
|
||||
-----------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesView.use_camera_lock_parent`
|
||||
|
||||
bpy.types.DomainFluidSettings
|
||||
-----------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.DomainFluidSettings.fluid_mesh_vertices`
|
||||
* :class:`bpy.types.DomainFluidSettings.surface_noobs`
|
||||
|
||||
bpy.types.Sculpt
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Sculpt.use_deform_only`
|
||||
|
||||
bpy.types.ClothCollisionSettings
|
||||
--------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ClothCollisionSettings.distance_repel`
|
||||
* :class:`bpy.types.ClothCollisionSettings.repel_force`
|
||||
|
||||
bpy.types.UILayout
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UILayout.template_edit_mode_selection`
|
||||
|
||||
bpy.types.ToolSettings
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ToolSettings.use_snap_project_self`
|
||||
|
||||
bpy.types.Mesh
|
||||
--------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **edge_face_count**
|
||||
* **edge_face_count_dict**
|
||||
* **edge_loops_from_edges**
|
||||
* **edge_loops_from_faces**
|
||||
|
||||
bpy.types.PointDensity
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.PointDensity.falloff_curve`
|
||||
* :class:`bpy.types.PointDensity.falloff_speed_scale`
|
||||
* :class:`bpy.types.PointDensity.use_falloff_curve`
|
||||
|
||||
bpy.types.SpaceTextEditor
|
||||
-------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceTextEditor.use_match_case`
|
||||
|
||||
bpy.types.CameraActuator
|
||||
------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.CameraActuator.damping`
|
||||
|
||||
bpy.types.Property
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Property.is_skip_save`
|
||||
|
||||
bpy.types.UserPreferencesSystem
|
||||
-------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesSystem.anisotropic_filter`
|
||||
|
||||
bpy.types.Object
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Object.empty_image_offset`
|
||||
|
||||
bpy.types.Image
|
||||
---------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Image.resolution`
|
||||
|
||||
bpy.types.SceneGameData
|
||||
-----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SceneGameData.use_glsl_color_management`
|
||||
|
||||
|
@@ -24,17 +24,17 @@ Dump the python API into a text file so we can generate changelogs.
|
||||
output from this tool should be added into "doc/python_api/rst/change_log.rst"
|
||||
|
||||
# dump api blender_version.py in CWD
|
||||
blender --background --python intern/tools/rna_api_dump.py -- --dump
|
||||
blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
|
||||
|
||||
# create changelog
|
||||
blender --background --python intern/tools/rna_api_dump.py -- \
|
||||
blender --background --python doc/python_api/sphinx_changelog_gen.py -- \
|
||||
--api_from blender_2_56_1.py \
|
||||
--api_to blender_2_57_0.py \
|
||||
--api_out changes.rst
|
||||
|
||||
|
||||
# Api comparison can also run without blender
|
||||
python intern/tools/rna_api_dump.py
|
||||
python doc/python_api/sphinx_changelog_gen.py \
|
||||
--api_from blender_api_2_56_6.py \
|
||||
--api_to blender_api_2_57.py \
|
||||
--api_out changes.rst
|
||||
|
@@ -29,15 +29,15 @@ For HTML generation
|
||||
|
||||
./blender.bin --background --python doc/python_api/sphinx_doc_gen.py
|
||||
|
||||
This will generate python files in doc/python_api/sphinx-in/,
|
||||
assuming that ./blender.bin is or links to the blender executable
|
||||
This will generate python files in doc/python_api/sphinx-in/
|
||||
providing ./blender.bin is or links to the blender executable
|
||||
|
||||
- Generate html docs by running...
|
||||
|
||||
cd doc/python_api
|
||||
sphinx-build sphinx-in sphinx-out
|
||||
|
||||
assuming that you have sphinx 1.0.7 installed
|
||||
This requires sphinx 1.0.7 to be installed.
|
||||
|
||||
For PDF generation
|
||||
------------------
|
||||
@@ -48,6 +48,15 @@ For PDF generation
|
||||
make
|
||||
'''
|
||||
|
||||
# Check we're running in blender
|
||||
if __import__("sys").modules.get("bpy") is None:
|
||||
print("\nError, this script must run from inside blender2.5")
|
||||
print(script_help_msg)
|
||||
|
||||
import sys
|
||||
sys.exit()
|
||||
|
||||
|
||||
# Switch for quick testing
|
||||
if 1:
|
||||
# full build
|
||||
@@ -1196,72 +1205,67 @@ def rna2sphinx(BASEPATH):
|
||||
|
||||
|
||||
def main():
|
||||
import bpy
|
||||
if 'bpy' not in dir():
|
||||
print("\nError, this script must run from inside blender2.5")
|
||||
print(script_help_msg)
|
||||
import shutil
|
||||
|
||||
script_dir = os.path.dirname(__file__)
|
||||
path_in = os.path.join(script_dir, "sphinx-in")
|
||||
path_out = os.path.join(script_dir, "sphinx-out")
|
||||
path_examples = os.path.join(script_dir, "examples")
|
||||
# only for partial updates
|
||||
path_in_tmp = path_in + "-tmp"
|
||||
|
||||
if not os.path.exists(path_in):
|
||||
os.mkdir(path_in)
|
||||
|
||||
for f in os.listdir(path_examples):
|
||||
if f.endswith(".py"):
|
||||
EXAMPLE_SET.add(os.path.splitext(f)[0])
|
||||
|
||||
# only for full updates
|
||||
if _BPY_FULL_REBUILD:
|
||||
shutil.rmtree(path_in, True)
|
||||
shutil.rmtree(path_out, True)
|
||||
else:
|
||||
import shutil
|
||||
# write here, then move
|
||||
shutil.rmtree(path_in_tmp, True)
|
||||
|
||||
script_dir = os.path.dirname(__file__)
|
||||
path_in = os.path.join(script_dir, "sphinx-in")
|
||||
path_out = os.path.join(script_dir, "sphinx-out")
|
||||
path_examples = os.path.join(script_dir, "examples")
|
||||
# only for partial updates
|
||||
path_in_tmp = path_in + "-tmp"
|
||||
rna2sphinx(path_in_tmp)
|
||||
|
||||
if not os.path.exists(path_in):
|
||||
os.mkdir(path_in)
|
||||
if not _BPY_FULL_REBUILD:
|
||||
import filecmp
|
||||
|
||||
for f in os.listdir(path_examples):
|
||||
if f.endswith(".py"):
|
||||
EXAMPLE_SET.add(os.path.splitext(f)[0])
|
||||
# now move changed files from 'path_in_tmp' --> 'path_in'
|
||||
file_list_path_in = set(os.listdir(path_in))
|
||||
file_list_path_in_tmp = set(os.listdir(path_in_tmp))
|
||||
|
||||
# only for full updates
|
||||
if _BPY_FULL_REBUILD:
|
||||
shutil.rmtree(path_in, True)
|
||||
shutil.rmtree(path_out, True)
|
||||
else:
|
||||
# write here, then move
|
||||
shutil.rmtree(path_in_tmp, True)
|
||||
# remove deprecated files that have been removed.
|
||||
for f in sorted(file_list_path_in):
|
||||
if f not in file_list_path_in_tmp:
|
||||
print("\tdeprecated: %s" % f)
|
||||
os.remove(os.path.join(path_in, f))
|
||||
|
||||
rna2sphinx(path_in_tmp)
|
||||
# freshen with new files.
|
||||
for f in sorted(file_list_path_in_tmp):
|
||||
f_from = os.path.join(path_in_tmp, f)
|
||||
f_to = os.path.join(path_in, f)
|
||||
|
||||
if not _BPY_FULL_REBUILD:
|
||||
import filecmp
|
||||
do_copy = True
|
||||
if f in file_list_path_in:
|
||||
if filecmp.cmp(f_from, f_to):
|
||||
do_copy = False
|
||||
|
||||
# now move changed files from 'path_in_tmp' --> 'path_in'
|
||||
file_list_path_in = set(os.listdir(path_in))
|
||||
file_list_path_in_tmp = set(os.listdir(path_in_tmp))
|
||||
if do_copy:
|
||||
print("\tupdating: %s" % f)
|
||||
shutil.copy(f_from, f_to)
|
||||
'''else:
|
||||
print("\tkeeping: %s" % f) # eh, not that useful'''
|
||||
|
||||
# remove deprecated files that have been removed.
|
||||
for f in sorted(file_list_path_in):
|
||||
if f not in file_list_path_in_tmp:
|
||||
print("\tdeprecated: %s" % f)
|
||||
os.remove(os.path.join(path_in, f))
|
||||
|
||||
# freshen with new files.
|
||||
for f in sorted(file_list_path_in_tmp):
|
||||
f_from = os.path.join(path_in_tmp, f)
|
||||
f_to = os.path.join(path_in, f)
|
||||
|
||||
do_copy = True
|
||||
if f in file_list_path_in:
|
||||
if filecmp.cmp(f_from, f_to):
|
||||
do_copy = False
|
||||
|
||||
if do_copy:
|
||||
print("\tupdating: %s" % f)
|
||||
shutil.copy(f_from, f_to)
|
||||
'''else:
|
||||
print("\tkeeping: %s" % f) # eh, not that useful'''
|
||||
|
||||
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
|
||||
if EXAMPLE_SET_UNUSED:
|
||||
print("\nUnused examples found in '%s'..." % path_examples)
|
||||
for f in EXAMPLE_SET_UNUSED:
|
||||
print(" %s.py" % f)
|
||||
print(" %d total\n" % len(EXAMPLE_SET_UNUSED))
|
||||
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
|
||||
if EXAMPLE_SET_UNUSED:
|
||||
print("\nUnused examples found in '%s'..." % path_examples)
|
||||
for f in EXAMPLE_SET_UNUSED:
|
||||
print(" %s.py" % f)
|
||||
print(" %d total\n" % len(EXAMPLE_SET_UNUSED))
|
||||
|
||||
import sys
|
||||
sys.exit()
|
||||
|
23
extern/bullet2/CMakeLists.txt
vendored
23
extern/bullet2/CMakeLists.txt
vendored
@@ -149,6 +149,15 @@ set(SRC
|
||||
src/LinearMath/btGeometryUtil.cpp
|
||||
src/LinearMath/btQuickprof.cpp
|
||||
src/LinearMath/btSerializer.cpp
|
||||
# UNUSED
|
||||
# src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
|
||||
# src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
|
||||
# src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
|
||||
# src/BulletCollision/CollisionShapes/btBox2dShape.cpp
|
||||
# src/BulletCollision/CollisionShapes/btConvex2dShape.cpp
|
||||
# src/BulletDynamics/Character/btKinematicCharacterController.cpp
|
||||
# src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
|
||||
# src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
|
||||
|
||||
src/Bullet-C-Api.h
|
||||
src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
|
||||
@@ -217,6 +226,7 @@ set(SRC
|
||||
src/BulletCollision/CollisionShapes/btTriangleCallback.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleInfoMap.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleMesh.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
|
||||
src/BulletCollision/CollisionShapes/btTriangleShape.h
|
||||
@@ -264,6 +274,7 @@ set(SRC
|
||||
src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
|
||||
src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
|
||||
src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
|
||||
src/BulletDynamics/Character/btCharacterControllerInterface.h
|
||||
src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
|
||||
src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
|
||||
src/BulletDynamics/ConstraintSolver/btContactConstraint.h
|
||||
@@ -291,9 +302,12 @@ set(SRC
|
||||
src/BulletSoftBody/btDefaultSoftBodySolver.h
|
||||
src/BulletSoftBody/btSoftBody.h
|
||||
src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h
|
||||
src/BulletSoftBody/btSoftBodyData.h
|
||||
src/BulletSoftBody/btSoftBodyHelpers.h
|
||||
src/BulletSoftBody/btSoftBodyInternals.h
|
||||
src/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h
|
||||
src/BulletSoftBody/btSoftBodySolverVertexBuffer.h
|
||||
src/BulletSoftBody/btSoftBodySolvers.h
|
||||
src/BulletSoftBody/btSoftRigidCollisionAlgorithm.h
|
||||
src/BulletSoftBody/btSoftRigidDynamicsWorld.h
|
||||
src/BulletSoftBody/btSoftSoftCollisionAlgorithm.h
|
||||
@@ -323,9 +337,16 @@ set(SRC
|
||||
src/LinearMath/btTransform.h
|
||||
src/LinearMath/btTransformUtil.h
|
||||
src/LinearMath/btVector3.h
|
||||
|
||||
src/btBulletCollisionCommon.h
|
||||
src/btBulletDynamicsCommon.h
|
||||
# src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
|
||||
# src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
|
||||
# src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
|
||||
# src/BulletCollision/CollisionShapes/btBox2dShape.h
|
||||
# src/BulletCollision/CollisionShapes/btConvex2dShape.h
|
||||
# src/BulletDynamics/Character/btKinematicCharacterController.h
|
||||
# src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h
|
||||
# src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h
|
||||
)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
4
extern/libopenjpeg/CMakeLists.txt
vendored
4
extern/libopenjpeg/CMakeLists.txt
vendored
@@ -32,6 +32,10 @@ set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DOPJ_STATIC)
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
bio.c
|
||||
cio.c
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
add_subdirectory(audaspace)
|
||||
add_subdirectory(string)
|
||||
add_subdirectory(ghost)
|
||||
add_subdirectory(guardedalloc)
|
||||
@@ -35,6 +34,10 @@ add_subdirectory(opennl)
|
||||
add_subdirectory(smoke)
|
||||
add_subdirectory(mikktspace)
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
add_subdirectory(audaspace)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_FLUID)
|
||||
add_subdirectory(elbeem)
|
||||
endif()
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# $Id$
|
||||
# ***** BEGIN LGPL LICENSE BLOCK *****
|
||||
#
|
||||
# Copyright 2009 Jörg Hermann Müller
|
||||
# Copyright 2009 Jrg Hermann Mller
|
||||
#
|
||||
# This file is part of AudaSpace.
|
||||
#
|
||||
@@ -29,7 +29,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${PTHREADS_INC}
|
||||
${PTHREADS_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
@@ -160,7 +160,7 @@ set(SRC
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
list(APPEND INC ffmpeg)
|
||||
list(APPEND INC_SYS ${FFMPEG_INC})
|
||||
list(APPEND INC_SYS ${FFMPEG_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
ffmpeg/AUD_FFMPEGFactory.cpp
|
||||
ffmpeg/AUD_FFMPEGReader.cpp
|
||||
@@ -195,7 +195,7 @@ endif()
|
||||
if(WITH_JACK)
|
||||
add_definitions(-DWITH_JACK)
|
||||
list(APPEND INC jack)
|
||||
list(APPEND INC_SYS ${JACK_INC})
|
||||
list(APPEND INC_SYS ${JACK_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
jack/AUD_JackDevice.cpp
|
||||
|
||||
@@ -206,7 +206,7 @@ endif()
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
add_definitions(-DWITH_SNDFILE)
|
||||
list(APPEND INC sndfile)
|
||||
list(APPEND INC_SYS ${SNDFILE_INC})
|
||||
list(APPEND INC_SYS ${SNDFILE_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
sndfile/AUD_SndFileFactory.cpp
|
||||
sndfile/AUD_SndFileReader.cpp
|
||||
@@ -218,7 +218,7 @@ endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
add_definitions(-DWITH_SAMPLERATE)
|
||||
list(APPEND INC_SYS ${LIBSAMPLERATE_INC})
|
||||
list(APPEND INC_SYS ${SAMPLERATE_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
SRC/AUD_SRCResampleFactory.cpp
|
||||
SRC/AUD_SRCResampleReader.cpp
|
||||
@@ -231,7 +231,7 @@ endif()
|
||||
if(WITH_FFTW3 AND FALSE)
|
||||
add_definitions(-DWITH_FFTW3)
|
||||
list(APPEND INC fftw)
|
||||
list(APPEND INC_SYS ${FFTW3_INC})
|
||||
list(APPEND INC_SYS ${FFTW3_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
fftw/AUD_BandPassFactory.cpp
|
||||
fftw/AUD_BandPassReader.cpp
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#define FFMPEG_HAVE_AVIO 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1))
|
||||
#if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1)) || ((LIBAVCODEC_VERSION_MAJOR == 52) && (LIBAVCODEC_VERSION_MINOR >= 122))
|
||||
#define FFMPEG_HAVE_DEFAULT_VAL_UNION 1
|
||||
#endif
|
||||
|
||||
|
@@ -741,11 +741,13 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
|
||||
NSRect contentRect = [NSWindow contentRectForFrameRect:frame
|
||||
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)];
|
||||
|
||||
GHOST_TInt32 bottom = (contentRect.size.height - 1) - height - top;
|
||||
|
||||
//Ensures window top left is inside this available rect
|
||||
left = left > contentRect.origin.x ? left : contentRect.origin.x;
|
||||
top = top > contentRect.origin.y ? top : contentRect.origin.y;
|
||||
bottom = bottom > contentRect.origin.y ? bottom : contentRect.origin.y;
|
||||
|
||||
window = new GHOST_WindowCocoa (this, title, left, top, width, height, state, type, stereoVisual, numOfAASamples);
|
||||
window = new GHOST_WindowCocoa (this, title, left, bottom, width, height, state, type, stereoVisual, numOfAASamples);
|
||||
|
||||
if (window) {
|
||||
if (window->getValid()) {
|
||||
@@ -809,7 +811,6 @@ GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
|
||||
*/
|
||||
GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
|
||||
{
|
||||
GHOST_TInt32 wx,wy;
|
||||
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
|
||||
if (!window) return GHOST_kFailure;
|
||||
|
||||
@@ -820,8 +821,7 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
|
||||
//Force mouse move event (not pushed by Cocoa)
|
||||
window->screenToClient(x, y, wx, wy);
|
||||
pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, wx,wy));
|
||||
pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, x, y));
|
||||
m_outsideLoopEventProcessed = true;
|
||||
|
||||
return GHOST_kSuccess;
|
||||
@@ -1433,9 +1433,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT
|
||||
GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
{
|
||||
NSEvent *event = (NSEvent *)eventPtr;
|
||||
GHOST_Window* window;
|
||||
GHOST_WindowCocoa* window;
|
||||
|
||||
window = (GHOST_Window*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]);
|
||||
window = (GHOST_WindowCocoa*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]);
|
||||
if (!window) {
|
||||
//printf("\nW failure for event 0x%x",[event type]);
|
||||
return GHOST_kFailure;
|
||||
@@ -1499,7 +1499,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
switch (window->getCursorGrabMode()) {
|
||||
case GHOST_kGrabHide: //Cursor hidden grab operation : no cursor move
|
||||
{
|
||||
GHOST_TInt32 x_warp, y_warp, x_accum, y_accum;
|
||||
GHOST_TInt32 x_warp, y_warp, x_accum, y_accum, x, y;
|
||||
|
||||
window->getCursorGrabInitPos(x_warp, y_warp);
|
||||
|
||||
@@ -1508,7 +1508,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
y_accum += -[event deltaY]; //Strange Apple implementation (inverted coordinates for the deltaY) ...
|
||||
window->setCursorGrabAccum(x_accum, y_accum);
|
||||
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_warp+x_accum, y_warp+y_accum));
|
||||
window->clientToScreenIntern(x_warp+x_accum, y_warp+y_accum, x, y);
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y));
|
||||
}
|
||||
break;
|
||||
case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries
|
||||
@@ -1516,19 +1517,16 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
NSPoint mousePos = [event locationInWindow];
|
||||
GHOST_TInt32 x_mouse= mousePos.x;
|
||||
GHOST_TInt32 y_mouse= mousePos.y;
|
||||
GHOST_TInt32 x_accum, y_accum, x_cur, y_cur;
|
||||
GHOST_Rect bounds, windowBounds, correctedBounds;
|
||||
GHOST_TInt32 x_accum, y_accum, x_cur, y_cur, x, y;
|
||||
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);
|
||||
@@ -1547,19 +1545,24 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
m_cursorDelta_y = y_mouse-mousePos.y;
|
||||
|
||||
//Set new cursor position
|
||||
window->clientToScreen(x_mouse, y_mouse, x_cur, y_cur);
|
||||
window->clientToScreenIntern(x_mouse, y_mouse, x_cur, y_cur);
|
||||
setMouseCursorPosition(x_cur, y_cur); /* wrap */
|
||||
|
||||
//Post event
|
||||
window->getCursorGrabInitPos(x_cur, y_cur);
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_cur + x_accum, y_cur + y_accum));
|
||||
window->clientToScreenIntern(x_cur + x_accum, y_cur + y_accum, x, y);
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
//Normal cursor operation: send mouse position in window
|
||||
NSPoint mousePos = [event locationInWindow];
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, mousePos.x, mousePos.y));
|
||||
GHOST_TInt32 x, y;
|
||||
|
||||
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x, y));
|
||||
|
||||
m_cursorDelta_x=0;
|
||||
m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter
|
||||
}
|
||||
@@ -1581,6 +1584,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
}
|
||||
else {
|
||||
NSPoint mousePos = [event locationInWindow];
|
||||
GHOST_TInt32 x, y;
|
||||
double dx = [event deltaX];
|
||||
double dy = -[event deltaY];
|
||||
|
||||
@@ -1597,7 +1601,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
if (dy<0.0) dy-=0.5; else dy+=0.5;
|
||||
if (dy< -deltaMax) dy= -deltaMax; else if (dy>deltaMax) dy=deltaMax;
|
||||
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventScroll, mousePos.x, mousePos.y, dx, dy));
|
||||
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
||||
dy = -dy;
|
||||
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventScroll, x, y, dx, dy));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1605,7 +1612,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
case NSEventTypeMagnify:
|
||||
{
|
||||
NSPoint mousePos = [event locationInWindow];
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, mousePos.x, mousePos.y,
|
||||
GHOST_TInt32 x, y;
|
||||
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventMagnify, x, y,
|
||||
[event magnification]*250.0 + 0.1, 0));
|
||||
}
|
||||
break;
|
||||
@@ -1613,7 +1622,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
case NSEventTypeRotate:
|
||||
{
|
||||
NSPoint mousePos = [event locationInWindow];
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventRotate, mousePos.x, mousePos.y,
|
||||
GHOST_TInt32 x, y;
|
||||
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
|
||||
pushEvent(new GHOST_EventTrackpad([event timestamp]*1000, window, GHOST_kTrackpadEventRotate, x, y,
|
||||
-[event rotation] * 5.0, 0));
|
||||
}
|
||||
case NSEventTypeBeginGesture:
|
||||
|
@@ -41,8 +41,7 @@
|
||||
|
||||
|
||||
GHOST_Window::GHOST_Window(
|
||||
const STR_String& /*title*/,
|
||||
GHOST_TInt32 /*left*/, GHOST_TInt32 /*top*/, GHOST_TUns32 width, GHOST_TUns32 height,
|
||||
GHOST_TUns32 width, GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual,
|
||||
|
@@ -76,9 +76,6 @@ public:
|
||||
* Constructor.
|
||||
* Creates a new window and opens it.
|
||||
* To check if the window was created properly, use the getValid() method.
|
||||
* @param title The text shown in the title bar of the window.
|
||||
* @param left The coordinate of the left edge of the window.
|
||||
* @param top The coordinate of the top edge of the window.
|
||||
* @param width The width the window.
|
||||
* @param heigh The height the window.
|
||||
* @param state The state the window is initially opened with.
|
||||
@@ -87,9 +84,6 @@ public:
|
||||
* @param numOfAASamples Number of samples used for AA (zero if no AA)
|
||||
*/
|
||||
GHOST_Window(
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
|
@@ -102,7 +102,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples
|
||||
) :
|
||||
GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone),
|
||||
GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone),
|
||||
m_windowRef(0),
|
||||
m_grafPtr(0),
|
||||
m_aglCtx(0),
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
GHOST_SystemCocoa *systemCocoa,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TInt32 bottom,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
@@ -180,6 +180,26 @@ public:
|
||||
*/
|
||||
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
|
||||
|
||||
/**
|
||||
* Converts a point in screen coordinates to client rectangle coordinates
|
||||
* but without the y coordinate conversion needed for ghost compatibility.
|
||||
* @param inX The x-coordinate in the client rectangle.
|
||||
* @param inY The y-coordinate in the client rectangle.
|
||||
* @param outX The x-coordinate on the screen.
|
||||
* @param outY The y-coordinate on the screen.
|
||||
*/
|
||||
void clientToScreenIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
|
||||
|
||||
/**
|
||||
* Converts a point in screen coordinates to client rectangle coordinates,
|
||||
* but without the y coordinate conversion needed for ghost compatibility.
|
||||
* @param inX The x-coordinate in the client rectangle.
|
||||
* @param inY The y-coordinate in the client rectangle.
|
||||
* @param outX The x-coordinate on the screen.
|
||||
* @param outY The y-coordinate on the screen.
|
||||
*/
|
||||
void screenToClientIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
|
||||
|
||||
/**
|
||||
* Gets the screen the window is displayed in
|
||||
* @return The NSScreen object
|
||||
|
@@ -308,14 +308,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||
GHOST_SystemCocoa *systemCocoa,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TInt32 bottom,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual, const GHOST_TUns16 numOfAASamples
|
||||
) :
|
||||
GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, numOfAASamples),
|
||||
GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone, stereoVisual, numOfAASamples),
|
||||
m_customCursor(0)
|
||||
{
|
||||
NSOpenGLPixelFormatAttribute pixelFormatAttrsWindow[40];
|
||||
@@ -327,13 +327,12 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
|
||||
//Creates the window
|
||||
NSRect rect;
|
||||
NSSize minSize;
|
||||
|
||||
rect.origin.x = left;
|
||||
rect.origin.y = top;
|
||||
rect.origin.y = bottom;
|
||||
rect.size.width = width;
|
||||
rect.size.height = height;
|
||||
|
||||
@@ -693,6 +692,29 @@ void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST
|
||||
{
|
||||
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::screenToClient(): window invalid")
|
||||
|
||||
screenToClientIntern(inX, inY, outX, outY);
|
||||
|
||||
/* switch y to match ghost convention */
|
||||
GHOST_Rect cBnds;
|
||||
getClientBounds(cBnds);
|
||||
outY = (cBnds.getHeight() - 1) - outY;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
|
||||
{
|
||||
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid")
|
||||
|
||||
/* switch y to match ghost convention */
|
||||
GHOST_Rect cBnds;
|
||||
getClientBounds(cBnds);
|
||||
inY = (cBnds.getHeight() - 1) - inY;
|
||||
|
||||
clientToScreenIntern(inX, inY, outX, outY);
|
||||
}
|
||||
|
||||
void GHOST_WindowCocoa::screenToClientIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
|
||||
{
|
||||
NSPoint screenCoord;
|
||||
NSPoint baseCoord;
|
||||
|
||||
@@ -705,11 +727,8 @@ void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST
|
||||
outY = baseCoord.y;
|
||||
}
|
||||
|
||||
|
||||
void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
|
||||
void GHOST_WindowCocoa::clientToScreenIntern(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const
|
||||
{
|
||||
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid")
|
||||
|
||||
NSPoint screenCoord;
|
||||
NSPoint baseCoord;
|
||||
|
||||
@@ -1211,7 +1230,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
m_systemCocoa->getCursorPosition(x_old,y_old);
|
||||
screenToClient(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]);
|
||||
screenToClientIntern(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]);
|
||||
//Warp position is stored in client (window base) coordinates
|
||||
setCursorGrabAccum(0, 0);
|
||||
|
||||
|
@@ -136,7 +136,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
|
||||
GHOST_TSuccess msEnabled,
|
||||
int msPixelFormat)
|
||||
:
|
||||
GHOST_Window(title, left, top, width, height, state, GHOST_kDrawingContextTypeNone,
|
||||
GHOST_Window(width, height, state, GHOST_kDrawingContextTypeNone,
|
||||
stereoVisual,numOfAASamples),
|
||||
m_system(system),
|
||||
m_hDC(0),
|
||||
|
@@ -164,7 +164,7 @@ GHOST_WindowX11(
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples
|
||||
) :
|
||||
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
|
||||
GHOST_Window(width,height,state,type,stereoVisual,numOfAASamples),
|
||||
m_context(NULL),
|
||||
m_display(display),
|
||||
m_normal_state(GHOST_kWindowStateNormal),
|
||||
|
@@ -905,9 +905,6 @@ void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
|
||||
lmin = MT_clamp(lmin, -MT_PI, MT_PI);
|
||||
lmax = MT_clamp(lmax, -MT_PI, MT_PI);
|
||||
|
||||
lmin = lmin;
|
||||
lmax = lmax;
|
||||
|
||||
if (axis == 1) {
|
||||
m_min_twist = lmin;
|
||||
m_max_twist = lmax;
|
||||
|
@@ -134,6 +134,7 @@ bool ConstraintSet::setControlParameter(int id, ConstraintAction action, double
|
||||
break;
|
||||
default:
|
||||
assert(action==ACT_NONE);
|
||||
break;
|
||||
}
|
||||
return setControlParameters(&values, 1, timestep);
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
add_definitions(-DFFTW3=1)
|
||||
list(APPEND INC ${FFTW3_INC})
|
||||
list(APPEND INC ${FFTW3_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_smoke "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 197 KiB |
@@ -22,6 +22,7 @@ __all__ = (
|
||||
"load_image",
|
||||
)
|
||||
|
||||
|
||||
# limited replacement for BPyImage.comprehensiveImageLoad
|
||||
def load_image(imagepath,
|
||||
dirname="",
|
||||
|
@@ -27,6 +27,7 @@ __all__ = (
|
||||
"ngon_tesselate",
|
||||
)
|
||||
|
||||
|
||||
def mesh_linked_faces(mesh):
|
||||
"""
|
||||
Splits the mesh into connected faces, use this for seperating cubes from
|
||||
@@ -267,6 +268,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
|
||||
fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly.
|
||||
'''
|
||||
|
||||
from mathutils.geometry import tesselate_polygon
|
||||
from mathutils import Vector
|
||||
vector_to_tuple = Vector.to_tuple
|
||||
|
||||
|
@@ -25,6 +25,7 @@ __all__ = (
|
||||
"location_3d_to_region_2d",
|
||||
)
|
||||
|
||||
|
||||
def region_2d_to_vector_3d(region, rv3d, coord):
|
||||
"""
|
||||
Return a direction vector from the viewport at the spesific 2d region
|
||||
|
@@ -20,7 +20,6 @@
|
||||
|
||||
from _bpy import types as bpy_types
|
||||
import _bpy
|
||||
from mathutils import Vector
|
||||
|
||||
StructRNA = bpy_types.Struct.__bases__[0]
|
||||
StructMetaPropGroup = _bpy.StructMetaPropGroup
|
||||
@@ -144,18 +143,21 @@ class _GenericBone:
|
||||
def x_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
from mathutils import Vector
|
||||
return Vector((1.0, 0.0, 0.0)) * self.matrix.to_3x3()
|
||||
|
||||
@property
|
||||
def y_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
from mathutils import Vector
|
||||
return Vector((0.0, 1.0, 0.0)) * self.matrix.to_3x3()
|
||||
|
||||
@property
|
||||
def z_axis(self):
|
||||
""" Vector pointing down the x-axis of the bone.
|
||||
"""
|
||||
from mathutils import Vector
|
||||
return Vector((0.0, 0.0, 1.0)) * self.matrix.to_3x3()
|
||||
|
||||
@property
|
||||
|
@@ -111,12 +111,16 @@ def draw(layout, context, context_member, property_type, use_edit=True):
|
||||
continue
|
||||
|
||||
row = layout.row()
|
||||
convert_to_pyobject = getattr(val, "convert_to_pyobject", None)
|
||||
to_dict = getattr(val, "to_dict", None)
|
||||
to_list = getattr(val, "to_list", None)
|
||||
|
||||
val_orig = val
|
||||
if convert_to_pyobject:
|
||||
val_draw = val = val.convert_to_pyobject()
|
||||
val_draw = str(val_draw)
|
||||
if to_dict:
|
||||
val = to_dict()
|
||||
val_draw = str(val)
|
||||
elif to_list:
|
||||
val = to_list()
|
||||
val_draw = str(val)
|
||||
else:
|
||||
val_draw = val
|
||||
|
||||
@@ -131,7 +135,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
|
||||
row.label(text=key)
|
||||
|
||||
# explicit exception for arrays
|
||||
if convert_to_pyobject and not hasattr(val_orig, "len"):
|
||||
if to_dict or to_list:
|
||||
row.label(text=val_draw)
|
||||
else:
|
||||
if key in rna_properties:
|
||||
|
@@ -152,7 +152,6 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
if j is not None:
|
||||
fmap[i] = j
|
||||
|
||||
done = [False] * len(faces)
|
||||
for i, j in fmap.items():
|
||||
|
||||
if not fuvsel[i] or not fuvsel[j]:
|
||||
@@ -170,10 +169,10 @@ class MeshMirrorUV(bpy.types.Operator):
|
||||
v1 = faces[j].vertices[:]
|
||||
v2 = [vmap[k] for k in faces[i].vertices[:]]
|
||||
|
||||
for k in range(len(uv1)):
|
||||
k_map = v1.index(v2[k])
|
||||
uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5
|
||||
uv1[k].y = uv2[k_map].y
|
||||
if len(v1) == len(v2):
|
||||
for k in range(len(v1)):
|
||||
k_map = v1.index(v2[k])
|
||||
uv1[k].xy = - (uv2[k_map].x - 0.5) + 0.5, uv2[k_map].y
|
||||
|
||||
if is_editmode:
|
||||
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
|
||||
|
@@ -244,6 +244,7 @@ class QuickExplode(bpy.types.Operator):
|
||||
self.frame_end = self.frame_start + self.frame_duration
|
||||
return self.execute(context)
|
||||
|
||||
|
||||
def obj_bb_minmax(obj, min_co, max_co):
|
||||
for i in range(0, 8):
|
||||
bb_vec = Vector(obj.bound_box[i]) * obj.matrix_world
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8 compliant>
|
||||
# TODO <pep8 compliant>
|
||||
|
||||
from mathutils import Matrix, Vector, geometry
|
||||
import bpy
|
||||
@@ -812,21 +812,25 @@ def main(context, island_margin, projection_limit):
|
||||
global RotMatStepRotation
|
||||
main_consts()
|
||||
|
||||
#XXX objects= bpy.data.scenes.active.objects
|
||||
objects = context.selected_editable_objects
|
||||
|
||||
# TODO, all selected meshes
|
||||
'''
|
||||
# objects = context.selected_editable_objects
|
||||
objects = []
|
||||
|
||||
# we can will tag them later.
|
||||
obList = [ob for ob in objects if ob.type == 'MESH']
|
||||
|
||||
# Face select object may not be selected.
|
||||
#XXX ob = objects.active
|
||||
ob= objects[0]
|
||||
ob = context.active_object
|
||||
|
||||
if ob and (not ob.select) and ob.type == 'MESH':
|
||||
# Add to the list
|
||||
obList =[ob]
|
||||
del objects
|
||||
'''
|
||||
|
||||
# quick workaround
|
||||
obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH']
|
||||
|
||||
if not obList:
|
||||
raise('error, no selected mesh objects')
|
||||
|
@@ -462,7 +462,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
bl_idname = "wm.context_modal_mouse"
|
||||
bl_label = "Context Modal Mouse"
|
||||
bl_options = {'INTERNAL'}
|
||||
bl_options = {'GRAB_POINTER', 'BLOCKING', 'INTERNAL'}
|
||||
|
||||
data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.")
|
||||
data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)")
|
||||
|
@@ -113,13 +113,25 @@ class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
sub.prop(curve, "use_fill_back")
|
||||
col.prop(curve, "use_fill_deform", text="Fill Deformed")
|
||||
|
||||
col.label(text="Textures:")
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
|
||||
class DATA_PT_curve_texture_space(CurveButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Texture Space"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
curve = context.curve
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location")
|
||||
row.column().prop(curve, "texspace_size")
|
||||
row.prop(curve, "use_auto_texspace")
|
||||
row.prop(curve, "use_uv_as_generated")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location", text="Location")
|
||||
row.column().prop(curve, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
|
@@ -118,6 +118,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, bpy.types.Panel):
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Vertex Groups"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
@@ -71,9 +71,22 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
|
||||
layout.label(text="Update:")
|
||||
layout.prop(mball, "update_method", expand=True)
|
||||
|
||||
|
||||
class DATA_PT_mball_texture_space(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Texture Space"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
mball = context.meta_ball
|
||||
|
||||
layout.prop(mball, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location")
|
||||
row.column().prop(mball, "texspace_size")
|
||||
row.column().prop(mball, "texspace_location", text="Location")
|
||||
row.column().prop(mball, "texspace_size", text="Size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
|
||||
|
@@ -883,7 +883,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
|
||||
sub = col.column()
|
||||
sub.enabled = True
|
||||
sub.active = False
|
||||
sub.prop(vol, "use_light_cache")
|
||||
sub.label("Light Cache Enabled")
|
||||
col.prop(vol, "cache_resolution")
|
||||
|
||||
sub = col.column(align=True)
|
||||
|
@@ -655,8 +655,8 @@ class ConstraintButtonsPanel():
|
||||
row = col.row()
|
||||
row.label(text="Source to Destination Mapping:")
|
||||
|
||||
# note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't
|
||||
# open it. Thus we are using the hardcoded value instead.
|
||||
# note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't
|
||||
# open it. Thus we are using the hardcoded value instead.
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_x_from", expand=False, text="")
|
||||
row.label(text=" %s X" % chr(187))
|
||||
|
@@ -879,6 +879,15 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
|
||||
col = row.column()
|
||||
col.prop(part, "billboard_offset")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.prop(part, "billboard_size", text="Scale")
|
||||
if part.billboard_align == 'VEL':
|
||||
col = row.column(align=True)
|
||||
col.label("Velocity Scale:")
|
||||
col.prop(part, "billboard_velocity_head", text="Head")
|
||||
col.prop(part, "billboard_velocity_tail", text="Tail")
|
||||
|
||||
if psys:
|
||||
col = layout.column()
|
||||
col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_textures")
|
||||
|
@@ -350,7 +350,7 @@ class INFO_MT_help(bpy.types.Menu):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
|
||||
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-257/'
|
||||
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-258/'
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@@ -849,7 +849,7 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel):
|
||||
|
||||
|
||||
class USERPREF_MT_addons_dev_guides(bpy.types.Menu):
|
||||
bl_label = "Develoment Guides"
|
||||
bl_label = "Development Guides"
|
||||
|
||||
# menu to open webpages with addons development guides
|
||||
def draw(self, context):
|
||||
|
@@ -98,6 +98,8 @@ class VIEW3D_HT_header(bpy.types.Header):
|
||||
row.prop(toolsettings, "use_snap_peel_object", text="")
|
||||
elif toolsettings.snap_element == 'FACE':
|
||||
row.prop(toolsettings, "use_snap_project", text="")
|
||||
if toolsettings.use_snap_project and obj.mode == 'EDIT':
|
||||
row.prop(toolsettings, "use_snap_project_self", text="")
|
||||
|
||||
# OpenGL render
|
||||
row = layout.row(align=True)
|
||||
@@ -772,10 +774,16 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
||||
if obj.type == 'CAMERA':
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
|
||||
props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
|
||||
props.data_path_iter = "selected_editable_objects"
|
||||
props.data_path_item = "data.lens"
|
||||
props.input_scale = 0.1
|
||||
if obj.data.type == 'PERSP':
|
||||
props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
|
||||
props.data_path_iter = "selected_editable_objects"
|
||||
props.data_path_item = "data.lens"
|
||||
props.input_scale = 0.1
|
||||
else:
|
||||
props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
|
||||
props.data_path_iter = "selected_editable_objects"
|
||||
props.data_path_item = "data.ortho_scale"
|
||||
props.input_scale = 0.01
|
||||
|
||||
if not obj.data.dof_object:
|
||||
#layout.label(text="Test Has DOF obj");
|
||||
@@ -1098,17 +1106,18 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
|
||||
layout.operator_menu_enum("brush.curve_preset", "shape")
|
||||
layout.separator()
|
||||
|
||||
sculpt_tool = brush.sculpt_tool
|
||||
if brush is not None: # unlikely but can happen
|
||||
sculpt_tool = brush.sculpt_tool
|
||||
|
||||
if sculpt_tool != 'GRAB':
|
||||
layout.prop_menu_enum(brush, "stroke_method")
|
||||
if sculpt_tool != 'GRAB':
|
||||
layout.prop_menu_enum(brush, "stroke_method")
|
||||
|
||||
if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
|
||||
layout.prop_menu_enum(brush, "direction")
|
||||
if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
|
||||
layout.prop_menu_enum(brush, "direction")
|
||||
|
||||
if sculpt_tool == 'LAYER':
|
||||
layout.prop(brush, "use_persistent")
|
||||
layout.operator("sculpt.set_persistent_base")
|
||||
if sculpt_tool == 'LAYER':
|
||||
layout.prop(brush, "use_persistent")
|
||||
layout.operator("sculpt.set_persistent_base")
|
||||
|
||||
layout.separator()
|
||||
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
|
||||
|
@@ -997,7 +997,11 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.image_paint_object and context.tool_settings.image_paint)
|
||||
ts = context.tool_settings
|
||||
return ((context.sculpt_object and ts.sculpt) or
|
||||
(context.vertex_paint_object and ts.vertex_paint) or
|
||||
(context.weight_paint_object and ts.weight_paint) or
|
||||
(context.image_paint_object and ts.image_paint))
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -1005,6 +1009,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel):
|
||||
settings = __class__.paint_settings(context)
|
||||
brush = settings.brush
|
||||
|
||||
if brush is None: # unlikely but can happen
|
||||
layout.label(text="Brush Unset")
|
||||
return
|
||||
|
||||
col = layout.column()
|
||||
|
||||
if context.sculpt_object and context.tool_settings.sculpt:
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
@@ -12,22 +12,22 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p class="title"><b>Blender 2.57</b></p>
|
||||
<p class="title"><b>Blender 2.58</b></p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>About</b></p>
|
||||
<p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.</p>
|
||||
<p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p>
|
||||
<p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>2.57</b></p>
|
||||
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.57. This release is the first official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. <a href="http://www.blender.org/development/release-logs/blender-256-beta/">More information about this release</a>.</p>
|
||||
<p class="header"><b>2.58</b></p>
|
||||
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.58. This release is the second official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. <a href="http://www.blender.org/development/release-logs/blender-258/">More information about this release</a>.</p>
|
||||
<p class="body">What to Expect:</p>
|
||||
<p class="body"> • Big improvements - This is our most exciting version to date, already a significant improvement in many ways over 2.49</p>
|
||||
<p class="body"> • Missing/Incomplete Features - Although most of it is there, not all functionality from pre-2.5 versions has been restored yet. Some functionality may be re-implemented a different way.</p>
|
||||
<p class="body"> • Changes - If you're used to the old Blenders, Blender 2.5 may seem quite different at first, but it won't be long before it grows on you even more than before.</p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>Bugs</b></p>
|
||||
<p class="body">Although Blender 2.57 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.57. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
|
||||
<p class="body">Although Blender 2.58 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.58. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>Package Contents</b></p>
|
||||
<p class="body">The downloaded Blender package includes:</p>
|
||||
@@ -51,7 +51,7 @@
|
||||
<p class="header"><b>Links</b></p>
|
||||
<p class="body">Users:</p>
|
||||
<p class="body"> General information <a href="http://www.blender.org">www.blender.org</a> <br>
|
||||
Full release log <a href="http://www.blender.org/development/release-logs/blender-257/">www.blender.org/development/release-logs/blender-257/</a><br>
|
||||
Full release log <a href="http://www.blender.org/development/release-logs/blender-258/">www.blender.org/development/release-logs/blender-258/</a><br>
|
||||
Tutorials <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a> <br>
|
||||
Manual <a href="http://wiki.blender.org/index.php/Doc:Manual">wiki.blender.org/index.php/Doc:Manual</a><br>
|
||||
User Forum <a href="http://www.blenderartists.org">www.blenderartists.org</a><br>
|
||||
|
@@ -43,7 +43,7 @@ extern "C" {
|
||||
/* these lines are grep'd, watch out for our not-so-awesome regex
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 257
|
||||
#define BLENDER_VERSION 258
|
||||
#define BLENDER_SUBVERSION 1
|
||||
|
||||
#define BLENDER_MINVERSION 250
|
||||
@@ -51,9 +51,9 @@ extern "C" {
|
||||
|
||||
/* used by packaging tools */
|
||||
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
||||
#define BLENDER_VERSION_CHAR b
|
||||
#define BLENDER_VERSION_CHAR
|
||||
/* alpha/beta/rc/release, docs use this */
|
||||
#define BLENDER_VERSION_CYCLE beta
|
||||
#define BLENDER_VERSION_CYCLE release
|
||||
|
||||
struct ListBase;
|
||||
struct MemFile;
|
||||
|
@@ -147,7 +147,8 @@ typedef struct ParticleBillboardData
|
||||
struct Object *ob;
|
||||
float vec[3], vel[3];
|
||||
float offset[2];
|
||||
float size, tilt, random, time;
|
||||
float size[2];
|
||||
float tilt, random, time;
|
||||
int uv[3];
|
||||
int lock, num;
|
||||
int totnum;
|
||||
|
@@ -43,8 +43,6 @@ set(INC
|
||||
../nodes
|
||||
../editors/include
|
||||
../render/extern/include
|
||||
../../../intern/audaspace/intern
|
||||
../../../intern/ffmpeg
|
||||
../../../intern/bsp/extern ../blenfont
|
||||
../../../intern/decimation/extern
|
||||
../../../intern/elbeem/extern
|
||||
@@ -238,6 +236,13 @@ set(SRC
|
||||
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
list(APPEND INC
|
||||
../../../intern/audaspace/intern
|
||||
)
|
||||
add_definitions(-DWITH_AUDASPACE)
|
||||
endif()
|
||||
|
||||
if(WITH_BULLET)
|
||||
list(APPEND INC ../../../extern/bullet2/src)
|
||||
add_definitions(-DUSE_BULLET)
|
||||
@@ -274,12 +279,13 @@ endif()
|
||||
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
list(APPEND INC ../quicktime)
|
||||
list(APPEND INC_SYS ${QUICKTIME_INC})
|
||||
list(APPEND INC_SYS ${QUICKTIME_INCLUDE_DIRS})
|
||||
add_definitions(-DWITH_QUICKTIME)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
list(APPEND INC_SYS ${FFMPEG_INC})
|
||||
list(APPEND INC ../../../intern/ffmpeg)
|
||||
list(APPEND INC_SYS ${FFMPEG_INCLUDE_DIRS})
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
|
@@ -172,6 +172,11 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *
|
||||
dst= &ob->mpath;
|
||||
}
|
||||
|
||||
/* avoid 0 size allocs */
|
||||
if(avs->path_sf >= avs->path_ef) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* if there is already a motionpath, just return that,
|
||||
* but provided it's settings are ok
|
||||
*/
|
||||
|
@@ -64,6 +64,7 @@
|
||||
#include "BLI_dynstr.h"
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_callbacks.h"
|
||||
|
||||
#include "IMB_imbuf.h"
|
||||
|
||||
@@ -96,7 +97,7 @@ UserDef U;
|
||||
/* ListBase = {NULL, NULL}; */
|
||||
short ENDIAN_ORDER;
|
||||
|
||||
static char versionstr[48]= "";
|
||||
char versionstr[48]= "";
|
||||
|
||||
/* ********** free ********** */
|
||||
|
||||
@@ -110,6 +111,9 @@ void free_blender(void)
|
||||
BKE_spacetypes_free(); /* after free main, it uses space callbacks */
|
||||
|
||||
IMB_exit();
|
||||
|
||||
BLI_cb_finalize();
|
||||
|
||||
seq_stripelem_cache_destruct();
|
||||
|
||||
free_nodesystem();
|
||||
@@ -129,9 +133,9 @@ void initglobals(void)
|
||||
ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN;
|
||||
|
||||
if(BLENDER_SUBVERSION)
|
||||
BLI_snprintf(versionstr, sizeof(versionstr), "www.blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
|
||||
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
|
||||
else
|
||||
BLI_snprintf(versionstr, sizeof(versionstr), "www.blender.org %d", BLENDER_VERSION);
|
||||
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d", BLENDER_VERSION);
|
||||
|
||||
#ifdef _WIN32 // FULLSCREEN
|
||||
G.windowstate = G_WINDOWSTATE_USERDEF;
|
||||
|
@@ -235,8 +235,6 @@ void make_local_brush(Brush *brush)
|
||||
if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
|
||||
if(scene->id.lib==NULL) {
|
||||
paint_brush_set(&scene->toolsettings->imapaint.paint, brushn);
|
||||
brushn->id.us++;
|
||||
brush->id.us--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -719,7 +719,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
|
||||
if(!data->cached)
|
||||
BLI_bvhtree_free(data->tree);
|
||||
|
||||
memset( data, 0, sizeof(data) );
|
||||
memset( data, 0, sizeof(*data) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,8 +32,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
#include <Python.h>
|
||||
#if 0 /* pynodes commented for now */
|
||||
# ifdef WITH_PYTHON
|
||||
# include <Python.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
@@ -85,8 +85,11 @@ Brush *paint_brush(Paint *p)
|
||||
|
||||
void paint_brush_set(Paint *p, Brush *br)
|
||||
{
|
||||
if(p)
|
||||
if(p) {
|
||||
id_us_min((ID *)p->brush);
|
||||
id_us_plus((ID *)br);
|
||||
p->brush= br;
|
||||
}
|
||||
}
|
||||
|
||||
int paint_facesel_test(Object *ob)
|
||||
@@ -110,12 +113,17 @@ void paint_init(Paint *p, const char col[3])
|
||||
p->flags |= PAINT_SHOW_BRUSH;
|
||||
}
|
||||
|
||||
void free_paint(Paint *UNUSED(paint))
|
||||
void free_paint(Paint *paint)
|
||||
{
|
||||
/* nothing */
|
||||
id_us_min((ID *)paint->brush);
|
||||
}
|
||||
|
||||
/* called when copying scene settings, so even if 'src' and 'tar' are the same
|
||||
* still do a id_us_plus(), rather then if we were copying betweem 2 existing
|
||||
* scenes where a matching value should decrease the existing user count as
|
||||
* with paint_brush_set() */
|
||||
void copy_paint(Paint *src, Paint *tar)
|
||||
{
|
||||
tar->brush= src->brush;
|
||||
id_us_plus((ID *)tar->brush);
|
||||
}
|
||||
|
@@ -3543,6 +3543,8 @@ static void default_particle_settings(ParticleSettings *part)
|
||||
part->path_start = 0.0f;
|
||||
part->path_end = 1.0f;
|
||||
|
||||
part->bb_size[0] = part->bb_size[1] = 1.0f;
|
||||
|
||||
part->keyed_loops = 1;
|
||||
|
||||
part->color_vec_max = 1.f;
|
||||
@@ -4514,8 +4516,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
|
||||
mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI));
|
||||
VECADD(yvec, yvec, tvec);
|
||||
|
||||
mul_v3_fl(xvec, bb->size);
|
||||
mul_v3_fl(yvec, bb->size);
|
||||
mul_v3_fl(xvec, bb->size[0]);
|
||||
mul_v3_fl(yvec, bb->size[1]);
|
||||
|
||||
VECADDFAC(center, bb->vec, xvec, bb->offset[0]);
|
||||
VECADDFAC(center, center, yvec, bb->offset[1]);
|
||||
|
@@ -73,7 +73,10 @@
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_sound.h"
|
||||
#include "AUD_C-API.h"
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
# include "AUD_C-API.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
@@ -697,6 +700,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
|
||||
}
|
||||
seq->strip->len = seq->len;
|
||||
case SEQ_SOUND:
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(!seq->sound)
|
||||
return;
|
||||
seq->len = ceil(AUD_getInfo(seq->sound->playback_handle).length * FPS);
|
||||
@@ -706,6 +710,9 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
|
||||
seq->len = 0;
|
||||
}
|
||||
seq->strip->len = seq->len;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
break;
|
||||
case SEQ_SCENE:
|
||||
{
|
||||
@@ -3493,6 +3500,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
|
||||
return seq;
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C); /* only for sound */
|
||||
@@ -3550,6 +3558,15 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
|
||||
|
||||
return seq;
|
||||
}
|
||||
#else // WITH_AUDASPACE
|
||||
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
|
||||
{
|
||||
(void)C;
|
||||
(void)seqbasep;
|
||||
(void)seq_load;
|
||||
return NULL;
|
||||
}
|
||||
#endif // WITH_AUDASPACE
|
||||
|
||||
Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
|
||||
{
|
||||
|
@@ -21,7 +21,9 @@
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_sound_types.h"
|
||||
|
||||
#include "AUD_C-API.h"
|
||||
#ifdef WITH_AUDASPACE
|
||||
# include "AUD_C-API.h"
|
||||
#endif
|
||||
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_global.h"
|
||||
@@ -36,6 +38,62 @@
|
||||
|
||||
static int force_device = -1;
|
||||
|
||||
|
||||
struct bSound* sound_new_file(struct Main *bmain, const char *filename)
|
||||
{
|
||||
bSound* sound = NULL;
|
||||
|
||||
char str[FILE_MAX];
|
||||
char *path;
|
||||
|
||||
int len;
|
||||
|
||||
strcpy(str, filename);
|
||||
|
||||
path = /*bmain ? bmain->name :*/ G.main->name;
|
||||
|
||||
BLI_path_abs(str, path);
|
||||
|
||||
len = strlen(filename);
|
||||
while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
|
||||
len--;
|
||||
|
||||
sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
|
||||
BLI_strncpy(sound->name, filename, FILE_MAX);
|
||||
// XXX unused currently sound->type = SOUND_TYPE_FILE;
|
||||
|
||||
sound_load(bmain, sound);
|
||||
|
||||
if(!sound->playback_handle)
|
||||
{
|
||||
free_libblock(&bmain->sound, sound);
|
||||
sound = NULL;
|
||||
}
|
||||
|
||||
return sound;
|
||||
}
|
||||
|
||||
void sound_free(struct bSound* sound)
|
||||
{
|
||||
if (sound->packedfile)
|
||||
{
|
||||
freePackedFile(sound->packedfile);
|
||||
sound->packedfile = NULL;
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(sound->handle)
|
||||
{
|
||||
AUD_unload(sound->handle);
|
||||
sound->handle = NULL;
|
||||
sound->playback_handle = NULL;
|
||||
}
|
||||
#endif // WITH_AUDASPACE
|
||||
}
|
||||
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
|
||||
#ifdef WITH_JACK
|
||||
static void sound_sync_callback(void* data, int mode, float time)
|
||||
{
|
||||
@@ -123,40 +181,6 @@ void sound_exit(void)
|
||||
AUD_exit();
|
||||
}
|
||||
|
||||
struct bSound* sound_new_file(struct Main *bmain, const char *filename)
|
||||
{
|
||||
bSound* sound = NULL;
|
||||
|
||||
char str[FILE_MAX];
|
||||
char *path;
|
||||
|
||||
int len;
|
||||
|
||||
strcpy(str, filename);
|
||||
|
||||
path = /*bmain ? bmain->name :*/ G.main->name;
|
||||
|
||||
BLI_path_abs(str, path);
|
||||
|
||||
len = strlen(filename);
|
||||
while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
|
||||
len--;
|
||||
|
||||
sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
|
||||
BLI_strncpy(sound->name, filename, FILE_MAX);
|
||||
// XXX unused currently sound->type = SOUND_TYPE_FILE;
|
||||
|
||||
sound_load(bmain, sound);
|
||||
|
||||
if(!sound->playback_handle)
|
||||
{
|
||||
free_libblock(&bmain->sound, sound);
|
||||
sound = NULL;
|
||||
}
|
||||
|
||||
return sound;
|
||||
}
|
||||
|
||||
// XXX unused currently
|
||||
#if 0
|
||||
struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
|
||||
@@ -301,22 +325,6 @@ void sound_load(struct Main *bmain, struct bSound* sound)
|
||||
}
|
||||
}
|
||||
|
||||
void sound_free(struct bSound* sound)
|
||||
{
|
||||
if (sound->packedfile)
|
||||
{
|
||||
freePackedFile(sound->packedfile);
|
||||
sound->packedfile = NULL;
|
||||
}
|
||||
|
||||
if(sound->handle)
|
||||
{
|
||||
AUD_unload(sound->handle);
|
||||
sound->handle = NULL;
|
||||
sound->playback_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static float sound_get_volume(Scene* scene, Sequence* sequence, float time)
|
||||
{
|
||||
AnimData *adt= BKE_animdata_from_id(&scene->id);
|
||||
@@ -490,8 +498,9 @@ int sound_scene_playing(struct Scene *scene)
|
||||
int sound_read_sound_buffer(struct bSound* sound, float* buffer, int length, float start, float end)
|
||||
{
|
||||
AUD_Sound* limiter = AUD_limitSound(sound->cache, start, end);
|
||||
return AUD_readSound(limiter, buffer, length);
|
||||
int ret= AUD_readSound(limiter, buffer, length);
|
||||
AUD_unload(limiter);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sound_get_channels(struct bSound* sound)
|
||||
@@ -502,3 +511,34 @@ int sound_get_channels(struct bSound* sound)
|
||||
|
||||
return info.specs.channels;
|
||||
}
|
||||
|
||||
#else // WITH_AUDASPACE
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
int sound_define_from_str(const char *UNUSED(str)) { return -1;}
|
||||
void sound_force_device(int UNUSED(device)) {}
|
||||
void sound_init_once(void) {}
|
||||
void sound_init(struct Main *UNUSED(bmain)) {}
|
||||
void sound_exit(void) {}
|
||||
void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { }
|
||||
void sound_delete_cache(struct bSound* UNUSED(sound)) {}
|
||||
void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
|
||||
void sound_create_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
|
||||
void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
|
||||
void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
|
||||
void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
|
||||
void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {}
|
||||
void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
|
||||
static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_play_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_stop_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_seek_scene(struct bContext *UNUSED(C)) {}
|
||||
float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
|
||||
int sound_scene_playing(struct Scene *UNUSED(scene)) { return 0; }
|
||||
int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
|
||||
int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
|
||||
|
||||
#endif // WITH_AUDASPACE
|
||||
|
@@ -49,7 +49,9 @@
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
|
||||
#include "AUD_C-API.h" /* must be before BKE_sound.h for define */
|
||||
#ifdef WITH_AUDASPACE
|
||||
# include "AUD_C-API.h"
|
||||
#endif
|
||||
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_idprop.h"
|
||||
@@ -89,7 +91,9 @@ static uint8_t* audio_output_buffer = 0;
|
||||
static int audio_outbuf_size = 0;
|
||||
static double audio_time = 0.0f;
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static AUD_Device* audio_mixdown_device = 0;
|
||||
#endif
|
||||
|
||||
#define FFMPEG_AUTOSPLIT_SIZE 2000000000
|
||||
|
||||
@@ -103,6 +107,7 @@ static void delete_picture(AVFrame* f)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static int write_audio_frame(void)
|
||||
{
|
||||
AVCodecContext* c = NULL;
|
||||
@@ -145,6 +150,7 @@ static int write_audio_frame(void)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif // #ifdef WITH_AUDASPACE
|
||||
|
||||
/* Allocate a temporary frame */
|
||||
static AVFrame* alloc_picture(int pix_fmt, int width, int height)
|
||||
@@ -851,7 +857,7 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
|
||||
ffmpeg_autosplit_count = 0;
|
||||
|
||||
success = start_ffmpeg_impl(rd, rectx, recty, reports);
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(audio_stream)
|
||||
{
|
||||
AVCodecContext* c = audio_stream->codec;
|
||||
@@ -861,12 +867,13 @@ int start_ffmpeg(struct Scene *scene, RenderData *rd, int rectx, int recty, Repo
|
||||
specs.rate = rd->ffcodecdata.audio_mixrate;
|
||||
audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume);
|
||||
}
|
||||
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
void end_ffmpeg(void);
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
static void write_audio_frames(double to_pts)
|
||||
{
|
||||
int finished = 0;
|
||||
@@ -878,6 +885,7 @@ static void write_audio_frames(double to_pts)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports)
|
||||
{
|
||||
@@ -905,8 +913,9 @@ int append_ffmpeg(RenderData *rd, int frame, int *pixels, int rectx, int recty,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
write_audio_frames((frame - rd->sfra) / (((double)rd->frs_sec) / rd->frs_sec_base));
|
||||
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -920,11 +929,13 @@ void end_ffmpeg(void)
|
||||
write_audio_frames();
|
||||
}*/
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
if(audio_mixdown_device)
|
||||
{
|
||||
AUD_closeReadDevice(audio_mixdown_device);
|
||||
audio_mixdown_device = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_stream && video_stream->codec) {
|
||||
fprintf(stderr, "Flushing delayed frames...\n");
|
||||
|
72
source/blender/blenlib/BLI_callbacks.h
Normal file
72
source/blender/blenlib/BLI_callbacks.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): mar 2001 Nzc
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/blenlib/BLI_callbacks.h
|
||||
* \ingroup bli
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BLI_CALLBACKS_H
|
||||
#define BLI_CALLBACKS_H
|
||||
|
||||
struct bContext;
|
||||
struct Main;
|
||||
struct ID;
|
||||
|
||||
typedef enum {
|
||||
BLI_CB_EVT_RENDER_PRE,
|
||||
BLI_CB_EVT_RENDER_POST,
|
||||
BLI_CB_EVT_LOAD_PRE,
|
||||
BLI_CB_EVT_LOAD_POST,
|
||||
BLI_CB_EVT_SAVE_PRE,
|
||||
BLI_CB_EVT_SAVE_POST,
|
||||
BLI_CB_EVT_TOT
|
||||
} eCbEvent;
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct bCallbackFuncStore *next, *prev;
|
||||
void (* func)(struct Main *, struct ID *, void *arg);
|
||||
void *arg;
|
||||
short alloc;
|
||||
} bCallbackFuncStore;
|
||||
|
||||
|
||||
void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt);
|
||||
void BLI_add_cb(bCallbackFuncStore *funcstore, eCbEvent evt);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void BLI_cb_init(void);
|
||||
void BLI_cb_finalize(void);
|
||||
|
||||
|
||||
/* This is blenlib internal only, unrelated to above */
|
||||
void callLocalErrorCallBack(const char* msg);
|
@@ -70,6 +70,7 @@ unsigned int rgb_to_cpack(float r, float g, float b);
|
||||
unsigned int hsv_to_cpack(float h, float s, float v);
|
||||
|
||||
float rgb_to_grayscale(float rgb[3]);
|
||||
unsigned char rgb_to_grayscale_byte(unsigned char rgb[3]);
|
||||
|
||||
/***************** Profile Transformations ********************/
|
||||
|
||||
|
@@ -67,6 +67,9 @@ float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const
|
||||
float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]);
|
||||
void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]);
|
||||
|
||||
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3]);
|
||||
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2]);
|
||||
|
||||
/******************************* Intersection ********************************/
|
||||
|
||||
/* TODO int return value consistency */
|
||||
@@ -79,6 +82,8 @@ void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3],
|
||||
|
||||
int isect_line_line_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]);
|
||||
int isect_line_line_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]);
|
||||
int isect_line_sphere_v3(const float l1[3], const float l2[3], const float sp[3], const float r, float r_p1[3], float r_p2[3]);
|
||||
int isect_line_sphere_v2(const float l1[2], const float l2[2], const float sp[2], const float r, float r_p1[2], float r_p2[2]);
|
||||
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]);
|
||||
|
||||
/* Returns the number of point of interests
|
||||
|
@@ -52,6 +52,7 @@ set(SRC
|
||||
intern/DLRB_tree.c
|
||||
intern/boxpack2d.c
|
||||
intern/bpath.c
|
||||
intern/callbacks.c
|
||||
intern/cpu.c
|
||||
intern/dynlib.c
|
||||
intern/edgehash.c
|
||||
@@ -89,6 +90,7 @@ set(SRC
|
||||
BLI_blenlib.h
|
||||
BLI_boxpack2d.h
|
||||
BLI_bpath.h
|
||||
BLI_callbacks.h
|
||||
BLI_cpu.h
|
||||
BLI_dlrbTree.h
|
||||
BLI_dynlib.h
|
||||
@@ -132,12 +134,11 @@ set(SRC
|
||||
BLI_voxel.h
|
||||
BLI_winstuff.h
|
||||
PIL_time.h
|
||||
intern/BLI_callbacks.h
|
||||
intern/dynamiclist.h
|
||||
)
|
||||
|
||||
if(WITH_BINRELOC)
|
||||
list(APPEND INC_SYS "${BINRELOC_INC}")
|
||||
list(APPEND INC_SYS "${BINRELOC_INCLUDE_DIRS}")
|
||||
add_definitions(-DWITH_BINRELOC)
|
||||
endif()
|
||||
|
||||
|
70
source/blender/blenlib/intern/callbacks.c
Normal file
70
source/blender/blenlib/intern/callbacks.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Blender Foundation (2011)
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_callbacks.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
static ListBase callback_slots[BLI_CB_EVT_TOT]= {{0}};
|
||||
|
||||
void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt)
|
||||
{
|
||||
ListBase *lb= &callback_slots[evt];
|
||||
bCallbackFuncStore *funcstore;
|
||||
|
||||
for(funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= (bCallbackFuncStore *)funcstore->next) {
|
||||
funcstore->func(main, self, funcstore->arg);
|
||||
}
|
||||
}
|
||||
|
||||
void BLI_add_cb(bCallbackFuncStore *funcstore, eCbEvent evt)
|
||||
{
|
||||
ListBase *lb= &callback_slots[evt];
|
||||
BLI_addtail(lb, funcstore);
|
||||
}
|
||||
|
||||
void BLI_cb_init(void)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/* call on application exit */
|
||||
void BLI_cb_finalize(void)
|
||||
{
|
||||
eCbEvent evt;
|
||||
for(evt= 0; evt < BLI_CB_EVT_TOT; evt++) {
|
||||
ListBase *lb= &callback_slots[evt];
|
||||
bCallbackFuncStore *funcstore;
|
||||
bCallbackFuncStore *funcstore_next;
|
||||
for(funcstore= (bCallbackFuncStore *)lb->first; funcstore; funcstore= funcstore_next) {
|
||||
funcstore_next= (bCallbackFuncStore *)funcstore->next;
|
||||
BLI_remlink(lb, funcstore);
|
||||
if(funcstore->alloc) {
|
||||
MEM_freeN(funcstore);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -488,6 +488,11 @@ float rgb_to_grayscale(float rgb[3])
|
||||
return 0.3f*rgb[0] + 0.58f*rgb[1] + 0.12f*rgb[2];
|
||||
}
|
||||
|
||||
unsigned char rgb_to_grayscale_byte(unsigned char rgb[3])
|
||||
{
|
||||
return (76*(unsigned short)rgb[0] + 148*(unsigned short)rgb[1] + 31*(unsigned short)rgb[2]) / 255;
|
||||
}
|
||||
|
||||
/* ********************************* lift/gamma/gain / ASC-CDL conversion ********************************* */
|
||||
|
||||
void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power)
|
||||
|
@@ -37,8 +37,6 @@
|
||||
#include "BLI_memarena.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
static float lambda_cp_line(const float p[3], const float l1[3], const float l2[3]);
|
||||
|
||||
/********************************** Polygons *********************************/
|
||||
|
||||
void cent_tri_v3(float cent[3], const float v1[3], const float v2[3], const float v3[3])
|
||||
@@ -364,6 +362,133 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
|
||||
return -1;
|
||||
}
|
||||
|
||||
int isect_line_sphere_v3(const float l1[3], const float l2[3],
|
||||
const float sp[3], const float r,
|
||||
float r_p1[3], float r_p2[3])
|
||||
{
|
||||
/* l1: coordinates (point of line)
|
||||
* l2: coordinates (point of line)
|
||||
* sp, r: coordinates and radius (sphere)
|
||||
* r_p1, r_p2: return intersection coordinates
|
||||
*/
|
||||
|
||||
|
||||
/* adapted for use in blender by Campbell Barton - 2011
|
||||
*
|
||||
* atelier iebele abel - 2001
|
||||
* atelier@iebele.nl
|
||||
* http://www.iebele.nl
|
||||
*
|
||||
* sphere_line_intersection function adapted from:
|
||||
* http://astronomy.swin.edu.au/pbourke/geometry/sphereline
|
||||
* Paul Bourke pbourke@swin.edu.au
|
||||
*/
|
||||
|
||||
const float ldir[3]= {
|
||||
l2[0] - l1[0],
|
||||
l2[1] - l1[1],
|
||||
l2[2] - l1[2]
|
||||
};
|
||||
|
||||
const float a= dot_v3v3(ldir, ldir);
|
||||
|
||||
const float b= 2.0f *
|
||||
(ldir[0] * (l1[0] - sp[0]) +
|
||||
ldir[1] * (l1[1] - sp[1]) +
|
||||
ldir[2] * (l1[2] - sp[2]));
|
||||
|
||||
const float c=
|
||||
dot_v3v3(sp, sp) +
|
||||
dot_v3v3(l1, l1) -
|
||||
(2.0f * dot_v3v3(sp, l1)) -
|
||||
(r * r);
|
||||
|
||||
const float i = b * b - 4.0f * a * c;
|
||||
|
||||
float mu;
|
||||
|
||||
if (i < 0.0f) {
|
||||
/* no intersections */
|
||||
return 0;
|
||||
}
|
||||
else if (i == 0.0f) {
|
||||
/* one intersection */
|
||||
mu = -b / (2.0f * a);
|
||||
madd_v3_v3v3fl(r_p1, l1, ldir, mu);
|
||||
return 1;
|
||||
}
|
||||
else if (i > 0.0) {
|
||||
const float i_sqrt= sqrt(i); /* avoid calc twice */
|
||||
|
||||
/* first intersection */
|
||||
mu = (-b + i_sqrt) / (2.0f * a);
|
||||
madd_v3_v3v3fl(r_p1, l1, ldir, mu);
|
||||
|
||||
/* second intersection */
|
||||
mu = (-b - i_sqrt) / (2.0f * a);
|
||||
madd_v3_v3v3fl(r_p2, l1, ldir, mu);
|
||||
return 2;
|
||||
}
|
||||
else {
|
||||
/* math domain error - nan */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* keep in sync with isect_line_sphere_v3 */
|
||||
int isect_line_sphere_v2(const float l1[2], const float l2[2],
|
||||
const float sp[2], const float r,
|
||||
float r_p1[2], float r_p2[2])
|
||||
{
|
||||
const float ldir[2]= {
|
||||
l2[0] - l1[0],
|
||||
l2[1] - l1[1]
|
||||
};
|
||||
|
||||
const float a= dot_v3v3(ldir, ldir);
|
||||
|
||||
const float b= 2.0f *
|
||||
(ldir[0] * (l1[0] - sp[0]) +
|
||||
ldir[1] * (l1[1] - sp[1]));
|
||||
|
||||
const float c=
|
||||
dot_v2v2(sp, sp) +
|
||||
dot_v2v2(l1, l1) -
|
||||
(2.0f * dot_v2v2(sp, l1)) -
|
||||
(r * r);
|
||||
|
||||
const float i = b * b - 4.0f * a * c;
|
||||
|
||||
float mu;
|
||||
|
||||
if (i < 0.0f) {
|
||||
/* no intersections */
|
||||
return 0;
|
||||
}
|
||||
else if (i == 0.0f) {
|
||||
/* one intersection */
|
||||
mu = -b / (2.0f * a);
|
||||
madd_v2_v2v2fl(r_p1, l1, ldir, mu);
|
||||
return 1;
|
||||
}
|
||||
else if (i > 0.0) {
|
||||
const float i_sqrt= sqrt(i); /* avoid calc twice */
|
||||
|
||||
/* first intersection */
|
||||
mu = (-b + i_sqrt) / (2.0f * a);
|
||||
madd_v2_v2v2fl(r_p1, l1, ldir, mu);
|
||||
|
||||
/* second intersection */
|
||||
mu = (-b - i_sqrt) / (2.0f * a);
|
||||
madd_v2_v2v2fl(r_p2, l1, ldir, mu);
|
||||
return 2;
|
||||
}
|
||||
else {
|
||||
/* math domain error - nan */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
-1: colliniar
|
||||
1: intersection
|
||||
@@ -683,7 +808,7 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
|
||||
|
||||
add_v3_v3v3(l1_plane, l1, p_no);
|
||||
|
||||
dist = lambda_cp_line(plane_co, l1, l1_plane);
|
||||
dist = line_point_factor_v3(plane_co, l1, l1_plane);
|
||||
|
||||
/* treat line like a ray, when 'no_flip' is set */
|
||||
if(no_flip && dist < 0.0f) {
|
||||
@@ -1133,7 +1258,7 @@ float closest_to_line_v2(float cp[2],const float p[2], const float l1[2], const
|
||||
}
|
||||
|
||||
/* little sister we only need to know lambda */
|
||||
static float lambda_cp_line(const float p[3], const float l1[3], const float l2[3])
|
||||
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
|
||||
{
|
||||
float h[3],u[3];
|
||||
sub_v3_v3v3(u, l2, l1);
|
||||
@@ -1141,6 +1266,14 @@ static float lambda_cp_line(const float p[3], const float l1[3], const float l2[
|
||||
return(dot_v3v3(u,h)/dot_v3v3(u,u));
|
||||
}
|
||||
|
||||
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
|
||||
{
|
||||
float h[2], u[2];
|
||||
sub_v2_v2v2(u, l2, l1);
|
||||
sub_v2_v2v2(h, p, l1);
|
||||
return(dot_v2v2(u, h)/dot_v2v2(u, u));
|
||||
}
|
||||
|
||||
/* Similar to LineIntersectsTriangleUV, except it operates on a quad and in 2d, assumes point is in quad */
|
||||
void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float *uv)
|
||||
{
|
||||
|
@@ -3540,6 +3540,18 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
|
||||
|
||||
mesh->mr->verts = newdataadr(fd, mesh->mr->verts);
|
||||
|
||||
/* If mesh has the same number of vertices as the
|
||||
highest multires level, load the current mesh verts
|
||||
into multires and discard the old data. Needed
|
||||
because some saved files either do not have a verts
|
||||
array, or the verts array contains out-of-date
|
||||
data. */
|
||||
if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) {
|
||||
if(mesh->mr->verts)
|
||||
MEM_freeN(mesh->mr->verts);
|
||||
mesh->mr->verts = MEM_dupallocN(mesh->mvert);
|
||||
}
|
||||
|
||||
for(; lvl; lvl= lvl->next) {
|
||||
lvl->verts= newdataadr(fd, lvl->verts);
|
||||
lvl->faces= newdataadr(fd, lvl->faces);
|
||||
@@ -3548,16 +3560,11 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
|
||||
}
|
||||
}
|
||||
|
||||
/* Gracefully handle corrupted mesh */
|
||||
/* if multires is present but has no valid vertex data,
|
||||
there's no way to recover it; silently remove multires */
|
||||
if(mesh->mr && !mesh->mr->verts) {
|
||||
/* If totals match, simply load the current mesh verts into multires */
|
||||
if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert)
|
||||
mesh->mr->verts = MEM_dupallocN(mesh->mvert);
|
||||
else {
|
||||
/* Otherwise, we can't recover the data, silently remove multires */
|
||||
multires_free(mesh->mr);
|
||||
mesh->mr = NULL;
|
||||
}
|
||||
multires_free(mesh->mr);
|
||||
mesh->mr = NULL;
|
||||
}
|
||||
|
||||
if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
|
||||
@@ -11636,9 +11643,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
|
||||
/* put compatibility code here until next subversion bump */
|
||||
|
||||
{
|
||||
if (main->versionfile < 258 || (main->versionfile == 258 && main->subversionfile < 1)){
|
||||
/* screen view2d settings were not properly initialized [#27164]
|
||||
* v2d->scroll caused the bug but best reset other values too which are in old blend files only.
|
||||
* need to make less ugly - possibly an iterator? */
|
||||
@@ -11705,6 +11710,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
ParticleSettings *part;
|
||||
for(part = main->particle.first; part; part = part->id.next) {
|
||||
/* Initialize particle billboard scale */
|
||||
part->bb_size[0] = part->bb_size[1] = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* put compatibility code here until next subversion bump */
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
|
||||
@@ -11787,7 +11806,8 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
|
||||
|
||||
// XXX
|
||||
user->uifonts.first= user->uifonts.last= NULL;
|
||||
user->uistyles.first= user->uistyles.last= NULL;
|
||||
|
||||
link_list(fd, &user->uistyles);
|
||||
|
||||
/* free fd->datamap again */
|
||||
oldnewmap_free_unused(fd->datamap);
|
||||
|
@@ -724,6 +724,7 @@ static void write_userdef(WriteData *wd)
|
||||
wmKeyMap *keymap;
|
||||
wmKeyMapItem *kmi;
|
||||
bAddon *bext;
|
||||
uiStyle *style;
|
||||
|
||||
writestruct(wd, USER, "UserDef", 1, &U);
|
||||
|
||||
@@ -743,6 +744,10 @@ static void write_userdef(WriteData *wd)
|
||||
|
||||
for(bext= U.addons.first; bext; bext=bext->next)
|
||||
writestruct(wd, DATA, "bAddon", 1, bext);
|
||||
|
||||
for(style= U.uistyles.first; style; style= style->next) {
|
||||
writestruct(wd, DATA, "uiStyle", 1, style);
|
||||
}
|
||||
}
|
||||
|
||||
static void write_boid_state(WriteData *wd, BoidState *state)
|
||||
|
@@ -50,7 +50,7 @@ set(SRC
|
||||
)
|
||||
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
list(APPEND INC_SYS ${QUICKTIME_INC})
|
||||
list(APPEND INC_SYS ${QUICKTIME_INCLUDE_DIRS})
|
||||
add_definitions(-DWITH_QUICKTIME)
|
||||
endif()
|
||||
|
||||
|
@@ -53,12 +53,12 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
// use this for retrieving bone names, since these must be unique
|
||||
// first try node name, if not available (since is optional), fall back to original id
|
||||
template<class T>
|
||||
static const char *bc_get_joint_name(T *node)
|
||||
{
|
||||
const std::string& id = node->getOriginalId();
|
||||
return id.size() ? id.c_str() : node->getName().c_str();
|
||||
const std::string& id = node->getName();
|
||||
return id.size() ? id.c_str() : node->getOriginalId().c_str();
|
||||
}
|
||||
|
||||
FCurve *AnimationImporter::create_fcurve(int array_index, const char *rna_path)
|
||||
@@ -827,7 +827,8 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW::
|
||||
|
||||
unit_m4(m);
|
||||
|
||||
if (!evaluate_animation(tm, m, fra, node->getOriginalId().c_str())) {
|
||||
std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
|
||||
if (!evaluate_animation(tm, m, fra, nodename.c_str())) {
|
||||
switch (type) {
|
||||
case COLLADAFW::Transformation::ROTATE:
|
||||
dae_rotate_to_mat4(tm, m);
|
||||
|
@@ -42,12 +42,12 @@
|
||||
|
||||
#include "ArmatureImporter.h"
|
||||
|
||||
// use this for retrieving bone names, since these must be unique
|
||||
// use node name, or fall back to original id if not present (name is optional)
|
||||
template<class T>
|
||||
static const char *bc_get_joint_name(T *node)
|
||||
{
|
||||
const std::string& id = node->getOriginalId();
|
||||
return id.size() ? id.c_str() : node->getName().c_str();
|
||||
const std::string& id = node->getName();
|
||||
return id.size() ? id.c_str() : node->getOriginalId().c_str();
|
||||
}
|
||||
|
||||
ArmatureImporter::ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, AnimationImporterBase *anim, Scene *sce) :
|
||||
|
@@ -44,19 +44,19 @@ set(INC_SYS
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND INC_SYS
|
||||
${OPENCOLLADA_INC}/COLLADAStreamWriter
|
||||
${OPENCOLLADA_INC}/COLLADABaseUtils
|
||||
${OPENCOLLADA_INC}/COLLADAFramework
|
||||
${OPENCOLLADA_INC}/COLLADASaxFrameworkLoader
|
||||
${OPENCOLLADA_INC}/GeneratedSaxParser
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADAStreamWriter
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADABaseUtils
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADAFramework
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADASaxFrameworkLoader
|
||||
${OPENCOLLADA_INCLUDE_DIR}/GeneratedSaxParser
|
||||
)
|
||||
else()
|
||||
list(APPEND INC_SYS
|
||||
${OPENCOLLADA_INC}/COLLADAStreamWriter/include
|
||||
${OPENCOLLADA_INC}/COLLADABaseUtils/include
|
||||
${OPENCOLLADA_INC}/COLLADAFramework/include
|
||||
${OPENCOLLADA_INC}/COLLADASaxFrameworkLoader/include
|
||||
${OPENCOLLADA_INC}/GeneratedSaxParser/include
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADAStreamWriter/include
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADABaseUtils/include
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADAFramework/include
|
||||
${OPENCOLLADA_INCLUDE_DIR}/COLLADASaxFrameworkLoader/include
|
||||
${OPENCOLLADA_INCLUDE_DIR}/GeneratedSaxParser/include
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@@ -309,7 +309,7 @@ Object* DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
|
||||
return ob;
|
||||
}
|
||||
|
||||
Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Node *source_node, COLLADAFW::Node *instance_node, Scene *sce, bool is_library_node)
|
||||
Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Node *source_node, COLLADAFW::Node *instance_node, Scene *sce, Object *par_ob, bool is_library_node)
|
||||
{
|
||||
Object *obn = copy_object(source_ob);
|
||||
obn->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
|
||||
@@ -353,10 +353,10 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
|
||||
Object *new_child = NULL;
|
||||
if (inodes.getCount()) { // \todo loop through instance nodes
|
||||
const COLLADAFW::UniqueId& id = inodes[0]->getInstanciatedObjectId();
|
||||
new_child = create_instance_node(object_map[id], node_map[id], child_node, sce, is_library_node);
|
||||
new_child = create_instance_node(object_map[id], node_map[id], child_node, sce, NULL, is_library_node);
|
||||
}
|
||||
else {
|
||||
new_child = create_instance_node(object_map[child_id], child_node, NULL, sce, is_library_node);
|
||||
new_child = create_instance_node(object_map[child_id], child_node, NULL, sce, NULL, is_library_node);
|
||||
}
|
||||
bc_set_parent(new_child, obn, mContext, true);
|
||||
|
||||
@@ -367,7 +367,12 @@ Object* DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
|
||||
|
||||
// when we have an instance_node, don't return the object, because otherwise
|
||||
// its correct location gets overwritten in write_node(). Fixes bug #26012.
|
||||
if(instance_node) return NULL;
|
||||
if(instance_node) {
|
||||
if (par_ob && obn)
|
||||
bc_set_parent(obn, par_ob, mContext);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
else return obn;
|
||||
}
|
||||
|
||||
@@ -385,11 +390,11 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
|
||||
COLLADAFW::InstanceLightPointerArray &lamp = node->getInstanceLights();
|
||||
COLLADAFW::InstanceControllerPointerArray &controller = node->getInstanceControllers();
|
||||
COLLADAFW::InstanceNodePointerArray &inst_node = node->getInstanceNodes();
|
||||
int geom_done = 0;
|
||||
int camera_done = 0;
|
||||
int lamp_done = 0;
|
||||
int controller_done = 0;
|
||||
int inst_done = 0;
|
||||
size_t geom_done = 0;
|
||||
size_t camera_done = 0;
|
||||
size_t lamp_done = 0;
|
||||
size_t controller_done = 0;
|
||||
size_t inst_done = 0;
|
||||
|
||||
// XXX linking object with the first <instance_geometry>, though a node may have more of them...
|
||||
// maybe join multiple <instance_...> meshes into 1, and link object with it? not sure...
|
||||
@@ -423,7 +428,7 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
|
||||
Object *source_ob = object_map[node_id];
|
||||
COLLADAFW::Node *source_node = node_map[node_id];
|
||||
|
||||
ob = create_instance_node(source_ob, source_node, node, sce, is_library_node);
|
||||
ob = create_instance_node(source_ob, source_node, node, sce, par, is_library_node);
|
||||
}
|
||||
++inst_done;
|
||||
}
|
||||
@@ -436,7 +441,8 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
|
||||
// check if object is not NULL
|
||||
if (!ob) return;
|
||||
|
||||
rename_id(&ob->id, (char*)node->getOriginalId().c_str());
|
||||
std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
|
||||
rename_id(&ob->id, (char*)nodename.c_str());
|
||||
|
||||
object_map[node->getUniqueId()] = ob;
|
||||
node_map[node->getUniqueId()] = node;
|
||||
@@ -518,7 +524,7 @@ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat )
|
||||
if(mImportStage!=General)
|
||||
return true;
|
||||
|
||||
const std::string& str_mat_id = cmat->getOriginalId();
|
||||
const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId();
|
||||
Material *ma = add_material((char*)str_mat_id.c_str());
|
||||
|
||||
this->uid_effect_map[cmat->getInstantiatedEffect()] = ma;
|
||||
@@ -670,6 +676,18 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if(ef->getOpacity().isTexture()) {
|
||||
COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
|
||||
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
|
||||
if(mtex != NULL) {
|
||||
mtex->mapto = MAP_ALPHA;
|
||||
mtex->tex->imaflag |= TEX_USEALPHA;
|
||||
i++;
|
||||
ma->spectra = ma->alpha = 0;
|
||||
ma->mode |= MA_ZTRANSP|MA_TRANSP;
|
||||
}
|
||||
}
|
||||
// TRANSPARENT
|
||||
// color
|
||||
// if (ef->getOpacity().isColor()) {
|
||||
|
@@ -72,7 +72,7 @@ public:
|
||||
/** these should not be here */
|
||||
Object* create_camera_object(COLLADAFW::InstanceCamera*, Scene*);
|
||||
Object* create_lamp_object(COLLADAFW::InstanceLight*, Scene*);
|
||||
Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, bool);
|
||||
Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
|
||||
void write_node(COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
|
||||
MTex* create_texture(COLLADAFW::EffectCommon*, COLLADAFW::Texture&, Material*, int, TexIndexTextureArrayMap&);
|
||||
void write_profile_COMMON(COLLADAFW::EffectCommon*, Material*);
|
||||
|
@@ -67,7 +67,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
std::string la_id(get_light_id(ob));
|
||||
std::string la_name(id_name(la));
|
||||
COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy);
|
||||
float e, d, constatt, linatt, quadatt;
|
||||
float d, constatt, linatt, quadatt;
|
||||
|
||||
d = la->dist;
|
||||
|
||||
@@ -84,7 +84,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
|
||||
// sun
|
||||
if (la->type == LA_SUN) {
|
||||
COLLADASW::DirectionalLight cla(mSW, la_id, la_name, e);
|
||||
COLLADASW::DirectionalLight cla(mSW, la_id, la_name);
|
||||
cla.setColor(col);
|
||||
cla.setConstantAttenuation(constatt);
|
||||
exportBlenderProfile(cla, la);
|
||||
@@ -92,7 +92,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
}
|
||||
// hemi
|
||||
else if (la->type == LA_HEMI) {
|
||||
COLLADASW::AmbientLight cla(mSW, la_id, la_name, e);
|
||||
COLLADASW::AmbientLight cla(mSW, la_id, la_name);
|
||||
cla.setColor(col);
|
||||
cla.setConstantAttenuation(constatt);
|
||||
exportBlenderProfile(cla, la);
|
||||
@@ -100,7 +100,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
}
|
||||
// spot
|
||||
else if (la->type == LA_SPOT) {
|
||||
COLLADASW::SpotLight cla(mSW, la_id, la_name, e);
|
||||
COLLADASW::SpotLight cla(mSW, la_id, la_name);
|
||||
cla.setColor(col);
|
||||
cla.setFallOffAngle(la->spotsize);
|
||||
cla.setFallOffExponent(la->spotblend);
|
||||
@@ -112,7 +112,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
}
|
||||
// lamp
|
||||
else if (la->type == LA_LOCAL) {
|
||||
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
|
||||
COLLADASW::PointLight cla(mSW, la_id, la_name);
|
||||
cla.setColor(col);
|
||||
cla.setConstantAttenuation(constatt);
|
||||
cla.setLinearAttenuation(linatt);
|
||||
@@ -123,7 +123,7 @@ void LightsExporter::operator()(Object *ob)
|
||||
// area lamp is not supported
|
||||
// it will be exported as a local lamp
|
||||
else {
|
||||
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
|
||||
COLLADASW::PointLight cla(mSW, la_id, la_name);
|
||||
cla.setColor(col);
|
||||
cla.setConstantAttenuation(constatt);
|
||||
cla.setLinearAttenuation(linatt);
|
||||
|
@@ -62,7 +62,7 @@ extern "C" {
|
||||
#include "MeshImporter.h"
|
||||
#include "collada_utils.h"
|
||||
|
||||
// works for COLLADAFW::Node, COLLADAFW::Geometry
|
||||
// get node name, or fall back to original id if not present (name is optional)
|
||||
template<class T>
|
||||
static const char *bc_get_dae_name(T *node)
|
||||
{
|
||||
@@ -755,9 +755,11 @@ MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBindi
|
||||
MTex *color_texture)
|
||||
{
|
||||
const COLLADAFW::TextureMapId texture_index = ctexture.getTextureMapId();
|
||||
const size_t setindex = ctexture.getSetIndex();
|
||||
size_t setindex = ctexture.getSetIndex();
|
||||
std::string uvname = ctexture.getSemantic();
|
||||
|
||||
if(setindex==-1) return NULL;
|
||||
|
||||
const CustomData *data = &me->fdata;
|
||||
int layer_index = CustomData_get_layer_index(data, CD_MTFACE);
|
||||
CustomDataLayer *cdl = &data->layers[layer_index+setindex];
|
||||
@@ -833,7 +835,6 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
|
||||
if (*color_texture &&
|
||||
strlen((*color_texture)->uvname) &&
|
||||
strcmp(layername, (*color_texture)->uvname) != 0) {
|
||||
|
||||
texture_face = (MTFace*)CustomData_get_layer_named(&me->fdata, CD_MTFACE,
|
||||
(*color_texture)->uvname);
|
||||
strcpy(layername, (*color_texture)->uvname);
|
||||
@@ -903,7 +904,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
|
||||
uid_object_map[*geom_uid] = ob;
|
||||
|
||||
// name Object
|
||||
const std::string& id = node->getOriginalId();
|
||||
const std::string& id = node->getName().size() ? node->getName() : node->getOriginalId();
|
||||
if (id.length())
|
||||
rename_id(&ob->id, (char*)id.c_str());
|
||||
|
||||
@@ -915,6 +916,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
|
||||
if (old_mesh->id.us == 0) free_libblock(&G.main->mesh, old_mesh);
|
||||
|
||||
char layername[100];
|
||||
layername[0] = '\0';
|
||||
MTFace *texture_face = NULL;
|
||||
MTex *color_texture = NULL;
|
||||
|
||||
@@ -957,7 +959,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string& str_geom_id = mesh->getOriginalId();
|
||||
const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId();
|
||||
Mesh *me = add_mesh((char*)str_geom_id.c_str());
|
||||
|
||||
// store the Mesh pointer to link it later with an Object
|
||||
|
@@ -48,12 +48,12 @@
|
||||
#include "SkinInfo.h"
|
||||
#include "collada_utils.h"
|
||||
|
||||
// use this for retrieving bone names, since these must be unique
|
||||
// use name, or fall back to original id if name not present (name is optional)
|
||||
template<class T>
|
||||
static const char *bc_get_joint_name(T *node)
|
||||
{
|
||||
const std::string& id = node->getOriginalId();
|
||||
return id.size() ? id.c_str() : node->getName().c_str();
|
||||
const std::string& id = node->getName();
|
||||
return id.size() ? id.c_str() : node->getOriginalId().c_str();
|
||||
}
|
||||
|
||||
// This is used to store data passed in write_controller_data.
|
||||
|
@@ -265,7 +265,7 @@ std::string get_light_id(Object *ob)
|
||||
|
||||
std::string get_joint_id(Bone *bone, Object *ob_arm)
|
||||
{
|
||||
return translate_id(id_name(ob_arm) + "_" + bone->name);
|
||||
return translate_id(bone->name);
|
||||
}
|
||||
|
||||
std::string get_camera_id(Object *ob)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user