svn merge ^/trunk/blender -r40720:40872
This commit is contained in:
177
CMakeLists.txt
177
CMakeLists.txt
@@ -26,8 +26,8 @@
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# We don't allow in-source builds. This causes no end of troubles because
|
||||
# all out-of-source builds will use the CMakeCache.txt file there and even
|
||||
# We don't allow in-source builds. This causes no end of troubles because
|
||||
# all out-of-source builds will use the CMakeCache.txt file there and even
|
||||
# build the libs and objects in it.
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
@@ -189,7 +189,6 @@ option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org
|
||||
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||
option(WITH_SAMPLERATE "Enable samplerate conversion" ON)
|
||||
|
||||
# Compression
|
||||
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
|
||||
@@ -197,7 +196,7 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)"
|
||||
|
||||
# Misc
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
||||
endif()
|
||||
@@ -273,7 +272,7 @@ if(WITH_PYTHON_MODULE)
|
||||
set(WITH_HEADLESS ON)
|
||||
endif()
|
||||
|
||||
TEST_SSE_SUPPORT()
|
||||
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
|
||||
|
||||
# don't store paths to libs for portable distrobution
|
||||
if(WITH_INSTALL_PORTABLE)
|
||||
@@ -286,8 +285,8 @@ endif()
|
||||
# linux only, not cached
|
||||
set(WITH_BINRELOC OFF)
|
||||
|
||||
# MAXOSX only, set to avoid uninitialized
|
||||
set(EXETYPE)
|
||||
# MAXOSX only, set to avoid uninitialized
|
||||
set(EXETYPE "")
|
||||
|
||||
# C/C++ flags
|
||||
set(PLATFORM_CFLAGS)
|
||||
@@ -298,26 +297,26 @@ set(CXX_WARNINGS)
|
||||
|
||||
# libraries to link the binary with passed to target_link_libraries()
|
||||
# known as LLIBS to scons
|
||||
set(PLATFORM_LINKLIBS)
|
||||
set(PLATFORM_LINKLIBS "")
|
||||
|
||||
# Added to linker flags in setup_liblinks
|
||||
# - CMAKE_EXE_LINKER_FLAGS
|
||||
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||
set(PLATFORM_LINKFLAGS)
|
||||
set(PLATFORM_LINKFLAGS_DEBUG)
|
||||
set(PLATFORM_LINKFLAGS "")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||
|
||||
|
||||
# disabled for now, not supported
|
||||
# option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
|
||||
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
|
||||
# On Unix:
|
||||
# On Unix:
|
||||
# cmake ../blender \
|
||||
# -D PYTHON_VERSION=3.2 \
|
||||
# -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
|
||||
# -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
|
||||
#
|
||||
# On Macs:
|
||||
# On Macs:
|
||||
# cmake ../blender \
|
||||
# -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 \
|
||||
@@ -329,7 +328,7 @@ set(PLATFORM_LINKFLAGS_DEBUG)
|
||||
#Platform specifics
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
|
||||
|
||||
# needed for ubuntu 11.04
|
||||
if(EXISTS "/usr/lib/x86_64-linux-gnu")
|
||||
set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
|
||||
@@ -381,10 +380,12 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
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)
|
||||
mark_as_advanced(
|
||||
SDLMAIN_LIBRARY
|
||||
SDL_INCLUDE_DIR
|
||||
SDL_LIBRARY
|
||||
SDL_LIBRARY_TEMP
|
||||
)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
set(WITH_SDL OFF)
|
||||
@@ -428,11 +429,13 @@ if(UNIX AND NOT APPLE)
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
mark_as_advanced(ICONV_LIBRARY)
|
||||
mark_as_advanced(INTL_LIBRARY)
|
||||
mark_as_advanced(
|
||||
ICONV_LIBRARY
|
||||
INTL_LIBRARY
|
||||
)
|
||||
|
||||
if(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
set(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -443,13 +446,6 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
find_package(Samplerate)
|
||||
if(NOT SAMPLERATE_FOUND)
|
||||
set(WITH_SAMPLERATE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
find_package(OpenCOLLADA)
|
||||
if(OPENCOLLADA_FOUND)
|
||||
@@ -519,16 +515,16 @@ if(UNIX AND NOT APPLE)
|
||||
# Intel C++ Compiler
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
# think these next two are broken
|
||||
find_program(XIAR xiar)
|
||||
if(XIAR)
|
||||
find_program(XIAR xiar)
|
||||
if(XIAR)
|
||||
set(CMAKE_AR "${XIAR}")
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(XIAR)
|
||||
|
||||
find_program(XILD xild)
|
||||
if(XILD)
|
||||
find_program(XILD xild)
|
||||
if(XILD)
|
||||
set(CMAKE_LINKER "${XILD}")
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(XILD)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
|
||||
@@ -551,7 +547,7 @@ elseif(WIN32)
|
||||
message("64 bit compiler detected.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
|
||||
endif()
|
||||
|
||||
|
||||
add_definitions(-DWIN32)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
@@ -561,13 +557,6 @@ elseif(WIN32)
|
||||
set(ICONV_LIBPATH ${ICONV}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
set(SAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
|
||||
set(SAMPLERATE_LIBRARIES libsamplerate)
|
||||
set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
|
||||
endif()
|
||||
|
||||
set(PNG "${LIBDIR}/png")
|
||||
set(PNG_INCLUDE_DIR "${PNG}/include")
|
||||
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
|
||||
@@ -576,7 +565,7 @@ elseif(WIN32)
|
||||
set(JPEG_INCLUDE_DIR "${JPEG}/include")
|
||||
set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
|
||||
|
||||
set(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
set(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
if(WITH_OPENAL)
|
||||
set(OPENAL ${LIBDIR}/openal)
|
||||
@@ -641,9 +630,9 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
set(GETTEXT ${LIBDIR}/gettext)
|
||||
set(GETTEXT_INC ${GETTEXT}/include)
|
||||
set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
|
||||
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
set(GETTEXT_LIB gnu_gettext)
|
||||
set(GETTEXT_LIBRARIES gnu_gettext)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CL_64)
|
||||
@@ -684,7 +673,7 @@ elseif(WIN32)
|
||||
${LIBDIR}/opencollada/include/COLLADABaseUtils/include
|
||||
${LIBDIR}/opencollada/include/COLLADAFramework/include
|
||||
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
|
||||
${LIBDIR}/opencollada/include/GeneratedSaxParser/include
|
||||
${LIBDIR}/opencollada/include/GeneratedSaxParser/include
|
||||
)
|
||||
|
||||
set(OPENCOLLADA_LIBRARIES
|
||||
@@ -741,7 +730,7 @@ elseif(WIN32)
|
||||
set(OPENEXR_INCUDE ${OPENEXR}/include${MSVC_INC})
|
||||
set(OPENEXR_INCLUDE_DIRS
|
||||
${OPENEXR_INCUDE}
|
||||
${OPENEXR_INCUDE}/IlmImf
|
||||
${OPENEXR_INCUDE}/IlmImf
|
||||
${OPENEXR_INCUDE}/Iex
|
||||
${OPENEXR_INCUDE}/Imath
|
||||
)
|
||||
@@ -800,9 +789,9 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
set(GETTEXT ${LIBDIR}/gcc/gettext)
|
||||
set(GETTEXT_INC ${GETTEXT}/include)
|
||||
set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
|
||||
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
set(GETTEXT_LIB intl)
|
||||
set(GETTEXT_LIBRARIES intl)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIBRARIES libjpeg)
|
||||
@@ -817,7 +806,7 @@ elseif(WIN32)
|
||||
set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
|
||||
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
|
||||
set(PTHREADS_LIBRARIES pthreadGC2)
|
||||
|
||||
|
||||
set(FREETYPE ${LIBDIR}/gcc/freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
@@ -837,13 +826,13 @@ elseif(WIN32)
|
||||
${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include
|
||||
${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include
|
||||
${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include
|
||||
${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include
|
||||
${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include
|
||||
)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
|
||||
set(PCRE_LIBRARIES pcre)
|
||||
endif()
|
||||
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
|
||||
@@ -870,7 +859,7 @@ elseif(WIN32)
|
||||
set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
|
||||
set(JACK_LIBRARIES jack)
|
||||
set(JACK_LIBPATH ${JACK}/lib)
|
||||
|
||||
|
||||
# TODO, gives linking errors, force off
|
||||
set(WITH_JACK OFF)
|
||||
endif()
|
||||
@@ -908,7 +897,7 @@ elseif(APPLE)
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
@@ -952,8 +941,8 @@ elseif(APPLE)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
set(GETTEXT ${LIBDIR}/gettext)
|
||||
set(GETTEXT_INC "${GETTEXT}/include")
|
||||
set(GETTEXT_LIB intl iconv)
|
||||
set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include")
|
||||
set(GETTEXT_LIBRARIES intl iconv)
|
||||
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
endif()
|
||||
|
||||
@@ -991,16 +980,9 @@ elseif(APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
set(SAMPLERATE ${LIBDIR}/samplerate)
|
||||
set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
|
||||
set(SAMPLERATE_LIBRARIES samplerate)
|
||||
set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
|
||||
endif()
|
||||
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
NAMES
|
||||
SystemStubs
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
NAMES
|
||||
SystemStubs
|
||||
PATHS
|
||||
)
|
||||
mark_as_advanced(SYSTEMSTUBS_LIBRARY)
|
||||
@@ -1018,13 +1000,13 @@ elseif(APPLE)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
|
||||
if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
|
||||
#libSDL still needs 32bit carbon quicktime
|
||||
#libSDL still needs 32bit carbon quicktime
|
||||
endif()
|
||||
elseif(WITH_CODEC_QUICKTIME)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
|
||||
endif()
|
||||
|
||||
# XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
|
||||
# XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
|
||||
# ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
|
||||
if(WITH_INPUT_NDOF)
|
||||
# This thread it *should* work and check the framework - campbell
|
||||
@@ -1101,11 +1083,11 @@ elseif(APPLE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
|
||||
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
|
||||
@@ -1124,31 +1106,17 @@ endif()
|
||||
# See TEST_SSE_SUPPORT() for how this is defined.
|
||||
|
||||
if(WITH_RAYOPTIMIZATION)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(_sse "-msse")
|
||||
set(_sse2 "-msse2")
|
||||
elseif(MSVC)
|
||||
set(_sse "/arch:SSE")
|
||||
set(_sse2 "/arch:SSE2")
|
||||
else()
|
||||
message(WARNING "SSE flags for this compiler not known")
|
||||
set(_sse)
|
||||
set(_sse2)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_SSE_BUILD)
|
||||
set(PLATFORM_CFLAGS " ${_sse} ${PLATFORM_CFLAGS}")
|
||||
set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
|
||||
add_definitions(-D__SSE__ -D__MMX__)
|
||||
endif()
|
||||
if(SUPPORT_SSE2_BUILD)
|
||||
set(PLATFORM_CFLAGS " ${_sse2} ${PLATFORM_CFLAGS}")
|
||||
set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}")
|
||||
add_definitions(-D__SSE2__)
|
||||
if(NOT SUPPORT_SSE_BUILD) # dont double up
|
||||
add_definitions(-D__MMX__)
|
||||
endif()
|
||||
endif()
|
||||
unset(_sse)
|
||||
unset(_sse2)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1184,7 +1152,7 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender WebPlugin
|
||||
|
||||
if(WITH_WEBPLUGIN)
|
||||
if(WITH_WEBPLUGIN)
|
||||
set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
|
||||
set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
|
||||
|
||||
@@ -1196,13 +1164,13 @@ endif()
|
||||
# Configure OpenGL.
|
||||
find_package(OpenGL)
|
||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||
# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenMP.
|
||||
if(WITH_OPENMP)
|
||||
find_package(OpenMP)
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
@@ -1214,9 +1182,11 @@ if(WITH_OPENMP)
|
||||
set(WITH_OPENMP OFF)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(OpenMP_C_FLAGS)
|
||||
mark_as_advanced(OpenMP_CXX_FLAGS)
|
||||
endif()
|
||||
mark_as_advanced(
|
||||
OpenMP_C_FLAGS
|
||||
OpenMP_CXX_FLAGS
|
||||
)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure GLEW
|
||||
@@ -1231,8 +1201,10 @@ else()
|
||||
message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GLEW_LIBRARY)
|
||||
mark_as_advanced(GLEW_INCLUDE_PATH)
|
||||
mark_as_advanced(
|
||||
GLEW_LIBRARY
|
||||
GLEW_INCLUDE_PATH
|
||||
)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -1240,7 +1212,7 @@ endif()
|
||||
|
||||
if(WITH_PYTHON_MODULE)
|
||||
add_definitions(-DPy_ENABLE_SHARED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Extra compile flags
|
||||
@@ -1249,7 +1221,7 @@ if((NOT WIN32) AND (NOT MSVC))
|
||||
# used for internal debug checks
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
|
||||
|
||||
|
||||
# assert() checks for this.
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
|
||||
@@ -1299,6 +1271,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
|
||||
|
||||
# disable numbered, false positives
|
||||
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
|
||||
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
|
||||
|
||||
endif()
|
||||
|
||||
# MSVC2010 fails to links C++ libs right
|
||||
@@ -1399,8 +1375,8 @@ if(FIRST_RUN)
|
||||
macro(info_cfg_text
|
||||
_text)
|
||||
set(_config_msg "${_config_msg}\n\n ${_text}")
|
||||
|
||||
|
||||
|
||||
|
||||
endmacro()
|
||||
|
||||
info_cfg_text("Build Options:")
|
||||
@@ -1438,7 +1414,6 @@ if(FIRST_RUN)
|
||||
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)
|
||||
|
||||
14
SConstruct
14
SConstruct
@@ -30,6 +30,7 @@
|
||||
# Then read all SConscripts and build
|
||||
#
|
||||
# TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
|
||||
# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one.
|
||||
|
||||
import platform as pltfrm
|
||||
|
||||
@@ -283,26 +284,21 @@ if env['WITH_BF_OPENMP'] == 1:
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
env['CCFLAGS'].append('/openmp')
|
||||
env['CPPFLAGS'].append('/openmp')
|
||||
env['CXXFLAGS'].append('/openmp')
|
||||
else:
|
||||
if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
|
||||
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
|
||||
env['CCFLAGS'].append('-openmp')
|
||||
env['CPPFLAGS'].append('-openmp')
|
||||
env['CXXFLAGS'].append('-openmp')
|
||||
else:
|
||||
env.Append(CCFLAGS=['-fopenmp'])
|
||||
env.Append(CPPFLAGS=['-fopenmp'])
|
||||
env.Append(CXXFLAGS=['-fopenmp'])
|
||||
|
||||
if env['WITH_GHOST_COCOA'] == True:
|
||||
env.Append(CFLAGS=['-DGHOST_COCOA'])
|
||||
env.Append(CXXFLAGS=['-DGHOST_COCOA'])
|
||||
env.Append(CPPFLAGS=['-DGHOST_COCOA'])
|
||||
|
||||
if env['USE_QTKIT'] == True:
|
||||
env.Append(CFLAGS=['-DUSE_QTKIT'])
|
||||
env.Append(CXXFLAGS=['-DUSE_QTKIT'])
|
||||
env.Append(CFLAGS=['-DUSE_QTKIT'])
|
||||
env.Append(CPPFLAGS=['-DUSE_QTKIT'])
|
||||
|
||||
#check for additional debug libnames
|
||||
@@ -334,23 +330,19 @@ if 'blendernogame' in B.targets:
|
||||
# disable elbeem (fluidsim) compilation?
|
||||
if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
|
||||
if btools.ENDIAN == "big":
|
||||
env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
|
||||
env['CXXFLAGS'].append('-D__BIG_ENDIAN__')
|
||||
env['CCFLAGS'].append('-D__BIG_ENDIAN__')
|
||||
else:
|
||||
env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||
env['CXXFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||
env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||
|
||||
|
||||
# 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
|
||||
@@ -523,7 +515,7 @@ if env['OURPLATFORM']!='darwin':
|
||||
|
||||
for f in df:
|
||||
# This files aren't used anymore
|
||||
if f in ['.Blanguages', '.bfont.ttf']:
|
||||
if f in (".bfont.ttf", ):
|
||||
continue
|
||||
|
||||
if not env['WITH_BF_INTERNATIONAL']:
|
||||
|
||||
@@ -58,8 +58,6 @@ WITH_BF_PNG = True
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32'
|
||||
|
||||
WITH_BF_STATICLIBSAMPLERATE = True
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
@@ -91,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
|
||||
WITH_BF_FFTW3 = True
|
||||
WITH_BF_STATICFFTW3 = True
|
||||
|
||||
# JACK
|
||||
WITH_BF_JACK = True
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
||||
@@ -52,8 +52,6 @@ WITH_BF_PNG = True
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32'
|
||||
|
||||
WITH_BF_STATICLIBSAMPLERATE = True
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
@@ -82,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
|
||||
|
||||
# JACK
|
||||
WITH_BF_JACK = True
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
||||
@@ -52,8 +52,6 @@ WITH_BF_PNG = True
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64'
|
||||
|
||||
WITH_BF_STATICLIBSAMPLERATE = True
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
@@ -82,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
|
||||
|
||||
# JACK
|
||||
WITH_BF_JACK = True
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
||||
@@ -58,8 +58,6 @@ WITH_BF_PNG = True
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64'
|
||||
|
||||
WITH_BF_STATICLIBSAMPLERATE = True
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
WITH_BF_STATICZLIB = True
|
||||
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
|
||||
@@ -91,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
|
||||
WITH_BF_FFTW3 = True
|
||||
WITH_BF_STATICFFTW3 = True
|
||||
|
||||
# JACK
|
||||
WITH_BF_JACK = True
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
||||
@@ -34,67 +34,71 @@ 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()
|
||||
SET(PYTHON_VERSION 3.2 CACHE STRING "Python Version (major and minor only)")
|
||||
MARK_AS_ADVANCED(PYTHON_VERSION)
|
||||
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
|
||||
# See: http://docs.python.org/extending/embedding.html#linking-requirements
|
||||
# for why this is needed
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
|
||||
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})
|
||||
# only search for the dirs if we havn't already
|
||||
IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
|
||||
|
||||
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}
|
||||
SET(_python_ABI_FLAGS
|
||||
"m;mu;u; " # release
|
||||
"md;mud;ud;d" # debug
|
||||
)
|
||||
|
||||
FIND_LIBRARY(PYTHON_LIBRARY
|
||||
NAMES
|
||||
"python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
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}"
|
||||
)
|
||||
|
||||
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()
|
||||
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})
|
||||
|
||||
UNSET(_CURRENT_ABI_FLAGS)
|
||||
UNSET(_CURRENT_PATH)
|
||||
FIND_PATH(PYTHON_INCLUDE_DIR
|
||||
NAMES
|
||||
Python.h
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
|
||||
)
|
||||
|
||||
UNSET(_python_ABI_FLAGS)
|
||||
UNSET(_python_SEARCH_DIRS)
|
||||
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)
|
||||
ENDIF()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
|
||||
# all listed variables are TRUE
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# - 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
|
||||
)
|
||||
@@ -11,7 +11,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
|
||||
# disable audio, its possible some devs may want this but for now disable
|
||||
# so the python module doesnt hold the audio device and loads quickly.
|
||||
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
|
||||
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
|
||||
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
|
||||
set(WITH_JACK OFF CACHE FORCE BOOL)
|
||||
set(WITH_SDL OFF CACHE FORCE BOOL)
|
||||
|
||||
@@ -38,6 +38,5 @@ set(WITH_OPENCOLLADA OFF CACHE FORCE BOOL)
|
||||
set(WITH_OPENMP OFF CACHE FORCE BOOL)
|
||||
set(WITH_PYTHON_INSTALL OFF CACHE FORCE BOOL)
|
||||
set(WITH_RAYOPTIMIZATION OFF CACHE FORCE BOOL)
|
||||
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
|
||||
set(WITH_SDL OFF CACHE FORCE BOOL)
|
||||
set(WITH_X11_XINPUT OFF CACHE FORCE BOOL)
|
||||
|
||||
@@ -18,7 +18,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
|
||||
# disable audio, its possible some devs may want this but for now disable
|
||||
# so the python module doesnt hold the audio device and loads quickly.
|
||||
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
|
||||
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
|
||||
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
|
||||
set(WITH_JACK OFF CACHE FORCE BOOL)
|
||||
set(WITH_SDL OFF CACHE FORCE BOOL)
|
||||
|
||||
@@ -181,9 +181,6 @@ macro(SETUP_LIBDIRS)
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
link_directories(${SNDFILE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_SAMPLERATE)
|
||||
link_directories(${SAMPLERATE_LIBPATH})
|
||||
endif()
|
||||
if(WITH_FFTW3)
|
||||
link_directories(${FFTW3_LIBPATH})
|
||||
endif()
|
||||
@@ -235,7 +232,7 @@ macro(setup_liblinks
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
target_link_libraries(${target} ${GETTEXT_LIB})
|
||||
target_link_libraries(${target} ${GETTEXT_LIBRARIES})
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
target_link_libraries(${target} ${ICONV_LIBRARIES})
|
||||
@@ -254,9 +251,6 @@ macro(setup_liblinks
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SAMPLERATE)
|
||||
target_link_libraries(${target} ${SAMPLERATE_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SDL)
|
||||
target_link_libraries(${target} ${SDL_LIBRARY})
|
||||
endif()
|
||||
@@ -280,6 +274,11 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
|
||||
# Strange!, without this ffmpeg gives linking errors (on linux)
|
||||
# even though its linked above
|
||||
target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
|
||||
|
||||
target_link_libraries(${target} ${FFMPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENCOLLADA)
|
||||
@@ -320,44 +319,59 @@ macro(setup_liblinks
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(TEST_SSE_SUPPORT)
|
||||
macro(TEST_SSE_SUPPORT
|
||||
_sse_flags
|
||||
_sse2_flags)
|
||||
|
||||
include(CheckCSourceRuns)
|
||||
|
||||
# message(STATUS "Detecting SSE support")
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_REQUIRED_FLAGS "-msse -msse2")
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
set(${_sse_flags} "-msse")
|
||||
set(${_sse2_flags} "-msse2")
|
||||
elseif(MSVC)
|
||||
set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ?
|
||||
set(${_sse_flags} "/arch:SSE")
|
||||
set(${_sse2_flags} "/arch:SSE2")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
set(${_sse_flags} "") # icc defaults to -msse
|
||||
set(${_sse2_flags} "-msse2")
|
||||
else()
|
||||
message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known")
|
||||
set(${_sse_flags})
|
||||
set(${_sse2_flags})
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ${SUPPORT_SSE_BUILD})
|
||||
set(CMAKE_REQUIRED_FLAGS "${${_sse_flags}} ${${_sse2_flags}}")
|
||||
|
||||
if(NOT DEFINED SUPPORT_SSE_BUILD)
|
||||
# result cached
|
||||
check_c_source_runs("
|
||||
#include <xmmintrin.h>
|
||||
int main() { __m128 v = _mm_setzero_ps(); return 0; }"
|
||||
int main(void) { __m128 v = _mm_setzero_ps(); return 0; }"
|
||||
SUPPORT_SSE_BUILD)
|
||||
|
||||
|
||||
if(SUPPORT_SSE_BUILD)
|
||||
message(STATUS "SSE Support: detected.")
|
||||
else()
|
||||
message(STATUS "SSE Support: missing.")
|
||||
endif()
|
||||
set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ${SUPPORT_SSE2_BUILD})
|
||||
if(NOT DEFINED SUPPORT_SSE2_BUILD)
|
||||
# result cached
|
||||
check_c_source_runs("
|
||||
#include <emmintrin.h>
|
||||
int main() { __m128d v = _mm_setzero_pd(); return 0; }"
|
||||
int main(void) { __m128d v = _mm_setzero_pd(); return 0; }"
|
||||
SUPPORT_SSE2_BUILD)
|
||||
|
||||
if(SUPPORT_SSE2_BUILD)
|
||||
message(STATUS "SSE2 Support: detected.")
|
||||
else()
|
||||
message(STATUS "SSE2 Support: missing.")
|
||||
endif()
|
||||
set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
endmacro()
|
||||
|
||||
# when we have warnings as errors applied globally this
|
||||
@@ -493,7 +507,7 @@ endmacro()
|
||||
|
||||
|
||||
# hacks to override initial project settings
|
||||
# these macros must be called directly before/after project(Blender)
|
||||
# these macros must be called directly before/after project(Blender)
|
||||
macro(blender_project_hack_pre)
|
||||
# ----------------
|
||||
# MINGW HACK START
|
||||
@@ -535,8 +549,10 @@ macro(blender_project_hack_post)
|
||||
# have libs we define and that cmake & scons builds match.
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
|
||||
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
|
||||
mark_as_advanced(
|
||||
CMAKE_C_STANDARD_LIBRARIES
|
||||
CMAKE_CXX_STANDARD_LIBRARIES
|
||||
)
|
||||
endif()
|
||||
unset(_reset_standard_libraries)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Source: blender
|
||||
Section: graphics
|
||||
Priority: extra
|
||||
Maintainer: Dan Eicher <dan@trollwerks.org>
|
||||
Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsamplerate0-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev
|
||||
Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev
|
||||
Standards-Version: 3.9.1
|
||||
Homepage: http://blender.org/
|
||||
X-Python3-Version: >= 3.2, << 3.3
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
blender_srcdir=$(dirname $startdir)"/../.."
|
||||
# value may be formatted: 35042:35051M
|
||||
blender_revision=$(svnversion $blender_srcdir | cut -d: -f2 | awk '{print $3}')
|
||||
blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
||||
blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
||||
blender_version=$(expr $blender_version / 100).$(expr $blender_version % 100) # 256 -> 2.56
|
||||
blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender.h)
|
||||
# blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
|
||||
@@ -12,10 +12,12 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
|
||||
# map the version a -> 1
|
||||
# not to be confused with blender's internal subversions
|
||||
if [ "$blender_version_char" ]; then
|
||||
blender_version=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
|
||||
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
|
||||
else
|
||||
blender_version_full=${blender_version}
|
||||
fi
|
||||
|
||||
blender_ver_string=$blender_version+svn$blender_revision
|
||||
blender_ver_string=$blender_version+svn$blender_version_full
|
||||
|
||||
pkgname=blender-snapshot
|
||||
pkgver=$blender_ver_string
|
||||
@@ -25,7 +27,7 @@ arch=('i686' 'x86_64')
|
||||
url="www.blender.org"
|
||||
license=('GPL')
|
||||
groups=()
|
||||
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'libsamplerate' 'ffmpeg')
|
||||
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
|
||||
makedepends=('cmake' 'svn')
|
||||
optdepends=()
|
||||
provides=()
|
||||
@@ -61,5 +63,8 @@ build() {
|
||||
package() {
|
||||
cd $srcdir/build
|
||||
make DESTDIR="$pkgdir" install
|
||||
python -m compileall $pkgdir/usr/share/blender
|
||||
python -m compileall \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/addons
|
||||
}
|
||||
|
||||
@@ -148,11 +148,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
# TODO - set proper paths here (add precompiled to lib/ ? )
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
|
||||
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = True
|
||||
BF_JACK = '/usr/local'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
|
||||
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = True
|
||||
BF_JACK = '/usr/local'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
|
||||
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = True
|
||||
BF_JACK = '/usr/local'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
|
||||
@@ -23,13 +23,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr'
|
||||
WITH_BF_STATICLIBSAMPLERATE = False
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
BF_LIBSAMPLERATE_LIB_STATIC = '${BF_LIBSAMPLERATE}/lib/libsamplerate.a'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
|
||||
@@ -23,11 +23,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
|
||||
@@ -16,11 +16,6 @@ WITH_BF_OPENAL = False
|
||||
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
|
||||
@@ -22,11 +22,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
BF_LIBSAMPLERATE = '/usr/local'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'samplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
|
||||
@@ -23,11 +23,6 @@ BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
|
||||
@@ -29,11 +29,6 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
|
||||
@@ -152,6 +147,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
|
||||
|
||||
@@ -17,7 +17,7 @@ BF_PYTHON_LIB = 'python32'
|
||||
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = False
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
@@ -40,11 +40,6 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
|
||||
BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
|
||||
BF_LIBSAMPLERATE_LIB = 'libsamplerate'
|
||||
BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
@@ -156,6 +151,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
|
||||
|
||||
@@ -131,7 +131,6 @@ def setup_staticlibs(lenv):
|
||||
lenv['BF_JPEG_LIBPATH'],
|
||||
lenv['BF_ZLIB_LIBPATH'],
|
||||
lenv['BF_PNG_LIBPATH'],
|
||||
lenv['BF_LIBSAMPLERATE_LIBPATH'],
|
||||
lenv['BF_ICONV_LIBPATH']
|
||||
])
|
||||
|
||||
@@ -194,9 +193,6 @@ def setup_staticlibs(lenv):
|
||||
if lenv['OURPLATFORM'] == 'linuxcross':
|
||||
libincs += Split(lenv['BF_OPENMP_LIBPATH'])
|
||||
|
||||
if lenv['WITH_BF_STATICLIBSAMPLERATE']:
|
||||
statlibs += Split(lenv['BF_LIBSAMPLERATE_LIB_STATIC'])
|
||||
|
||||
# setting this last so any overriding of manually libs could be handled
|
||||
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
libincs.append('/usr/lib')
|
||||
@@ -270,9 +266,6 @@ def setup_syslibs(lenv):
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
syslibs.append(lenv['BF_EXPAT_LIB'])
|
||||
|
||||
if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
|
||||
syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB'])
|
||||
|
||||
if lenv['WITH_BF_JEMALLOC']:
|
||||
if not lenv['WITH_BF_STATICJEMALLOC']:
|
||||
syslibs += Split(lenv['BF_JEMALLOC_LIB'])
|
||||
@@ -572,8 +565,6 @@ def AppIt(target=None, source=None, env=None):
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
|
||||
@@ -634,7 +625,11 @@ def UnixPyBundle(target=None, source=None, env=None):
|
||||
run("rm -rf '%s/distutils'" % py_target)
|
||||
run("rm -rf '%s/lib2to3'" % py_target)
|
||||
run("rm -rf '%s/config'" % py_target)
|
||||
run("rm -rf '%s/config-*'" % py_target)
|
||||
|
||||
for f in os.listdir(py_target):
|
||||
if f.startswith("config-"):
|
||||
run("rm -rf '%s/%s'" % (py_target, f))
|
||||
|
||||
run("rm -rf '%s/site-packages'" % py_target)
|
||||
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
|
||||
run("rm -rf '%s/idlelib'" % py_target)
|
||||
|
||||
@@ -99,7 +99,6 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
|
||||
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
|
||||
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
|
||||
'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_STATICLIBSAMPLERATE', 'BF_LIBSAMPLERATE_LIB_STATIC',
|
||||
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
|
||||
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
|
||||
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
|
||||
@@ -267,13 +266,6 @@ def read_opts(env, cfg, args):
|
||||
('BF_SDL_LIB', 'SDL library', ''),
|
||||
('BF_SDL_LIBPATH', 'SDL library path', ''),
|
||||
|
||||
('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''),
|
||||
('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''),
|
||||
('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''),
|
||||
('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''),
|
||||
('BF_LIBSAMPLERATE_LIB_STATIC', 'Path to libsamplerate static library', ''),
|
||||
(BoolVariable('WITH_BF_STATICLIBSAMPLERATE', 'Staticly link to libsamplerate', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
|
||||
('BF_JACK', 'jack base path', ''),
|
||||
('BF_JACK_INC', 'jack include path', ''),
|
||||
|
||||
@@ -11,10 +11,10 @@ device = aud.device()
|
||||
factory = aud.Factory('music.ogg')
|
||||
|
||||
# play the audio, this return a handle to control play/pause
|
||||
handle = device.play(sound)
|
||||
handle = device.play(factory)
|
||||
# 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)
|
||||
factory_buffered = aud.Factory.buffer(factory)
|
||||
handle_buffered = device.play(factory_buffered)
|
||||
|
||||
# stop the sounds (otherwise they play until their ends)
|
||||
handle.stop()
|
||||
|
||||
@@ -909,6 +909,181 @@ Added
|
||||
|
||||
* :class:`bpy.types.SceneGameData.use_glsl_color_management`
|
||||
|
||||
|
||||
2.58 to 2.59
|
||||
============
|
||||
|
||||
bpy.types.Scene
|
||||
---------------
|
||||
|
||||
Function Arguments
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* :class:`bpy.types.Scene.collada_export` (filepath, selected), *was (filepath)*
|
||||
|
||||
bpy.types.MultiresModifier
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.MultiresModifier.use_subsurf_uv`
|
||||
|
||||
bpy.types.KeyMap
|
||||
----------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **copy_to_user**
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **is_user_defined** -> :class:`bpy.types.KeyMap.is_user_modified`
|
||||
|
||||
bpy.types.SceneRenderLayer
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SceneRenderLayer.use_pass_material_index`
|
||||
|
||||
bpy.types.ToolSettings
|
||||
----------------------
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **use_snap_project_self** -> :class:`bpy.types.ToolSettings.use_snap_self`
|
||||
|
||||
bpy.types.UserPreferencesInput
|
||||
------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_fly_helicopter`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_lock_horizon`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_orbit_invert_axes`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_sensitivity`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_show_guide`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_zoom_invert`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_zoom_updown`
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **edited_keymaps**
|
||||
* **ndof_pan_speed**
|
||||
* **ndof_rotate_speed**
|
||||
|
||||
bpy.types.IDMaterials
|
||||
---------------------
|
||||
|
||||
Function Arguments
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* :class:`bpy.types.IDMaterials.pop` (index, update_data), *was (index)*
|
||||
|
||||
bpy.types.Material
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Material.pass_index`
|
||||
|
||||
bpy.types.RenderLayer
|
||||
---------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RenderLayer.use_pass_material_index`
|
||||
|
||||
bpy.types.Object
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Object.closest_point_on_mesh`
|
||||
|
||||
bpy.types.ThemeNodeEditor
|
||||
-------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ThemeNodeEditor.noodle_curving`
|
||||
|
||||
bpy.types.ChildOfConstraint
|
||||
---------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ChildOfConstraint.inverse_matrix`
|
||||
|
||||
bpy.types.KeyConfigurations
|
||||
---------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.KeyConfigurations.addon`
|
||||
* :class:`bpy.types.KeyConfigurations.user`
|
||||
|
||||
bpy.types.Image
|
||||
---------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Image.use_generated_float`
|
||||
|
||||
bpy.types.KeyMapItem
|
||||
--------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.KeyMapItem.is_user_modified`
|
||||
|
||||
|
||||
2.59 to 2.60
|
||||
============
|
||||
|
||||
.. These have been manually added wait until RC to do final changelog!
|
||||
|
||||
bpy.types.MeshTextureFace
|
||||
-------------------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **use_image**
|
||||
* **use_object_color**
|
||||
* **use_blend_shared**
|
||||
|
||||
Moved
|
||||
^^^^^
|
||||
|
||||
* **hide** -> :class:`bpy.types.Material.game_settings.invisible`
|
||||
* **use_collision** -> :class:`bpy.types.Material.game_settings.physics`
|
||||
* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless`
|
||||
* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling`
|
||||
* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text`
|
||||
* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend`
|
||||
* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend`
|
||||
* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
|
||||
.. Automatically Generated, 2.59 -> r40804!
|
||||
|
||||
bpy.types.RenderSettings
|
||||
------------------------
|
||||
|
||||
@@ -937,7 +1112,15 @@ Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Sound.factory`
|
||||
* :class:`bpy.types.Sound.mono`
|
||||
* :class:`bpy.types.Sound.use_mono`
|
||||
|
||||
bpy.types.Camera
|
||||
----------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Camera.view_frame`
|
||||
|
||||
bpy.types.Scene
|
||||
---------------
|
||||
@@ -961,7 +1144,7 @@ bpy.types.Armature
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Armature.vert_deformer`
|
||||
* :class:`bpy.types.Armature.deform_method`
|
||||
|
||||
bpy.types.GameObjectSettings
|
||||
----------------------------
|
||||
@@ -969,8 +1152,8 @@ bpy.types.GameObjectSettings
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.GameObjectSettings.create_obstacle`
|
||||
* :class:`bpy.types.GameObjectSettings.obstacle_radius`
|
||||
* :class:`bpy.types.GameObjectSettings.use_obstacle_create`
|
||||
|
||||
bpy.types.BlendData
|
||||
-------------------
|
||||
@@ -997,13 +1180,13 @@ Added
|
||||
* :class:`bpy.types.ThemeGraphEditor.handle_auto_clamped`
|
||||
* :class:`bpy.types.ThemeGraphEditor.handle_sel_auto_clamped`
|
||||
|
||||
bpy.types.MultiresModifier
|
||||
--------------------------
|
||||
bpy.types.CompositorNodeIDMask
|
||||
------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.MultiresModifier.use_subsurf_uv`
|
||||
* :class:`bpy.types.CompositorNodeIDMask.use_smooth_mask`
|
||||
|
||||
bpy.types.Node
|
||||
--------------
|
||||
@@ -1013,27 +1196,6 @@ Added
|
||||
|
||||
* :class:`bpy.types.Node.parent`
|
||||
|
||||
bpy.types.KeyMap
|
||||
----------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **copy_to_user**
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **is_user_defined** -> :class:`bpy.types.KeyMap.is_user_modified`
|
||||
|
||||
bpy.types.SceneRenderLayer
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SceneRenderLayer.use_pass_material_index`
|
||||
|
||||
bpy.types.Texture
|
||||
-----------------
|
||||
|
||||
@@ -1042,6 +1204,14 @@ Added
|
||||
|
||||
* :class:`bpy.types.Texture.evaluate`
|
||||
|
||||
bpy.types.UILayout
|
||||
------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UILayout.template_keymap_item_properties`
|
||||
|
||||
bpy.types.ToolSettings
|
||||
----------------------
|
||||
|
||||
@@ -1050,45 +1220,18 @@ Added
|
||||
|
||||
* :class:`bpy.types.ToolSettings.use_multipaint`
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
|
||||
* **use_snap_project_self** -> :class:`bpy.types.ToolSettings.use_snap_self`
|
||||
|
||||
bpy.types.RenderEngine
|
||||
----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RenderEngine.report`
|
||||
|
||||
bpy.types.UserPreferencesInput
|
||||
------------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_fly_helicopter`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_lock_horizon`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_orbit_invert_axes`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_panx_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_pany_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_panz_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_roll_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_rotate_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_sensitivity`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_show_guide`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_tilt_invert_axis`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_zoom_invert`
|
||||
* :class:`bpy.types.UserPreferencesInput.ndof_zoom_updown`
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **edited_keymaps**
|
||||
* **ndof_pan_speed**
|
||||
* **ndof_rotate_speed**
|
||||
|
||||
bpy.types.LockedTrackConstraint
|
||||
-------------------------------
|
||||
@@ -1101,10 +1244,18 @@ Added
|
||||
bpy.types.SpaceGraphEditor
|
||||
--------------------------
|
||||
|
||||
Renamed
|
||||
^^^^^^^
|
||||
Moved
|
||||
^^^^^
|
||||
|
||||
* **use_fancy_drawing** -> :class:`bpy.types.SpaceGraphEditor.use_beauty_drawing`
|
||||
* use_fancy_drawing -> :class:`bpy.types.SpaceGraphEditor.use_beauty_drawing`
|
||||
|
||||
bpy.types.ParticleSystem
|
||||
------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ParticleSystem.dt_frac`
|
||||
|
||||
bpy.types.Mesh
|
||||
--------------
|
||||
@@ -1176,14 +1327,6 @@ Added
|
||||
* :class:`bpy.types.EnvironmentMap.is_valid`
|
||||
* :class:`bpy.types.EnvironmentMap.save`
|
||||
|
||||
bpy.types.IDMaterials
|
||||
---------------------
|
||||
|
||||
Function Arguments
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* :class:`bpy.types.IDMaterials.save` (index, update_data), *was (index)*
|
||||
|
||||
bpy.types.UserPreferencesSystem
|
||||
-------------------------------
|
||||
|
||||
@@ -1213,7 +1356,7 @@ bpy.types.MovieSequence
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.MovieSequence.streamindex`
|
||||
* :class:`bpy.types.MovieSequence.stream_index`
|
||||
|
||||
bpy.types.Material
|
||||
------------------
|
||||
@@ -1222,15 +1365,6 @@ Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Material.game_settings`
|
||||
* :class:`bpy.types.Material.pass_index`
|
||||
|
||||
bpy.types.RenderLayer
|
||||
---------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.RenderLayer.use_pass_material_index`
|
||||
|
||||
bpy.types.Object
|
||||
----------------
|
||||
@@ -1238,17 +1372,8 @@ bpy.types.Object
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.Object.closest_point_on_mesh`
|
||||
* :class:`bpy.types.Object.matrix_parent_inverse`
|
||||
|
||||
bpy.types.ThemeNodeEditor
|
||||
-------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ThemeNodeEditor.noodle_curving`
|
||||
|
||||
bpy.types.SequenceProxy
|
||||
-----------------------
|
||||
|
||||
@@ -1265,14 +1390,6 @@ Added
|
||||
* :class:`bpy.types.SequenceProxy.quality`
|
||||
* :class:`bpy.types.SequenceProxy.timecode`
|
||||
|
||||
bpy.types.SpaceUVEditor
|
||||
-----------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.SpaceUVEditor.show_faces`
|
||||
|
||||
bpy.types.Sequence
|
||||
------------------
|
||||
|
||||
@@ -1281,14 +1398,6 @@ Added
|
||||
|
||||
* :class:`bpy.types.Sequence.waveform`
|
||||
|
||||
bpy.types.ChildOfConstraint
|
||||
---------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.ChildOfConstraint.inverse_matrix`
|
||||
|
||||
bpy.types.DopeSheet
|
||||
-------------------
|
||||
|
||||
@@ -1311,15 +1420,6 @@ Added
|
||||
* :class:`bpy.types.ActionActuator.use_force`
|
||||
* :class:`bpy.types.ActionActuator.use_local`
|
||||
|
||||
bpy.types.KeyConfigurations
|
||||
---------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.KeyConfigurations.addon`
|
||||
* :class:`bpy.types.KeyConfigurations.user`
|
||||
|
||||
bpy.types.VertexGroup
|
||||
---------------------
|
||||
|
||||
@@ -1344,7 +1444,6 @@ Added
|
||||
|
||||
* :class:`bpy.types.Image.pack`
|
||||
* :class:`bpy.types.Image.unpack`
|
||||
* :class:`bpy.types.Image.use_generated_float`
|
||||
|
||||
bpy.types.Curve
|
||||
---------------
|
||||
@@ -1360,13 +1459,14 @@ Removed
|
||||
* **use_fill_back**
|
||||
* **use_fill_front**
|
||||
|
||||
bpy.types.KeyMapItem
|
||||
--------------------
|
||||
bpy.types.ParticleSettings
|
||||
--------------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
* :class:`bpy.types.KeyMapItem.is_user_modified`
|
||||
* :class:`bpy.types.ParticleSettings.adaptive_subframes`
|
||||
* :class:`bpy.types.ParticleSettings.courant_target`
|
||||
|
||||
bpy.types.SceneGameData
|
||||
-----------------------
|
||||
@@ -1380,27 +1480,3 @@ Added
|
||||
* :class:`bpy.types.SceneGameData.restrict_animation_updates`
|
||||
* :class:`bpy.types.SceneGameData.show_obstacle_simulation`
|
||||
|
||||
bpy.types.MeshTextureFace
|
||||
-------------------------
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
* **use_image**
|
||||
* **use_object_color**
|
||||
* **use_blend_shared**
|
||||
|
||||
Moved
|
||||
^^^^^
|
||||
|
||||
* **hide** -> :class:`bpy.types.Material.game_settings.invisible`
|
||||
* **use_collision** -> :class:`bpy.types.Material.game_settings.physics`
|
||||
* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless`
|
||||
* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling`
|
||||
* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text`
|
||||
* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend`
|
||||
* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend`
|
||||
* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation`
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ def api_changelog(api_from, api_to, api_out):
|
||||
for func_id, args_old, args_new in func_args:
|
||||
args_new = ", ".join(args_new)
|
||||
args_old = ", ".join(args_old)
|
||||
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, prop_id, args_new, args_old))
|
||||
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
|
||||
fw("\n")
|
||||
|
||||
fout.close()
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
set(INC
|
||||
.
|
||||
FX
|
||||
SRC
|
||||
intern
|
||||
../ffmpeg
|
||||
)
|
||||
@@ -262,20 +261,6 @@ if(WITH_CODEC_SNDFILE)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
add_definitions(-DWITH_SAMPLERATE)
|
||||
list(APPEND INC_SYS
|
||||
${SAMPLERATE_INCLUDE_DIRS}
|
||||
)
|
||||
list(APPEND SRC
|
||||
SRC/AUD_SRCResampleFactory.cpp
|
||||
SRC/AUD_SRCResampleReader.cpp
|
||||
|
||||
SRC/AUD_SRCResampleFactory.h
|
||||
SRC/AUD_SRCResampleReader.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3 AND FALSE)
|
||||
add_definitions(-DWITH_FFTW3)
|
||||
list(APPEND INC
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
Import ('env')
|
||||
|
||||
sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp')
|
||||
incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] + ' ' + env['BF_LIBSAMPLERATE_INC']
|
||||
sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp')
|
||||
incs = '. intern FX ' + env['BF_PTHREADS_INC']
|
||||
defs = []
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
@@ -44,7 +44,4 @@ if env['WITH_BF_PYTHON']:
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
|
||||
# not optional with scons yet
|
||||
defs.append('WITH_SAMPLERATE')
|
||||
|
||||
env.BlenderLib ('bf_intern_audaspace', sources, Split(incs), defs, libtype=['intern','player'], priority = [25,215] )
|
||||
|
||||
@@ -37,18 +37,18 @@
|
||||
|
||||
class CTR_Link {
|
||||
public:
|
||||
CTR_Link(
|
||||
CTR_Link(
|
||||
) ;
|
||||
|
||||
CTR_Link(
|
||||
CTR_Link(
|
||||
CTR_Link *next,
|
||||
CTR_Link *prev
|
||||
) ;
|
||||
|
||||
|
||||
CTR_Link *
|
||||
getNext(
|
||||
) const ;
|
||||
|
||||
|
||||
CTR_Link *
|
||||
getPrev(
|
||||
) const ;
|
||||
@@ -76,14 +76,14 @@ public:
|
||||
) ;
|
||||
|
||||
private:
|
||||
CTR_Link *m_next;
|
||||
CTR_Link *m_prev;
|
||||
CTR_Link *m_next;
|
||||
CTR_Link *m_prev;
|
||||
};
|
||||
|
||||
class CTR_List {
|
||||
public:
|
||||
|
||||
CTR_List(
|
||||
CTR_List(
|
||||
) ;
|
||||
|
||||
CTR_Link *
|
||||
@@ -103,10 +103,10 @@ public:
|
||||
addTail(
|
||||
CTR_Link *link
|
||||
) ;
|
||||
|
||||
|
||||
private:
|
||||
CTR_Link m_head;
|
||||
CTR_Link m_tail;
|
||||
CTR_Link m_head;
|
||||
CTR_Link m_tail;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,24 +37,24 @@
|
||||
template <class Key, class Value>
|
||||
class CTR_Map {
|
||||
private:
|
||||
struct Entry {
|
||||
Entry (Entry *next, Key key, Value value) :
|
||||
m_next(next),
|
||||
m_key(key),
|
||||
m_value(value) {}
|
||||
struct Entry {
|
||||
Entry (Entry *next, Key key, Value value) :
|
||||
m_next(next),
|
||||
m_key(key),
|
||||
m_value(value) {}
|
||||
|
||||
Entry *m_next;
|
||||
Key m_key;
|
||||
Value m_value;
|
||||
};
|
||||
|
||||
Entry *m_next;
|
||||
Key m_key;
|
||||
Value m_value;
|
||||
};
|
||||
|
||||
public:
|
||||
CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) {
|
||||
m_buckets = new Entry *[num_buckets];
|
||||
for (int i = 0; i < num_buckets; ++i) {
|
||||
m_buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) {
|
||||
m_buckets = new Entry *[num_buckets];
|
||||
for (int i = 0; i < num_buckets; ++i) {
|
||||
m_buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CTR_Map(const CTR_Map& map)
|
||||
{
|
||||
@@ -68,114 +68,114 @@ public:
|
||||
insert(entry->m_key, entry->m_value);
|
||||
}
|
||||
}
|
||||
|
||||
int size() {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
Value* at(int index) {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
if (count==index)
|
||||
{
|
||||
return &bucket->m_value;
|
||||
}
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Key* getKey(int index) {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
if (count==index)
|
||||
{
|
||||
return &bucket->m_key;
|
||||
}
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
for (int i = 0; i < m_num_buckets; ++i) {
|
||||
Entry *entry_ptr = m_buckets[i];
|
||||
|
||||
while (entry_ptr != 0) {
|
||||
Entry *tmp_ptr = entry_ptr->m_next;
|
||||
delete entry_ptr;
|
||||
entry_ptr = tmp_ptr;
|
||||
}
|
||||
m_buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
~CTR_Map() {
|
||||
clear();
|
||||
delete [] m_buckets;
|
||||
}
|
||||
|
||||
void insert(const Key& key, const Value& value) {
|
||||
Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets];
|
||||
while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) {
|
||||
entry_ptr = entry_ptr->m_next;
|
||||
}
|
||||
|
||||
if (entry_ptr != 0) {
|
||||
entry_ptr->m_value = value;
|
||||
}
|
||||
else {
|
||||
Entry **bucket = &m_buckets[key.hash() % m_num_buckets];
|
||||
*bucket = new Entry(*bucket, key, value);
|
||||
}
|
||||
}
|
||||
int size() {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void remove(const Key& key) {
|
||||
Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets];
|
||||
while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) {
|
||||
entry_ptr = &(*entry_ptr)->m_next;
|
||||
}
|
||||
|
||||
if (*entry_ptr != 0) {
|
||||
Entry *tmp_ptr = (*entry_ptr)->m_next;
|
||||
delete *entry_ptr;
|
||||
*entry_ptr = tmp_ptr;
|
||||
}
|
||||
}
|
||||
Value* at(int index) {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
if (count==index)
|
||||
{
|
||||
return &bucket->m_value;
|
||||
}
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Key* getKey(int index) {
|
||||
int count=0;
|
||||
for (int i=0;i<m_num_buckets;i++)
|
||||
{
|
||||
Entry* bucket = m_buckets[i];
|
||||
while(bucket)
|
||||
{
|
||||
if (count==index)
|
||||
{
|
||||
return &bucket->m_key;
|
||||
}
|
||||
bucket = bucket->m_next;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
for (int i = 0; i < m_num_buckets; ++i) {
|
||||
Entry *entry_ptr = m_buckets[i];
|
||||
|
||||
while (entry_ptr != 0) {
|
||||
Entry *tmp_ptr = entry_ptr->m_next;
|
||||
delete entry_ptr;
|
||||
entry_ptr = tmp_ptr;
|
||||
}
|
||||
m_buckets[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
~CTR_Map() {
|
||||
clear();
|
||||
delete [] m_buckets;
|
||||
}
|
||||
|
||||
void insert(const Key& key, const Value& value) {
|
||||
Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets];
|
||||
while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) {
|
||||
entry_ptr = entry_ptr->m_next;
|
||||
}
|
||||
|
||||
if (entry_ptr != 0) {
|
||||
entry_ptr->m_value = value;
|
||||
}
|
||||
else {
|
||||
Entry **bucket = &m_buckets[key.hash() % m_num_buckets];
|
||||
*bucket = new Entry(*bucket, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
void remove(const Key& key) {
|
||||
Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets];
|
||||
while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) {
|
||||
entry_ptr = &(*entry_ptr)->m_next;
|
||||
}
|
||||
|
||||
if (*entry_ptr != 0) {
|
||||
Entry *tmp_ptr = (*entry_ptr)->m_next;
|
||||
delete *entry_ptr;
|
||||
*entry_ptr = tmp_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
Value *operator[](Key key) {
|
||||
Entry *bucket = m_buckets[key.hash() % m_num_buckets];
|
||||
while ((bucket != 0) && !(key == bucket->m_key)) {
|
||||
bucket = bucket->m_next;
|
||||
}
|
||||
return bucket != 0 ? &bucket->m_value : 0;
|
||||
}
|
||||
|
||||
Value *operator[](Key key) {
|
||||
Entry *bucket = m_buckets[key.hash() % m_num_buckets];
|
||||
while ((bucket != 0) && !(key == bucket->m_key)) {
|
||||
bucket = bucket->m_next;
|
||||
}
|
||||
return bucket != 0 ? &bucket->m_value : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_num_buckets;
|
||||
Entry **m_buckets;
|
||||
int m_num_buckets;
|
||||
Entry **m_buckets;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -96,14 +96,14 @@ typedef enum {
|
||||
} GHOST_TFireTimeConstant;
|
||||
|
||||
typedef enum {
|
||||
GHOST_kModifierKeyLeftShift = 0,
|
||||
GHOST_kModifierKeyRightShift,
|
||||
GHOST_kModifierKeyLeftAlt,
|
||||
GHOST_kModifierKeyRightAlt,
|
||||
GHOST_kModifierKeyLeftControl,
|
||||
GHOST_kModifierKeyRightControl,
|
||||
GHOST_kModifierKeyOS,
|
||||
GHOST_kModifierKeyNumMasks
|
||||
GHOST_kModifierKeyLeftShift = 0,
|
||||
GHOST_kModifierKeyRightShift,
|
||||
GHOST_kModifierKeyLeftAlt,
|
||||
GHOST_kModifierKeyRightAlt,
|
||||
GHOST_kModifierKeyLeftControl,
|
||||
GHOST_kModifierKeyRightControl,
|
||||
GHOST_kModifierKeyOS,
|
||||
GHOST_kModifierKeyNumMasks
|
||||
} GHOST_TModifierKeyMask;
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,12 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f
|
||||
sources.remove('intern' + os.sep + f + 'SDL.cpp')
|
||||
except ValueError:
|
||||
pass
|
||||
defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
|
||||
## removing because scons does not support system installation
|
||||
## if this is used for blender.org builds it means our distrobution
|
||||
## will find any locally installed blender and double up its script path.
|
||||
## So until this is supported properly as with CMake,
|
||||
## just dont use the PREFIX.
|
||||
# defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
|
||||
defs += ['WITH_X11_XINPUT'] # XXX, make an option
|
||||
|
||||
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
|
||||
@@ -102,8 +107,8 @@ if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-v
|
||||
if window_system in ('win32-vc', 'win64-vc'):
|
||||
env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') )
|
||||
|
||||
elif env['OURPLATFORM'] == 'darwin': # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet
|
||||
env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/gcc-4.2' )
|
||||
elif env['WITH_GHOST_COCOA']: # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet
|
||||
env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/g++-4.2' )
|
||||
print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC"
|
||||
|
||||
else:
|
||||
|
||||
@@ -44,35 +44,35 @@
|
||||
* @date May 15, 2001
|
||||
*/
|
||||
struct GHOST_Buttons {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_Buttons();
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_Buttons();
|
||||
|
||||
virtual ~GHOST_Buttons();
|
||||
|
||||
/**
|
||||
* Returns the state of a single button.
|
||||
* @param mask. Key button to return.
|
||||
* @return The state of the button (pressed == true).
|
||||
*/
|
||||
virtual bool get(GHOST_TButtonMask mask) const;
|
||||
|
||||
/**
|
||||
* Updates the state of a single button.
|
||||
* @param mask. Button state to update.
|
||||
* @param down. The new state of the button.
|
||||
*/
|
||||
virtual void set(GHOST_TButtonMask mask, bool down);
|
||||
|
||||
/**
|
||||
* Sets the state of all buttons to up.
|
||||
*/
|
||||
virtual void clear();
|
||||
|
||||
GHOST_TUns8 m_ButtonLeft : 1;
|
||||
GHOST_TUns8 m_ButtonMiddle : 1;
|
||||
GHOST_TUns8 m_ButtonRight : 1;
|
||||
|
||||
/**
|
||||
* Returns the state of a single button.
|
||||
* @param mask. Key button to return.
|
||||
* @return The state of the button (pressed == true).
|
||||
*/
|
||||
virtual bool get(GHOST_TButtonMask mask) const;
|
||||
|
||||
/**
|
||||
* Updates the state of a single button.
|
||||
* @param mask. Button state to update.
|
||||
* @param down. The new state of the button.
|
||||
*/
|
||||
virtual void set(GHOST_TButtonMask mask, bool down);
|
||||
|
||||
/**
|
||||
* Sets the state of all buttons to up.
|
||||
*/
|
||||
virtual void clear();
|
||||
|
||||
GHOST_TUns8 m_ButtonLeft : 1;
|
||||
GHOST_TUns8 m_ButtonMiddle : 1;
|
||||
GHOST_TUns8 m_ButtonRight : 1;
|
||||
};
|
||||
|
||||
#endif // _GHOST_BUTTONS_H_
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
*/
|
||||
struct GHOST_ModifierKeys
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_ModifierKeys();
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_ModifierKeys();
|
||||
|
||||
virtual ~GHOST_ModifierKeys();
|
||||
|
||||
@@ -58,25 +58,25 @@ struct GHOST_ModifierKeys
|
||||
*/
|
||||
static GHOST_TKey getModifierKeyCode(GHOST_TModifierKeyMask mask);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the state of a single modifier key.
|
||||
* @param mask. Key state to return.
|
||||
* @return The state of the key (pressed == true).
|
||||
*/
|
||||
virtual bool get(GHOST_TModifierKeyMask mask) const;
|
||||
|
||||
/**
|
||||
* Updates the state of a single modifier key.
|
||||
* @param mask. Key state to update.
|
||||
* @param down. The new state of the key.
|
||||
*/
|
||||
virtual void set(GHOST_TModifierKeyMask mask, bool down);
|
||||
|
||||
/**
|
||||
* Sets the state of all modifier keys to up.
|
||||
*/
|
||||
virtual void clear();
|
||||
|
||||
/**
|
||||
* Returns the state of a single modifier key.
|
||||
* @param mask. Key state to return.
|
||||
* @return The state of the key (pressed == true).
|
||||
*/
|
||||
virtual bool get(GHOST_TModifierKeyMask mask) const;
|
||||
|
||||
/**
|
||||
* Updates the state of a single modifier key.
|
||||
* @param mask. Key state to update.
|
||||
* @param down. The new state of the key.
|
||||
*/
|
||||
virtual void set(GHOST_TModifierKeyMask mask, bool down);
|
||||
|
||||
/**
|
||||
* Sets the state of all modifier keys to up.
|
||||
*/
|
||||
virtual void clear();
|
||||
|
||||
/**
|
||||
* Determines whether to modifier key states are equal.
|
||||
@@ -84,21 +84,21 @@ struct GHOST_ModifierKeys
|
||||
* @return Indication of equality.
|
||||
*/
|
||||
virtual bool equals(const GHOST_ModifierKeys& keys) const;
|
||||
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftShift : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightShift : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftAlt : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightAlt : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftControl : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightControl : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_OS : 1;
|
||||
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftShift : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightShift : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftAlt : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightAlt : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_LeftControl : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_RightControl : 1;
|
||||
/** Bitfield that stores the appropriate key state. */
|
||||
GHOST_TUns8 m_OS : 1;
|
||||
};
|
||||
|
||||
#endif // _GHOST_MODIFIER_KEYS_H_
|
||||
|
||||
@@ -55,16 +55,16 @@ class GHOST_EventWindow;
|
||||
*/
|
||||
class GHOST_SystemCarbon : public GHOST_System {
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemCarbon();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemCarbon();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemCarbon();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemCarbon();
|
||||
|
||||
/***************************************************************************************
|
||||
** Time(r) functionality
|
||||
***************************************************************************************/
|
||||
@@ -211,54 +211,54 @@ protected:
|
||||
virtual GHOST_TSuccess exit();
|
||||
|
||||
|
||||
/**
|
||||
* Handles a tablet event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleTabletEvent(EventRef event);
|
||||
/**
|
||||
* Handles a mouse event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleMouseEvent(EventRef event);
|
||||
/**
|
||||
* Handles a tablet event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleTabletEvent(EventRef event);
|
||||
/**
|
||||
* Handles a mouse event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleMouseEvent(EventRef event);
|
||||
|
||||
/**
|
||||
* Handles a key event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleKeyEvent(EventRef event);
|
||||
/**
|
||||
* Handles a key event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleKeyEvent(EventRef event);
|
||||
|
||||
/**
|
||||
* Handles a window event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleWindowEvent(EventRef event);
|
||||
/**
|
||||
* Handles a window event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
OSStatus handleWindowEvent(EventRef event);
|
||||
|
||||
/**
|
||||
* Handles all basic Mac application stuff for a mouse down event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
bool handleMouseDown(EventRef event);
|
||||
/**
|
||||
* Handles all basic Mac application stuff for a mouse down event.
|
||||
* @param event A Mac event.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
bool handleMouseDown(EventRef event);
|
||||
|
||||
/**
|
||||
* Handles a Mac menu command.
|
||||
* @param menuResult A Mac menu/item identifier.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
bool handleMenuCommand(GHOST_TInt32 menuResult);
|
||||
|
||||
/* callback for blender generated events */
|
||||
// static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
|
||||
/**
|
||||
* Handles a Mac menu command.
|
||||
* @param menuResult A Mac menu/item identifier.
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
bool handleMenuCommand(GHOST_TInt32 menuResult);
|
||||
|
||||
/* callback for blender generated events */
|
||||
// static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
|
||||
|
||||
|
||||
/**
|
||||
* Callback for Carbon when it has events.
|
||||
*/
|
||||
/**
|
||||
* Callback for Carbon when it has events.
|
||||
*/
|
||||
static OSStatus sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
|
||||
|
||||
/** Apple Event Handlers */
|
||||
@@ -267,23 +267,23 @@ protected:
|
||||
static OSErr sAEHandlerPrintDocs(const AppleEvent *event, AppleEvent *reply, SInt32 refCon);
|
||||
static OSErr sAEHandlerQuit(const AppleEvent *event, AppleEvent *reply, SInt32 refCon);
|
||||
|
||||
/**
|
||||
* Callback for Mac Timer tasks that expire.
|
||||
* @param tmTask Pointer to the timer task that expired.
|
||||
*/
|
||||
//static void s_timerCallback(TMTaskPtr tmTask);
|
||||
|
||||
/** Event handler reference. */
|
||||
EventHandlerRef m_handler;
|
||||
/**
|
||||
* Callback for Mac Timer tasks that expire.
|
||||
* @param tmTask Pointer to the timer task that expired.
|
||||
*/
|
||||
//static void s_timerCallback(TMTaskPtr tmTask);
|
||||
|
||||
/** Event handler reference. */
|
||||
EventHandlerRef m_handler;
|
||||
|
||||
/** Start time at initialization. */
|
||||
GHOST_TUns64 m_start_time;
|
||||
|
||||
/** State of the modifiers. */
|
||||
UInt32 m_modifierMask;
|
||||
/** State of the modifiers. */
|
||||
UInt32 m_modifierMask;
|
||||
|
||||
/** Ignores window size messages (when window is dragged). */
|
||||
bool m_ignoreWindowSizedMessages;
|
||||
/** Ignores window size messages (when window is dragged). */
|
||||
bool m_ignoreWindowSizedMessages;
|
||||
};
|
||||
|
||||
#endif // _GHOST_SYSTEM_CARBON_H_
|
||||
|
||||
@@ -52,16 +52,16 @@ class GHOST_WindowCocoa;
|
||||
|
||||
class GHOST_SystemCocoa : public GHOST_System {
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemCocoa();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemCocoa();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemCocoa();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemCocoa();
|
||||
|
||||
/***************************************************************************************
|
||||
** Time(r) functionality
|
||||
***************************************************************************************/
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
/**
|
||||
* Create a new window.
|
||||
* The new window is added to the list of windows managed.
|
||||
* The new window is added to the list of windows managed.
|
||||
* Never explicitly delete the window, use disposeWindow() instead.
|
||||
* @param title The name of the window (displayed in the title bar of the window if the OS supports it).
|
||||
* @param left The coordinate of the left edge of the window.
|
||||
@@ -107,17 +107,17 @@ public:
|
||||
* @return The new window (or 0 if creation failed).
|
||||
*/
|
||||
virtual GHOST_IWindow* createWindow(
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual = false,
|
||||
const GHOST_TUns16 numOfAASamples = 0,
|
||||
const GHOST_TEmbedderWindowID parentWindow = 0
|
||||
);
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual = false,
|
||||
const GHOST_TUns16 numOfAASamples = 0,
|
||||
const GHOST_TEmbedderWindowID parentWindow = 0
|
||||
);
|
||||
|
||||
/***************************************************************************************
|
||||
** Event management functionality
|
||||
@@ -140,19 +140,19 @@ public:
|
||||
* Handle Cocoa openFile event
|
||||
* Display confirmation request panel if changes performed since last save
|
||||
*/
|
||||
bool handleOpenDocumentRequest(void *filepathStr);
|
||||
bool handleOpenDocumentRequest(void *filepathStr);
|
||||
|
||||
/**
|
||||
* Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
|
||||
* @param eventType The type of drag'n'drop event
|
||||
* Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
|
||||
* @param eventType The type of drag'n'drop event
|
||||
* @param draggedObjectType The type object concerned (currently array of file names, string, TIFF image)
|
||||
* @param mouseX x mouse coordinate (in cocoa base window coordinates)
|
||||
* @param mouseY y mouse coordinate
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
|
||||
GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data);
|
||||
GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data);
|
||||
|
||||
/***************************************************************************************
|
||||
** Cursor management functionality
|
||||
@@ -207,18 +207,18 @@ public:
|
||||
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
|
||||
|
||||
/**
|
||||
* Handles a window event. Called by GHOST_WindowCocoa window delegate
|
||||
* @param eventType The type of window event
|
||||
* Handles a window event. Called by GHOST_WindowCocoa window delegate
|
||||
* @param eventType The type of window event
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
|
||||
|
||||
/**
|
||||
* Handles the Cocoa event telling the application has become active (again)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleApplicationBecomeActiveEvent();
|
||||
* Handles the Cocoa event telling the application has become active (again)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleApplicationBecomeActiveEvent();
|
||||
|
||||
/**
|
||||
* External objects should call this when they send an event outside processEvents.
|
||||
@@ -239,28 +239,28 @@ protected:
|
||||
*/
|
||||
virtual GHOST_TSuccess init();
|
||||
|
||||
/**
|
||||
* Handles a tablet event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
|
||||
|
||||
/**
|
||||
* Handles a mouse event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleMouseEvent(void *eventPtr);
|
||||
* Handles a tablet event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
|
||||
|
||||
/**
|
||||
* Handles a mouse event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleMouseEvent(void *eventPtr);
|
||||
|
||||
/**
|
||||
* Handles a key event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleKeyEvent(void *eventPtr);
|
||||
|
||||
/**
|
||||
* Handles a key event.
|
||||
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleKeyEvent(void *eventPtr);
|
||||
|
||||
/**
|
||||
* Performs the actual cursor position update (location in screen coordinates).
|
||||
* @param x The x-coordinate of the cursor.
|
||||
@@ -281,11 +281,11 @@ protected:
|
||||
/** Mouse buttons state */
|
||||
GHOST_TUns32 m_pressedMouseButtons;
|
||||
|
||||
/** State of the modifiers. */
|
||||
GHOST_TUns32 m_modifierMask;
|
||||
/** State of the modifiers. */
|
||||
GHOST_TUns32 m_modifierMask;
|
||||
|
||||
/** Ignores window size messages (when window is dragged). */
|
||||
bool m_ignoreWindowSizedMessages;
|
||||
/** Ignores window size messages (when window is dragged). */
|
||||
bool m_ignoreWindowSizedMessages;
|
||||
|
||||
/** Stores the mouse cursor delta due to setting a new cursor position
|
||||
* Needed because cocoa event delta cursor move takes setCursorPosition changes too.
|
||||
|
||||
@@ -50,16 +50,16 @@
|
||||
*/
|
||||
class GHOST_SystemPathsCarbon : public GHOST_SystemPaths {
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemPathsCarbon();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemPathsCarbon();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemPathsCarbon();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemPathsCarbon();
|
||||
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
@@ -78,12 +78,12 @@ public:
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
virtual const GHOST_TUns8* getBinaryDir() const;
|
||||
virtual const GHOST_TUns8* getBinaryDir() const;
|
||||
|
||||
/**
|
||||
* Add the file to the operating system most recently used files
|
||||
*/
|
||||
void addToSystemRecentFiles(const char* filename) const;
|
||||
void addToSystemRecentFiles(const char* filename) const;
|
||||
};
|
||||
|
||||
#endif // _GHOST_SYSTEM_CARBON_H_
|
||||
|
||||
@@ -44,15 +44,15 @@
|
||||
|
||||
class GHOST_SystemPathsCocoa : public GHOST_SystemPaths {
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemPathsCocoa();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemPathsCocoa();
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_SystemPathsCocoa();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~GHOST_SystemPathsCocoa();
|
||||
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
|
||||
@@ -21,25 +21,25 @@
|
||||
#define __ITaskbarList_INTERFACE_DEFINED__
|
||||
extern "C" {const GUID CLSID_TaskbarList = {0x56FDF344, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} };
|
||||
const GUID IID_ITaskbarList = {0x56FDF342, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; }
|
||||
class ITaskbarList : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0;
|
||||
};
|
||||
class ITaskbarList : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0;
|
||||
};
|
||||
#endif /* ITaskbarList */
|
||||
|
||||
#ifndef __ITaskbarList2_INTERFACE_DEFINED__
|
||||
#define __ITaskbarList2_INTERFACE_DEFINED__
|
||||
extern "C" {const GUID IID_ITaskbarList2 = {0x602D4995, 0xB13A, 0x429b, {0xA6, 0x6E, 0x19, 0x35, 0xE4, 0x4F, 0x43, 0x17} }; }
|
||||
class ITaskbarList2 : public ITaskbarList
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0;
|
||||
};
|
||||
class ITaskbarList2 : public ITaskbarList
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0;
|
||||
};
|
||||
#endif /* ITaskbarList2 */
|
||||
|
||||
#ifndef __ITaskbarList3_INTERFACE_DEFINED__
|
||||
@@ -51,9 +51,9 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA
|
||||
#define THBN_CLICKED 0x1800
|
||||
extern "C" {const GUID IID_ITaskList3 = { 0xEA1AFB91, 0x9E28, 0x4B86, {0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF} };}
|
||||
|
||||
class ITaskbarList3 : public ITaskbarList2
|
||||
{
|
||||
public:
|
||||
class ITaskbarList3 : public ITaskbarList2
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProgressValue (HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProgressState (HWND hwnd, TBPFLAG tbpFlags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE RegisterTab (HWND hwndTab, HWND hwndMDI) = 0;
|
||||
@@ -62,11 +62,11 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA
|
||||
virtual HRESULT STDMETHODCALLTYPE SetTabActive (HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon (HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip (HWND hwnd, LPCWSTR pszTip) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip (HWND hwnd, RECT *prcClip) = 0;
|
||||
};
|
||||
};
|
||||
#endif /* ITaskbarList3 */
|
||||
|
||||
#endif /*GHOST_TASKBARWIN32_H_*/
|
||||
|
||||
@@ -339,11 +339,11 @@ protected:
|
||||
|
||||
/** Number of samples used in anti-aliasing, set to 0 if no AA **/
|
||||
GHOST_TUns16 m_numOfAASamples;
|
||||
|
||||
/** Full-screen width */
|
||||
GHOST_TUns32 m_fullScreenWidth;
|
||||
/** Full-screen height */
|
||||
GHOST_TUns32 m_fullScreenHeight;
|
||||
|
||||
/** Full-screen width */
|
||||
GHOST_TUns32 m_fullScreenWidth;
|
||||
/** Full-screen height */
|
||||
GHOST_TUns32 m_fullScreenHeight;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -200,12 +200,12 @@ public:
|
||||
virtual GHOST_TSuccess activateDrawingContext();
|
||||
|
||||
virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const;
|
||||
|
||||
/**
|
||||
* Returns the dirty state of the window when in full-screen mode.
|
||||
* @return Whether it is dirty.
|
||||
*/
|
||||
virtual bool getFullScreenDirty();
|
||||
|
||||
/**
|
||||
* Returns the dirty state of the window when in full-screen mode.
|
||||
* @return Whether it is dirty.
|
||||
*/
|
||||
virtual bool getFullScreenDirty();
|
||||
|
||||
/* accessor for fullscreen window */
|
||||
virtual void setMac_windowState(short value);
|
||||
@@ -257,24 +257,24 @@ protected:
|
||||
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
|
||||
|
||||
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
|
||||
|
||||
/**
|
||||
* Converts a string object to a Mac Pascal string.
|
||||
* @param in The string object to be converted.
|
||||
* @param out The converted string.
|
||||
*/
|
||||
virtual void gen2mac(const STR_String& in, Str255 out) const;
|
||||
|
||||
/**
|
||||
* Converts a Mac Pascal string to a string object.
|
||||
* @param in The string to be converted.
|
||||
* @param out The converted string object.
|
||||
*/
|
||||
virtual void mac2gen(const Str255 in, STR_String& out) const;
|
||||
/**
|
||||
* Converts a string object to a Mac Pascal string.
|
||||
* @param in The string object to be converted.
|
||||
* @param out The converted string.
|
||||
*/
|
||||
virtual void gen2mac(const STR_String& in, Str255 out) const;
|
||||
|
||||
/**
|
||||
* Converts a Mac Pascal string to a string object.
|
||||
* @param in The string to be converted.
|
||||
* @param out The converted string object.
|
||||
*/
|
||||
virtual void mac2gen(const Str255 in, STR_String& out) const;
|
||||
|
||||
WindowRef m_windowRef;
|
||||
CGrafPtr m_grafPtr;
|
||||
AGLContext m_aglCtx;
|
||||
WindowRef m_windowRef;
|
||||
CGrafPtr m_grafPtr;
|
||||
AGLContext m_aglCtx;
|
||||
|
||||
/** The first created OpenGL context (for sharing display lists) */
|
||||
static AGLContext s_firstaglCtx;
|
||||
@@ -282,9 +282,9 @@ protected:
|
||||
Cursor* m_customCursor;
|
||||
|
||||
GHOST_TabletData m_tablet;
|
||||
|
||||
/** When running in full-screen this tells whether to refresh the window. */
|
||||
bool m_fullScreenDirty;
|
||||
|
||||
/** When running in full-screen this tells whether to refresh the window. */
|
||||
bool m_fullScreenDirty;
|
||||
|
||||
/** specific MacOs X full screen window setting as we use partially system mechanism
|
||||
values : 0 not maximizable default
|
||||
@@ -295,17 +295,17 @@ protected:
|
||||
in order to be unified with GHOST fullscreen/maximised settings
|
||||
|
||||
(lukep)
|
||||
**/
|
||||
|
||||
**/
|
||||
|
||||
short mac_windowState;
|
||||
|
||||
|
||||
/**
|
||||
* The width/height of the size rectangle in the lower right corner of a
|
||||
* Mac/Carbon window. This is also the height of the gutter area.
|
||||
*/
|
||||
/**
|
||||
* The width/height of the size rectangle in the lower right corner of a
|
||||
* Mac/Carbon window. This is also the height of the gutter area.
|
||||
*/
|
||||
#ifdef GHOST_DRAW_CARBON_GUTTER
|
||||
static const GHOST_TInt32 s_sizeRectSize;
|
||||
static const GHOST_TInt32 s_sizeRectSize;
|
||||
#endif // GHOST_DRAW_CARBON_GUTTER
|
||||
};
|
||||
|
||||
|
||||
@@ -190,16 +190,16 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
|
||||
|
||||
static void drawGearGL(int id)
|
||||
{
|
||||
static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
|
||||
static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
|
||||
static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
|
||||
static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
|
||||
static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
|
||||
static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
|
||||
static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
|
||||
static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
@@ -218,40 +218,40 @@ static void drawGearGL(int id)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
glEnable(GL_NORMALIZE);
|
||||
glEnable(GL_NORMALIZE);
|
||||
}
|
||||
|
||||
|
||||
static void drawGL(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glPushMatrix();
|
||||
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(fAngle, 0.0, 0.0, 1.0);
|
||||
drawGearGL(1);
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(fAngle, 0.0, 0.0, 1.0);
|
||||
drawGearGL(1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1f, -2.0f, 0.0f);
|
||||
glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0);
|
||||
drawGearGL(2);
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1f, -2.0f, 0.0f);
|
||||
glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0);
|
||||
drawGearGL(2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1f, 2.2f, -1.8f);
|
||||
glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0);
|
||||
drawGearGL(3);
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1f, 2.2f, -1.8f);
|
||||
glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0);
|
||||
drawGearGL(3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@@ -260,21 +260,21 @@ static void setViewPortGL(GHOST_WindowHandle hWindow)
|
||||
GHOST_RectangleHandle hRect = NULL;
|
||||
GLfloat w, h;
|
||||
|
||||
GHOST_ActivateWindowDrawingContext(hWindow);
|
||||
hRect = GHOST_GetClientBounds(hWindow);
|
||||
GHOST_ActivateWindowDrawingContext(hWindow);
|
||||
hRect = GHOST_GetClientBounds(hWindow);
|
||||
|
||||
w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect);
|
||||
h = 1.0;
|
||||
w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect);
|
||||
h = 1.0;
|
||||
|
||||
glViewport(0, 0, GHOST_GetWidthRectangle(hRect), GHOST_GetHeightRectangle(hRect));
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-w, w, -h, h, 5.0, 60.0);
|
||||
glFrustum(-w, w, -h, h, 5.0, 60.0);
|
||||
/* glOrtho(0, bnds.getWidth(), 0, bnds.getHeight(), -10, 10); */
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
|
||||
glClearColor(.2f,0.0f,0.0f,0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
@@ -541,8 +541,8 @@ int main(int argc, char** argv)
|
||||
static void gearsTimerProc(GHOST_TimerTaskHandle hTask, GHOST_TUns64 time)
|
||||
{
|
||||
GHOST_WindowHandle hWindow = NULL;
|
||||
fAngle += 2.0;
|
||||
view_roty += 1.0;
|
||||
fAngle += 2.0;
|
||||
view_roty += 1.0;
|
||||
hWindow = (GHOST_WindowHandle)GHOST_GetTimerTaskUserData(hTask);
|
||||
if (GHOST_GetFullScreen(shSystem))
|
||||
{
|
||||
|
||||
@@ -166,13 +166,13 @@ typedef struct
|
||||
tbool bOrient;
|
||||
} STSpace;
|
||||
|
||||
int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn);
|
||||
tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
|
||||
const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
|
||||
const SMikkTSpaceContext * pContext);
|
||||
static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
static int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn);
|
||||
static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
|
||||
const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
|
||||
const SMikkTSpaceContext * pContext);
|
||||
|
||||
static int MakeIndex(const int iFace, const int iVert)
|
||||
{
|
||||
@@ -216,14 +216,14 @@ static STSpace AvgTSpace(const STSpace * pTS0, const STSpace * pTS1)
|
||||
|
||||
|
||||
|
||||
SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index);
|
||||
SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index);
|
||||
SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index);
|
||||
static SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index);
|
||||
static SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index);
|
||||
static SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index);
|
||||
|
||||
|
||||
// degen triangles
|
||||
void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris);
|
||||
void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris);
|
||||
static void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris);
|
||||
static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris);
|
||||
|
||||
|
||||
tbool genTangSpaceDefault(const SMikkTSpaceContext * pContext)
|
||||
@@ -450,11 +450,11 @@ NOINLINE int FindGridCell(const float fMin, const float fMax, const float fVal)
|
||||
return iIndex<g_iCells?iIndex:(g_iCells-1);
|
||||
}
|
||||
|
||||
void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in);
|
||||
void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries);
|
||||
void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in);
|
||||
static void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries);
|
||||
static void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
|
||||
|
||||
void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
{
|
||||
|
||||
// Generate bounding box
|
||||
@@ -579,7 +579,7 @@ void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpa
|
||||
free(piHashOffsets);
|
||||
}
|
||||
|
||||
void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in)
|
||||
static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in)
|
||||
{
|
||||
// make bbox
|
||||
int c=0, l=0, channel=0;
|
||||
@@ -689,7 +689,7 @@ void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikk
|
||||
}
|
||||
}
|
||||
|
||||
void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries)
|
||||
static void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries)
|
||||
{
|
||||
// this can be optimized further using a tree structure or more hashing.
|
||||
int e=0;
|
||||
@@ -724,7 +724,7 @@ void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pCont
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
static void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
{
|
||||
int iNumUniqueVerts = 0, t=0, i=0;
|
||||
for(t=0; t<iNrTrianglesIn; t++)
|
||||
@@ -767,7 +767,7 @@ void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikk
|
||||
}
|
||||
}
|
||||
|
||||
int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
{
|
||||
int iTSpacesOffs = 0, f=0, t=0;
|
||||
int iDstTriIndex = 0;
|
||||
@@ -878,7 +878,7 @@ int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[],
|
||||
return iTSpacesOffs;
|
||||
}
|
||||
|
||||
SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
|
||||
static SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
|
||||
{
|
||||
int iF, iI;
|
||||
SVec3 res; float pos[3];
|
||||
@@ -888,7 +888,7 @@ SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
|
||||
return res;
|
||||
}
|
||||
|
||||
SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
|
||||
static SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
|
||||
{
|
||||
int iF, iI;
|
||||
SVec3 res; float norm[3];
|
||||
@@ -898,7 +898,7 @@ SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
|
||||
return res;
|
||||
}
|
||||
|
||||
SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index)
|
||||
static SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index)
|
||||
{
|
||||
int iF, iI;
|
||||
SVec3 res; float texc[2];
|
||||
@@ -920,8 +920,8 @@ typedef union
|
||||
int array[3];
|
||||
} SEdge;
|
||||
|
||||
void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn);
|
||||
void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn);
|
||||
static void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn);
|
||||
static void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn);
|
||||
|
||||
// returns the texture area times 2
|
||||
static float CalcTexArea(const SMikkTSpaceContext * pContext, const int indices[])
|
||||
@@ -940,7 +940,7 @@ static float CalcTexArea(const SMikkTSpaceContext * pContext, const int indices[
|
||||
return fSignedAreaSTx2<0 ? (-fSignedAreaSTx2) : fSignedAreaSTx2;
|
||||
}
|
||||
|
||||
void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
|
||||
{
|
||||
int f=0, i=0, t=0;
|
||||
// pTriInfos[f].iFlag is cleared in GenerateInitialVerticesIndexList() which is called before this function.
|
||||
@@ -1062,10 +1062,10 @@ void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpac
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int iMyTriIndex, SGroup * pGroup);
|
||||
void AddTriToGroup(SGroup * pGroup, const int iTriIndex);
|
||||
static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int iMyTriIndex, SGroup * pGroup);
|
||||
static void AddTriToGroup(SGroup * pGroup, const int iTriIndex);
|
||||
|
||||
int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn)
|
||||
static int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn)
|
||||
{
|
||||
const int iNrMaxGroups = iNrTrianglesIn*3;
|
||||
int iNrActiveGroups = 0;
|
||||
@@ -1126,13 +1126,13 @@ int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTriangle
|
||||
return iNrActiveGroups;
|
||||
}
|
||||
|
||||
void AddTriToGroup(SGroup * pGroup, const int iTriIndex)
|
||||
static void AddTriToGroup(SGroup * pGroup, const int iTriIndex)
|
||||
{
|
||||
pGroup->pFaceIndices[pGroup->iNrFaces] = iTriIndex;
|
||||
++pGroup->iNrFaces;
|
||||
}
|
||||
|
||||
tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
|
||||
static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
|
||||
const int iMyTriIndex, SGroup * pGroup)
|
||||
{
|
||||
STriInfo * pMyTriInfo = &psTriInfos[iMyTriIndex];
|
||||
@@ -1187,13 +1187,13 @@ tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2);
|
||||
void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed);
|
||||
STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive);
|
||||
static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2);
|
||||
static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed);
|
||||
static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive);
|
||||
|
||||
tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
|
||||
const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
|
||||
const SMikkTSpaceContext * pContext)
|
||||
static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
|
||||
const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
|
||||
const SMikkTSpaceContext * pContext)
|
||||
{
|
||||
STSpace * pSubGroupTspace = NULL;
|
||||
SSubGroup * pUniSubGroups = NULL;
|
||||
@@ -1361,8 +1361,8 @@ tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGro
|
||||
return TTRUE;
|
||||
}
|
||||
|
||||
STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[],
|
||||
const SMikkTSpaceContext * pContext, const int iVertexRepresentitive)
|
||||
static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[],
|
||||
const SMikkTSpaceContext * pContext, const int iVertexRepresentitive)
|
||||
{
|
||||
STSpace res;
|
||||
float fAngleSum = 0;
|
||||
@@ -1435,7 +1435,7 @@ STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[]
|
||||
return res;
|
||||
}
|
||||
|
||||
tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
|
||||
static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
|
||||
{
|
||||
tbool bStillSame=TTRUE;
|
||||
int i=0;
|
||||
@@ -1448,7 +1448,7 @@ tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
|
||||
return bStillSame;
|
||||
}
|
||||
|
||||
void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
|
||||
static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
|
||||
{
|
||||
int iL, iR, n, index, iMid, iTmp;
|
||||
|
||||
@@ -1492,10 +1492,10 @@ void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed);
|
||||
void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in);
|
||||
static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed);
|
||||
static void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in);
|
||||
|
||||
void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn)
|
||||
static void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn)
|
||||
{
|
||||
// build array of edges
|
||||
unsigned int uSeed = INTERNAL_RND_SORT_SEED; // could replace with a random seed?
|
||||
@@ -1590,7 +1590,7 @@ void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriLis
|
||||
}
|
||||
}
|
||||
|
||||
void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn)
|
||||
static void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn)
|
||||
{
|
||||
int f=0, i=0;
|
||||
for(f=0; f<iNrTrianglesIn; f++)
|
||||
@@ -1639,7 +1639,7 @@ void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int
|
||||
}
|
||||
}
|
||||
|
||||
void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed)
|
||||
static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed)
|
||||
{
|
||||
unsigned int t;
|
||||
int iL, iR, n, index, iMid;
|
||||
@@ -1696,7 +1696,7 @@ void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channe
|
||||
}
|
||||
|
||||
// resolve ordering and edge number
|
||||
void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in)
|
||||
static void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in)
|
||||
{
|
||||
*edgenum_out = -1;
|
||||
|
||||
@@ -1730,7 +1730,7 @@ void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[],
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////// Degenerate triangles ////////////////////////////////////
|
||||
|
||||
void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris)
|
||||
static void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris)
|
||||
{
|
||||
int iNextGoodTriangleSearchIndex=-1;
|
||||
tbool bStillFindingGoodOnes;
|
||||
@@ -1813,7 +1813,7 @@ void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrian
|
||||
assert(iNrTrianglesIn == t);
|
||||
}
|
||||
|
||||
void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris)
|
||||
static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris)
|
||||
{
|
||||
int t=0, i=0;
|
||||
// deal with degenerate triangles
|
||||
|
||||
@@ -95,11 +95,11 @@ public:
|
||||
STR_String& Format(const char *fmt, ...); // Set formatted text to string
|
||||
STR_String& FormatAdd(const char *fmt, ...); // Add formatted text to string
|
||||
inline void Clear() { Len = pData[0] = 0; }
|
||||
inline const STR_String & Reverse()
|
||||
{
|
||||
for (int i1=0, i2=Len-1; i1<i2; i1++, i2--)
|
||||
swap(pData[i1], pData[i2]); return *this;
|
||||
}
|
||||
inline const STR_String & Reverse()
|
||||
{
|
||||
for (int i1=0, i2=Len-1; i1<i2; i1++, i2--)
|
||||
swap(pData[i1], pData[i2]); return *this;
|
||||
}
|
||||
|
||||
// Properties
|
||||
bool IsUpper() const;
|
||||
|
||||
@@ -133,12 +133,12 @@ def do_clean(po, pot_messages):
|
||||
if pot_messages.get(msgid):
|
||||
t = po_messages.get(msgid)
|
||||
if not t:
|
||||
print(('Reusing full item from commented ' + \
|
||||
'lines for msgid \'%s\'') % (msgid))
|
||||
print("Reusing full item from commented "
|
||||
"lines for msgid '%s'" % msgid)
|
||||
po_messages[msgid] = commented_messages[msgid]
|
||||
elif not t['translation']:
|
||||
print(('Reusing translation from commented ' + \
|
||||
'lines for msgid \'%s\'') % (msgid))
|
||||
print("Reusing translation from commented "
|
||||
"lines for msgid '%s'" % msgid)
|
||||
m = commented_messages[msgid]
|
||||
t['translation'] = m['translation']
|
||||
t['translation_lines'] = m['translation_lines']
|
||||
@@ -153,17 +153,17 @@ def do_clean(po, pot_messages):
|
||||
first = True
|
||||
for x in item['message_lines']:
|
||||
if first:
|
||||
handle.write("msgid \"%s\"\n" % (x))
|
||||
handle.write("msgid \"%s\"\n" % x)
|
||||
else:
|
||||
handle.write("\"%s\"\n" % (x))
|
||||
handle.write("\"%s\"\n" % x)
|
||||
first = False
|
||||
|
||||
first = True
|
||||
for x in item['translation_lines']:
|
||||
if first:
|
||||
handle.write("msgstr \"%s\"\n" % (x))
|
||||
handle.write("msgstr \"%s\"\n" % x)
|
||||
else:
|
||||
handle.write("\"%s\"\n" % (x))
|
||||
handle.write("\"%s\"\n" % x)
|
||||
first = False
|
||||
|
||||
handle.write("\n")
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
# update the pot file according the POTFILES.in
|
||||
|
||||
import os
|
||||
import sys
|
||||
import collections
|
||||
|
||||
@@ -145,17 +144,17 @@ def main():
|
||||
first = True
|
||||
for x in item['message_lines']:
|
||||
if first:
|
||||
handle.write("msgid \"%s\"\n" % (x))
|
||||
handle.write("msgid \"%s\"\n" % x)
|
||||
else:
|
||||
handle.write("\"%s\"\n" % (x))
|
||||
handle.write("\"%s\"\n" % x)
|
||||
first = False
|
||||
|
||||
first = True
|
||||
for x in item['translation_lines']:
|
||||
if first:
|
||||
handle.write("msgstr \"%s\"\n" % (x))
|
||||
handle.write("msgstr \"%s\"\n" % x)
|
||||
else:
|
||||
handle.write("\"%s\"\n" % (x))
|
||||
handle.write("\"%s\"\n" % x)
|
||||
first = False
|
||||
|
||||
handle.write("\n")
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
# <pep8 compliant>
|
||||
# <pep8-80 compliant>
|
||||
|
||||
# Write out messages.txt from blender
|
||||
|
||||
@@ -36,6 +36,72 @@ COMMENT_PREFIX = "#~ "
|
||||
def dump_messages_rna(messages):
|
||||
import bpy
|
||||
|
||||
def classBlackList():
|
||||
blacklist_rna_class = [
|
||||
# core classes
|
||||
"Context", "Event", "Function", "UILayout",
|
||||
"BlendData",
|
||||
# registerable classes
|
||||
"Panel", "Menu", "Header", "RenderEngine",
|
||||
"Operator", "OperatorMacro", "Macro",
|
||||
"KeyingSetInfo", "UnknownType",
|
||||
# window classes
|
||||
"WindowManager", "Window"
|
||||
]
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Collect internal operators
|
||||
|
||||
# extend with all internal operators
|
||||
# note that this uses internal api introspection functions
|
||||
# all possible operator names
|
||||
op_names = list(sorted(set(
|
||||
[cls.bl_rna.identifier for cls in
|
||||
bpy.types.OperatorProperties.__subclasses__()] +
|
||||
[cls.bl_rna.identifier for cls in
|
||||
bpy.types.Operator.__subclasses__()] +
|
||||
[cls.bl_rna.identifier for cls in
|
||||
bpy.types.OperatorMacro.__subclasses__()]
|
||||
)))
|
||||
|
||||
get_inatance = __import__("_bpy").ops.get_instance
|
||||
path_resolve = type(bpy.context).__base__.path_resolve
|
||||
for idname in op_names:
|
||||
op = get_inatance(idname)
|
||||
if 'INTERNAL' in path_resolve(op, "bl_options"):
|
||||
blacklist_rna_class.append(idname)
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Collect builtin classes we dont need to doc
|
||||
blacklist_rna_class.append("Property")
|
||||
blacklist_rna_class.extend(
|
||||
[cls.__name__ for cls in
|
||||
bpy.types.Property.__subclasses__()])
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Collect classes which are attached to collections, these are api
|
||||
# access only.
|
||||
collection_props = set()
|
||||
for cls_id in dir(bpy.types):
|
||||
cls = getattr(bpy.types, cls_id)
|
||||
for prop in cls.bl_rna.properties:
|
||||
if prop.type == 'COLLECTION':
|
||||
prop_cls = prop.srna
|
||||
if prop_cls is not None:
|
||||
collection_props.add(prop_cls.identifier)
|
||||
blacklist_rna_class.extend(sorted(collection_props))
|
||||
|
||||
return blacklist_rna_class
|
||||
|
||||
blacklist_rna_class = classBlackList()
|
||||
|
||||
def filterRNA(bl_rna):
|
||||
id = bl_rna.identifier
|
||||
if id in blacklist_rna_class:
|
||||
print(" skipping", id)
|
||||
return True
|
||||
return False
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Function definitions
|
||||
|
||||
@@ -70,6 +136,10 @@ def dump_messages_rna(messages):
|
||||
messages.setdefault(item.description, []).append(msgsrc)
|
||||
|
||||
def walkRNA(bl_rna):
|
||||
|
||||
if filterRNA(bl_rna):
|
||||
return
|
||||
|
||||
msgsrc = "bpy.types.%s" % bl_rna.identifier
|
||||
|
||||
if bl_rna.name and bl_rna.name != bl_rna.identifier:
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
English:en_US
|
||||
Japanese:ja_JP
|
||||
Dutch:nl_NL
|
||||
Italian:it_IT
|
||||
German:de_DE
|
||||
Finnish:fi_FI
|
||||
Swedish:sv_SE
|
||||
French:fr_FR
|
||||
Spanish:es_ES
|
||||
Catalan:ca_ES
|
||||
Czech:cs_CZ
|
||||
Brazilian Portuguese:pt_BR
|
||||
Simplified Chinese:zh_CN
|
||||
Traditional Chinese:zh_TW
|
||||
Russian:ru_RU
|
||||
Croatian:hr_HR
|
||||
Serbian:sr_RS
|
||||
Ukrainian:uk_UA
|
||||
Polish:pl_PL
|
||||
Romanian:ro_RO
|
||||
Arabic:ar_SA
|
||||
Bulgarian:bg_BG
|
||||
Greek:el_GR
|
||||
Korean:ko_KR
|
||||
@@ -27,6 +27,7 @@ op_poll = ops_module.poll
|
||||
op_call = ops_module.call
|
||||
op_as_string = ops_module.as_string
|
||||
op_get_rna = ops_module.get_rna
|
||||
op_get_instance = ops_module.get_instance
|
||||
|
||||
|
||||
class BPyOps(object):
|
||||
@@ -184,11 +185,13 @@ class BPyOpsSubModOp(object):
|
||||
return ret
|
||||
|
||||
def get_rna(self):
|
||||
'''
|
||||
currently only used for 'bl_rna'
|
||||
'''
|
||||
"""Internal function for introspection"""
|
||||
return op_get_rna(self.idname())
|
||||
|
||||
def get_instance(self):
|
||||
"""Internal function for introspection"""
|
||||
return op_get_instance(self.idname())
|
||||
|
||||
def __repr__(self): # useful display, repr(op)
|
||||
import bpy
|
||||
idname = self.idname()
|
||||
|
||||
@@ -119,14 +119,17 @@ def keyconfig_merge(kc1, kc2):
|
||||
"""
|
||||
merged_keymaps = [(km, kc1) for km in kc1.keymaps]
|
||||
if kc1 != kc2:
|
||||
merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps))
|
||||
merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not km_exists_in(km, merged_keymaps))
|
||||
|
||||
return merged_keymaps
|
||||
|
||||
|
||||
def keyconfig_export(wm, kc, filepath):
|
||||
def _export_properties(prefix, properties, lines=None):
|
||||
from bpy.types import OperatorProperties
|
||||
|
||||
if lines is None:
|
||||
lines = []
|
||||
|
||||
def string_value(value):
|
||||
if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int):
|
||||
result = repr(value)
|
||||
@@ -137,20 +140,19 @@ def keyconfig_export(wm, kc, filepath):
|
||||
|
||||
return result
|
||||
|
||||
def export_properties(prefix, properties, lines=None):
|
||||
if lines is None:
|
||||
lines = []
|
||||
for pname in properties.bl_rna.properties.keys():
|
||||
if pname != "rna_type" and not properties.is_property_hidden(pname):
|
||||
value = getattr(properties, pname)
|
||||
if isinstance(value, OperatorProperties):
|
||||
_export_properties(prefix + "." + pname, value, lines)
|
||||
elif properties.is_property_set(pname):
|
||||
value = string_value(value)
|
||||
if value != "":
|
||||
lines.append("%s.%s = %s\n" % (prefix, pname, value))
|
||||
return lines
|
||||
|
||||
for pname in properties.bl_rna.properties.keys():
|
||||
if pname != "rna_type" and not properties.is_property_hidden(pname):
|
||||
value = getattr(properties, pname)
|
||||
if isinstance(value, OperatorProperties):
|
||||
export_properties(prefix + "." + pname, value, lines)
|
||||
elif properties.is_property_set(pname):
|
||||
value = string_value(value)
|
||||
if value != "":
|
||||
lines.append("%s.%s = %s\n" % (prefix, pname, value))
|
||||
return lines
|
||||
|
||||
def keyconfig_export(wm, kc, filepath):
|
||||
|
||||
f = open(filepath, "w")
|
||||
|
||||
@@ -209,7 +211,7 @@ def keyconfig_export(wm, kc, filepath):
|
||||
props = kmi.properties
|
||||
|
||||
if props is not None:
|
||||
f.write("".join(export_properties("kmi.properties", props)))
|
||||
f.write("".join(_export_properties("kmi.properties", props)))
|
||||
|
||||
f.write("\n")
|
||||
|
||||
@@ -246,7 +248,7 @@ def keyconfig_test(kc):
|
||||
props = kmi.properties
|
||||
|
||||
if props is not None:
|
||||
export_properties("kmi.properties", props, s)
|
||||
_export_properties("kmi.properties", props, s)
|
||||
|
||||
return "".join(s).strip()
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ def align_objects(align_x,
|
||||
|
||||
for obj, bb_world in objs:
|
||||
|
||||
if bb_quality:
|
||||
if bb_quality and obj.type == 'MESH':
|
||||
GBB = GlobalBB_HQ(obj)
|
||||
else:
|
||||
GBB = GlobalBB_LQ(bb_world)
|
||||
@@ -204,7 +204,7 @@ def align_objects(align_x,
|
||||
matrix_world = obj.matrix_world.copy()
|
||||
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
|
||||
|
||||
if bb_quality:
|
||||
if bb_quality and obj.type == 'MESH':
|
||||
GBB = GlobalBB_HQ(obj)
|
||||
else:
|
||||
GBB = GlobalBB_LQ(bb_world)
|
||||
|
||||
@@ -462,10 +462,10 @@ class QuickFluid(Operator):
|
||||
|
||||
if self.style == 'INFLOW':
|
||||
mod.settings.type = 'INFLOW'
|
||||
mod.settings.inflow_velocity = self.initial_velocity.copy()
|
||||
mod.settings.inflow_velocity = self.initial_velocity
|
||||
else:
|
||||
mod.settings.type = 'FLUID'
|
||||
mod.settings.initial_velocity = self.initial_velocity.copy()
|
||||
mod.settings.initial_velocity = self.initial_velocity
|
||||
|
||||
obj.hide_render = not self.show_flows
|
||||
if not self.show_flows:
|
||||
|
||||
@@ -136,7 +136,8 @@ class PlayRenderedAnim(Operator):
|
||||
del process
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), "-j", str(scene.frame_step), file]
|
||||
opts = ["-a", "-f", str(rd.fps), str(rd.fps_base),
|
||||
"-j", str(scene.frame_step), file]
|
||||
cmd.extend(opts)
|
||||
elif preset == 'DJV':
|
||||
opts = [file, "-playback_speed", "%d" % int(rd.fps / rd.fps_base)]
|
||||
@@ -166,9 +167,8 @@ class PlayRenderedAnim(Operator):
|
||||
print("Executing command:\n %r" % " ".join(cmd))
|
||||
|
||||
try:
|
||||
process = subprocess.Popen(cmd)
|
||||
subprocess.Popen(cmd)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
self.report({'ERROR'},
|
||||
"Couldn't run external animation player with command "
|
||||
"%r\n%s" % (" ".join(cmd), str(e)))
|
||||
|
||||
@@ -362,7 +362,7 @@ class INFO_MT_help(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-259/'
|
||||
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-260/'
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
|
||||
return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
||||
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
||||
'PLUGIN',
|
||||
'WIPE', 'GLOW', 'TRANSFORM', 'SPEED',
|
||||
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
|
||||
'MULTICAM', 'ADJUSTMENT'}
|
||||
|
||||
def draw(self, context):
|
||||
@@ -547,7 +547,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
|
||||
'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
||||
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
||||
'PLUGIN',
|
||||
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
|
||||
'WIPE', 'GLOW', 'TRANSFORM',
|
||||
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
@@ -22,8 +22,6 @@ from bpy.types import Header, Menu, Panel
|
||||
import os
|
||||
import addon_utils
|
||||
|
||||
from bpy.props import StringProperty, BoolProperty, EnumProperty
|
||||
|
||||
|
||||
def ui_items_general(col, context):
|
||||
""" General UI Theme Settings (User Interface)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
from bpy.types import Menu, OperatorProperties
|
||||
import os
|
||||
|
||||
|
||||
class USERPREF_MT_keyconfigs(Menu):
|
||||
@@ -122,19 +121,6 @@ class InputKeyMapPanel:
|
||||
for entry in children:
|
||||
self.draw_entry(display_keymaps, entry, col, level + 1)
|
||||
|
||||
@staticmethod
|
||||
def draw_kmi_properties(box, properties, title=None):
|
||||
box.separator()
|
||||
if title:
|
||||
box.label(text=title)
|
||||
flow = box.column_flow(columns=2)
|
||||
for pname, value in properties.bl_rna.properties.items():
|
||||
if pname != "rna_type" and not properties.is_property_hidden(pname):
|
||||
if isinstance(value, OperatorProperties):
|
||||
InputKeyMapPanel.draw_kmi_properties(box, value, title=pname)
|
||||
else:
|
||||
flow.prop(properties, pname)
|
||||
|
||||
def draw_kmi(self, display_keymaps, kc, km, kmi, layout, level):
|
||||
map_type = kmi.map_type
|
||||
|
||||
@@ -219,9 +205,7 @@ class InputKeyMapPanel:
|
||||
subrow.prop(kmi, "key_modifier", text="", event=True)
|
||||
|
||||
# Operator properties
|
||||
props = kmi.properties
|
||||
if props is not None:
|
||||
InputKeyMapPanel.draw_kmi_properties(box, props)
|
||||
box.template_keymap_item_properties(kmi)
|
||||
|
||||
# Modal key maps attached to this operator
|
||||
if not km.is_modal:
|
||||
|
||||
@@ -720,11 +720,14 @@ class VIEW3D_MT_object(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.menu("VIEW3D_MT_object_quick_effects")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.menu("VIEW3D_MT_object_game")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("object.join_uvs")
|
||||
layout.operator("object.join")
|
||||
|
||||
layout.separator()
|
||||
@@ -878,8 +881,8 @@ class VIEW3D_MT_object_parent(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.parent_set", text="Set")
|
||||
layout.operator("object.parent_clear", text="Clear")
|
||||
layout.operator_menu_enum("object.parent_set", "type", text="Set")
|
||||
layout.operator_menu_enum("object.parent_clear", "type", text="Clear")
|
||||
|
||||
|
||||
class VIEW3D_MT_object_track(Menu):
|
||||
@@ -888,8 +891,8 @@ class VIEW3D_MT_object_track(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.track_set", text="Set")
|
||||
layout.operator("object.track_clear", text="Clear")
|
||||
layout.operator_menu_enum("object.track_set", "type", text="Set")
|
||||
layout.operator_menu_enum("object.track_clear", "type", text="Clear")
|
||||
|
||||
|
||||
class VIEW3D_MT_object_group(Menu):
|
||||
@@ -918,6 +921,18 @@ class VIEW3D_MT_object_constraints(Menu):
|
||||
layout.operator("object.constraints_clear")
|
||||
|
||||
|
||||
class VIEW3D_MT_object_quick_effects(Menu):
|
||||
bl_label = "Quick Effects"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.quick_fur")
|
||||
layout.operator("object.quick_explode")
|
||||
layout.operator("object.quick_smoke")
|
||||
layout.operator("object.quick_fluid")
|
||||
|
||||
|
||||
class VIEW3D_MT_object_showhide(Menu):
|
||||
bl_label = "Show/Hide"
|
||||
|
||||
@@ -967,6 +982,7 @@ class VIEW3D_MT_make_links(Menu):
|
||||
|
||||
layout.operator_enum("object.make_links_data", "type") # inline
|
||||
|
||||
layout.operator("object.join_uvs") # stupid place to add this!
|
||||
|
||||
class VIEW3D_MT_object_game(Menu):
|
||||
bl_label = "Game"
|
||||
|
||||
@@ -353,14 +353,26 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
|
||||
|
||||
# custom properties
|
||||
def doCustomProps(ksi, ks, bone):
|
||||
|
||||
prop_type_compat = {bpy.types.BooleanProperty,
|
||||
bpy.types.IntProperty,
|
||||
bpy.types.FloatProperty}
|
||||
|
||||
# go over all custom properties for bone
|
||||
for prop, val in bone.items():
|
||||
for prop in bone.keys():
|
||||
# ignore special "_RNA_UI" used for UI editing
|
||||
if prop == "_RNA_UI":
|
||||
continue
|
||||
|
||||
# for now, just add all of 'em
|
||||
ksi.addProp(ks, bone, '["%s"]' % (prop))
|
||||
prop_rna = type(bone).bl_rna.properties.get(prop, None)
|
||||
if prop_rna is None:
|
||||
prop_path = '["%s"]' % prop
|
||||
if bone.path_resolve(prop_path, False).rna_type in prop_type_compat:
|
||||
ksi.addProp(ks, bone, prop_path)
|
||||
elif prop_rna.is_animatable:
|
||||
ksi.addProp(ks, bone, prop)
|
||||
|
||||
|
||||
###############################
|
||||
|
||||
|
||||
@@ -12,22 +12,18 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p class="title"><b>Blender 2.59</b></p>
|
||||
<p class="title"><b>Blender 2.60</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.59</b></p>
|
||||
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.59. This release is the third 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-259/">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 class="header"><b>2.60</b></p>
|
||||
<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.60. This release is the first official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-260/">More information about this release</a>.</p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>Bugs</b></p>
|
||||
<p class="body">Although Blender 2.59 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.59. 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.60 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. 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>
|
||||
@@ -43,7 +39,7 @@
|
||||
<p class="body"><b>Installing Add-ons (all systems)</b> Add-ons can be installed from the user preferences addons section, download an addon as a .py or .zip file, then press the "Install Add-on" button and select the file to install it.</p>
|
||||
<p><br></p>
|
||||
<p class="header"><b>Getting Started</b></p>
|
||||
<p class="body">When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area on the right and a Timeline at the bottom.</p>
|
||||
<p class="body">When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area and an Outliner area on the right and a Timeline at the bottom.</p>
|
||||
<p class="body">Orbit around in the 3D view by holding the middle mouse button and dragging. Alternatively, hold the alt key and drag the left mouse button. Additionally, hold Shift to pan the view and Ctrl to zoom.</p>
|
||||
<p class="body">Select objects using the right mouse button. With the object selected, perform actions by clicking any of the tool buttons on the left, or make changes to its properties by altering any of the setting on the right.</p>
|
||||
<p class="body">For more information on how to use Blender, <a href="http://www.blender.org/education-help/">watch tutorials</a> or <a href="http://wiki.blender.org/index.php/Doc:Manual">read the manual</a>.</p>
|
||||
@@ -51,7 +47,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-259/">www.blender.org/development/release-logs/blender-259/</a><br>
|
||||
Full release log <a href="http://www.blender.org/development/release-logs/blender-260/">www.blender.org/development/release-logs/blender-260/</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>
|
||||
|
||||
@@ -53,7 +53,7 @@ set(SRC
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND INC_SYS
|
||||
${GETTEXT_INC}
|
||||
${GETTEXT_INCLUDE_DIRS}
|
||||
)
|
||||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
||||
#define BLENDER_VERSION_CHAR
|
||||
/* alpha/beta/rc/release, docs use this */
|
||||
#define BLENDER_VERSION_CYCLE beta
|
||||
#define BLENDER_VERSION_CYCLE rc
|
||||
|
||||
struct ListBase;
|
||||
struct MemFile;
|
||||
|
||||
@@ -46,6 +46,7 @@ struct Curve;
|
||||
struct objfnt;
|
||||
struct TmpFont;
|
||||
struct CharInfo;
|
||||
struct Main;
|
||||
|
||||
struct chartrans {
|
||||
float xof, yof;
|
||||
@@ -77,10 +78,10 @@ void BKE_font_register_builtin(void *mem, int size);
|
||||
void free_vfont(struct VFont *sc);
|
||||
void free_ttfont(void);
|
||||
struct VFont *get_builtin_font(void);
|
||||
struct VFont *load_vfont(const char *name);
|
||||
struct VFont *load_vfont(struct Main *bmain, const char *name);
|
||||
struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
|
||||
|
||||
struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode);
|
||||
struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
|
||||
|
||||
int BKE_font_getselection(struct Object *ob, int *start, int *end);
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ short *give_totcolp_id(struct ID *id);
|
||||
|
||||
struct Material *give_current_material(struct Object *ob, short act);
|
||||
struct ID *material_from(struct Object *ob, short act);
|
||||
void assign_material_id(struct ID *id, struct Material *ma, short act);
|
||||
void assign_material(struct Object *ob, struct Material *ma, short act);
|
||||
void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ struct ReportList;
|
||||
struct VFont;
|
||||
|
||||
/* pack */
|
||||
struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename);
|
||||
struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase);
|
||||
struct PackedFile *newPackedFileMemory(void *mem, int memlen);
|
||||
|
||||
void packAll(struct Main *bmain, struct ReportList *reports);
|
||||
|
||||
@@ -1511,7 +1511,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
|
||||
|
||||
/* in par the family name is stored, use this to find the other objects */
|
||||
|
||||
chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI);
|
||||
chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI);
|
||||
if(chartransdata==NULL) return;
|
||||
|
||||
cu= par->data;
|
||||
|
||||
@@ -1160,6 +1160,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* RNA property update disabled for now - [#28525] [#28690] [#28774] [#28777] */
|
||||
#if 0
|
||||
/* buffer property update for later flushing */
|
||||
if (RNA_property_update_check(prop)) {
|
||||
short skip_updates_hack = 0;
|
||||
@@ -1176,6 +1178,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
|
||||
if (skip_updates_hack == 0)
|
||||
RNA_property_update_cache_add(&new_ptr, prop);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* successful */
|
||||
|
||||
@@ -419,12 +419,10 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex
|
||||
}
|
||||
|
||||
if(bezt->h1==HD_VECT) { /* vector */
|
||||
mul_v2_fl(dvec_a, 1.0f/3.0f);
|
||||
sub_v2_v2v2(p2-3, p2, dvec_a);
|
||||
madd_v2_v2v2fl(p2-3, p2, dvec_a, -1.0f/3.0f);
|
||||
}
|
||||
if(bezt->h2==HD_VECT) {
|
||||
mul_v2_fl(dvec_b, 1.0f/3.0f);
|
||||
sub_v2_v2v2(p2+3, p2, dvec_b);
|
||||
madd_v2_v2v2fl(p2+3, p2, dvec_b, 1.0f/3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2596,12 +2596,10 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
|
||||
}
|
||||
|
||||
if(bezt->h1==HD_VECT) { /* vector */
|
||||
mul_v3_fl(dvec_a, 1.0f/3.0f);
|
||||
sub_v3_v3v3(p2-3, p2, dvec_a);
|
||||
madd_v3_v3v3fl(p2-3, p2, dvec_a, -1.0f/3.0f);
|
||||
}
|
||||
if(bezt->h2==HD_VECT) {
|
||||
mul_v3_fl(dvec_b, 1.0f/3.0f);
|
||||
sub_v3_v3v3(p2+3, p2, dvec_b);
|
||||
madd_v3_v3v3fl(p2+3, p2, dvec_b, 1.0f/3.0f);
|
||||
}
|
||||
|
||||
len_b= len_v3v3(p2, p2+3);
|
||||
|
||||
@@ -2850,10 +2850,8 @@ int CustomData_verify_versions(struct CustomData *data, int index)
|
||||
|
||||
static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external)
|
||||
{
|
||||
char *path = (id->lib)? id->lib->filepath: G.main->name;
|
||||
|
||||
BLI_strncpy(filename, external->filename, FILE_MAX);
|
||||
BLI_path_abs(filename, path);
|
||||
BLI_path_abs(filename, ID_BLEND_PATH(G.main, id));
|
||||
}
|
||||
|
||||
void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem)
|
||||
|
||||
@@ -2028,17 +2028,27 @@ static int object_modifiers_use_time(Object *ob)
|
||||
/* check whether any modifiers are animated */
|
||||
if (ob->adt) {
|
||||
AnimData *adt = ob->adt;
|
||||
FCurve *fcu;
|
||||
|
||||
/* action - check for F-Curves with paths containing 'modifiers[' */
|
||||
if (adt->action) {
|
||||
FCurve *fcu;
|
||||
|
||||
for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
|
||||
if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* This here allows modifier properties to get driven and still update properly
|
||||
*
|
||||
* Workaround to get [#26764] (e.g. subsurf levels not updating when animated/driven)
|
||||
* working, without the updating problems ([#28525] [#28690] [#28774] [#28777]) caused
|
||||
* by the RNA updates cache introduced in r.38649
|
||||
*/
|
||||
for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
|
||||
if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
|
||||
return 1;
|
||||
}
|
||||
|
||||
// XXX: also, should check NLA strips, though for now assume that nobody uses
|
||||
// that and we can omit that for performance reasons...
|
||||
}
|
||||
|
||||
@@ -1209,7 +1209,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
|
||||
if(cu->path) free_path(cu->path);
|
||||
cu->path= NULL;
|
||||
|
||||
if(ob->type==OB_FONT) BKE_text_to_curve(scene, ob, 0);
|
||||
if(ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
|
||||
|
||||
if(!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ struct TmpFont *vfont_find_tmpfont(VFont *vfont)
|
||||
return tmpfnt;
|
||||
}
|
||||
|
||||
static VFontData *vfont_get_data(VFont *vfont)
|
||||
static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
|
||||
{
|
||||
struct TmpFont *tmpfnt = NULL;
|
||||
PackedFile *tpf;
|
||||
@@ -319,11 +319,11 @@ static VFontData *vfont_get_data(VFont *vfont)
|
||||
BLI_addtail(&ttfdata, tmpfnt);
|
||||
}
|
||||
} else {
|
||||
pf= newPackedFile(NULL, vfont->name);
|
||||
pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
|
||||
|
||||
if(!tmpfnt)
|
||||
{
|
||||
tpf= newPackedFile(NULL, vfont->name);
|
||||
tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
|
||||
|
||||
// Add temporary packed file to globals
|
||||
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
|
||||
@@ -351,7 +351,7 @@ static VFontData *vfont_get_data(VFont *vfont)
|
||||
return vfont->data;
|
||||
}
|
||||
|
||||
VFont *load_vfont(const char *name)
|
||||
VFont *load_vfont(Main *bmain, const char *name)
|
||||
{
|
||||
char filename[FILE_MAXFILE];
|
||||
VFont *vfont= NULL;
|
||||
@@ -371,8 +371,8 @@ VFont *load_vfont(const char *name)
|
||||
BLI_strncpy(dir, name, sizeof(dir));
|
||||
BLI_splitdirstring(dir, filename);
|
||||
|
||||
pf= newPackedFile(NULL, name);
|
||||
tpf= newPackedFile(NULL, name);
|
||||
pf= newPackedFile(NULL, name, bmain->name);
|
||||
tpf= newPackedFile(NULL, name, bmain->name);
|
||||
|
||||
is_builtin= 0;
|
||||
}
|
||||
@@ -382,7 +382,7 @@ VFont *load_vfont(const char *name)
|
||||
|
||||
vfd= BLI_vfontdata_from_freetypefont(pf);
|
||||
if (vfd) {
|
||||
vfont = alloc_libblock(&G.main->vfont, ID_VF, filename);
|
||||
vfont = alloc_libblock(&bmain->vfont, ID_VF, filename);
|
||||
vfont->data = vfd;
|
||||
|
||||
/* if there's a font name, use it for the ID name */
|
||||
@@ -439,7 +439,7 @@ VFont *get_builtin_font(void)
|
||||
if (strcmp(vf->name, FO_BUILTIN_NAME)==0)
|
||||
return vf;
|
||||
|
||||
return load_vfont(FO_BUILTIN_NAME);
|
||||
return load_vfont(G.main, FO_BUILTIN_NAME);
|
||||
}
|
||||
|
||||
static VChar *find_vfont_char(VFontData *vfd, intptr_t character)
|
||||
@@ -500,7 +500,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
|
||||
|
||||
}
|
||||
|
||||
static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
|
||||
static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
|
||||
{
|
||||
BezTriple *bezt1, *bezt2;
|
||||
Nurb *nu1 = NULL, *nu2 = NULL;
|
||||
@@ -509,7 +509,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float
|
||||
VChar *che = NULL;
|
||||
int i;
|
||||
|
||||
vfd= vfont_get_data(which_vfont(cu, info));
|
||||
vfd= vfont_get_data(bmain, which_vfont(cu, info));
|
||||
if (!vfd) return;
|
||||
|
||||
/*
|
||||
@@ -662,7 +662,7 @@ static float char_width(Curve *cu, VChar *che, CharInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
|
||||
struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int mode)
|
||||
{
|
||||
VFont *vfont, *oldvfont;
|
||||
VFontData *vfd= NULL;
|
||||
@@ -714,7 +714,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
|
||||
if (cu->tb==NULL)
|
||||
cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBox compat");
|
||||
|
||||
vfd= vfont_get_data(vfont);
|
||||
vfd= vfont_get_data(bmain, vfont);
|
||||
|
||||
/* The VFont Data can not be found */
|
||||
if(!vfd) {
|
||||
@@ -792,7 +792,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
|
||||
}
|
||||
|
||||
if (vfont != oldvfont) {
|
||||
vfd= vfont_get_data(vfont);
|
||||
vfd= vfont_get_data(bmain, vfont);
|
||||
oldvfont = vfont;
|
||||
}
|
||||
|
||||
@@ -1157,7 +1157,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
|
||||
}
|
||||
// We do not want to see any character for \n or \r
|
||||
if(cha != '\n' && cha != '\r')
|
||||
buildchar(cu, cha, info, ct->xof, ct->yof, ct->rot, i);
|
||||
buildchar(bmain, cu, cha, info, ct->xof, ct->yof, ct->rot, i);
|
||||
|
||||
if ((info->flag & CU_CHINFO_UNDERLINE) && (cu->textoncurve == NULL) && (cha != '\n') && (cha != '\r')) {
|
||||
float ulwidth, uloverlap= 0.0f;
|
||||
|
||||
@@ -182,7 +182,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
|
||||
gpl->thickness = 3;
|
||||
|
||||
/* auto-name */
|
||||
sprintf(gpl->info, "GP_Layer");
|
||||
strcpy(gpl->info, "GP_Layer");
|
||||
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info));
|
||||
|
||||
/* make this one the active one */
|
||||
|
||||
@@ -1480,7 +1480,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
|
||||
/* try to repack file */
|
||||
if(ima->packedfile) {
|
||||
PackedFile *pf;
|
||||
pf = newPackedFile(NULL, ima->name);
|
||||
pf = newPackedFile(NULL, ima->name, ID_BLEND_PATH(G.main, &ima->id));
|
||||
if (pf) {
|
||||
freePackedFile(ima->packedfile);
|
||||
ima->packedfile = pf;
|
||||
@@ -1653,10 +1653,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
|
||||
BLI_stringdec(name, head, tail, &numlen);
|
||||
BLI_stringenc(name, head, tail, numlen, frame);
|
||||
|
||||
if(ima->id.lib)
|
||||
BLI_path_abs(name, ima->id.lib->filepath);
|
||||
else
|
||||
BLI_path_abs(name, G.main->name);
|
||||
BLI_path_abs(name, ID_BLEND_PATH(G.main, &ima->id));
|
||||
|
||||
flag= IB_rect|IB_multilayer;
|
||||
if(ima->flag & IMA_DO_PREMUL)
|
||||
@@ -1768,11 +1765,8 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
|
||||
char str[FILE_MAX];
|
||||
|
||||
BLI_strncpy(str, ima->name, FILE_MAX);
|
||||
if(ima->id.lib)
|
||||
BLI_path_abs(str, ima->id.lib->filepath);
|
||||
else
|
||||
BLI_path_abs(str, G.main->name);
|
||||
|
||||
BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id));
|
||||
|
||||
/* FIXME: make several stream accessible in image editor, too*/
|
||||
ima->anim = openanim(str, IB_rect, 0);
|
||||
|
||||
@@ -1834,10 +1828,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
|
||||
|
||||
/* get the right string */
|
||||
BLI_strncpy(str, ima->name, sizeof(str));
|
||||
if(ima->id.lib)
|
||||
BLI_path_abs(str, ima->id.lib->filepath);
|
||||
else
|
||||
BLI_path_abs(str, G.main->name);
|
||||
BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id));
|
||||
|
||||
/* read ibuf */
|
||||
ibuf = IMB_loadiffname(str, flag);
|
||||
@@ -1860,7 +1851,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
|
||||
|
||||
/* make packed file for autopack */
|
||||
if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK))
|
||||
ima->packedfile = newPackedFile(NULL, str);
|
||||
ima->packedfile = newPackedFile(NULL, str, ID_BLEND_PATH(G.main, &ima->id));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -941,9 +941,9 @@ static void get_flags_for_id(ID *id, char *buf)
|
||||
isnode= ((Tex *)id)->use_nodes;
|
||||
|
||||
if (id->us<0)
|
||||
sprintf(buf, "-1W ");
|
||||
strcpy(buf, "-1W ");
|
||||
else if (!id->lib && !isfake && id->us && !isnode)
|
||||
sprintf(buf, " ");
|
||||
strcpy(buf, " ");
|
||||
else if(isnode)
|
||||
sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' ');
|
||||
else
|
||||
|
||||
@@ -723,6 +723,48 @@ void test_object_materials(ID *id)
|
||||
}
|
||||
}
|
||||
|
||||
void assign_material_id(ID *id, Material *ma, short act)
|
||||
{
|
||||
Material *mao, **matar, ***matarar;
|
||||
short *totcolp;
|
||||
|
||||
if(act>MAXMAT) return;
|
||||
if(act<1) act= 1;
|
||||
|
||||
/* prevent crashing when using accidentally */
|
||||
BLI_assert(id->lib == NULL);
|
||||
if(id->lib) return;
|
||||
|
||||
/* test arraylens */
|
||||
|
||||
totcolp= give_totcolp_id(id);
|
||||
matarar= give_matarar_id(id);
|
||||
|
||||
if(totcolp==NULL || matarar==NULL) return;
|
||||
|
||||
if(act > *totcolp) {
|
||||
matar= MEM_callocN(sizeof(void *)*act, "matarray1");
|
||||
|
||||
if(*totcolp) {
|
||||
memcpy(matar, *matarar, sizeof(void *)*(*totcolp));
|
||||
MEM_freeN(*matarar);
|
||||
}
|
||||
|
||||
*matarar= matar;
|
||||
*totcolp= act;
|
||||
}
|
||||
|
||||
/* in data */
|
||||
mao= (*matarar)[act-1];
|
||||
if(mao) mao->id.us--;
|
||||
(*matarar)[act-1]= ma;
|
||||
|
||||
if(ma)
|
||||
id_us_plus((ID *)ma);
|
||||
|
||||
test_object_materials(id);
|
||||
}
|
||||
|
||||
void assign_material(Object *ob, Material *ma, short act)
|
||||
{
|
||||
Material *mao, **matar, ***matarar;
|
||||
@@ -1953,6 +1995,11 @@ int do_version_tface(Main *main, int fileload)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* material is not used by faces with texface
|
||||
* set the default flag - do it only once */
|
||||
else
|
||||
if (fileload)
|
||||
ma->game.flag = GEMAT_BACKCULL;
|
||||
}
|
||||
|
||||
return nowarning;
|
||||
|
||||
@@ -1284,16 +1284,16 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
|
||||
if (strip->name[0]==0) {
|
||||
switch (strip->type) {
|
||||
case NLASTRIP_TYPE_CLIP: /* act-clip */
|
||||
sprintf(strip->name, "%s", (strip->act)?(strip->act->id.name+2):("<No Action>"));
|
||||
BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):("<No Action>"), sizeof(strip->name));
|
||||
break;
|
||||
case NLASTRIP_TYPE_TRANSITION: /* transition */
|
||||
sprintf(strip->name, "Transition");
|
||||
BLI_strncpy(strip->name, "Transition", sizeof(strip->name));
|
||||
break;
|
||||
case NLASTRIP_TYPE_META: /* meta */
|
||||
sprintf(strip->name, "Meta");
|
||||
BLI_strncpy(strip->name, "Meta", sizeof(strip->name));
|
||||
break;
|
||||
default:
|
||||
sprintf(strip->name, "NLA Strip");
|
||||
BLI_strncpy(strip->name, "NLA Strip", sizeof(strip->name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1650,7 +1650,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
|
||||
if(ob->matbits) MEM_freeN(ob->matbits);
|
||||
ob->mat = NULL;
|
||||
ob->matbits= NULL;
|
||||
if ((target->totcol) && (target->mat) && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { //XXX OB_SUPPORT_MATERIAL
|
||||
if ((target->totcol) && (target->mat) && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
|
||||
int i;
|
||||
ob->colbits = target->colbits;
|
||||
|
||||
@@ -3070,14 +3070,13 @@ void object_camera_matrix(
|
||||
void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3],
|
||||
float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
|
||||
{
|
||||
float aspx, aspy;
|
||||
float facx, facy;
|
||||
float depth;
|
||||
|
||||
/* aspect correcton */
|
||||
if (scene) {
|
||||
aspx= (float) scene->r.xsch*scene->r.xasp;
|
||||
aspy= (float) scene->r.ysch*scene->r.yasp;
|
||||
float aspx= (float) scene->r.xsch*scene->r.xasp;
|
||||
float aspy= (float) scene->r.ysch*scene->r.yasp;
|
||||
|
||||
if(aspx < aspy) {
|
||||
r_asp[0]= aspx / aspy;
|
||||
@@ -3089,8 +3088,6 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
|
||||
}
|
||||
}
|
||||
else {
|
||||
aspx= 1.0f;
|
||||
aspy= 1.0f;
|
||||
r_asp[0]= 1.0f;
|
||||
r_asp[1]= 1.0f;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ PackedFile *newPackedFileMemory(void *mem, int memlen)
|
||||
return pf;
|
||||
}
|
||||
|
||||
PackedFile *newPackedFile(ReportList *reports, const char *filename)
|
||||
PackedFile *newPackedFile(ReportList *reports, const char *filename, const char *basepath)
|
||||
{
|
||||
PackedFile *pf = NULL;
|
||||
int file, filelen;
|
||||
@@ -185,7 +185,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename)
|
||||
// convert relative filenames to absolute filenames
|
||||
|
||||
strcpy(name, filename);
|
||||
BLI_path_abs(name, G.main->name);
|
||||
BLI_path_abs(name, basepath);
|
||||
|
||||
// open the file
|
||||
// and create a PackedFile structure
|
||||
@@ -224,7 +224,7 @@ void packAll(Main *bmain, ReportList *reports)
|
||||
for(ima=bmain->image.first; ima; ima=ima->id.next) {
|
||||
if(ima->packedfile == NULL && ima->id.lib==NULL) {
|
||||
if(ima->source==IMA_SRC_FILE) {
|
||||
ima->packedfile = newPackedFile(reports, ima->name);
|
||||
ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
|
||||
}
|
||||
else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
|
||||
BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2);
|
||||
@@ -234,11 +234,11 @@ void packAll(Main *bmain, ReportList *reports)
|
||||
|
||||
for(vf=bmain->vfont.first; vf; vf=vf->id.next)
|
||||
if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0)
|
||||
vf->packedfile = newPackedFile(reports, vf->name);
|
||||
vf->packedfile = newPackedFile(reports, vf->name, bmain->name);
|
||||
|
||||
for(sound=bmain->sound.first; sound; sound=sound->id.next)
|
||||
if(sound->packedfile == NULL && sound->id.lib==NULL)
|
||||
sound->packedfile = newPackedFile(reports, sound->name);
|
||||
sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1639,8 +1639,6 @@ float hyp3,hyp4,b4,b5
|
||||
if(wipezone->flip) x = xo - x;
|
||||
angle = wipezone->angle;
|
||||
|
||||
posy = facf0 * yo;
|
||||
|
||||
if(wipe->forward){
|
||||
posx = facf0 * xo;
|
||||
posy = facf0 * yo;
|
||||
@@ -2320,7 +2318,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
|
||||
|
||||
|
||||
/* Swap buffers */
|
||||
swap=temp;temp=map;map=swap;
|
||||
swap=temp;temp=map; /* map=swap; */ /* UNUSED */
|
||||
|
||||
/* Tidy up */
|
||||
MEM_freeN (filter);
|
||||
@@ -2490,7 +2488,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
|
||||
|
||||
|
||||
/* Swap buffers */
|
||||
swap=temp;temp=map;map=swap;
|
||||
swap=temp;temp=map; /* map=swap; */ /* UNUSED */
|
||||
|
||||
/* Tidy up */
|
||||
MEM_freeN (filter);
|
||||
|
||||
@@ -340,20 +340,13 @@ void sound_load(struct Main *bmain, struct bSound* sound)
|
||||
#endif
|
||||
{
|
||||
char fullpath[FILE_MAX];
|
||||
char *path;
|
||||
|
||||
/* load sound */
|
||||
PackedFile* pf = sound->packedfile;
|
||||
|
||||
/* dont modify soundact->sound->name, only change a copy */
|
||||
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
|
||||
|
||||
if(sound->id.lib)
|
||||
path = sound->id.lib->filepath;
|
||||
else
|
||||
path = bmain->name;
|
||||
|
||||
BLI_path_abs(fullpath, path);
|
||||
BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
|
||||
|
||||
/* but we need a packed file then */
|
||||
if (pf)
|
||||
|
||||
@@ -489,6 +489,12 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
|
||||
c->qmax=51;
|
||||
}
|
||||
|
||||
// Keep lossless encodes in the RGB domain.
|
||||
if (codec_id == CODEC_ID_HUFFYUV || codec_id == CODEC_ID_FFV1) {
|
||||
/* HUFFYUV was PIX_FMT_YUV422P before */
|
||||
c->pix_fmt = PIX_FMT_RGB32;
|
||||
}
|
||||
|
||||
if ((of->oformat->flags & AVFMT_GLOBALHEADER)
|
||||
// || !strcmp(of->oformat->name, "mp4")
|
||||
// || !strcmp(of->oformat->name, "mov")
|
||||
@@ -518,8 +524,8 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
|
||||
return NULL;
|
||||
}
|
||||
|
||||
video_buffersize = 2000000;
|
||||
video_buffer = (uint8_t*)MEM_mallocN(video_buffersize,
|
||||
video_buffersize = avpicture_get_size(c->pix_fmt, c->width, c->height);
|
||||
video_buffer = (uint8_t*)MEM_mallocN(video_buffersize*sizeof(uint8_t),
|
||||
"FFMPEG video buffer");
|
||||
|
||||
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
|
||||
@@ -565,6 +571,11 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* need to prevent floating point exception when using vorbis audio codec,
|
||||
initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */
|
||||
st->codec->time_base.num= 1;
|
||||
st->codec->time_base.den= st->codec->sample_rate;
|
||||
|
||||
audio_outbuf_size = FF_MIN_BUFFER_SIZE;
|
||||
|
||||
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
|
||||
@@ -737,7 +748,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
|
||||
}
|
||||
}
|
||||
|
||||
av_write_header(of);
|
||||
if (av_write_header(of) < 0) {
|
||||
BKE_report(reports, RPT_ERROR, "Could not initialize streams. Probably unsupported codec combination.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
outfile = of;
|
||||
av_dump_format(of, 0, name, 1);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ void RegisterBlendExtension(void) {
|
||||
lresult = RegCreateKeyEx(root, "blendfile", 0,
|
||||
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
|
||||
if (lresult == ERROR_SUCCESS) {
|
||||
sprintf(buffer,"%s","Blender File");
|
||||
strcpy(buffer,"Blender File");
|
||||
lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
@@ -10450,7 +10450,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
ma->mode |= MA_TRANSP;
|
||||
}
|
||||
else {
|
||||
ma->mode |= MA_ZTRANSP;
|
||||
/* ma->mode |= MA_ZTRANSP; */ /* leave ztransp as is even if its not used [#28113] */
|
||||
ma->mode &= ~MA_TRANSP;
|
||||
}
|
||||
|
||||
@@ -11821,7 +11821,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
if(!mat->mtex[tex_nr]) continue;
|
||||
if(mat->mtex[tex_nr]->mapto & MAP_ALPHA) transp_tex= 1;
|
||||
}
|
||||
|
||||
|
||||
/* weak! material alpha could be animated */
|
||||
if(mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex){
|
||||
mat->mode |= MA_TRANSP;
|
||||
mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP);
|
||||
@@ -12187,8 +12188,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
if(mtex) {
|
||||
if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) {
|
||||
if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) {
|
||||
mtex->norfac= -mtex->norfac;
|
||||
mtex->texflag|= MTEX_BUMP_FLIPPED;
|
||||
Tex *tex= newlibadr(fd, lib, mtex->tex);
|
||||
|
||||
if(!tex || (tex->imaflag&TEX_NORMALMAP)==0) {
|
||||
mtex->norfac= -mtex->norfac;
|
||||
mtex->texflag|= MTEX_BUMP_FLIPPED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short
|
||||
if (timecodes) {
|
||||
int hours=0, minutes=0, seconds=0, frames=0;
|
||||
float raw_seconds= cfra;
|
||||
char neg[2]= "";
|
||||
char neg[2]= {'\0'};
|
||||
|
||||
/* get cframes */
|
||||
if (cfra < 0) {
|
||||
/* correction for negative cfraues */
|
||||
sprintf(neg, "-");
|
||||
neg[0]= '-';
|
||||
cfra = -cfra;
|
||||
}
|
||||
if (cfra >= 3600) {
|
||||
|
||||
@@ -63,9 +63,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
|
||||
return icon;
|
||||
else if ELEM3(NULL, id, fcu, fcu->rna_path) {
|
||||
if (fcu == NULL)
|
||||
sprintf(name, "<invalid>");
|
||||
strcpy(name, "<invalid>");
|
||||
else if (fcu->rna_path == NULL)
|
||||
sprintf(name, "<no path>");
|
||||
strcpy(name, "<no path>");
|
||||
else /* id == NULL */
|
||||
BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index);
|
||||
}
|
||||
|
||||
@@ -259,6 +259,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
|
||||
|
||||
static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int recalc, int mode)
|
||||
{
|
||||
struct Main *bmain= CTX_data_main(C);
|
||||
Curve *cu= obedit->data;
|
||||
EditFont *ef= cu->editfont;
|
||||
cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0];
|
||||
@@ -269,7 +270,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
|
||||
if(mode == FO_EDIT)
|
||||
update_string(cu);
|
||||
|
||||
BKE_text_to_curve(scene, obedit, mode);
|
||||
BKE_text_to_curve(bmain, scene, obedit, mode);
|
||||
|
||||
if(recalc)
|
||||
DAG_id_tag_update(obedit->data, 0);
|
||||
@@ -928,9 +929,10 @@ static int move_cursor(bContext *C, int type, int select)
|
||||
|
||||
if(select == 0) {
|
||||
if(cu->selstart) {
|
||||
struct Main *bmain= CTX_data_main(C);
|
||||
cu->selstart = cu->selend = 0;
|
||||
update_string(cu);
|
||||
BKE_text_to_curve(scene, obedit, FO_SELCHANGE);
|
||||
BKE_text_to_curve(bmain, scene, obedit, FO_SELCHANGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1644,13 +1646,14 @@ static int open_cancel(bContext *UNUSED(C), wmOperator *op)
|
||||
|
||||
static int open_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
struct Main *bmain= CTX_data_main(C);
|
||||
VFont *font;
|
||||
PropertyPointerRNA *pprop;
|
||||
PointerRNA idptr;
|
||||
char filepath[FILE_MAX];
|
||||
RNA_string_get(op->ptr, "filepath", filepath);
|
||||
|
||||
font= load_vfont(filepath);
|
||||
font= load_vfont(bmain, filepath);
|
||||
|
||||
if(!font) {
|
||||
if(op->customdata) MEM_freeN(op->customdata);
|
||||
|
||||
@@ -749,6 +749,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
|
||||
void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
|
||||
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
|
||||
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
|
||||
void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
|
||||
|
||||
void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type);
|
||||
|
||||
|
||||
@@ -2049,7 +2049,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
|
||||
wm_subwindow_getsize(window, window->screen->mainwin, &getsizex, &getsizey);
|
||||
|
||||
block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]);
|
||||
block->auto_open= 2;
|
||||
block->auto_open= TRUE;
|
||||
block->flag |= UI_BLOCK_LOOP; /* tag as menu */
|
||||
}
|
||||
|
||||
@@ -2291,7 +2291,7 @@ int ui_but_can_align(uiBut *but)
|
||||
return !ELEM3(but->type, LABEL, OPTION, OPTIONN);
|
||||
}
|
||||
|
||||
static void ui_block_do_align_but(uiBut *first, int nr)
|
||||
static void ui_block_do_align_but(uiBut *first, short nr)
|
||||
{
|
||||
uiBut *prev, *but=NULL, *next;
|
||||
int flag= 0, cols=0, rows=0;
|
||||
@@ -2428,7 +2428,7 @@ static void ui_block_do_align_but(uiBut *first, int nr)
|
||||
void ui_block_do_align(uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
int nr;
|
||||
short nr;
|
||||
|
||||
/* align buttons with same align nr */
|
||||
for(but=block->buttons.first; but;) {
|
||||
@@ -2519,7 +2519,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
||||
but->pos= -1; /* cursor invisible */
|
||||
|
||||
if(ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { /* add a space to name */
|
||||
slen= strlen(but->str);
|
||||
/* slen remains unchanged from previous assignment, ensure this stays true */
|
||||
if(slen>0 && slen<UI_MAX_NAME_STR-2) {
|
||||
if(but->str[slen-1]!=' ') {
|
||||
but->str[slen]= ' ';
|
||||
|
||||
@@ -1307,12 +1307,12 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
|
||||
}
|
||||
/* mouse inside the widget */
|
||||
else if (x >= startx) {
|
||||
float aspect= (but->block->aspect);
|
||||
const float aspect_sqrt= sqrtf(but->block->aspect);
|
||||
|
||||
but->pos= strlen(origstr)-but->ofs;
|
||||
|
||||
/* XXX does not take zoom level into account */
|
||||
while (startx + aspect*BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
|
||||
while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
|
||||
if (but->pos <= 0) break;
|
||||
but->pos--;
|
||||
origstr[but->pos+but->ofs] = 0;
|
||||
@@ -1368,133 +1368,115 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc
|
||||
return changed;
|
||||
}
|
||||
|
||||
static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump)
|
||||
static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all)
|
||||
{
|
||||
char *str;
|
||||
int len;
|
||||
const char *str= data->str;
|
||||
const int len= strlen(str);
|
||||
const int pos_prev= but->pos;
|
||||
const int has_sel= (but->selend - but->selsta) > 0;
|
||||
|
||||
str= data->str;
|
||||
len= strlen(str);
|
||||
|
||||
if(direction) { /* right*/
|
||||
/* if there's a selection */
|
||||
if ((but->selend - but->selsta) > 0) {
|
||||
/* extend the selection based on the first direction taken */
|
||||
if(select) {
|
||||
if (!data->selextend) {
|
||||
data->selextend = EXTEND_RIGHT;
|
||||
}
|
||||
if (data->selextend == EXTEND_RIGHT) {
|
||||
but->selend++;
|
||||
if (but->selend > len) but->selend = len;
|
||||
} else if (data->selextend == EXTEND_LEFT) {
|
||||
but->selsta++;
|
||||
/* if the selection start has gone past the end,
|
||||
* flip them so they're in sync again */
|
||||
if (but->selsta == but->selend) {
|
||||
but->pos = but->selsta;
|
||||
data->selextend = EXTEND_RIGHT;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* special case, quit selection and set cursor */
|
||||
if (has_sel && !select) {
|
||||
if (jump_all) {
|
||||
but->selsta = but->selend= but->pos = direction ? len : 0;
|
||||
}
|
||||
else {
|
||||
if (direction) {
|
||||
but->selsta = but->pos = but->selend;
|
||||
data->selextend = 0;
|
||||
}
|
||||
} else {
|
||||
if(select) {
|
||||
/* make a selection, starting from the cursor position */
|
||||
int tlen;
|
||||
but->selsta = but->pos;
|
||||
|
||||
but->pos++;
|
||||
if(but->pos > (tlen= strlen(str))) but->pos= tlen;
|
||||
|
||||
but->selend = but->pos;
|
||||
} else if(jump) {
|
||||
/* jump betweenn special characters (/,\,_,-, etc.),
|
||||
else {
|
||||
but->pos = but->selend = but->selsta;
|
||||
}
|
||||
}
|
||||
data->selextend = 0;
|
||||
}
|
||||
else {
|
||||
if(direction) { /* right*/
|
||||
if(jump) {
|
||||
/* jump between special characters (/,\,_,-, etc.),
|
||||
* look at function test_special_char() for complete
|
||||
* list of special character, ctr -> */
|
||||
while(but->pos < len) {
|
||||
but->pos++;
|
||||
if(test_special_char(str[but->pos])) break;
|
||||
if(!jump_all && test_special_char(str[but->pos])) break;
|
||||
}
|
||||
} else {
|
||||
int tlen;
|
||||
}
|
||||
else {
|
||||
but->pos++;
|
||||
if(but->pos > (tlen= strlen(str))) but->pos= tlen;
|
||||
if(but->pos > len) but->pos= len;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { /* left */
|
||||
/* if there's a selection */
|
||||
if ((but->selend - but->selsta) > 0) {
|
||||
/* extend the selection based on the first direction taken */
|
||||
if(select) {
|
||||
if (!data->selextend) {
|
||||
data->selextend = EXTEND_LEFT;
|
||||
else { /* left */
|
||||
if(jump) {
|
||||
|
||||
/* left only: compensate for index/change in direction */
|
||||
if(but->pos > 0) {
|
||||
but->pos--;
|
||||
}
|
||||
if (data->selextend == EXTEND_LEFT) {
|
||||
but->selsta--;
|
||||
if (but->selsta < 0) but->selsta = 0;
|
||||
} else if (data->selextend == EXTEND_RIGHT) {
|
||||
but->selend--;
|
||||
/* if the selection start has gone past the end,
|
||||
* flip them so they're in sync again */
|
||||
if (but->selsta == but->selend) {
|
||||
but->pos = but->selsta;
|
||||
data->selextend = EXTEND_LEFT;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
but->pos = but->selend = but->selsta;
|
||||
data->selextend = 0;
|
||||
}
|
||||
} else {
|
||||
if(select) {
|
||||
/* make a selection, starting from the cursor position */
|
||||
but->selend = but->pos;
|
||||
|
||||
but->pos--;
|
||||
if(but->pos<0) but->pos= 0;
|
||||
|
||||
but->selsta = but->pos;
|
||||
} else if(jump) {
|
||||
/* jump betweenn special characters (/,\,_,-, etc.),
|
||||
|
||||
/* jump between special characters (/,\,_,-, etc.),
|
||||
* look at function test_special_char() for complete
|
||||
* list of special character, ctr -> */
|
||||
while(but->pos > 0){
|
||||
but->pos--;
|
||||
if(test_special_char(str[but->pos])) break;
|
||||
if(!jump_all && test_special_char(str[but->pos])) break;
|
||||
}
|
||||
} else {
|
||||
|
||||
/* left only: compensate for index/change in direction */
|
||||
if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) {
|
||||
but->pos++;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
if(but->pos>0) but->pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select)
|
||||
{
|
||||
char *str;
|
||||
|
||||
str= data->str;
|
||||
|
||||
if(direction) { /* right */
|
||||
if(select) {
|
||||
but->selsta = but->pos;
|
||||
but->selend = strlen(str);
|
||||
data->selextend = EXTEND_RIGHT;
|
||||
} else {
|
||||
but->selsta = but->selend = but->pos= strlen(str);
|
||||
}
|
||||
}
|
||||
else { /* left */
|
||||
if(select) {
|
||||
but->selend = but->pos;
|
||||
but->selsta = 0;
|
||||
data->selextend = EXTEND_LEFT;
|
||||
} else {
|
||||
but->selsta = but->selend = but->pos= 0;
|
||||
/* existing selection */
|
||||
if (has_sel) {
|
||||
|
||||
if(data->selextend == 0) {
|
||||
data->selextend= EXTEND_RIGHT;
|
||||
}
|
||||
|
||||
if (direction) {
|
||||
if (data->selextend == EXTEND_RIGHT) {
|
||||
but->selend= but->pos;
|
||||
}
|
||||
else {
|
||||
but->selsta= but->pos;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (data->selextend == EXTEND_LEFT) {
|
||||
but->selsta= but->pos;
|
||||
}
|
||||
else {
|
||||
but->selend= but->pos;
|
||||
}
|
||||
}
|
||||
|
||||
if (but->selend < but->selsta) {
|
||||
SWAP(short, but->selsta, but->selend);
|
||||
data->selextend= (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT;
|
||||
}
|
||||
|
||||
} /* new selection */
|
||||
else {
|
||||
if (direction) {
|
||||
data->selextend= EXTEND_RIGHT;
|
||||
but->selend= but->pos;
|
||||
but->selsta= pos_prev;
|
||||
}
|
||||
else {
|
||||
data->selextend= EXTEND_LEFT;
|
||||
but->selend= pos_prev;
|
||||
but->selsta= but->pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1831,11 +1813,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
}
|
||||
break;
|
||||
case RIGHTARROWKEY:
|
||||
ui_textedit_move(but, data, 1, event->shift, event->ctrl);
|
||||
ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE);
|
||||
retval= WM_UI_HANDLER_BREAK;
|
||||
break;
|
||||
case LEFTARROWKEY:
|
||||
ui_textedit_move(but, data, 0, event->shift, event->ctrl);
|
||||
ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE);
|
||||
retval= WM_UI_HANDLER_BREAK;
|
||||
break;
|
||||
case DOWNARROWKEY:
|
||||
@@ -1845,7 +1827,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
}
|
||||
/* pass on purposedly */
|
||||
case ENDKEY:
|
||||
ui_textedit_move_end(but, data, 1, event->shift);
|
||||
ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE);
|
||||
retval= WM_UI_HANDLER_BREAK;
|
||||
break;
|
||||
case UPARROWKEY:
|
||||
@@ -1855,7 +1837,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
}
|
||||
/* pass on purposedly */
|
||||
case HOMEKEY:
|
||||
ui_textedit_move_end(but, data, 0, event->shift);
|
||||
ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE);
|
||||
retval= WM_UI_HANDLER_BREAK;
|
||||
break;
|
||||
case PADENTER:
|
||||
@@ -4681,7 +4663,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
|
||||
/* check if the mouse is in the region */
|
||||
if(!BLI_in_rcti(&ar->winrct, x, y)) {
|
||||
for(block=ar->uiblocks.first; block; block=block->next)
|
||||
block->auto_open= 0;
|
||||
block->auto_open= FALSE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4868,8 +4850,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
|
||||
if(data->used_mouse && !data->autoopentimer) {
|
||||
int time;
|
||||
|
||||
if(but->block->auto_open==2) time= 1; // test for toolbox
|
||||
else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open) time= 5*U.menuthreshold2;
|
||||
if(but->block->auto_open==TRUE) time= 1; // test for toolbox
|
||||
else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open==TRUE) time= 5*U.menuthreshold2;
|
||||
else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
|
||||
else time= -1;
|
||||
|
||||
@@ -4967,9 +4949,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
|
||||
/* we disable auto_open in the block after a threshold, because we still
|
||||
* want to allow auto opening adjacent menus even if no button is activated
|
||||
* in between going over to the other button, but only for a short while */
|
||||
if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open)
|
||||
if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open==TRUE)
|
||||
if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
|
||||
but->block->auto_open= 0;
|
||||
but->block->auto_open= FALSE;
|
||||
|
||||
if(type == BUTTON_ACTIVATE_OVER) {
|
||||
data->used_mouse= 1;
|
||||
@@ -5157,7 +5139,9 @@ void uiContextActivePropertyHandle(bContext *C)
|
||||
* currently this is mainly so reset defaults works for the
|
||||
* operator redo panel - campbell */
|
||||
uiBlock *block= activebut->block;
|
||||
block->handle_func(C, block->handle_func_arg, 0);
|
||||
if (block->handle_func) {
|
||||
block->handle_func(C, block->handle_func_arg, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,19 +136,10 @@ typedef enum {
|
||||
/* for scope resize zone */
|
||||
#define SCOPE_RESIZE_PAD 9
|
||||
|
||||
typedef struct {
|
||||
short xim, yim;
|
||||
unsigned int *rect;
|
||||
short xofs, yofs;
|
||||
} uiIconImage;
|
||||
|
||||
|
||||
typedef struct uiLinkLine { /* only for draw/edit */
|
||||
struct uiLinkLine *next, *prev;
|
||||
|
||||
struct uiBut *from, *to;
|
||||
short flag, pad;
|
||||
|
||||
struct uiBut *from, *to;
|
||||
} uiLinkLine;
|
||||
|
||||
typedef struct {
|
||||
@@ -164,10 +155,10 @@ typedef struct {
|
||||
|
||||
struct uiBut {
|
||||
struct uiBut *next, *prev;
|
||||
short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend;
|
||||
short alignnr;
|
||||
int flag;
|
||||
|
||||
short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend, alignnr;
|
||||
short pad1;
|
||||
|
||||
char *str;
|
||||
char strdata[UI_MAX_NAME_STR];
|
||||
char drawstr[UI_MAX_DRAW_STR];
|
||||
@@ -282,7 +273,7 @@ struct uiBlock {
|
||||
float minx, miny, maxx, maxy;
|
||||
float aspect;
|
||||
|
||||
short alignnr;
|
||||
int puphash; // popup menu hash for memory
|
||||
|
||||
uiButHandleFunc func;
|
||||
void *func_arg1;
|
||||
@@ -306,9 +297,12 @@ struct uiBlock {
|
||||
void *drawextra_arg2;
|
||||
|
||||
int flag;
|
||||
short alignnr;
|
||||
|
||||
char direction;
|
||||
char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */
|
||||
short auto_open;
|
||||
char auto_open;
|
||||
char _pad[7];
|
||||
double auto_open_last;
|
||||
|
||||
const char *lockstr;
|
||||
@@ -326,15 +320,12 @@ struct uiBlock {
|
||||
ListBase saferct; // uiSafetyRct list
|
||||
|
||||
uiPopupBlockHandle *handle; // handle
|
||||
|
||||
int puphash; // popup menu hash for memory
|
||||
|
||||
void *evil_C; // XXX hack for dynamic operator enums
|
||||
|
||||
struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time.
|
||||
float _hsv[3]; // XXX, only access via ui_block_hsv_get()
|
||||
char color_profile; // color profile for correcting linear colors for display
|
||||
struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time.
|
||||
|
||||
};
|
||||
|
||||
typedef struct uiSafetyRct {
|
||||
@@ -400,9 +391,9 @@ struct uiPopupBlockHandle {
|
||||
|
||||
/* for operator popups */
|
||||
struct wmOperatorType *optype;
|
||||
int opcontext;
|
||||
ScrArea *ctx_area;
|
||||
ARegion *ctx_region;
|
||||
int opcontext;
|
||||
|
||||
/* return values */
|
||||
int butretval;
|
||||
|
||||
@@ -768,7 +768,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
|
||||
if(properties) {
|
||||
PointerRNA tptr;
|
||||
|
||||
WM_operator_properties_create(&tptr, opname);
|
||||
WM_operator_properties_create_ptr(&tptr, ot);
|
||||
if(tptr.data) {
|
||||
IDP_FreeProperty(tptr.data);
|
||||
MEM_freeN(tptr.data);
|
||||
@@ -2432,7 +2432,7 @@ static void ui_item_estimate(uiItem *item)
|
||||
}
|
||||
}
|
||||
|
||||
static void ui_item_align(uiLayout *litem, int nr)
|
||||
static void ui_item_align(uiLayout *litem, short nr)
|
||||
{
|
||||
uiItem *item;
|
||||
uiButtonItem *bitem;
|
||||
|
||||
@@ -2308,7 +2308,6 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
|
||||
uiStyle *style= UI_GetStyle();
|
||||
uiPopupBlockHandle *handle;
|
||||
uiPopupMenu *pup;
|
||||
|
||||
pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy");
|
||||
pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP);
|
||||
pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
|
||||
@@ -2323,6 +2322,19 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
|
||||
pup->popup= 1;
|
||||
pup->block->flag |= UI_BLOCK_NO_FLIP;
|
||||
}
|
||||
/* some enums reversing is strange, currently we have no good way to
|
||||
* reverse some enum's but not others, so reverse all so the first menu
|
||||
* items are always close to the mouse cursor */
|
||||
#if 0
|
||||
else {
|
||||
/* if this is an rna button then we can assume its an enum
|
||||
* flipping enums is generally not good since the order can be
|
||||
* important [#28786] */
|
||||
if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
|
||||
pup->block->flag |= UI_BLOCK_NO_FLIP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(str) {
|
||||
/* menu is created from a string */
|
||||
|
||||
@@ -2542,3 +2542,61 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
||||
uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
|
||||
}
|
||||
|
||||
/********************************* Keymap *************************************/
|
||||
|
||||
static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
|
||||
{
|
||||
wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p;
|
||||
WM_keyconfig_update_tag(NULL, kmi);
|
||||
}
|
||||
|
||||
static void template_keymap_item_properties(uiLayout *layout, const char *title, PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *flow;
|
||||
|
||||
uiItemS(layout);
|
||||
|
||||
if(title)
|
||||
uiItemL(layout, title, ICON_NONE);
|
||||
|
||||
flow= uiLayoutColumnFlow(layout, 2, 0);
|
||||
|
||||
RNA_STRUCT_BEGIN(ptr, prop) {
|
||||
int flag= RNA_property_flag(prop);
|
||||
|
||||
if(flag & PROP_HIDDEN)
|
||||
continue;
|
||||
|
||||
/* recurse for nested properties */
|
||||
if(RNA_property_type(prop) == PROP_POINTER) {
|
||||
PointerRNA propptr= RNA_property_pointer_get(ptr, prop);
|
||||
const char *name= RNA_property_ui_name(prop);
|
||||
|
||||
if(propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
|
||||
template_keymap_item_properties(layout, name, &propptr);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* add property */
|
||||
uiItemR(flow, ptr, RNA_property_identifier(prop), 0, NULL, ICON_NONE);
|
||||
}
|
||||
RNA_STRUCT_END;
|
||||
}
|
||||
|
||||
void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
|
||||
{
|
||||
PointerRNA propptr= RNA_pointer_get(ptr, "properties");
|
||||
|
||||
if(propptr.data) {
|
||||
uiBut *but= uiLayoutGetBlock(layout)->buttons.last;
|
||||
|
||||
template_keymap_item_properties(layout, NULL, &propptr);
|
||||
|
||||
/* attach callbacks to compensate for missing properties update,
|
||||
we don't know which keymap (item) is being modified there */
|
||||
for(; but; but=but->next)
|
||||
uiButSetFunc(but, keymap_item_modified, ptr->data, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,12 +175,18 @@ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, fl
|
||||
|
||||
/********************* Add Object Operator ********************/
|
||||
|
||||
void view_align_update(struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
|
||||
{
|
||||
RNA_struct_idprops_unset(ptr, "rotation");
|
||||
}
|
||||
|
||||
void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* note: this property gets hidden for add-camera operator */
|
||||
RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
|
||||
prop= RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
|
||||
RNA_def_property_update_runtime(prop, view_align_update);
|
||||
|
||||
if(do_editmode) {
|
||||
prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user