Compare commits
11 Commits
missing-li
...
temp-ghash
Author | SHA1 | Date | |
---|---|---|---|
58d6cbba6d | |||
94549adec4 | |||
77a4d705c7 | |||
f808f36c12 | |||
b6f0c9e25a | |||
ecc9fe9945 | |||
4e3bc21492 | |||
88ae44a363 | |||
df587b03c3 | |||
1df3713365 | |||
23b42a5e69 |
169
CMakeLists.txt
169
CMakeLists.txt
@@ -158,30 +158,25 @@ option_defaults_init(
|
||||
_init_SDL
|
||||
_init_FFTW3
|
||||
_init_GAMEENGINE
|
||||
_init_OPENSUBDIV
|
||||
)
|
||||
|
||||
# customize...
|
||||
if (UNIX AND NOT APPLE)
|
||||
if(UNIX AND NOT APPLE)
|
||||
# some of these libraries are problematic on Linux
|
||||
# disable less important dependencies by default
|
||||
set(_init_BUILDINFO OFF)
|
||||
set(_init_CODEC_FFMPEG OFF)
|
||||
set(_init_CYCLES_OSL OFF)
|
||||
set(_init_IMAGE_OPENEXR OFF)
|
||||
set(_init_IMAGE_REDCODE OFF)
|
||||
set(_init_INPUT_NDOF OFF)
|
||||
set(_init_JACK OFF)
|
||||
set(_init_LIBMV_SCHUR_SPECIALIZATION OFF)
|
||||
set(_init_OPENCOLLADA OFF)
|
||||
set(_init_OPENCOLORIO OFF)
|
||||
set(_init_SDL OFF)
|
||||
set(_init_FFTW3 OFF)
|
||||
set(_init_OPENSUBDIV OFF)
|
||||
elseif(WIN32)
|
||||
set(_init_JACK OFF)
|
||||
elseif(APPLE)
|
||||
set(_init_INPUT_NDOF OFF)
|
||||
set(_init_JACK OFF)
|
||||
set(_init_OPENSUBDIV OFF)
|
||||
set(_init_GAMEENGINE OFF)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -226,15 +221,7 @@ mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||
|
||||
# Compositor
|
||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||
option(WITH_COMPOSITOR_WERROR "Treat warnings as errors in compositor code" OFF)
|
||||
mark_as_advanced(WITH_COMPOSITOR_WERROR)
|
||||
|
||||
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" _init_OPENSUBDIV)
|
||||
option(WITH_SUBSURF_WERROR "Treat warnings as errors in subsurf code" OFF)
|
||||
mark_as_advanced(WITH_COMPOSITOR_WERROR)
|
||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
|
||||
@@ -252,13 +239,7 @@ option(WITH_HEADLESS "Build without graphical support (renderfarm, server m
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
|
||||
option(WITH_AUDASPACE "Build with blenders audio library (only disable if you know what you're doing!)" ON)
|
||||
option(WITH_SYSTEM_AUDASPACE "Build with external audaspace library installed on the system (only enable if you know what you're doing!)" OFF)
|
||||
mark_as_advanced(WITH_AUDASPACE)
|
||||
mark_as_advanced(WITH_SYSTEM_AUDASPACE)
|
||||
|
||||
if(NOT WITH_AUDASPACE)
|
||||
set(WITH_SYSTEM_AUDASPACE OFF)
|
||||
endif()
|
||||
|
||||
option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
|
||||
@@ -337,11 +318,9 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
# Camera/motion tracking
|
||||
option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
|
||||
option(WITH_LIBMV "Enable libmv structure from motion library" ON)
|
||||
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ${_init_LIBMV_SCHUR_SPECIALIZATION})
|
||||
option(WITH_LIBMV_WERROR "Treat warnings as errors in Libmv (and Blender's motion tracking) code")
|
||||
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||
mark_as_advanced(WITH_LIBMV_WERROR)
|
||||
|
||||
# Freestyle
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
@@ -375,20 +354,18 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
# Cycles
|
||||
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
|
||||
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
|
||||
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
|
||||
option(WITH_CYCLES "Enable cycles Render Engine" ON)
|
||||
option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
|
||||
option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
|
||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
|
||||
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
||||
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
|
||||
option(WITH_CYCLES_WERROR "Treat warnings as errors in Cycles code" OFF)
|
||||
option(WITH_CYCLES_LOGGING "Build cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG "Build cycles with extra debug capabilities" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||
mark_as_advanced(WITH_CYCLES_DEBUG)
|
||||
mark_as_advanced(WITH_CYCLES_WERROR)
|
||||
|
||||
# LLVM
|
||||
option(WITH_LLVM "Use LLVM" OFF)
|
||||
@@ -418,6 +395,7 @@ option(WITH_BOOST "Enable features depending on boost" ON)
|
||||
|
||||
# Unit testsing
|
||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||
option(WITH_TESTS_PERFORMANCE "Enable performance tests" OFF)
|
||||
|
||||
|
||||
# Documentation
|
||||
@@ -434,6 +412,7 @@ option(WITH_GL_EGL "Use the EGL OpenGL system library instead of th
|
||||
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
|
||||
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
|
||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||
option(WITH_GPU_DEBUG "Create a debug OpenGL context (allows inserting custom messages and getting notifications for bad GL use)" OFF)
|
||||
|
||||
mark_as_advanced(
|
||||
WITH_GLEW_MX
|
||||
@@ -442,6 +421,7 @@ mark_as_advanced(
|
||||
WITH_GL_PROFILE_COMPAT
|
||||
WITH_GL_PROFILE_CORE
|
||||
WITH_GL_PROFILE_ES20
|
||||
WITH_GPU_DEBUG
|
||||
)
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
@@ -511,11 +491,7 @@ if(APPLE)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
|
||||
if(${MAC_SYS} MATCHES 15)
|
||||
set(OSX_SYSTEM 10.11)
|
||||
# throw an error here, older cmake cannot handle 2 digit subversion!
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
elseif(${MAC_SYS} MATCHES 14)
|
||||
if(${MAC_SYS} MATCHES 14)
|
||||
set(OSX_SYSTEM 10.10)
|
||||
# throw an error here, older cmake cannot handle 2 digit subversion!
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
@@ -532,11 +508,13 @@ if(APPLE)
|
||||
else()
|
||||
set(OSX_SYSTEM unsupported)
|
||||
endif()
|
||||
message(STATUS "Detected system-version: " ${OSX_SYSTEM})
|
||||
|
||||
# workaround for incorrect cmake xcode lookup for developer previews - XCODE_VERSION does not take xcode-select path into accout
|
||||
# but would always look into /Applications/Xcode.app while dev versions are named Xcode<version>-DP<preview_number>
|
||||
execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_CHECK OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate to bundlepath in any case
|
||||
message(STATUS "Xcode-bundle : " ${XCODE_BUNDLE})
|
||||
|
||||
if(${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
|
||||
@@ -564,8 +542,8 @@ if(APPLE)
|
||||
string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
|
||||
unset(XCODE_VERS_BUILD_NR)
|
||||
endif()
|
||||
|
||||
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}")
|
||||
|
||||
message(STATUS "Detected Xcode-version: " ${XCODE_VERSION})
|
||||
|
||||
if(${XCODE_VERSION} VERSION_LESS 4.3)
|
||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE) # use guaranteed existing sdk
|
||||
@@ -719,34 +697,6 @@ if(HAVE_STDBOOL_H)
|
||||
add_definitions(-DHAVE_STDBOOL_H)
|
||||
endif()
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
if(WITH_SYSTEM_AUDASPACE)
|
||||
set(AUDASPACE_DEFINITIONS
|
||||
-DWITH_AUDASPACE
|
||||
-DWITH_SYSTEM_AUDASPACE
|
||||
"-DAUD_DEVICE_H=<AUD_Device.h>"
|
||||
"-DAUD_SPECIAL_H=<AUD_Special.h>"
|
||||
"-DAUD_SOUND_H=<AUD_Sound.h>"
|
||||
"-DAUD_HANDLE_H=<AUD_Handle.h>"
|
||||
"-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
|
||||
"-DAUD_TYPES_H=<AUD_Types.h>"
|
||||
"-DAUD_PYTHON_H=<python/PyAPI.h>"
|
||||
)
|
||||
else()
|
||||
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
|
||||
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
|
||||
set(AUDASPACE_DEFINITIONS
|
||||
-DWITH_AUDASPACE
|
||||
"-DAUD_DEVICE_H=<AUD_C-API.h>"
|
||||
"-DAUD_SPECIAL_H=<AUD_C-API.h>"
|
||||
"-DAUD_SOUND_H=<AUD_C-API.h>"
|
||||
"-DAUD_HANDLE_H=<AUD_C-API.h>"
|
||||
"-DAUD_SEQUENCE_H=<AUD_C-API.h>"
|
||||
"-DAUD_TYPES_H=<AUD_Space.h>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for valid directories
|
||||
# ... a partial checkout may cause this.
|
||||
@@ -848,14 +798,6 @@ if(WITH_X11)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Main Platform Checks
|
||||
#
|
||||
# - UNIX
|
||||
# - WIN32
|
||||
# - APPLE
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
macro(find_package_wrapper)
|
||||
if(WITH_STATIC_LIBS)
|
||||
@@ -924,13 +866,6 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
# Audio IO
|
||||
if(WITH_SYSTEM_AUDASPACE)
|
||||
find_package_wrapper(Audaspace)
|
||||
if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND)
|
||||
message(FATAL_ERROR "Audaspace external library not found!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENAL)
|
||||
find_package_wrapper(OpenAL)
|
||||
if(NOT OPENAL_FOUND)
|
||||
@@ -1131,9 +1066,9 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
find_package_wrapper(LLVM)
|
||||
find_package_wrapper(LLVM)
|
||||
|
||||
if(NOT LLVM_FOUND)
|
||||
if(NOT LLVM_FOUND)
|
||||
set(WITH_LLVM OFF)
|
||||
message(STATUS "LLVM not found")
|
||||
endif()
|
||||
@@ -1144,18 +1079,6 @@ if(UNIX AND NOT APPLE)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
find_package_wrapper(OpenSubdiv)
|
||||
|
||||
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES})
|
||||
set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere
|
||||
|
||||
if(NOT OPENSUBDIV_FOUND)
|
||||
set(WITH_OPENSUBDIV OFF)
|
||||
message(STATUS "OpenSubdiv not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
|
||||
|
||||
@@ -1193,12 +1116,12 @@ if(UNIX AND NOT APPLE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
||||
else()
|
||||
message(STATUS "GNU gold linker isn't available, using the default system linker.")
|
||||
endif()
|
||||
else ()
|
||||
message(INFO "GNU gold linker isn't available, using the default system linker.")
|
||||
endif ()
|
||||
unset(LD_VERSION)
|
||||
|
||||
# CLang is the same as GCC for now.
|
||||
@@ -1576,13 +1499,6 @@ elseif(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
set(OPENSUBDIV_INCLUDE_DIR ${LIBDIR}/opensubdiv/include)
|
||||
set(OPENSUBDIV_LIBPATH ${LIBDIR}/opensubdiv/lib)
|
||||
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBPATH}/osdCPU.lib ${OPENSUBDIV_LIBPATH}/osdGPU.lib)
|
||||
find_package(OpenSubdiv)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
@@ -1590,16 +1506,6 @@ elseif(WIN32)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
endif()
|
||||
|
||||
# Audio IO
|
||||
if(WITH_SYSTEM_AUDASPACE)
|
||||
set(AUDASPACE_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
|
||||
set(AUDASPACE_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace.lib)
|
||||
set(AUDASPACE_C_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
|
||||
set(AUDASPACE_C_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-c.lib)
|
||||
set(AUDASPACE_PY_INCLUDE_DIRS ${LIBDIR}/audaspace/include/audaspace)
|
||||
set(AUDASPACE_PY_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-py.lib)
|
||||
endif()
|
||||
|
||||
# used in many places so include globally, like OpenGL
|
||||
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
|
||||
|
||||
@@ -1919,17 +1825,6 @@ elseif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
|
||||
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
|
||||
find_library(OSL_LIB_UTIL NAMES osdutil PATHS ${OPENSUBDIV_LIBPATH})
|
||||
find_library(OSL_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
find_library(OSL_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
|
||||
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
|
||||
list(APPEND OPENSUBDIV_LIBRARIES ${OSL_LIB_UTIL} ${OSL_LIB_CPU} ${OSL_LIB_GPU})
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
find_library(JACK_FRAMEWORK
|
||||
NAMES jackmp
|
||||
@@ -2322,14 +2217,9 @@ endif()
|
||||
if(WITH_IMAGE_OPENJPEG)
|
||||
if(WITH_SYSTEM_OPENJPEG)
|
||||
# dealt with above
|
||||
set(OPENJPEG_DEFINES "")
|
||||
else()
|
||||
set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
|
||||
set(OPENJPEG_DEFINES "-DOPJ_STATIC")
|
||||
endif()
|
||||
# Special handling of Windows platform where openjpeg is always static.
|
||||
if(WIN32)
|
||||
set(OPENJPEG_DEFINES "-DOPJ_STATIC")
|
||||
add_definitions(-DOPJ_STATIC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -2462,6 +2352,10 @@ if(WITH_GL_EGL)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_EGL)
|
||||
endif()
|
||||
|
||||
if(WITH_GPU_DEBUG)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GPU_DEBUG)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenMP.
|
||||
if(WITH_OPENMP)
|
||||
@@ -2969,6 +2863,7 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_GL_PROFILE_COMPAT)
|
||||
info_cfg_option(WITH_GL_PROFILE_CORE)
|
||||
info_cfg_option(WITH_GL_PROFILE_ES20)
|
||||
info_cfg_option(WITH_GPU_DEBUG)
|
||||
if(WIN32)
|
||||
info_cfg_option(WITH_GL_ANGLE)
|
||||
endif()
|
||||
|
@@ -122,7 +122,7 @@ endif
|
||||
# Build Blender
|
||||
all: FORCE
|
||||
@echo
|
||||
@echo Configuring Blender in \"$(BUILD_DIR)\" ...
|
||||
@echo Configuring Blender ...
|
||||
|
||||
# # if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
|
||||
# # $(CMAKE_CONFIG); \
|
||||
|
26
SConstruct
26
SConstruct
@@ -331,10 +331,7 @@ if env['OURPLATFORM']=='darwin':
|
||||
print B.bc.OKGREEN + "Available SDK's: \n" + B.bc.ENDC + MACOSX_SDK_CHECK.replace('\t', '')
|
||||
|
||||
if env['MACOSX_SDK'] == '': # no set sdk, choosing best one found
|
||||
if 'OS X 10.11' in MACOSX_SDK_CHECK:
|
||||
env['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
|
||||
env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.11.sdk'
|
||||
elif 'OS X 10.10' in MACOSX_SDK_CHECK:
|
||||
if 'OS X 10.10' in MACOSX_SDK_CHECK:
|
||||
env['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
|
||||
env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.10.sdk'
|
||||
elif 'OS X 10.9' in MACOSX_SDK_CHECK:
|
||||
@@ -517,10 +514,6 @@ if env['WITH_BF_STATICCXX']:
|
||||
else:
|
||||
print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
|
||||
|
||||
# audaspace is needed for the game engine
|
||||
if not env['WITH_BF_AUDASPACE']:
|
||||
env['WITH_BF_GAMEENGINE'] = False
|
||||
|
||||
# check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
|
||||
if 'blenderplayer' in B.targets:
|
||||
env['WITH_BF_PLAYER'] = True
|
||||
@@ -547,25 +540,13 @@ else:
|
||||
env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||
|
||||
# TODO, make optional (as with CMake)
|
||||
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
|
||||
env['CPPFLAGS'].append('-DWITH_AVI')
|
||||
env['CPPFLAGS'].append('-DWITH_OPENNL')
|
||||
|
||||
if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
|
||||
env['CPPFLAGS'].append('-DHAVE_STDBOOL_H')
|
||||
|
||||
# Audaspace
|
||||
|
||||
if env['WITH_BF_AUDASPACE']:
|
||||
env['BF_AUDASPACE_C_INC'] = '#intern/audaspace/intern'
|
||||
env['BF_AUDASPACE_PY_INC'] = '#intern/audaspace/intern'
|
||||
env['BF_AUDASPACE_DEF'] = ['WITH_AUDASPACE']
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_DEVICE_H="<AUD_C-API.h>"')
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_SPECIAL_H="<AUD_C-API.h>"')
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_SOUND_H="<AUD_C-API.h>"')
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_HANDLE_H="<AUD_C-API.h>"')
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_SEQUENCE_H="<AUD_C-API.h>"')
|
||||
env['BF_AUDASPACE_DEF'].append('AUD_TYPES_H="<AUD_Space.h>"')
|
||||
|
||||
# OpenGL
|
||||
|
||||
if env['WITH_BF_GL_PROFILE_COMPAT']:
|
||||
@@ -785,8 +766,6 @@ if B.targets != ['cudakernels']:
|
||||
data_to_c_simple("release/datafiles/preview_cycles.blend")
|
||||
|
||||
# --- glsl ---
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_geometry.glsl")
|
||||
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_color_frag.glsl")
|
||||
|
||||
@@ -810,7 +789,6 @@ if B.targets != ['cudakernels']:
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_vert.glsl")
|
||||
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
|
||||
data_to_c_simple("intern/opensubdiv/gpu_shader_opensubd_display.glsl")
|
||||
|
||||
# --- blender ---
|
||||
data_to_c_simple("release/datafiles/bfont.pfb")
|
||||
|
@@ -27,16 +27,13 @@ getopt \
|
||||
-o s:i:t:h \
|
||||
--long source:,install:,tmp:,info:,threads:,help,no-sudo,with-all,with-opencollada,\
|
||||
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,\
|
||||
force-all,force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-osd,\
|
||||
force-ffmpeg,force-opencollada,\
|
||||
skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,\
|
||||
skip-ffmpeg,skip-opencollada,\
|
||||
force-all,force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\
|
||||
force-ffmpeg,\
|
||||
skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,skip-opencollada,\
|
||||
required-numpy: \
|
||||
-- "$@" \
|
||||
)
|
||||
|
||||
COMMANDLINE=$@
|
||||
|
||||
DISTRO=""
|
||||
RPM=""
|
||||
SRC="$HOME/src/blender-deps"
|
||||
@@ -44,7 +41,6 @@ INST="/opt/lib"
|
||||
TMP="/tmp"
|
||||
CWD=$PWD
|
||||
INFO_PATH=$CWD
|
||||
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
# Do not install some optional, potentially conflicting libs by default...
|
||||
WITH_ALL=false
|
||||
@@ -142,9 +138,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--force-osl
|
||||
Force the rebuild of OpenShadingLanguage.
|
||||
|
||||
--force-osd
|
||||
Force the rebuild of OpenSubdiv.
|
||||
|
||||
--force-opencollada
|
||||
Force the rebuild of OpenCOLLADA.
|
||||
|
||||
@@ -181,9 +174,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--skip-osl
|
||||
Unconditionally skip OpenShadingLanguage installation/building.
|
||||
|
||||
--skip-osd
|
||||
Unconditionally skip OpenSubdiv installation/building.
|
||||
|
||||
--skip-opencollada
|
||||
Unconditionally skip OpenCOLLADA installation/building.
|
||||
|
||||
@@ -243,12 +233,6 @@ OSL_VERSION_MIN=$OSL_VERSION
|
||||
OSL_FORCE_REBUILD=false
|
||||
OSL_SKIP=false
|
||||
|
||||
# OpenSubdiv needs to be compiled for now
|
||||
OSD_VERSION="3.0.2"
|
||||
OSD_VERSION_MIN=$OSD_VERSION
|
||||
OSD_FORCE_REBUILD=false
|
||||
OSD_SKIP=false
|
||||
|
||||
# Version??
|
||||
OPENCOLLADA_VERSION="1.3"
|
||||
OPENCOLLADA_FORCE_REBUILD=false
|
||||
@@ -391,11 +375,6 @@ while true; do
|
||||
OSL_VERSION_MIN=$OSL_VERSION
|
||||
shift; shift; continue
|
||||
;;
|
||||
--ver-osd)
|
||||
OSD_VERSION="$2"
|
||||
OSD_VERSION_MIN=$OSD_VERSION
|
||||
shift; shift; continue
|
||||
;;
|
||||
--force-all)
|
||||
PYTHON_FORCE_REBUILD=true
|
||||
NUMPY_FORCE_REBUILD=true
|
||||
@@ -405,7 +384,6 @@ while true; do
|
||||
OIIO_FORCE_REBUILD=true
|
||||
LLVM_FORCE_REBUILD=true
|
||||
OSL_FORCE_REBUILD=true
|
||||
OSD_FORCE_REBUILD=true
|
||||
OPENCOLLADA_FORCE_REBUILD=true
|
||||
FFMPEG_FORCE_REBUILD=true
|
||||
shift; continue
|
||||
@@ -439,9 +417,6 @@ while true; do
|
||||
--force-osl)
|
||||
OSL_FORCE_REBUILD=true; shift; continue
|
||||
;;
|
||||
--force-osd)
|
||||
OSD_FORCE_REBUILD=true; shift; continue
|
||||
;;
|
||||
--force-opencollada)
|
||||
OPENCOLLADA_FORCE_REBUILD=true; shift; continue
|
||||
;;
|
||||
@@ -472,9 +447,6 @@ while true; do
|
||||
--skip-osl)
|
||||
OSL_SKIP=true; shift; continue
|
||||
;;
|
||||
--skip-osd)
|
||||
OSD_SKIP=true; shift; continue
|
||||
;;
|
||||
--skip-opencollada)
|
||||
OPENCOLLADA_SKIP=true; shift; continue
|
||||
;;
|
||||
@@ -537,14 +509,6 @@ OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
|
||||
OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
|
||||
OSL_SOURCE_REPO_BRANCH="blender-fixes"
|
||||
|
||||
OSD_USE_REPO=true
|
||||
# Script foo to make the version string compliant with the archive name:
|
||||
# ${Varname//SearchForThisChar/ReplaceWithThisChar}
|
||||
OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${OSD_VERSION//./_}.tar.gz" )
|
||||
OSD_SOURCE_REPO=( "https://github.com/PixarAnimationStudios/OpenSubdiv.git" )
|
||||
OSD_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
|
||||
OSD_SOURCE_REPO_BRANCH="dev"
|
||||
|
||||
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
|
||||
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
|
||||
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
||||
@@ -1379,7 +1343,19 @@ compile_LLVM() {
|
||||
cd $_src
|
||||
|
||||
# XXX Ugly patching hack!
|
||||
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/llvm.patch"
|
||||
cat << EOF | patch -p1
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -13,7 +13,7 @@
|
||||
set(LLVM_VERSION_MAJOR 3)
|
||||
set(LLVM_VERSION_MINOR 1)
|
||||
|
||||
-set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}svn")
|
||||
+set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}")
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
EOF
|
||||
|
||||
cd $CWD
|
||||
|
||||
@@ -1449,10 +1425,10 @@ compile_OSL() {
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check osl-$OSL_VERSION $osl_magic
|
||||
if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
|
||||
#~ if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
|
||||
#~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
|
||||
clean_OSL
|
||||
fi
|
||||
#~ clean_OSL
|
||||
#~ fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Building OpenShadingLanguage-$OSL_VERSION"
|
||||
@@ -1481,9 +1457,6 @@ compile_OSL() {
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OSL_SOURCE_REPO_UID
|
||||
git reset --hard
|
||||
|
||||
# XXX Ugly patching hack!
|
||||
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/osl.patch"
|
||||
fi
|
||||
|
||||
# Always refresh the whole build!
|
||||
@@ -1525,9 +1498,6 @@ compile_OSL() {
|
||||
fi
|
||||
fi
|
||||
|
||||
#~ cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
||||
#~ cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
|
||||
|
||||
cmake $cmake_d ..
|
||||
|
||||
make -j$THREADS && make install
|
||||
@@ -1552,99 +1522,6 @@ compile_OSL() {
|
||||
run_ldconfig "osl"
|
||||
}
|
||||
|
||||
#### Build OSD ####
|
||||
_init_osd() {
|
||||
_src=$SRC/OpenSubdiv-$OSD_VERSION
|
||||
_git=true
|
||||
_inst=$INST/osd-$OSD_VERSION
|
||||
_inst_shortcut=$INST/osd
|
||||
}
|
||||
|
||||
clean_OSD() {
|
||||
_init_osd
|
||||
_clean
|
||||
}
|
||||
|
||||
compile_OSD() {
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
osd_magic=0
|
||||
_init_osd
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check osd-$OSD_VERSION $osd_magic
|
||||
if [ $? -eq 1 -o $OSD_FORCE_REBUILD == true ]; then
|
||||
clean_OSD
|
||||
fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Building OpenSubdiv-$OSD_VERSION"
|
||||
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
|
||||
if [ $OSD_USE_REPO == true ]; then
|
||||
git clone ${OSD_SOURCE_REPO[0]} $_src
|
||||
else
|
||||
download OSD_SOURCE[@] "$_src.tar.gz"
|
||||
INFO "Unpacking OpenSubdiv-$OSD_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)OpenSubdiv-[^/]*(.*),\1OpenSubdiv-$OSD_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
|
||||
if [ $OSD_USE_REPO == true ]; then
|
||||
git remote set-url origin ${OSD_SOURCE_REPO[0]}
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull --no-edit -X theirs origin $OSD_SOURCE_REPO_BRANCH
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OSD_SOURCE_REPO_UID
|
||||
git reset --hard
|
||||
fi
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
rm -rf build
|
||||
fi
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
# ptex is only needed when nicholas bishop is ready
|
||||
cmake_d="$cmake_d -D NO_PTEX=1"
|
||||
cmake_d="$cmake_d -D NO_CLEW=1"
|
||||
# maya plugin, docs, tutorials, regression tests and examples are not needed
|
||||
cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1"
|
||||
|
||||
cmake $cmake_d ..
|
||||
|
||||
make -j$THREADS && make install
|
||||
make clean
|
||||
|
||||
if [ -d $_inst ]; then
|
||||
_create_inst_shortcut
|
||||
else
|
||||
ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
magic_compile_set osd-$OSD_VERSION $osd_magic
|
||||
|
||||
cd $CWD
|
||||
INFO "Done compiling OpenSubdiv-$OSD_VERSION!"
|
||||
else
|
||||
INFO "Own OpenSubdiv-$OSD_VERSION is up to date, nothing to do!"
|
||||
INFO "If you want to force rebuild of this lib, use the --force-osd option."
|
||||
fi
|
||||
|
||||
run_ldconfig "osd"
|
||||
}
|
||||
|
||||
|
||||
#### Build OpenCOLLADA ####
|
||||
_init_opencollada() {
|
||||
_src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
|
||||
@@ -1936,9 +1813,8 @@ install_DEB() {
|
||||
THEORA_DEV="libtheora-dev"
|
||||
|
||||
_packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
|
||||
libfreetype6-dev libx11-dev \
|
||||
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
|
||||
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
|
||||
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
|
||||
libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev"
|
||||
|
||||
@@ -2213,20 +2089,6 @@ install_DEB() {
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if $OSD_SKIP; then
|
||||
WARNING "Skipping OpenSubdiv installation, as requested..."
|
||||
else
|
||||
if $have_llvm; then
|
||||
install_packages_DEB flex bison libtbb-dev
|
||||
# No package currently!
|
||||
PRINT ""
|
||||
compile_OSD
|
||||
else
|
||||
WARNING "No LLVM available, cannot build OSD!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if $WITH_OPENCOLLADA; then
|
||||
PRINT ""
|
||||
if $OPENCOLLADA_SKIP; then
|
||||
@@ -2425,9 +2287,9 @@ install_RPM() {
|
||||
OGG_DEV="libogg-devel"
|
||||
THEORA_DEV="libtheora-devel"
|
||||
|
||||
_packages="gcc gcc-c++ git make cmake scons libtiff-devel libjpeg-devel\
|
||||
libpng-devel libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
_packages="gcc gcc-c++ make scons libtiff-devel libjpeg-devel\
|
||||
libpng-devel libX11-devel libXi-devel wget ncurses-devel \
|
||||
readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
||||
libxml2-devel yaml-cpp-devel tinyxml-devel"
|
||||
|
||||
@@ -2533,7 +2395,7 @@ install_RPM() {
|
||||
if $NUMPY_SKIP; then
|
||||
WARNING "Skipping NumPy installation, as requested..."
|
||||
else
|
||||
check_package_version_ge_RPM python3-numpy $NUMPY_VERSION_MIN
|
||||
check_package_version_match_RPM python3-numpy $NUMPY_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_RPM python3-numpy
|
||||
elif $NUMPY_REQUIRED; then
|
||||
@@ -2654,7 +2516,7 @@ install_RPM() {
|
||||
else
|
||||
if $have_llvm; then
|
||||
# No package currently!
|
||||
install_packages_RPM flex bison
|
||||
install_packages_RPM flex bison git
|
||||
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
|
||||
install_packages_RPM tbb-devel
|
||||
fi
|
||||
@@ -2665,29 +2527,12 @@ install_RPM() {
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if $OSD_SKIP; then
|
||||
WARNING "Skipping OpenSubdiv installation, as requested..."
|
||||
else
|
||||
if $have_llvm; then
|
||||
# No package currently!
|
||||
install_packages_RPM flex bison
|
||||
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
|
||||
install_packages_RPM tbb-devel
|
||||
fi
|
||||
PRINT ""
|
||||
compile_OSD
|
||||
else
|
||||
WARNING "No LLVM available, cannot build OSD!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if $WITH_OPENCOLLADA; then
|
||||
PRINT ""
|
||||
if $OPENCOLLADA_SKIP; then
|
||||
WARNING "Skipping OpenCOLLADA installation, as requested..."
|
||||
else
|
||||
install_packages_RPM pcre-devel
|
||||
install_packages_RPM pcre-devel git
|
||||
# Find path to libxml shared lib...
|
||||
_XML2_LIB=`rpm -ql libxml2-devel | grep -e ".*/libxml2.so"`
|
||||
# No package...
|
||||
@@ -2795,8 +2640,7 @@ install_ARCH() {
|
||||
OGG_DEV="libogg"
|
||||
THEORA_DEV="libtheora"
|
||||
|
||||
_packages="base-devel git scons cmake \
|
||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||
_packages="base-devel scons cmake libxi glew libpng libtiff wget openal \
|
||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw \
|
||||
libxml2 yaml-cpp tinyxml"
|
||||
|
||||
@@ -2983,7 +2827,7 @@ install_ARCH() {
|
||||
clean_OSL
|
||||
else
|
||||
#XXX Note: will fail to build with LLVM 3.2!
|
||||
install_packages_ARCH intel-tbb
|
||||
install_packages_ARCH git intel-tbb
|
||||
PRINT ""
|
||||
compile_OSL
|
||||
fi
|
||||
@@ -2992,20 +2836,6 @@ install_ARCH() {
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if $OSD_SKIP; then
|
||||
WARNING "Skipping OpenSubdiv installation, as requested..."
|
||||
else
|
||||
if $have_llvm; then
|
||||
# No package currently? Just build for now!
|
||||
install_packages_ARCH intel-tbb
|
||||
PRINT ""
|
||||
compile_OSD
|
||||
else
|
||||
WARNING "No LLVM available, cannot build OSD!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if $WITH_OPENCOLLADA; then
|
||||
PRINT ""
|
||||
if $OPENCOLLADA_SKIP; then
|
||||
@@ -3016,7 +2846,7 @@ install_ARCH() {
|
||||
install_packages_ARCH opencollada
|
||||
clean_OpenCOLLADA
|
||||
else
|
||||
install_packages_ARCH pcre
|
||||
install_packages_ARCH pcre git
|
||||
PRINT ""
|
||||
compile_OpenCOLLADA
|
||||
fi
|
||||
@@ -3117,10 +2947,6 @@ print_info() {
|
||||
PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
|
||||
PRINT ""
|
||||
PRINT ""
|
||||
PRINT "Ran with:"
|
||||
PRINT " install_deps.sh $COMMANDLINE"
|
||||
PRINT ""
|
||||
PRINT ""
|
||||
PRINT "If you're using CMake add this to your configuration flags:"
|
||||
|
||||
_buildargs=""
|
||||
@@ -3185,14 +3011,6 @@ print_info() {
|
||||
_buildargs="$_buildargs $_1 $_2"
|
||||
fi
|
||||
|
||||
if [ -d $INST/osd ]; then
|
||||
_1="-D WITH_OPENSUBDIV=ON"
|
||||
_2="-D OPENSUBDIV_ROOT_DIR=$INST/osd"
|
||||
PRINT " $_1"
|
||||
PRINT " $_2"
|
||||
_buildargs="$_buildargs $_1 $_2"
|
||||
fi
|
||||
|
||||
if $WITH_OPENCOLLADA; then
|
||||
_1="-D WITH_OPENCOLLADA=ON"
|
||||
PRINT " $_1"
|
||||
@@ -3259,13 +3077,6 @@ print_info() {
|
||||
PRINT "BF_OSL = '$INST/osl'"
|
||||
fi
|
||||
|
||||
if [ "$OSD_SKIP" = false ]; then
|
||||
PRINT "WITH_BF_OPENSUBDIV = True"
|
||||
if [ -d $INST/osd ]; then
|
||||
PRINT "BF_OPENSUBDIV = '$INST/osd'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$BOOST_SKIP" = false ]; then
|
||||
PRINT "WITH_BF_BOOST = True"
|
||||
if [ -d $INST/boost ]; then
|
||||
@@ -3312,27 +3123,7 @@ elif [ -f /etc/redhat-release -o /etc/SuSE-release ]; then
|
||||
DISTRO="RPM"
|
||||
install_RPM
|
||||
else
|
||||
ERROR "Failed to detect distribution type."
|
||||
PRINT ""
|
||||
PRINT "Your distribution is not supported by this script, you'll have to install dependencies and"
|
||||
PRINT "dev packages yourself (list non-exhaustive, but should cover most needs):"
|
||||
PRINT " * Basics of dev environment (cmake or scons, gcc, svn , git, ...)."
|
||||
PRINT " * Python$PYTHON_VERSION_MIN, numpy."
|
||||
PRINT " * libboost$BOOST_VERSION_MIN (locale, filesystem, regex, system, thread, wave)."
|
||||
PRINT " * libjpeg, libpng, libtiff, libopenjpeg, libopenal."
|
||||
PRINT " * ffmpeg (with libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, ...)."
|
||||
PRINT " * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed)."
|
||||
PRINT " * libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp."
|
||||
PRINT " * libsdl1.2, libglew, libglewmx."
|
||||
PRINT " * libopencolorio$OCIO_VERSION_MIN, libopenexr$OPENEXR_VERSION_MIN, libopenimageio$OIIO_VERSION_MIN."
|
||||
PRINT " * llvm-$LLVM_VERSION (with clang)."
|
||||
PRINT ""
|
||||
PRINT "Most of up-listed packages are available in recent distributions. The following are likely not,"
|
||||
PRINT "you'll have to build them (they are all optional, though):"
|
||||
PRINT " * OpenShadingLanguage (from https://github.com/Nazg-Gul/OpenShadingLanguage.git, branch blender-fixes, commit 22ee5ea298fd215430dfbd160b5aefd507f06db0)."
|
||||
PRINT " * OpenSubDiv (from https://github.com/PixarAnimationStudios/OpenSubdiv.git, branch dev, commit 404659fffa659da075d1c9416e4fc939139a84ee)."
|
||||
PRINT " * OpenCollada (from https://github.com/KhronosGroup/OpenCOLLADA.git, branch master, commit 3335ac164e68b2512a40914b14c74db260e6ff7d)."
|
||||
PRINT ""
|
||||
ERROR "Failed to detect distribution type"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -13,7 +13,7 @@
|
||||
set(LLVM_VERSION_MAJOR 3)
|
||||
set(LLVM_VERSION_MINOR 1)
|
||||
|
||||
-set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}svn")
|
||||
+set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}")
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
--- a/src/shaders/CMakeLists.txt
|
||||
+++ b/src/shaders/CMakeLists.txt
|
||||
@@ -27,7 +27,7 @@ macro (osl_compile oslsrc objlist headers)
|
||||
message (STATUS "cmd: ${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc ${oslsrc}")
|
||||
endif ()
|
||||
add_custom_command (OUTPUT ${osofile}
|
||||
- COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc" ${oslsrc}
|
||||
+ COMMAND "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc" "-o" ${osofile} ${oslsrc}
|
||||
MAIN_DEPENDENCY ${oslsrc}
|
||||
DEPENDS ${${headers}} ${oslsrc} "${CMAKE_CURRENT_BINARY_DIR}/stdosl.h" "${CMAKE_CURRENT_BINARY_DIR}/../oslc/oslc"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
@@ -166,15 +166,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
# Ocean Simulation
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
# OpenSubdiv
|
||||
WITH_BF_OPENSUBDIV = True
|
||||
WITH_BF_STATICOPENSUBDIV = True
|
||||
BF_OPENSUBDIV = '/opt/lib/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
BF_OPENSUBDIV_LIB_STATIC = '${BF_OPENSUBDIV}/lib/libosdCPU.a ${BF_OPENSUBDIV}/lib/libosdGPU.a'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
|
||||
|
@@ -166,15 +166,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
# Ocean Simulation
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
# OpenSubdiv
|
||||
WITH_BF_OPENSUBDIV = True
|
||||
WITH_BF_STATICOPENSUBDIV = True
|
||||
BF_OPENSUBDIV = '/opt/lib/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
BF_OPENSUBDIV_LIB_STATIC = '${BF_OPENSUBDIV}/lib/libosdCPU.a ${BF_OPENSUBDIV}/lib/libosdGPU.a'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
|
||||
#CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
|
||||
CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
|
||||
CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
|
||||
|
||||
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
# List of the branches being built automatically overnight
|
||||
NIGHT_SCHEDULE_BRANCHES = [None]
|
||||
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
|
||||
|
||||
# List of the branches available for force build
|
||||
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
|
||||
@@ -305,12 +305,12 @@ add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder,
|
||||
add_builder(c, 'mac_i386_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=11)
|
||||
add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1)
|
||||
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2)
|
||||
#add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1)
|
||||
#add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2)
|
||||
add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1)
|
||||
add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2)
|
||||
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
|
||||
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
|
||||
#add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4)
|
||||
#add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
|
||||
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
|
||||
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1)
|
||||
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder, hour=2)
|
||||
|
||||
|
@@ -52,18 +52,12 @@ if 'cmake' in builder:
|
||||
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
|
||||
|
||||
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
|
||||
if 'win32' not in builder:
|
||||
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
|
||||
else:
|
||||
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=0")
|
||||
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
|
||||
# configure and make
|
||||
retcode = subprocess.call(['cmake', blender_dir] + cmake_options)
|
||||
if retcode != 0:
|
||||
sys.exit(retcode)
|
||||
|
||||
if 'win32' in builder:
|
||||
retcode = subprocess.call(['msbuild', 'INSTALL.vcxproj', '/Property:PlatformToolset=v120_xp', '/p:Configuration=Release'])
|
||||
elif 'win64' in builder:
|
||||
if 'win' in builder:
|
||||
retcode = subprocess.call(['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release'])
|
||||
else:
|
||||
retcode = subprocess.call(['make', '-s', '-j4', 'install'])
|
||||
|
@@ -123,26 +123,14 @@ else:
|
||||
os.remove(f)
|
||||
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
|
||||
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
|
||||
|
||||
# TODO(sergey): Such magic usually happens in SCon's packaging bu we don't have it
|
||||
# in the CMake yet. For until then we do some magic here.
|
||||
tokens = result_file.split('-')
|
||||
blender_version = tokens[1].split('.')
|
||||
blender_full_version = '.'.join(blender_version[0:2])
|
||||
git_hash = tokens[2].split('.')[1]
|
||||
platform = builder.split('_')[0]
|
||||
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
|
||||
if branch != '':
|
||||
builderified_name = branch + "-" + builderified_name
|
||||
|
||||
os.rename(result_file, "{}.zip".format(builderified_name))
|
||||
os.rename(result_file, "{}.zip".format(builder))
|
||||
# create zip file
|
||||
try:
|
||||
upload_zip = "buildbot_upload.zip"
|
||||
if os.path.exists(upload_zip):
|
||||
os.remove(upload_zip)
|
||||
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
|
||||
z.write("{}.zip".format(builderified_name))
|
||||
z.write("{}.zip".format(builder))
|
||||
z.close()
|
||||
sys.exit(retcode)
|
||||
except Exception as ex:
|
||||
|
@@ -1,113 +0,0 @@
|
||||
# - Try to find audaspace
|
||||
# Once done, this will define
|
||||
#
|
||||
# AUDASPACE_FOUND - system has audaspace
|
||||
# AUDASPACE_INCLUDE_DIRS - the audaspace include directories
|
||||
# AUDASPACE_LIBRARIES - link these to use audaspace
|
||||
# AUDASPACE_C_FOUND - system has audaspace's C binding
|
||||
# AUDASPACE_C_INCLUDE_DIRS - the audaspace's C binding include directories
|
||||
# AUDASPACE_C_LIBRARIES - link these to use audaspace's C binding
|
||||
# AUDASPACE_PY_FOUND - system has audaspace's python binding
|
||||
# AUDASPACE_PY_INCLUDE_DIRS - the audaspace's python binding include directories
|
||||
# AUDASPACE_PY_LIBRARIES - link these to use audaspace's python binding
|
||||
|
||||
IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
|
||||
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_audaspace_SEARCH_DIRS
|
||||
${AUDASPACE_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
# Use pkg-config to get hints about paths
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
# Include dir
|
||||
FIND_PATH(AUDASPACE_INCLUDE_DIR
|
||||
NAMES ISound.h
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES include/audaspace
|
||||
)
|
||||
|
||||
# Library
|
||||
FIND_LIBRARY(AUDASPACE_LIBRARY
|
||||
NAMES audaspace
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES lib lib64
|
||||
)
|
||||
|
||||
# Include dir
|
||||
FIND_PATH(AUDASPACE_C_INCLUDE_DIR
|
||||
NAMES AUD_Sound.h
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES include/audaspace
|
||||
)
|
||||
|
||||
# Library
|
||||
FIND_LIBRARY(AUDASPACE_C_LIBRARY
|
||||
NAMES audaspace-c
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES lib lib64
|
||||
)
|
||||
|
||||
# Include dir
|
||||
FIND_PATH(AUDASPACE_PY_INCLUDE_DIR
|
||||
NAMES python/PyAPI.h
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES include/audaspace
|
||||
)
|
||||
|
||||
# Library
|
||||
FIND_LIBRARY(AUDASPACE_PY_LIBRARY
|
||||
NAMES audaspace-py
|
||||
HINTS ${_audaspace_SEARCH_DIRS}
|
||||
PATHS ${AUDASPACE_PKGCONF_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES lib lib64
|
||||
)
|
||||
|
||||
FIND_PACKAGE(PackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace DEFAULT_MSG AUDASPACE_LIBRARY AUDASPACE_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_C DEFAULT_MSG AUDASPACE_C_LIBRARY AUDASPACE_C_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRARY AUDASPACE_PY_INCLUDE_DIR)
|
||||
|
||||
IF(AUDASPACE_FOUND)
|
||||
SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
|
||||
SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
|
||||
ENDIF(AUDASPACE_FOUND)
|
||||
|
||||
IF(AUDASPACE_C_FOUND)
|
||||
SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
|
||||
SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
|
||||
ENDIF(AUDASPACE_C_FOUND)
|
||||
|
||||
IF(AUDASPACE_PY_FOUND)
|
||||
SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
|
||||
SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
|
||||
ENDIF(AUDASPACE_PY_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
AUDASPACE_LIBRARY
|
||||
AUDASPACE_LIBRARIES
|
||||
AUDASPACE_INCLUDE_DIR
|
||||
AUDASPACE_INCLUDE_DIRS
|
||||
AUDASPACE_C_LIBRARY
|
||||
AUDASPACE_C_LIBRARIES
|
||||
AUDASPACE_C_INCLUDE_DIR
|
||||
AUDASPACE_C_INCLUDE_DIRS
|
||||
AUDASPACE_PY_LIBRARY
|
||||
AUDASPACE_PY_LIBRARIES
|
||||
AUDASPACE_PY_INCLUDE_DIR
|
||||
AUDASPACE_PY_INCLUDE_DIRS
|
||||
)
|
@@ -1,111 +0,0 @@
|
||||
# - Find OpenSubdiv library
|
||||
# Find the native OpenSubdiv includes and library
|
||||
# This module defines
|
||||
# OPENSUBDIV_INCLUDE_DIRS, where to find OpenSubdiv headers, Set when
|
||||
# OPENSUBDIV_INCLUDE_DIR is found.
|
||||
# OPENSUBDIV_LIBRARIES, libraries to link against to use OpenSubdiv.
|
||||
# OPENSUBDIV_ROOT_DIR, the base directory to search for OpenSubdiv.
|
||||
# This can also be an environment variable.
|
||||
# OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# OPENSUBDIV_LIBRARY, where to find the OpenSubdiv library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2013 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 OPENSUBDIV_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENSUBDIV_ROOT_DIR AND NOT $ENV{OPENSUBDIV_ROOT_DIR} STREQUAL "")
|
||||
SET(OPENSUBDIV_ROOT_DIR $ENV{OPENSUBDIV_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_opensubdiv_FIND_COMPONENTS
|
||||
osdGPU
|
||||
osdCPU
|
||||
)
|
||||
|
||||
SET(_opensubdiv_SEARCH_DIRS
|
||||
${OPENSUBDIV_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt/lib/opensubdiv
|
||||
)
|
||||
|
||||
FIND_PATH(OPENSUBDIV_INCLUDE_DIR
|
||||
NAMES
|
||||
opensubdiv/osd/mesh.h
|
||||
HINTS
|
||||
${_opensubdiv_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
SET(_opensubdiv_LIBRARIES)
|
||||
FOREACH(COMPONENT ${_opensubdiv_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
|
||||
FIND_LIBRARY(OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${COMPONENT}
|
||||
HINTS
|
||||
${_opensubdiv_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
LIST(APPEND _opensubdiv_LIBRARIES "${OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
MACRO(OPENSUBDIV_CHECK_CONTROLLER
|
||||
controller_include_file
|
||||
variable_name)
|
||||
IF(EXISTS "${OPENSUBDIV_INCLUDE_DIR}/opensubdiv/osd/${controller_include_file}")
|
||||
SET(${variable_name} TRUE)
|
||||
ELSE()
|
||||
SET(${variable_name} FALSE)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENSUBDIV_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSubdiv DEFAULT_MSG
|
||||
_opensubdiv_LIBRARIES OPENSUBDIV_INCLUDE_DIR)
|
||||
|
||||
IF(OPENSUBDIV_FOUND)
|
||||
SET(OPENSUBDIV_LIBRARIES ${_opensubdiv_LIBRARIES})
|
||||
SET(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
|
||||
|
||||
# Find available compute controllers.
|
||||
|
||||
FIND_PACKAGE(OpenMP)
|
||||
IF(OPENMP_FOUND)
|
||||
SET(OPENSUBDIV_HAS_OPENMP TRUE)
|
||||
ELSE()
|
||||
SET(OPENSUBDIV_HAS_OPENMP FALSE)
|
||||
ENDIF()
|
||||
|
||||
OPENSUBDIV_CHECK_CONTROLLER("tbbEvaluator.h" OPENSUBDIV_HAS_TBB)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("clEvaluator.h" OPENSUBDIV_HAS_OPENCL)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
|
||||
ENDIF(OPENSUBDIV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENSUBDIV_INCLUDE_DIR
|
||||
)
|
||||
FOREACH(COMPONENT ${_opensubdiv_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
MARK_AS_ADVANCED(OPENSUBDIV_${UPPERCOMPONENT}_LIBRARY)
|
||||
ENDFOREACH()
|
@@ -12,7 +12,7 @@
|
||||
#
|
||||
#=============================================================================
|
||||
|
||||
macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
|
||||
if(WITH_GTESTS)
|
||||
get_property(_current_include_directories
|
||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -40,20 +40,10 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}"
|
||||
INCLUDE_DIRECTORIES "${TEST_INC}")
|
||||
if(${DO_ADD_TEST})
|
||||
add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
|
||||
endif()
|
||||
add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
|
||||
BLENDER_SRC_GTEST_EX("${NAME}" "${SRC}" "${EXTRA_LIBS}" "TRUE")
|
||||
endmacro()
|
||||
|
||||
macro(BLENDER_TEST NAME EXTRA_LIBS)
|
||||
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "TRUE")
|
||||
endmacro()
|
||||
|
||||
macro(BLENDER_TEST_PERFORMANCE NAME EXTRA_LIBS)
|
||||
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "FALSE")
|
||||
BLENDER_SRC_GTEST("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}")
|
||||
endmacro()
|
||||
|
@@ -10,9 +10,9 @@ set(MY_WC_COMMIT_TIMESTAMP 0)
|
||||
# Guess if this is a git working copy and then look up the revision
|
||||
if(EXISTS ${SOURCE_DIR}/.git)
|
||||
# The FindGit.cmake module is part of the standard distribution
|
||||
find_package(Git)
|
||||
include(FindGit)
|
||||
if(GIT_FOUND)
|
||||
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
|
||||
message(STATUS "-- Found Git: ${GIT_EXECUTABLE}")
|
||||
|
||||
execute_process(COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
@@ -97,10 +97,6 @@ if(EXISTS ${SOURCE_DIR}/.git)
|
||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# May fail in rare cases
|
||||
if(MY_WC_COMMIT_TIMESTAMP STREQUAL "")
|
||||
set(MY_WC_COMMIT_TIMESTAMP 0)
|
||||
endif()
|
||||
|
||||
# Update GIT index before getting dirty files
|
||||
execute_process(COMMAND git update-index -q --refresh
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# Turn everything ON thats expected for an official release builds.
|
||||
# turn everything OFF except for python which defaults to ON
|
||||
# and is needed for the UI
|
||||
#
|
||||
# Example usage:
|
||||
# cmake -C../blender/build_files/cmake/config/blender_full.cmake ../blender
|
||||
@@ -12,7 +13,6 @@ set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
@@ -52,18 +52,11 @@ set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
|
||||
|
||||
# platform dependant options
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
elseif(WIN32)
|
||||
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
elseif (APPLE)
|
||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
|
@@ -48,6 +48,7 @@ set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENNL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -48,7 +48,7 @@ macro(list_insert_before
|
||||
unset(_index)
|
||||
endmacro()
|
||||
|
||||
function(list_assert_duplicates
|
||||
function (list_assert_duplicates
|
||||
list_id
|
||||
)
|
||||
|
||||
@@ -343,9 +343,6 @@ function(setup_liblinks
|
||||
if(WITH_BULLET AND WITH_SYSTEM_BULLET)
|
||||
target_link_libraries(${target} ${BULLET_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_AUDASPACE AND WITH_SYSTEM_AUDASPACE)
|
||||
target_link_libraries(${target} ${AUDASPACE_C_LIBRARIES} ${AUDASPACE_PY_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENAL)
|
||||
target_link_libraries(${target} ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
@@ -373,16 +370,6 @@ function(setup_liblinks
|
||||
if(WITH_OPENCOLORIO)
|
||||
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENSUBDIV)
|
||||
if(WIN32 AND NOT UNIX)
|
||||
file_list_suffix(OPENSUBDIV_LIBRARIES_DEBUG "${OPENSUBDIV_LIBRARIES}" "_d")
|
||||
target_link_libraries_debug(${target} "${OPENSUBDIV_LIBRARIES_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${OPENSUBDIV_LIBRARIES}")
|
||||
unset(OPENSUBDIV_LIBRARIES_DEBUG)
|
||||
else()
|
||||
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_CYCLES_OSL)
|
||||
target_link_libraries(${target} ${OSL_LIBRARIES})
|
||||
endif()
|
||||
@@ -591,7 +578,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
ge_videotex
|
||||
bf_dna
|
||||
bf_blenfont
|
||||
bf_blentranslation
|
||||
bf_intern_audaspace
|
||||
bf_intern_mikktspace
|
||||
bf_intern_dualcon
|
||||
@@ -609,7 +595,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
extern_libmv
|
||||
extern_glog
|
||||
extern_sdlew
|
||||
extern_eigen3
|
||||
|
||||
bf_intern_glew_mx
|
||||
)
|
||||
@@ -688,10 +673,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
list(APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv)
|
||||
endif()
|
||||
|
||||
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
|
||||
set(REMLIB ${SORTLIB})
|
||||
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
|
||||
@@ -1282,7 +1263,7 @@ function(data_to_c
|
||||
add_custom_command(
|
||||
OUTPUT ${file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${file_from} ${file_to}
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${file_from} ${file_to}
|
||||
DEPENDS ${file_from} datatoc)
|
||||
|
||||
set_source_files_properties(${file_to} PROPERTIES GENERATED TRUE)
|
||||
@@ -1307,7 +1288,7 @@ function(data_to_c_simple
|
||||
add_custom_command(
|
||||
OUTPUT ${_file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${_file_from} ${_file_to}
|
||||
DEPENDS ${_file_from} datatoc)
|
||||
|
||||
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
|
||||
@@ -1340,8 +1321,8 @@ function(data_to_c_simple_icons
|
||||
OUTPUT ${_file_from} ${_file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
#COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py ${_path_from_abs} ${_file_from}
|
||||
COMMAND "$<TARGET_FILE:datatoc_icon>" ${_path_from_abs} ${_file_from}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc_icon ${_path_from_abs} ${_file_from}
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${_file_from} ${_file_to}
|
||||
DEPENDS
|
||||
${_icon_files}
|
||||
datatoc_icon
|
||||
@@ -1410,7 +1391,7 @@ function(msgfmt_simple
|
||||
add_custom_command(
|
||||
OUTPUT ${_file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:msgfmt>" ${_file_from} ${_file_to}
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/msgfmt ${_file_from} ${_file_to}
|
||||
DEPENDS msgfmt ${_file_from})
|
||||
|
||||
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
|
||||
|
@@ -21,10 +21,10 @@ SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
|
||||
# Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
|
||||
set(MY_WC_HASH "unknown")
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
|
||||
find_package(Git)
|
||||
include(FindGit)
|
||||
if(GIT_FOUND)
|
||||
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
|
||||
execute_process(COMMAND git rev-parse --short HEAD
|
||||
message(STATUS "-- Found Git: ${GIT_EXECUTABLE}")
|
||||
execute_process(COMMAND git rev-parse --short @{u}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE MY_WC_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
|
@@ -59,21 +59,14 @@ def is_c_any(filename):
|
||||
CMAKE_DIR = "."
|
||||
|
||||
|
||||
def cmake_cache_var_iter():
|
||||
import re
|
||||
re_cache = re.compile(r'([A-Za-z0-9_\-]+)?:?([A-Za-z0-9_\-]+)?=(.*)$')
|
||||
with open(join(CMAKE_DIR, "CMakeCache.txt"), 'r', encoding='utf-8') as cache_file:
|
||||
for l in cache_file:
|
||||
match = re_cache.match(l.strip())
|
||||
if match is not None:
|
||||
var, type_, val = match.groups()
|
||||
yield (var, type_ or "", val)
|
||||
|
||||
|
||||
def cmake_cache_var(var):
|
||||
for var_iter, type_iter, value_iter in cmake_cache_var_iter():
|
||||
if var == var_iter:
|
||||
return value_iter
|
||||
cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"))
|
||||
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
|
||||
cache_file.close()
|
||||
|
||||
for l in lines:
|
||||
if l.split(":")[0] == var:
|
||||
return l.split("=", 1)[-1]
|
||||
return None
|
||||
|
||||
|
||||
|
@@ -52,8 +52,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
# we use simply jack framework
|
||||
WITH_BF_JACK = True
|
||||
BF_JACK = '/Library/Frameworks/Jackmp.framework'
|
||||
@@ -215,12 +213,6 @@ WITH_BF_FREESTYLE = True
|
||||
#OpenMP ( will be checked for compiler support and turned off eventually )
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
WITH_BF_OPENSUBDIV = False
|
||||
BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = []
|
||||
|
@@ -26,8 +26,6 @@ BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
@@ -228,14 +226,6 @@ BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
WITH_BF_OPENSUBDIV = False
|
||||
WITH_BF_STATICOPENSUBDIV = False
|
||||
BF_OPENSUBDIV = '/usr'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIB_STATIC = '${BF_OPENSUBDIV_LIBPATH}/libosdGPU.a ${BF_OPENSUBDIV_LIBPATH}/libosdCPU.a'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
|
@@ -23,8 +23,6 @@ BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
@@ -168,12 +166,6 @@ BF_BOOST_LIB = 'boost_date_time-mgw46-mt-s-1_49 boost_filesystem-mgw46-mt-s-1_49
|
||||
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mgw46-mt-s-1_49'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_OPENSUBDIV = False
|
||||
BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
@@ -42,8 +42,6 @@ BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
|
||||
@@ -210,12 +208,6 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
WITH_BF_OPENSUBDIV = True
|
||||
BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
|
@@ -22,8 +22,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_FFMPEG_LIBPATH}/swresample-0.dll ${BF_FFMPEG_LIBPATH}/xvidcore.dll'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
@@ -167,12 +165,6 @@ BF_BOOST_LIB = 'boost_date_time-mgw47-mt-s-1_49 boost_date_time-mgw47-mt-sd-1_49
|
||||
BF_BOOST_LIB_INTERNATIONAL = ' boost_locale-mgw47-mt-s-1_49 boost_locale-mgw47-mt-sd-1_49'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_OPENSUBDIV = False
|
||||
BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
@@ -55,8 +55,6 @@ BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL2.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_AUDASPACE = True
|
||||
|
||||
WITH_BF_JACK = False
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
@@ -214,12 +212,6 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['']
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
WITH_BF_OPENSUBDIV = True
|
||||
BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
|
||||
BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
|
||||
BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
|
||||
BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
|
@@ -242,11 +242,6 @@ def setup_staticlibs(lenv):
|
||||
if lenv['WITH_BF_STATIC3DMOUSE']:
|
||||
statlibs += Split(lenv['BF_3DMOUSE_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_OPENSUBDIV']:
|
||||
libincs += Split(lenv['BF_OPENSUBDIV_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOPENSUBDIV']:
|
||||
statlibs += Split(lenv['BF_OPENSUBDIV_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', 'win64-mingw'):
|
||||
# We must remove any previous items defining this path, for same reason stated above!
|
||||
@@ -349,13 +344,6 @@ def setup_syslibs(lenv):
|
||||
if not lenv['WITH_BF_STATICPNG']:
|
||||
syslibs += Split(lenv['BF_PNG_LIB'])
|
||||
|
||||
if lenv['WITH_BF_OPENSUBDIV']:
|
||||
if not lenv['WITH_BF_STATICOPENSUBDIV']:
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'):
|
||||
syslibs += [osdlib+'_d' for osdlib in Split(lenv['BF_OPENSUBDIV_LIB'])]
|
||||
else:
|
||||
syslibs += Split(lenv['BF_OPENSUBDIV_LIB'])
|
||||
|
||||
# Hack to pass OSD libraries to linker before extern_{clew,cuew}
|
||||
for syslib in create_blender_liblist(lenv, 'system'):
|
||||
syslibs.append(os.path.basename(syslib))
|
||||
@@ -796,8 +784,6 @@ def AppIt(target=None, source=None, env=None):
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/site-packages/ %s/%s.app/Contents/Resources/%s/python/lib/python%s/site-packages/'%(libdir,installdir,binary,VERSION,env['BF_PYTHON_VERSION'])
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -r %s/python/bin -d %s/%s.app/Contents/Resources/%s/python/'%(libdir,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
|
||||
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
|
||||
commands.getoutput(cmd)
|
||||
|
@@ -107,7 +107,6 @@ def print_arguments(args, bc):
|
||||
def validate_arguments(args, bc):
|
||||
opts_list = [
|
||||
'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
|
||||
'WITH_BF_AUDASPACE', 'BF_AUDASPACE_C_INC', 'BF_AUDASPACE_PY_INC', 'BF_AUDASPACE_DEF',
|
||||
'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', 'WITH_BF_SDL_DYNLOAD',
|
||||
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD',
|
||||
@@ -183,8 +182,7 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
|
||||
'WITH_BF_LIBMV', 'WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS',
|
||||
'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER',
|
||||
'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS',
|
||||
'WITH_BF_OPENSUBDIV', 'WITH_BF_STATICOPENSUBDIV', 'BF_OPENSUBDIV', 'BF_OPENSUBDIV_INC', 'BF_OPENSUBDIV_LIB', 'BF_OPENSUBDIV_LIBPATH', 'BF_OPENSUBDIV_LIB_STATIC'
|
||||
'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS'
|
||||
]
|
||||
|
||||
# Have options here that scons expects to be lists
|
||||
@@ -299,11 +297,6 @@ def read_opts(env, cfg, args):
|
||||
('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
|
||||
(BoolVariable('WITH_BF_STATICOPENAL', 'Staticly link to openal', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_AUDASPACE', 'Build with audaspace if true', True)),
|
||||
('BF_AUDASPACE_C_INC', 'audaspace-c include path', ''),
|
||||
('BF_AUDASPACE_PY_INC', 'audaspace-py include path', ''),
|
||||
('BF_AUDASPACE_DEF', 'audaspace defines', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_SDL', 'Use SDL if true', False)),
|
||||
('BF_SDL', 'SDL base path', ''),
|
||||
('BF_SDL_INC', 'SDL include path', ''),
|
||||
@@ -663,14 +656,6 @@ def read_opts(env, cfg, args):
|
||||
|
||||
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OPENSUBDIV', 'Build with OpenSubdiv library', False)),
|
||||
(BoolVariable('WITH_BF_STATICOPENSUBDIV', 'Staticly link to OpenColorIO', False)),
|
||||
('BF_OPENSUBDIV', 'OpenSubdiv root path', ''),
|
||||
('BF_OPENSUBDIV_INC', 'OpenSubdiv include path', ''),
|
||||
('BF_OPENSUBDIV_LIB', 'OpenSubdiv library', ''),
|
||||
('BF_OPENSUBDIV_LIBPATH', 'OpenSubdiv library path', ''),
|
||||
('BF_OPENSUBDIV_LIB_STATIC', 'OpenSubdiv static library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_CPP11', '"Build with C++11 standard enabled, for development use only!', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_LEGACY_DEPSGRAPH', 'Build Blender with legacy dependency graph', True)),
|
||||
|
104
doc/build_systems/cmake.txt
Normal file
104
doc/build_systems/cmake.txt
Normal file
@@ -0,0 +1,104 @@
|
||||
|
||||
Blender CMake build system
|
||||
============================
|
||||
|
||||
Contents
|
||||
---------------
|
||||
|
||||
1. Introduction
|
||||
2. Obtaining CMake
|
||||
3. Building Blender
|
||||
4. Generic Setup
|
||||
5. Configuring the build after SVN updates
|
||||
|
||||
1. Introduction
|
||||
---------------
|
||||
|
||||
This document describes general usage of the new CMake scripts. The
|
||||
inner workings will be described in blender-cmake-dev.txt (TODO).
|
||||
|
||||
2. Obtaining CMake
|
||||
------------------
|
||||
|
||||
CMake for can either be downloaded using your favorite package manager
|
||||
or is also available from the CMake website at http://www.cmake.org
|
||||
The website also contains some documentation on CMake usage but I found
|
||||
the man page alone pretty helpful.
|
||||
|
||||
3. Building Blender
|
||||
-------------------
|
||||
|
||||
Building Blender requires obtaining a compiler, library dependencies,
|
||||
and correct setup depending on the system. For details on how to set
|
||||
up a build on various operating systems, see the wiki documentation:
|
||||
|
||||
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender
|
||||
|
||||
4. Generic Setup
|
||||
----------------
|
||||
|
||||
CMake allows one to generate the build project files and binary objects
|
||||
outside the source tree which can be pretty handy in working and experimenting
|
||||
with different Blender configurations (Audio/NoAudio, GameEngine/NoGameEngine etc.)
|
||||
while maintaining a clean source tree. It also makes it possible to generate files
|
||||
for different build systems on the same source tree. This also has benefits for
|
||||
general SVN management for the developer as patches and submit logs are much cleaner.
|
||||
|
||||
Create a directory outside the blender source tree where you would like to build
|
||||
Blender (from now on called $BLENDERBUILD). On the commandline you can then run
|
||||
the cmake command to generate your initial build files. First just run 'cmake' which
|
||||
will inform you what the available generators are. Thn you can run
|
||||
'cmake -G generator $BLENDERSOURCE' to generate the build files. Here is an example
|
||||
of all this for Xcode:
|
||||
|
||||
% mkdir $BLENDERBUILD
|
||||
% cd $BLENDERBUILD
|
||||
% cmake
|
||||
|
||||
...
|
||||
...
|
||||
--version [file] = Show program name/version banner and exit.
|
||||
|
||||
Generators
|
||||
|
||||
The following generators are available on this platform:
|
||||
KDevelop3 = Generates KDevelop 3 project files.
|
||||
Unix Makefiles = Generates standard UNIX makefiles.
|
||||
Xcode = Generate XCode project files.
|
||||
|
||||
|
||||
|
||||
% cmake -G Xcode $BLENDERSOURCE
|
||||
...
|
||||
...
|
||||
-- Configuring blender
|
||||
-- Configuring blenderplayer
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: $BLENDERBUILD
|
||||
|
||||
This will generate the build files with default values. Specific features can
|
||||
be enabled or disabled by running the ccmake "GUI" from $BLENDERBUILD as follows:
|
||||
|
||||
% ccmake $BLENDERSOURCE
|
||||
|
||||
A number of options appear which can be changed depending on your needs and
|
||||
available dependencies (e.g. setting WITH_OPENEXR to OFF will disable support
|
||||
for OpenEXR). It will also allow you to override default and detected paths
|
||||
(e.g. Python directories) and compile and link flags. When you are satisfied
|
||||
used ccmake to re-configure the build files and exit.
|
||||
|
||||
It is also possible to use the commandline of 'cmake' to override certain
|
||||
of these settings.
|
||||
|
||||
5. Configuring the build after SVN updates
|
||||
------------------------------------------
|
||||
|
||||
The $BLENDERBUILD directory maintains a file called CMakeCache.txt which
|
||||
remembers the initial run's settings for subsequent generation runs. After
|
||||
SVN updates that contain changes to the build system, rebuilding Blender will
|
||||
automatically invoke CMake to regenerate the CMakeCache.txt and other files
|
||||
as needed.
|
||||
|
||||
/Jacques Beaurain (jbinto)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* These pages document the source code of blender.
|
||||
*
|
||||
* \subsection implinks Important Links
|
||||
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker.
|
||||
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker
|
||||
* - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki.
|
||||
*
|
||||
* \subsection blother Other
|
||||
|
@@ -11,6 +11,7 @@
|
||||
/** \defgroup bmesh BMesh
|
||||
* \ingroup blender
|
||||
*/
|
||||
/** \defgroup texture Texturing */
|
||||
/** \defgroup compositor Compositing */
|
||||
|
||||
/** \defgroup python Python
|
||||
@@ -94,10 +95,6 @@
|
||||
|
||||
/** \defgroup blender Blender */
|
||||
|
||||
/** \defgroup blt BlenTranslation
|
||||
* \ingroup blender
|
||||
*/
|
||||
|
||||
/** \defgroup blf BlenFont
|
||||
* \ingroup blender
|
||||
*/
|
||||
@@ -325,7 +322,7 @@
|
||||
* \ingroup gui
|
||||
*/
|
||||
|
||||
/** \defgroup externformats External Formats */
|
||||
/** \defgroup externformats external formats */
|
||||
|
||||
/** \defgroup collada COLLADA
|
||||
* \ingroup externformats
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Sound Playback
|
||||
++++++++++++++++++++
|
||||
|
||||
This script shows how to use the classes: :class:`Device`, :class:`Factory` and
|
||||
:class:`Handle`.
|
||||
"""
|
||||
|
@@ -1,10 +1,9 @@
|
||||
"""
|
||||
Texture Replacement
|
||||
+++++++++++++++++++
|
||||
|
||||
Example of how to replace a texture in game with an external image.
|
||||
``createTexture()`` and ``removeTexture()`` are to be called from a
|
||||
module Python Controller.
|
||||
createTexture() and removeTexture() are to be called from a module Python
|
||||
Controller.
|
||||
"""
|
||||
from bge import logic
|
||||
from bge import texture
|
||||
|
@@ -1,8 +1,7 @@
|
||||
"""
|
||||
Basic Video Playback
|
||||
++++++++++++++++++++
|
||||
Example of how to replace a texture in game with a video. It needs to run
|
||||
everyframe.
|
||||
Example of how to replace a texture in game with a video. It needs to run everyframe
|
||||
"""
|
||||
import bge
|
||||
from bge import texture
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Handler Example
|
||||
+++++++++++++++++++++
|
||||
|
||||
This script shows the most simple example of adding a handler.
|
||||
"""
|
||||
|
||||
|
@@ -7,9 +7,8 @@ act on specified rather than the selected or active data, or to execute an
|
||||
operator in the different part of the user interface.
|
||||
|
||||
The context overrides are passed as a dictionary, with keys matching the context
|
||||
member names in bpy.context.
|
||||
For example to override ``bpy.context.active_object``,
|
||||
you would pass ``{'active_object': object}``.
|
||||
member names in bpy.context. For example to override bpy.context.active_object,
|
||||
you would pass {'active_object': object}.
|
||||
"""
|
||||
|
||||
# remove all objects in scene rather than the selected ones
|
||||
|
@@ -3,21 +3,21 @@ Calling Operators
|
||||
-----------------
|
||||
|
||||
Provides python access to calling operators, this includes operators written in
|
||||
C, Python or macros.
|
||||
C, Python or Macros.
|
||||
|
||||
Only keyword arguments can be used to pass operator properties.
|
||||
|
||||
Operators don't have return values as you might expect,
|
||||
instead they return a set() which is made up of:
|
||||
``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``.
|
||||
Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``.
|
||||
Operators don't have return values as you might expect, instead they return a
|
||||
set() which is made up of: {'RUNNING_MODAL', 'CANCELLED', 'FINISHED',
|
||||
'PASS_THROUGH'}.
|
||||
Common return values are {'FINISHED'} and {'CANCELLED'}.
|
||||
|
||||
|
||||
Calling an operator in the wrong context will raise a ``RuntimeError``,
|
||||
Calling an operator in the wrong context will raise a RuntimeError,
|
||||
there is a poll() method to avoid this problem.
|
||||
|
||||
Note that the operator ID (bl_idname) in this example is ``mesh.subdivide``,
|
||||
``bpy.ops`` is just the access path for python.
|
||||
Note that the operator ID (bl_idname) in this example is 'mesh.subdivide',
|
||||
'bpy.ops' is just the access path for python.
|
||||
|
||||
|
||||
Keywords and Positional Arguments
|
||||
@@ -32,9 +32,9 @@ There are 3 optional positional arguments (documented in detail below).
|
||||
|
||||
bpy.ops.test.operator(override_context, execution_context, undo)
|
||||
|
||||
- override_context - ``dict`` type.
|
||||
- execution_context - ``str`` (enum).
|
||||
- undo - ``bool`` type.
|
||||
* override_context - dict type
|
||||
* execution_context - string (enum)
|
||||
* undo - boolean
|
||||
|
||||
|
||||
Each of these arguments is optional, but must be given in the order above.
|
||||
|
@@ -8,8 +8,7 @@ bl_info = {
|
||||
"warning": "",
|
||||
"wiki_url": "",
|
||||
"tracker_url": "",
|
||||
"category": "Object",
|
||||
}
|
||||
"category": "Object"}
|
||||
|
||||
|
||||
import bpy
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Submenus
|
||||
++++++++
|
||||
|
||||
This menu demonstrates some different functions.
|
||||
"""
|
||||
import bpy
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Extending Menus
|
||||
+++++++++++++++
|
||||
|
||||
When creating menus for addons you can't reference menus in Blender's default
|
||||
scripts.
|
||||
Instead, the addon can add menu items to existing menus.
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Menu Example
|
||||
++++++++++++++++++
|
||||
|
||||
Here is an example of a simple menu. Menus differ from panels in that they must
|
||||
reference from a header, panel or another menu.
|
||||
|
||||
|
@@ -7,10 +7,10 @@ for more flexible mesh editing from python see :mod:`bmesh`.
|
||||
|
||||
Blender stores 4 main arrays to define mesh geometry.
|
||||
|
||||
- :class:`Mesh.vertices` (3 points in space)
|
||||
- :class:`Mesh.edges` (reference 2 vertices)
|
||||
- :class:`Mesh.loops` (reference a single vertex and edge)
|
||||
- :class:`Mesh.polygons`: (reference a range of loops)
|
||||
* :class:`Mesh.vertices` (3 points in space)
|
||||
* :class:`Mesh.edges` (reference 2 vertices)
|
||||
* :class:`Mesh.loops` (reference a single vertex and edge)
|
||||
* :class:`Mesh.polygons`: (reference a range of loops)
|
||||
|
||||
|
||||
Each polygon reference a slice in the loop array, this way, polygons do not store vertices or corner data such as UV's directly,
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Poll Function
|
||||
+++++++++++++++
|
||||
|
||||
The :class:`NodeTree.poll` function determines if a node tree is visible
|
||||
in the given context (similar to how :class:`Panel.poll`
|
||||
and :class:`Menu.poll` define visibility). If it returns False,
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Object Operations Example
|
||||
+++++++++++++++++++++++++++++++
|
||||
|
||||
This script demonstrates basic operations on object like creating new
|
||||
object, placing it into scene, selecting it and making it active.
|
||||
"""
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Invoke Function
|
||||
+++++++++++++++
|
||||
|
||||
:class:`Operator.invoke` is used to initialize the operator from the context
|
||||
at the moment the operator is called.
|
||||
invoke() is typically used to assign properties which are then used by
|
||||
@@ -32,7 +31,7 @@ class SimpleMouseOperator(bpy.types.Operator):
|
||||
y = bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
# rather than printing, use the report function,
|
||||
# rather then printing, use the report function,
|
||||
# this way the message appears in the header,
|
||||
self.report({'INFO'}, "Mouse coords are %d %d" % (self.x, self.y))
|
||||
return {'FINISHED'}
|
||||
|
@@ -4,7 +4,7 @@ Calling a File Selector
|
||||
This example shows how an operator can use the file selector.
|
||||
|
||||
Notice the invoke function calls a window manager method and returns
|
||||
``{'RUNNING_MODAL'}``, this means the file selector stays open and the operator does not
|
||||
RUNNING_MODAL, this means the file selector stays open and the operator does not
|
||||
exit immediately after invoke finishes.
|
||||
|
||||
The file selector runs the operator, calling :class:`Operator.execute` when the
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Dialog Box
|
||||
++++++++++
|
||||
|
||||
This operator uses its :class:`Operator.invoke` function to call a popup.
|
||||
"""
|
||||
import bpy
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Custom Drawing
|
||||
++++++++++++++
|
||||
|
||||
By default operator properties use an automatic user interface layout.
|
||||
If you need more control you can create your own layout with a
|
||||
:class:`Operator.draw` function.
|
||||
|
@@ -1,9 +1,8 @@
|
||||
"""
|
||||
Modal Execution
|
||||
+++++++++++++++
|
||||
|
||||
This operator defines a :class:`Operator.modal` function which running,
|
||||
handling events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``.
|
||||
handling events until it returns {'FINISHED'} or {'CANCELLED'}.
|
||||
|
||||
Grab, Rotate, Scale and Fly-Mode are examples of modal operators.
|
||||
They are especially useful for interactive tools,
|
||||
@@ -11,9 +10,9 @@ your operator can have its own state where keys toggle options as the operator
|
||||
runs.
|
||||
|
||||
:class:`Operator.invoke` is used to initialize the operator as being by
|
||||
returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
|
||||
returning {'RUNNING_MODAL'}, initializing the modal loop.
|
||||
|
||||
Notice ``__init__()`` and ``__del__()`` are declared.
|
||||
Notice __init__() and __del__() are declared.
|
||||
For other operator types they are not useful but for modal operators they will
|
||||
be called before the :class:`Operator.invoke` and after the operator finishes.
|
||||
"""
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Operator Example
|
||||
++++++++++++++++++++++
|
||||
|
||||
This script shows simple operator which prints a message.
|
||||
|
||||
Since the operator only has an :class:`Operator.execute` function it takes no
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Simple Object Panel
|
||||
+++++++++++++++++++
|
||||
|
||||
This panel has a :class:`Panel.poll` and :class:`Panel.draw_header` function,
|
||||
even though the contents is basic this closely resembles blenders panels.
|
||||
"""
|
||||
|
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Basic Panel Example
|
||||
+++++++++++++++++++
|
||||
|
||||
This script is a simple panel which will draw into the object properties
|
||||
section.
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
"""
|
||||
Advanced UIList Example - Filtering and Reordering
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
This script is an extended version of the ``UIList`` subclass used to show vertex groups. It is not used 'as is',
|
||||
This script is an extended version of the UIList subclass used to show vertex groups. It is not used 'as is',
|
||||
because iterating over all vertices in a 'draw' function is a very bad idea for UI performances! However, it's a good
|
||||
example of how to create/use filtering/reordering callbacks.
|
||||
"""
|
||||
|
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Note that when keying data paths which contain nested properties this must be
|
||||
done from the :class:`ID` subclass, in this case the :class:`Armature` rather
|
||||
than the bone.
|
||||
then the bone.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
@@ -1,192 +0,0 @@
|
||||
# Draws an off-screen buffer and display it in the corner of the view.
|
||||
import bpy
|
||||
from bgl import *
|
||||
|
||||
|
||||
class OffScreenDraw(bpy.types.Operator):
|
||||
bl_idname = "view3d.offscreen_draw"
|
||||
bl_label = "View3D Offscreen Draw"
|
||||
|
||||
_handle_calc = None
|
||||
_handle_draw = None
|
||||
is_enabled = False
|
||||
|
||||
# manage draw handler
|
||||
@staticmethod
|
||||
def draw_callback_px(self, context):
|
||||
scene = context.scene
|
||||
aspect_ratio = scene.render.resolution_x / scene.render.resolution_y
|
||||
|
||||
self._update_offscreen(context, self._offscreen)
|
||||
self._opengl_draw(context, self._texture, aspect_ratio, 0.2)
|
||||
|
||||
@staticmethod
|
||||
def handle_add(self, context):
|
||||
OffScreenDraw._handle_draw = bpy.types.SpaceView3D.draw_handler_add(
|
||||
self.draw_callback_px, (self, context),
|
||||
'WINDOW', 'POST_PIXEL',
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def handle_remove():
|
||||
if OffScreenDraw._handle_draw is not None:
|
||||
bpy.types.SpaceView3D.draw_handler_remove(OffScreenDraw._handle_draw, 'WINDOW')
|
||||
|
||||
OffScreenDraw._handle_draw = None
|
||||
|
||||
# off-screen buffer
|
||||
@staticmethod
|
||||
def _setup_offscreen(context):
|
||||
import gpu
|
||||
scene = context.scene
|
||||
aspect_ratio = scene.render.resolution_x / scene.render.resolution_y
|
||||
|
||||
try:
|
||||
offscreen = gpu.offscreen.new(512, int(512 / aspect_ratio))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
offscreen = None
|
||||
|
||||
return offscreen
|
||||
|
||||
@staticmethod
|
||||
def _update_offscreen(context, offscreen):
|
||||
scene = context.scene
|
||||
render = scene.render
|
||||
camera = scene.camera
|
||||
|
||||
modelview_matrix = camera.matrix_world.inverted()
|
||||
projection_matrix = camera.calc_matrix_camera(
|
||||
render.resolution_x,
|
||||
render.resolution_y,
|
||||
render.pixel_aspect_x,
|
||||
render.pixel_aspect_y,
|
||||
)
|
||||
|
||||
|
||||
offscreen.draw_view3d(
|
||||
scene,
|
||||
context.space_data,
|
||||
context.region,
|
||||
projection_matrix,
|
||||
modelview_matrix,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _opengl_draw(context, texture, aspect_ratio, scale):
|
||||
"""
|
||||
OpenGL code to draw a rectangle in the viewport
|
||||
"""
|
||||
|
||||
glDisable(GL_DEPTH_TEST)
|
||||
|
||||
# view setup
|
||||
glMatrixMode(GL_PROJECTION)
|
||||
glPushMatrix()
|
||||
glLoadIdentity()
|
||||
|
||||
glMatrixMode(GL_MODELVIEW)
|
||||
glPushMatrix()
|
||||
glLoadIdentity()
|
||||
|
||||
glOrtho(-1, 1, -1, 1, -15, 15)
|
||||
gluLookAt(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
|
||||
|
||||
act_tex = Buffer(GL_INT, 1)
|
||||
glGetIntegerv(GL_TEXTURE_2D, act_tex)
|
||||
|
||||
viewport = Buffer(GL_INT, 4)
|
||||
glGetIntegerv(GL_VIEWPORT, viewport)
|
||||
|
||||
width = int(scale * viewport[2])
|
||||
height = int(width / aspect_ratio)
|
||||
|
||||
glViewport(viewport[0], viewport[1], width, height)
|
||||
glScissor(viewport[0], viewport[1], width, height)
|
||||
|
||||
# draw routine
|
||||
glEnable(GL_TEXTURE_2D)
|
||||
glActiveTexture(GL_TEXTURE0)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture)
|
||||
|
||||
texco = [(1, 1), (0, 1), (0, 0), (1, 0)]
|
||||
verco = [(1.0, 1.0), (-1.0, 1.0), (-1.0, -1.0), (1.0, -1.0)]
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
|
||||
|
||||
glColor4f(1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
glBegin(GL_QUADS)
|
||||
for i in range(4):
|
||||
glTexCoord3f(texco[i][0], texco[i][1], 0.0)
|
||||
glVertex2f(verco[i][0], verco[i][1])
|
||||
glEnd()
|
||||
|
||||
# restoring settings
|
||||
glBindTexture(GL_TEXTURE_2D, act_tex[0])
|
||||
|
||||
glDisable(GL_TEXTURE_2D)
|
||||
|
||||
# reset view
|
||||
glMatrixMode(GL_PROJECTION)
|
||||
glPopMatrix()
|
||||
|
||||
glMatrixMode(GL_MODELVIEW)
|
||||
glPopMatrix()
|
||||
|
||||
glViewport(viewport[0], viewport[1], viewport[2], viewport[3])
|
||||
glScissor(viewport[0], viewport[1], viewport[2], viewport[3])
|
||||
|
||||
# operator functions
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.area.type == 'VIEW_3D'
|
||||
|
||||
def modal(self, context, event):
|
||||
if context.area:
|
||||
context.area.tag_redraw()
|
||||
|
||||
return {'PASS_THROUGH'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
if OffScreenDraw.is_enabled:
|
||||
self.cancel(context)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
else:
|
||||
self._offscreen = OffScreenDraw._setup_offscreen(context)
|
||||
if self._offscreen:
|
||||
self._texture = self._offscreen.color_texture
|
||||
else:
|
||||
self.report({'ERROR'}, "Error initializing offscreen buffer. More details in the console")
|
||||
return {'CANCELLED'}
|
||||
|
||||
OffScreenDraw.handle_add(self, context)
|
||||
OffScreenDraw.is_enabled = True
|
||||
|
||||
if context.area:
|
||||
context.area.tag_redraw()
|
||||
|
||||
context.window_manager.modal_handler_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
def cancel(self, context):
|
||||
OffScreenDraw.handle_remove()
|
||||
OffScreenDraw.is_enabled = False
|
||||
|
||||
if context.area:
|
||||
context.area.tag_redraw()
|
||||
|
||||
|
||||
def register():
|
||||
bpy.utils.register_class(OffScreenDraw)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(OffScreenDraw)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
@@ -32,7 +32,14 @@ Functions
|
||||
:arg physicsid_2: The physics id of the second object in constraint.
|
||||
:type physicsid_2: int
|
||||
|
||||
:arg constraint_type: The type of the constraint, see `Create Constraint Constants`_.
|
||||
:arg constraint_type: The type of the constraint, one of...
|
||||
|
||||
- :class:`POINTTOPOINT_CONSTRAINT`
|
||||
- :class:`LINEHINGE_CONSTRAINT`
|
||||
- :class:`ANGULAR_CONSTRAINT`
|
||||
- :class:`CONETWIST_CONSTRAINT`
|
||||
- :class:`VEHICLE_CONSTRAINT`
|
||||
- :class:`GENERIC_6DOF_CONSTRAINT`
|
||||
|
||||
:type constraint_type: int
|
||||
|
||||
@@ -145,7 +152,22 @@ Functions
|
||||
|
||||
Sets the debug mode.
|
||||
|
||||
:arg mode: The new debug mode, see `Debug Mode Constants`_.
|
||||
:arg mode: The new debug mode.
|
||||
|
||||
- :class:`DBG_NODEBUG`
|
||||
- :class:`DBG_DRAWWIREFRAME`
|
||||
- :class:`DBG_DRAWAABB`
|
||||
- :class:`DBG_DRAWFREATURESTEXT`
|
||||
- :class:`DBG_DRAWCONTACTPOINTS`
|
||||
- :class:`DBG_NOHELPTEXT`
|
||||
- :class:`DBG_DRAWTEXT`
|
||||
- :class:`DBG_PROFILETIMINGS`
|
||||
- :class:`DBG_ENABLESATCOMPARISION`
|
||||
- :class:`DBG_DISABLEBULLETLCP`
|
||||
- :class:`DBG_ENABLECCD`
|
||||
- :class:`DBG_DRAWCONSTRAINTS`
|
||||
- :class:`DBG_DRAWCONSTRAINTLIMITS`
|
||||
- :class:`DBG_FASTWIREFRAME`
|
||||
|
||||
:type mode: int
|
||||
|
||||
|
@@ -258,8 +258,7 @@ General functions
|
||||
|
||||
Sets the world gravity.
|
||||
|
||||
:arg gravity: gravity vector
|
||||
:type gravity: Vector((fx, fy, fz))
|
||||
:type gravity: list [fx, fy, fz]
|
||||
|
||||
.. function:: getSpectrum()
|
||||
|
||||
@@ -338,28 +337,6 @@ General functions
|
||||
|
||||
.. warning: Not implimented yet
|
||||
|
||||
.. function:: getAnimRecordFrame()
|
||||
|
||||
Gets the current frame number used for recording animations. This
|
||||
number is incremented automatically by Blender when the "Record
|
||||
animation" feature is turned on.
|
||||
|
||||
:rtype: int
|
||||
|
||||
.. function:: setAnimRecordFrame(framenr)
|
||||
|
||||
Sets the current frame number used for recording animations. This
|
||||
number is automatically incremented by Blender when the "Record
|
||||
animation" feature is turned on.
|
||||
|
||||
The frame number Must be non-negative, unless Blender has
|
||||
:attr:`bpy.types.UserPreferencesEdit.use_negative_frames` enabled
|
||||
in its user preferences. Only use non-negative numbers to be on
|
||||
the safe side, unless you know what you are doing.
|
||||
|
||||
:arg framenr: The new frame number.
|
||||
:type framenr: int
|
||||
|
||||
.. function:: getExitKey()
|
||||
|
||||
Gets the key used to exit the game engine
|
||||
|
@@ -8,8 +8,7 @@ Intro
|
||||
|
||||
.. module:: bge.render
|
||||
|
||||
Example of using a :class:`bge.types.SCA_MouseSensor`,
|
||||
and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
|
||||
Example of using a :class:`bge.types.SCA_MouseSensor`, and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
|
||||
|
||||
.. note::
|
||||
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
|
||||
@@ -78,9 +77,7 @@ Constants
|
||||
|
||||
.. DATA:: VSYNC_ADAPTIVE
|
||||
|
||||
Enables adaptive vsync if supported.
|
||||
Adaptive vsync enables vsync if the framerate is above the monitors refresh rate.
|
||||
Otherwise, vsync is diabled if the framerate is too low.
|
||||
Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low.
|
||||
|
||||
.. data:: LEFT_EYE
|
||||
|
||||
@@ -111,55 +108,40 @@ Functions
|
||||
|
||||
Set the width and height of the window (in pixels). This also works for fullscreen applications.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player.
|
||||
|
||||
:arg width: width in pixels
|
||||
:type width: integer
|
||||
:arg height: height in pixels
|
||||
:type height: integer
|
||||
|
||||
.. function:: setFullScreen(enable)
|
||||
|
||||
Set whether or not the window should be fullscreen.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player.
|
||||
|
||||
:arg enable: ``True`` to set full screen, ``False`` to set windowed.
|
||||
:type enable: bool
|
||||
|
||||
.. function:: getFullScreen()
|
||||
|
||||
Returns whether or not the window is fullscreen.
|
||||
|
||||
.. note:: Only works in the standalone player, not the Blender-embedded player; there it always returns False.
|
||||
|
||||
:rtype: bool
|
||||
|
||||
.. function:: getDisplayDimensions()
|
||||
|
||||
Get the display dimensions, in pixels, of the display (e.g., the
|
||||
monitor). Can return the size of the entire view, so the
|
||||
combination of all monitors; for example, ``(3840, 1080)`` for two
|
||||
side-by-side 1080p monitors.
|
||||
Get the actual display dimensions, in pixels, of the physical display (e.g., the monitor).
|
||||
|
||||
:rtype: tuple (width, height)
|
||||
:type dimension: list [width,heigh]
|
||||
|
||||
.. function:: makeScreenshot(filename)
|
||||
|
||||
Writes an image file with the current displayed frame.
|
||||
|
||||
The image is written to *'filename'*.
|
||||
The path may be absolute (eg. ``/home/foo/image``) or relative when started with
|
||||
``//`` (eg. ``//image``). Note that absolute paths are not portable between platforms.
|
||||
If the filename contains a ``#``,
|
||||
it will be replaced by an incremental index so that screenshots can be taken multiple
|
||||
times without overwriting the previous ones (eg. ``image-#``).
|
||||
The image is written to *'filename'*. The path may be absolute (eg. "/home/foo/image") or relative when started with
|
||||
"//" (eg. "//image"). Note that absolute paths are not portable between platforms.
|
||||
If the filename contains a "#", it will be replaced by an incremental index so that screenshots can be taken multiple
|
||||
times without overwriting the previous ones (eg. "image-#").
|
||||
|
||||
Settings for the image are taken from the render settings (file format and respective settings,
|
||||
gamma and colospace conversion, etc).
|
||||
The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
|
||||
When running from the standalone player, instead of the embedded player, only PNG files are supported.
|
||||
Additional color conversions are also not supported.
|
||||
Settings for the image are taken from the render settings (file format and respective settings, gamma and colospace
|
||||
conversion, etc). The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
|
||||
When running from the standalone player, instead of the embedded player, only PNG files are supported. Additional
|
||||
color conversions are also not supported.
|
||||
|
||||
:arg filename: path and name of the file to write
|
||||
:type filename: string
|
||||
@@ -167,14 +149,13 @@ Functions
|
||||
|
||||
.. function:: enableVisibility(visible)
|
||||
|
||||
Deprecated; doesn't do anything.
|
||||
Doesn't really do anything...
|
||||
|
||||
|
||||
.. function:: showMouse(visible)
|
||||
|
||||
Enables or disables the operating system mouse cursor.
|
||||
|
||||
:arg visible:
|
||||
:type visible: boolean
|
||||
|
||||
|
||||
@@ -182,15 +163,15 @@ Functions
|
||||
|
||||
Sets the mouse cursor position.
|
||||
|
||||
:arg x: X-coordinate in screen pixel coordinates.
|
||||
:type x: integer
|
||||
:arg y: Y-coordinate in screen pixel coordinates.
|
||||
:type y: integer
|
||||
|
||||
|
||||
.. function:: setBackgroundColor(rgba)
|
||||
|
||||
Deprecated and no longer functional. Use :py:meth:`bge.types.KX_WorldInfo.backgroundColor` instead.
|
||||
Sets the window background color. (Deprecated: use KX_WorldInfo.background_color)
|
||||
|
||||
:type rgba: list [r, g, b, a]
|
||||
|
||||
|
||||
.. function:: setEyeSeparation(eyesep)
|
||||
@@ -234,7 +215,6 @@ Functions
|
||||
|
||||
Set the material mode to use for OpenGL rendering.
|
||||
|
||||
:arg mode: material mode
|
||||
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
.. note:: Changes will only affect newly created scenes.
|
||||
@@ -251,17 +231,14 @@ Functions
|
||||
|
||||
Enables or disables a GLSL material setting.
|
||||
|
||||
:arg setting:
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
|
||||
.. function:: getGLSLMaterialSetting(setting)
|
||||
.. function:: getGLSLMaterialSetting(setting, enable)
|
||||
|
||||
Get the state of a GLSL material setting.
|
||||
|
||||
:arg setting:
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:rtype: boolean
|
||||
|
||||
@@ -322,28 +299,24 @@ Functions
|
||||
|
||||
Show or hide the framerate.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: showProfile(enable)
|
||||
|
||||
Show or hide the profile.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: showProperties(enable)
|
||||
|
||||
Show or hide the debug properties.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: autoDebugList(enable)
|
||||
|
||||
Enable or disable auto adding debug properties to the debug list.
|
||||
|
||||
:arg enable:
|
||||
:type enable: boolean
|
||||
|
||||
.. function:: clearDebugList()
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -89,48 +89,6 @@ base class --- :class:`PyObjectPlus`
|
||||
:return: the material's shader
|
||||
:rtype: :class:`BL_Shader`
|
||||
|
||||
.. attribute:: alpha
|
||||
|
||||
The material's alpha transparency.
|
||||
|
||||
:type: float between 0.0 and 1.0 inclusive
|
||||
|
||||
.. attribute:: hardness
|
||||
|
||||
How hard (sharp) the material's specular reflection is.
|
||||
|
||||
:type: integer between 1 and 511 inclusive
|
||||
|
||||
.. attribute:: emit
|
||||
|
||||
Amount of light to emit.
|
||||
|
||||
:type: float between 0.0 and 2.0 inclusive
|
||||
|
||||
.. attribute:: specularIntensity
|
||||
|
||||
How intense (bright) the material's specular reflection is.
|
||||
|
||||
:type: float between 0.0 and 1.0 inclusive
|
||||
|
||||
.. attribute:: diffuseIntensity
|
||||
|
||||
The material's amount of diffuse reflection.
|
||||
|
||||
:type: float between 0.0 and 1.0 inclusive
|
||||
|
||||
.. attribute:: specularColor
|
||||
|
||||
The material's specular color.
|
||||
|
||||
:type: :class:`mathutils.Color`
|
||||
|
||||
.. attribute:: diffuseColor
|
||||
|
||||
The material's diffuse color.
|
||||
|
||||
:type: :class:`mathutils.Color`
|
||||
|
||||
.. method:: setBlending(src, dest)
|
||||
|
||||
Set the pixel color arithmetic functions.
|
||||
|
@@ -51,18 +51,6 @@ base class --- :class:`KX_GameObject`
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: shift_x
|
||||
|
||||
The camera's horizontal shift.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: shift_y
|
||||
|
||||
The camera's vertical shift.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: perspective
|
||||
|
||||
True if this camera has a perspective transform, False for an orthographic projection.
|
||||
|
@@ -25,7 +25,7 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.
|
||||
|
||||
:type: int in [0, 255], default 1
|
||||
:type: int
|
||||
|
||||
.. attribute:: jumpCount
|
||||
|
||||
|
@@ -133,11 +133,10 @@ base class --- :class:`PyObjectPlus`
|
||||
Returns the contraint type (read only)
|
||||
|
||||
:type: integer
|
||||
|
||||
- :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
|
||||
- :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
|
||||
- :class:`~bge.constraints.ANGULAR_CONSTRAINT`
|
||||
- :class:`~bge.constraints.CONETWIST_CONSTRAINT`
|
||||
- :class:`~bge.constraints.VEHICLE_CONSTRAINT`
|
||||
- :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
|
||||
- 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
|
||||
- 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
|
||||
- 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
|
||||
- 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
|
||||
- 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
|
||||
- 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
|
||||
|
||||
|
@@ -137,7 +137,7 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
.. note::
|
||||
|
||||
A value of 0.0 disables this option (rather than setting it stationary).
|
||||
A value of 0.0 disables this option (rather then setting it stationary).
|
||||
|
||||
.. attribute:: angularVelocityMin
|
||||
|
||||
@@ -799,7 +799,7 @@ base class --- :class:`SCA_IObject`
|
||||
:return: the first object hit or None if no object or object does not match prop
|
||||
:rtype: :class:`KX_GameObject`
|
||||
|
||||
.. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly, mask)
|
||||
.. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly)
|
||||
|
||||
Look from a point/object to another point/object and find first object hit within dist that matches prop.
|
||||
if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None, None, None) if no hit.
|
||||
@@ -851,8 +851,6 @@ base class --- :class:`SCA_IObject`
|
||||
* 2: return value is a 5-tuple and the 5th element is a 2-tuple (u, v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping.
|
||||
|
||||
:type poly: integer
|
||||
:arg mask: collision mask: The collision mask (16 layers mapped to a 16-bit integer) is combined with each object's collision group, to hit only a subset of the objects in the scene. Only those objects for which ``collisionGroup & mask`` is true can be hit.
|
||||
:type mask: bitfield
|
||||
:return: (object, hitpoint, hitnormal) or (object, hitpoint, hitnormal, polygon) or (object, hitpoint, hitnormal, polygon, hituv).
|
||||
|
||||
* object, hitpoint and hitnormal are None if no hit.
|
||||
@@ -974,16 +972,6 @@ base class --- :class:`SCA_IObject`
|
||||
:return: The current frame of the action
|
||||
:rtype: float
|
||||
|
||||
.. method:: getActionName(layer=0)
|
||||
|
||||
Gets the name of the current action playing in the supplied layer.
|
||||
|
||||
:arg layer: The layer that you want to get the action name from.
|
||||
:type layer: integer
|
||||
|
||||
:return: The name of the current action
|
||||
:rtype: string
|
||||
|
||||
.. method:: setActionFrame(frame, layer=0)
|
||||
|
||||
Set the current frame of the action playing in the supplied layer.
|
||||
|
@@ -51,7 +51,7 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
.. attribute:: materials
|
||||
|
||||
:type: list of :class:`KX_BlenderMaterial` type
|
||||
:type: list of :class:`KX_BlenderMaterial` or :class:`KX_PolygonMaterial` types
|
||||
|
||||
.. attribute:: numPolygons
|
||||
|
||||
|
@@ -23,7 +23,7 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
The material of the polygon.
|
||||
|
||||
:type: :class:`KX_BlenderMaterial`
|
||||
:type: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
|
||||
|
||||
.. attribute:: texture_name
|
||||
|
||||
@@ -84,7 +84,7 @@ base class --- :class:`SCA_IObject`
|
||||
.. method:: getMaterial()
|
||||
|
||||
:return: The polygon material
|
||||
:rtype: :class:`KX_BlenderMaterial`
|
||||
:rtype: :class:`KX_PolygonMaterial` or :class:`KX_BlenderMaterial`
|
||||
|
||||
.. method:: getTextureName()
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
KX_WorldInfo(PyObjectPlus)
|
||||
KX_WordlInfo(PyObjectPlus)
|
||||
=============================
|
||||
|
||||
.. module:: bge.types
|
||||
@@ -7,7 +7,7 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: KX_WorldInfo(PyObjectPlus)
|
||||
|
||||
A world object.
|
||||
A wolrd object.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -63,17 +63,17 @@ base class --- :class:`PyObjectPlus`
|
||||
The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
Mist and background color sould always set to the same color.
|
||||
|
||||
:type: :class:`mathutils.Color`
|
||||
:type: :class:`mathutils.Vector`
|
||||
|
||||
.. attribute:: backgroundColor
|
||||
|
||||
The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
Mist and background color sould always set to the same color.
|
||||
|
||||
:type: :class:`mathutils.Color`
|
||||
:type: :class:`mathutils.Vector`
|
||||
|
||||
.. attribute:: ambientColor
|
||||
|
||||
The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
|
||||
:type: :class:`mathutils.Color`
|
||||
:type: :class:`mathutils.Vector`
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -16,24 +16,24 @@ and in the game engine.
|
||||
|
||||
.. warning::
|
||||
|
||||
The API provided by this module is subject to change.
|
||||
The data exposed by the API are are closely related to Blender's internal GLSL code
|
||||
and may change if the GLSL code is modified (e.g. new uniform type).
|
||||
The API provided by this module should be consider unstable. The data exposed by the API
|
||||
are are closely related to Blender's internal GLSL code and may change if the GLSL code
|
||||
is modified (e.g. new uniform type).
|
||||
|
||||
|
||||
Constants
|
||||
=========
|
||||
|
||||
|
||||
GLSL Data Type
|
||||
GLSL data type
|
||||
--------------
|
||||
|
||||
.. _data-type:
|
||||
|
||||
Type of GLSL data.
|
||||
For shader uniforms, the data type determines which ``glUniform`` function
|
||||
For shader uniforms, the data type determines which glUniform function
|
||||
variant to use to send the uniform value to the GPU.
|
||||
For vertex attributes, the data type determines which ``glVertexAttrib`` function
|
||||
For vertex attributes, the data type determines which glVertexAttrib function
|
||||
variant to use to send the vertex attribute to the GPU.
|
||||
|
||||
See export_shader_
|
||||
@@ -42,37 +42,53 @@ See export_shader_
|
||||
|
||||
one integer
|
||||
|
||||
:value: 1
|
||||
|
||||
.. data:: GPU_DATA_1F
|
||||
|
||||
one float
|
||||
|
||||
:value: 2
|
||||
|
||||
.. data:: GPU_DATA_2F
|
||||
|
||||
two floats
|
||||
|
||||
:value: 3
|
||||
|
||||
.. data:: GPU_DATA_3F
|
||||
|
||||
three floats
|
||||
|
||||
:value: 4
|
||||
|
||||
.. data:: GPU_DATA_4F
|
||||
|
||||
four floats
|
||||
|
||||
:value: 5
|
||||
|
||||
.. data:: GPU_DATA_9F
|
||||
|
||||
matrix 3x3 in column-major order
|
||||
|
||||
:value: 6
|
||||
|
||||
.. data:: GPU_DATA_16F
|
||||
|
||||
matrix 4x4 in column-major order
|
||||
|
||||
:value: 7
|
||||
|
||||
.. data:: GPU_DATA_4UB
|
||||
|
||||
four unsigned byte
|
||||
|
||||
:value: 8
|
||||
|
||||
GLSL Uniform Types
|
||||
------------------
|
||||
|
||||
GLSL uniform type
|
||||
-----------------
|
||||
|
||||
.. _uniform-type:
|
||||
|
||||
@@ -85,7 +101,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
|
||||
.. _mat4_cam_to_world:
|
||||
.. _mat4_world_to_cam:
|
||||
|
||||
``mat4_cam_to_world``
|
||||
*mat4_cam_to_world*
|
||||
Model matrix of the camera. OpenGL 4x4 matrix that converts
|
||||
camera local coordinates to world coordinates. In blender this is obtained from the
|
||||
'matrix_world' attribute of the camera object.
|
||||
@@ -96,7 +112,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
|
||||
.. _mat4_object_to_world:
|
||||
.. _mat4_world_to_object:
|
||||
|
||||
``mat4_object_to_world``
|
||||
*mat4_object_to_world*
|
||||
Model matrix of the object that is being rendered. OpenGL 4x4 matric that converts
|
||||
object local coordinates to world coordinates. In blender this is obtained from the
|
||||
'matrix_world' attribute of the object.
|
||||
@@ -106,7 +122,7 @@ The calculation of some of the uniforms is based on matrices available in the sc
|
||||
.. _mat4_lamp_to_world:
|
||||
.. _mat4_world_to_lamp:
|
||||
|
||||
``mat4_lamp_to_world``
|
||||
*mat4_lamp_to_world*
|
||||
Model matrix of the lamp lighting the object. OpenGL 4x4 matrix that converts lamp
|
||||
local coordinates to world coordinates. In blender this is obtained from the
|
||||
'matrix_world' attribute of the lamp object.
|
||||
@@ -114,305 +130,151 @@ The calculation of some of the uniforms is based on matrices available in the sc
|
||||
Some uniform will need the *mat4_world_to_lamp* matrix
|
||||
computed as the inverse of this matrix.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Any uniforms used for view projections or transformations (object, lamp matrices for eg),
|
||||
can only be set once per frame.
|
||||
|
||||
|
||||
GLSL Object Uniforms
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. note::
|
||||
|
||||
- Object transformations and color must be set before drawing the object.
|
||||
- There is at most one uniform of these types per shader.
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_VIEWMAT
|
||||
|
||||
A matrix that converts world coordinates to camera coordinates (see mat4_world_to_cam_).
|
||||
The uniform is a 4x4 GL matrix that converts world coordinates to
|
||||
camera coordinates (see mat4_world_to_cam_). Can be set once per frame.
|
||||
There is at most one uniform of that type per shader.
|
||||
|
||||
:type: matrix4x4
|
||||
:value: 1
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_MAT
|
||||
|
||||
A matrix that converts object coordinates to world coordinates (see mat4_object_to_world_).
|
||||
The uniform is a 4x4 GL matrix that converts object coordinates
|
||||
to world coordinates (see mat4_object_to_world_). Must be set before drawing the object.
|
||||
There is at most one uniform of that type per shader.
|
||||
|
||||
:type: matrix4x4
|
||||
:value: 2
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_VIEWIMAT
|
||||
|
||||
The uniform is a 4x4 GL matrix that converts coordinates
|
||||
in camera space to world coordinates (see mat4_cam_to_world_).
|
||||
Can be set once per frame.
|
||||
There is at most one uniform of that type per shader.
|
||||
|
||||
:type: matrix4x4
|
||||
:value: 3
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_IMAT
|
||||
|
||||
The uniform is a 4x4 GL matrix that converts world coodinates
|
||||
to object coordinates (see mat4_world_to_object_).
|
||||
Must be set before drawing the object.
|
||||
There is at most one uniform of that type per shader.
|
||||
|
||||
:type: matrix4x4
|
||||
:value: 4
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_COLOR
|
||||
|
||||
An RGB color + alpha defined at object level.
|
||||
Each values between 0.0 and 1.0.
|
||||
The uniform is a vector of 4 float representing a RGB color + alpha defined at object level.
|
||||
Each values between 0.0 and 1.0. In blender it corresponds to the 'color' attribute of the object.
|
||||
Must be set before drawing the object.
|
||||
There is at most one uniform of that type per shader.
|
||||
|
||||
See :class:`bpy.types.Object.color`.
|
||||
|
||||
:type: float4
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE
|
||||
|
||||
Multiplier for bump-map scaling.
|
||||
|
||||
:type: float
|
||||
|
||||
|
||||
GLSL Lamp Uniforms
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. note::
|
||||
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
:value: 5
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNVEC
|
||||
|
||||
Represents the direction of light in camera space.
|
||||
The uniform is a vector of 3 float representing the direction of light in camera space.
|
||||
In Blender, this is computed by
|
||||
|
||||
Computed as:
|
||||
mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
|
||||
mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
|
||||
|
||||
.. note::
|
||||
- The lamp Z axis points to the opposite direction of light.
|
||||
- The norm of the vector should be unit length.
|
||||
as the lamp Z axis points to the opposite direction of light.
|
||||
The norm of the vector should be unity. Can be set once per frame.
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
|
||||
:type: float3
|
||||
:value: 6
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNCO
|
||||
|
||||
Represents the position of the light in camera space.
|
||||
The uniform is a vector of 3 float representing the position of the light in camera space.
|
||||
Computed as
|
||||
|
||||
Computed as:
|
||||
mat4_world_to_cam_ * vec3_lamp_pos
|
||||
mat4_world_to_cam_ * vec3_lamp_pos
|
||||
|
||||
:type: float3
|
||||
Can be set once per frame.
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
|
||||
:value: 7
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNIMAT
|
||||
|
||||
Matrix that converts vector in camera space to lamp space.
|
||||
The uniform is a 4x4 GL matrix that converts vector in camera space to lamp space.
|
||||
Computed as
|
||||
|
||||
Computed as:
|
||||
mat4_world_to_lamp_ * mat4_cam_to_world_
|
||||
mat4_world_to_lamp_ * mat4_cam_to_world_
|
||||
|
||||
:type: matrix4x4
|
||||
Can be set once per frame.
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
|
||||
:value: 8
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNPERSMAT
|
||||
|
||||
Matrix that converts a vector in camera space to shadow buffer depth space.
|
||||
The uniform is a 4x4 GL matrix that converts a vector in camera space to shadow buffer depth space.
|
||||
Computed as
|
||||
|
||||
Computed as:
|
||||
mat4_perspective_to_depth_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_.
|
||||
mat4_perspective_to_depth_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_.
|
||||
|
||||
.. _mat4_perspective_to_depth:
|
||||
|
||||
``mat4_perspective_to_depth`` is a fixed matrix defined as follow::
|
||||
*mat4_perspective_to_depth* is a fixed matrix defined as follow::
|
||||
|
||||
0.5 0.0 0.0 0.5
|
||||
0.0 0.5 0.0 0.5
|
||||
0.0 0.0 0.5 0.5
|
||||
0.0 0.0 0.0 1.0
|
||||
|
||||
.. note::
|
||||
This uniform can be set once per frame. There is one uniform of that type per lamp casting shadow in the scene.
|
||||
|
||||
- There is one uniform of that type per lamp casting shadow in the scene.
|
||||
|
||||
:type: matrix4x4
|
||||
:value: 9
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNENERGY
|
||||
|
||||
See :class:`bpy.types.Lamp.energy`.
|
||||
The uniform is a single float representing the lamp energy. In blender it corresponds
|
||||
to the 'energy' attribute of the lamp data block.
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
|
||||
:type: float
|
||||
:value: 10
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DYNCOL
|
||||
|
||||
See :class:`bpy.types.Lamp.color`.
|
||||
The uniform is a vector of 3 float representing the lamp color.
|
||||
Color elements are between 0.0 and 1.0. In blender it corresponds
|
||||
to the 'color' attribute of the lamp data block.
|
||||
There is one uniform of that type per lamp lighting the material.
|
||||
|
||||
:type: float3
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_DISTANCE
|
||||
|
||||
See :class:`bpy.types.Lamp.distance`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_ATT1
|
||||
|
||||
See
|
||||
:class:`bpy.types.PointLamp.linear_attenuation`,
|
||||
:class:`bpy.types.SpotLamp.linear_attenuation`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_ATT2
|
||||
|
||||
See
|
||||
:class:`bpy.types.PointLamp.quadratic_attenuation`,
|
||||
:class:`bpy.types.SpotLamp.quadratic_attenuation`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_SPOTSIZE
|
||||
|
||||
See :class:`bpy.types.SpotLamp.spot_size`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_SPOTBLEND
|
||||
|
||||
See :class:`bpy.types.SpotLamp.spot_blend`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_LAMP_SPOTSCALE
|
||||
|
||||
Represents the SpotLamp local scale.
|
||||
|
||||
:type: float2
|
||||
|
||||
|
||||
GLSL Sampler Uniforms
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
:value: 11
|
||||
|
||||
.. data:: GPU_DYNAMIC_SAMPLER_2DBUFFER
|
||||
|
||||
Represents an internal texture used for certain effect
|
||||
The uniform is an integer representing an internal texture used for certain effect
|
||||
(color band, etc).
|
||||
|
||||
:type: integer
|
||||
:value: 12
|
||||
|
||||
.. data:: GPU_DYNAMIC_SAMPLER_2DIMAGE
|
||||
|
||||
Represents a texture loaded from an image file.
|
||||
The uniform is an integer representing a texture loaded from an image file.
|
||||
|
||||
:type: integer
|
||||
:value: 13
|
||||
|
||||
.. data:: GPU_DYNAMIC_SAMPLER_2DSHADOW
|
||||
|
||||
Represents a texture loaded from a shadow buffer file.
|
||||
The uniform is an float representing the bumpmap scaling.
|
||||
|
||||
:type: integer
|
||||
:value: 14
|
||||
|
||||
.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE
|
||||
|
||||
The uniform is an integer representing a shadow buffer corresponding to a lamp
|
||||
casting shadow.
|
||||
|
||||
:value: 15
|
||||
|
||||
|
||||
GLSL Mist Uniforms
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_ENABLE:
|
||||
|
||||
See :class:`bpy.types.WorldMistSettings.use_mist`.
|
||||
|
||||
:type: float (0 or 1)
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_START
|
||||
|
||||
See :class:`bpy.types.WorldMistSettings.start`.
|
||||
|
||||
:type: float
|
||||
|
||||
See :class:`bpy.types.WorldMistSettings.depth`.
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_DISTANCE
|
||||
|
||||
:type: float
|
||||
|
||||
See :class:`bpy.types.WorldMistSettings.intensity`.
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_INTENSITY
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_TYPE
|
||||
|
||||
See :class:`bpy.types.WorldMistSettings.falloff`.
|
||||
|
||||
:type: float (used as an index into the type)
|
||||
|
||||
.. data:: GPU_DYNAMIC_MIST_COLOR
|
||||
|
||||
|
||||
GLSL World Uniforms
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. data:: GPU_DYNAMIC_HORIZON_COLOR
|
||||
|
||||
See :class:`bpy.types.World.horizon_color`.
|
||||
|
||||
:type: float3
|
||||
|
||||
.. data:: GPU_DYNAMIC_AMBIENT_COLOR
|
||||
|
||||
See :class:`bpy.types.World.ambient_color`.
|
||||
|
||||
:type: float3
|
||||
|
||||
|
||||
GLSL Material Uniforms
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_DIFFRGB
|
||||
|
||||
See :class:`bpy.types.Material.diffuse_color`.
|
||||
|
||||
:type: float3
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_REF
|
||||
|
||||
See :class:`bpy.types.Material.diffuse_intensity`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_SPECRGB
|
||||
|
||||
See :class:`bpy.types.Material.specular_color`.
|
||||
|
||||
:type: float3
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_SPEC
|
||||
|
||||
See :class:`bpy.types.Material.specular_intensity`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_HARD
|
||||
|
||||
See :class:`bpy.types.Material.specular_hardness`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_EMIT
|
||||
|
||||
See :class:`bpy.types.Material.emit`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_AMB
|
||||
|
||||
See :class:`bpy.types.Material.ambient`.
|
||||
|
||||
:type: float
|
||||
|
||||
.. data:: GPU_DYNAMIC_MAT_ALPHA
|
||||
|
||||
See :class:`bpy.types.Material.alpha`.
|
||||
|
||||
:type: float
|
||||
|
||||
|
||||
|
||||
GLSL Attribute Type
|
||||
GLSL attribute type
|
||||
-------------------
|
||||
|
||||
.. _attribute-type:
|
||||
@@ -429,7 +291,9 @@ layer that contains the vertex attribute.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
mesh.uv_layers[attribute["name"]]
|
||||
mesh.uv_textures[attribute["name"]]
|
||||
|
||||
:value: 5
|
||||
|
||||
.. data:: CD_MCOL
|
||||
|
||||
@@ -442,6 +306,8 @@ layer that contains the vertex attribute.
|
||||
|
||||
mesh.vertex_colors[attribute["name"]]
|
||||
|
||||
:value: 6
|
||||
|
||||
.. data:: CD_ORCO
|
||||
|
||||
Vertex attribute is original coordinates. Data type is vector 3 float.
|
||||
@@ -453,6 +319,8 @@ layer that contains the vertex attribute.
|
||||
|
||||
mesh.vertices
|
||||
|
||||
:value: 14
|
||||
|
||||
.. data:: CD_TANGENT
|
||||
|
||||
Vertex attribute is the tangent vector. Data type is vector 4 float.
|
||||
@@ -462,6 +330,8 @@ layer that contains the vertex attribute.
|
||||
C function to compute the tangent layer from the other layers can be obtained from
|
||||
blender.org.
|
||||
|
||||
:value: 18
|
||||
|
||||
|
||||
Functions
|
||||
=========
|
||||
@@ -471,12 +341,8 @@ Functions
|
||||
.. function:: export_shader(scene,material)
|
||||
|
||||
Extracts the GLSL shader producing the visual effect of material in scene for the purpose of
|
||||
reusing the shader in an external engine.
|
||||
|
||||
This function is meant to be used in material exporter
|
||||
so that the GLSL shader can be exported entirely.
|
||||
|
||||
The return value is a dictionary containing the
|
||||
reusing the shader in an external engine. This function is meant to be used in material exporter
|
||||
so that the GLSL shader can be exported entirely. The return value is a dictionary containing the
|
||||
shader source code and all associated data.
|
||||
|
||||
:arg scene: the scene in which the material in rendered.
|
||||
@@ -488,91 +354,76 @@ Functions
|
||||
|
||||
The dictionary contains the following elements:
|
||||
|
||||
- ``["fragment"]``: string
|
||||
* ["fragment"] : string
|
||||
fragment shader source code.
|
||||
|
||||
- ``["vertex"]``: string
|
||||
* ["vertex"] : string
|
||||
vertex shader source code.
|
||||
|
||||
- ``["uniforms"]``: sequence
|
||||
* ["uniforms"] : sequence
|
||||
list of uniforms used in fragment shader, can be empty list. Each element of the
|
||||
sequence is a dictionary with the following elements:
|
||||
|
||||
- ``["varname"]``: string
|
||||
* ["varname"] : string
|
||||
name of the uniform in the fragment shader. Always of the form 'unf<number>'.
|
||||
|
||||
- ``["datatype"]``: integer
|
||||
* ["datatype"] : integer
|
||||
data type of the uniform variable. Can be one of the following:
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
* :data:`gpu.GPU_DATA_1I` : use glUniform1i
|
||||
* :data:`gpu.GPU_DATA_1F` : use glUniform1fv
|
||||
* :data:`gpu.GPU_DATA_2F` : use glUniform2fv
|
||||
* :data:`gpu.GPU_DATA_3F` : use glUniform3fv
|
||||
* :data:`gpu.GPU_DATA_4F` : use glUniform4fv
|
||||
* :data:`gpu.GPU_DATA_9F` : use glUniformMatrix3fv
|
||||
* :data:`gpu.GPU_DATA_16F` : use glUniformMatrix4fv
|
||||
|
||||
- :data:`gpu.GPU_DATA_1I` : use ``glUniform1i``
|
||||
- :data:`gpu.GPU_DATA_1F` : use ``glUniform1fv``
|
||||
- :data:`gpu.GPU_DATA_2F` : use ``glUniform2fv``
|
||||
- :data:`gpu.GPU_DATA_3F` : use ``glUniform3fv``
|
||||
- :data:`gpu.GPU_DATA_4F` : use ``glUniform4fv``
|
||||
- :data:`gpu.GPU_DATA_9F` : use ``glUniformMatrix3fv``
|
||||
- :data:`gpu.GPU_DATA_16F` : use ``glUniformMatrix4fv``
|
||||
|
||||
- ``["type"]``: integer
|
||||
* ["type"] : integer
|
||||
type of uniform, determines the origin and method of calculation. See uniform-type_.
|
||||
Depending on the type, more elements will be be present.
|
||||
|
||||
- ``["lamp"]``: :class:`bpy.types.Object`
|
||||
Reference to the lamp object from which the uniforms value are extracted.
|
||||
Set for the following uniforms types:
|
||||
* ["lamp"] : :class:`bpy.types.Object`
|
||||
Reference to the lamp object from which the uniforms value are extracted. Set for the following uniforms types:
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
:columns: 3
|
||||
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT`
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY`
|
||||
- :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
|
||||
- :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY`
|
||||
* :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
|
||||
* :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`
|
||||
|
||||
Notes:
|
||||
|
||||
- The uniforms
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`,
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`,
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` and
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
|
||||
refer to the lamp object position and orientation,
|
||||
both of can be derived from the object world matrix:
|
||||
* The uniforms :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`, :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`, :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` and :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT`
|
||||
refer to the lamp object position and orientation, both of can be derived from the object world matrix:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
obmat = uniform["lamp"].matrix_world
|
||||
|
||||
where obmat is the mat4_lamp_to_world_ matrix of the lamp as a 2 dimensional array,
|
||||
the lamp world location location is in ``obmat[3]``.
|
||||
the lamp world location location is in obmat[3].
|
||||
|
||||
- The uniform types
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` and
|
||||
:data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL`
|
||||
refer to the lamp data bloc that you get from:
|
||||
* The uniform types :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` and :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL` refer to the lamp data bloc that you get from:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
la = uniform["lamp"].data
|
||||
|
||||
from which you get ``lamp.energy`` and ``lamp.color``
|
||||
from which you get la.energy and la.color
|
||||
|
||||
- Lamp duplication is not supported: if you have duplicated lamps in your scene
|
||||
* Lamp duplication is not supported: if you have duplicated lamps in your scene
|
||||
(i.e. lamp that are instantiated by dupligroup, etc), this element will only
|
||||
give you a reference to the orignal lamp and you will not know which instance
|
||||
of the lamp it is refering too. You can still handle that case in the exporter
|
||||
by distributing the uniforms amongst the duplicated lamps.
|
||||
|
||||
- ``["image"]``: :class:`bpy.types.Image`
|
||||
Reference to the image databloc.
|
||||
Set for uniform type
|
||||
:data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE`.
|
||||
You can get the image data from:
|
||||
* ["image"] : :class:`bpy.types.Image`
|
||||
Reference to the image databloc. Set for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE`. You can get the image data from:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -581,63 +432,60 @@ Functions
|
||||
# image size as a 2-dimensional array of int
|
||||
uniform["image"].size
|
||||
|
||||
- ``["texnumber"]``: integer
|
||||
* ["texnumber"] : integer
|
||||
Channel number to which the texture is bound when drawing the object.
|
||||
Set for uniform types
|
||||
:data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`,
|
||||
:data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE` and
|
||||
:data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`.
|
||||
Set for uniform types :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`, :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE` and :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`.
|
||||
|
||||
This is provided for information only: when reusing the shader outside blencer,
|
||||
you are free to assign the textures to the channel of your choice and to pass
|
||||
that number channel to the GPU in the uniform.
|
||||
|
||||
- ``["texpixels"]``: byte array
|
||||
texture data for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`.
|
||||
Although the corresponding uniform is a 2D sampler,
|
||||
the texture is always a 1D texture of n x 1 pixel.
|
||||
The texture size n is provided in ["texsize"] element.
|
||||
* ["texpixels"] : byte array
|
||||
texture data for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`. Although
|
||||
the corresponding uniform is a 2D sampler, the texture is always a 1D texture
|
||||
of n x 1 pixel. The texture size n is provided in ["texsize"] element.
|
||||
These texture are only used for computer generated texture (colorband, etc).
|
||||
The texture data is provided so that you can make a real image out of it in the exporter.
|
||||
The texture data is provided so that you can make a real image out of it in the
|
||||
exporter.
|
||||
|
||||
- ``["texsize"]``: integer
|
||||
* ["texsize"] : integer
|
||||
horizontal size of texture for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`.
|
||||
The texture data is in ["texpixels"].
|
||||
|
||||
- ``["attributes"]``: sequence
|
||||
* ["attributes"] : sequence
|
||||
list of attributes used in vertex shader, can be empty. Blender doesn't use
|
||||
standard attributes except for vertex position and normal. All other vertex
|
||||
attributes must be passed using the generic ``glVertexAttrib`` functions.
|
||||
attributes must be passed using the generic glVertexAttrib functions.
|
||||
The attribute data can be found in the derived mesh custom data using RNA.
|
||||
Each element of the sequence is a dictionary containing the following elements:
|
||||
|
||||
- ``["varname"]``: string
|
||||
* ["varname"] : string
|
||||
name of the uniform in the vertex shader. Always of the form 'att<number>'.
|
||||
|
||||
- ``["datatype"]``: integer
|
||||
* ["datatype"] : integer
|
||||
data type of vertex attribute, can be one of the following:
|
||||
|
||||
- :data:`gpu.GPU_DATA_2F`: use ``glVertexAttrib2fv``
|
||||
- :data:`gpu.GPU_DATA_3F`: use ``glVertexAttrib3fv``
|
||||
- :data:`gpu.GPU_DATA_4F`: use ``glVertexAttrib4fv``
|
||||
- :data:`gpu.GPU_DATA_4UB`: use ``glVertexAttrib4ubv``
|
||||
* :data:`gpu.GPU_DATA_2F` : use glVertexAttrib2fv
|
||||
* :data:`gpu.GPU_DATA_3F` : use glVertexAttrib3fv
|
||||
* :data:`gpu.GPU_DATA_4F` : use glVertexAttrib4fv
|
||||
* :data:`gpu.GPU_DATA_4UB` : use glVertexAttrib4ubv
|
||||
|
||||
- ``["number"]``: integer
|
||||
Generic attribute number. This is provided for information only.
|
||||
Blender doesn't use ``glBindAttribLocation`` to place generic attributes at specific location,
|
||||
* ["number"] : integer
|
||||
generic attribute number. This is provided for information only. Blender
|
||||
doesn't use glBindAttribLocation to place generic attributes at specific location,
|
||||
it lets the shader compiler place the attributes automatically and query the
|
||||
placement with ``glGetAttribLocation``.
|
||||
The result of this placement is returned in this element.
|
||||
placement with glGetAttribLocation. The result of this placement is returned in
|
||||
this element.
|
||||
|
||||
When using this shader in a render engine, you should either use
|
||||
``glBindAttribLocation`` to force the attribute at this location or use
|
||||
``glGetAttribLocation`` to get the placement chosen by the compiler of your GPU.
|
||||
glBindAttribLocation to force the attribute at this location or use
|
||||
glGetAttribLocation to get the placement chosen by the compiler of your GPU.
|
||||
|
||||
- ``["type"]``: integer
|
||||
* ["type"] : integer
|
||||
type of the mesh custom data from which the vertex attribute is loaded.
|
||||
See attribute-type_.
|
||||
|
||||
- ``["name"]``: string or integer
|
||||
* ["name"] : string or integer
|
||||
custom data layer name, used for attribute type :data:`gpu.CD_MTFACE` and :data:`gpu.CD_MCOL`.
|
||||
|
||||
Example:
|
||||
@@ -664,14 +512,14 @@ Notes
|
||||
|
||||
.. _mat4_lamp_to_perspective:
|
||||
|
||||
#. Calculation of the ``mat4_lamp_to_perspective`` matrix for a spot lamp.
|
||||
1. Calculation of the *mat4_lamp_to_perspective* matrix for a spot lamp.
|
||||
|
||||
The following pseudo code shows how the ``mat4_lamp_to_perspective`` matrix is computed
|
||||
The following pseudo code shows how the *mat4_lamp_to_perspective* matrix is computed
|
||||
in blender for uniforms of :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT` type:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Get the lamp datablock with:
|
||||
#Get the lamp datablock with:
|
||||
lamp = bpy.data.objects[uniform["lamp"]].data
|
||||
|
||||
# Compute the projection matrix:
|
||||
@@ -683,11 +531,11 @@ Notes
|
||||
# The size of the projection plane is computed with the usual formula:
|
||||
wsize = lamp.clista * tan(lamp.spotsize/2)
|
||||
|
||||
# And the projection matrix:
|
||||
#And the projection matrix:
|
||||
mat4_lamp_to_perspective = glFrustum(-wsize, wsize, -wsize, wsize, lamp.clista, lamp.clipend)
|
||||
|
||||
#. Creation of the shadow map for a spot lamp.
|
||||
2. Creation of the shadow map for a spot lamp.
|
||||
|
||||
The shadow map is the depth buffer of a render performed by placing the camera at the
|
||||
spot light position. The size of the shadow map is given by the attribute ``lamp.bufsize``:
|
||||
spot light position. The size of the shadow map is given by the attribute lamp.bufsize :
|
||||
shadow map size in pixel, same size in both dimensions.
|
||||
|
@@ -2,8 +2,7 @@
|
||||
Gotchas
|
||||
*******
|
||||
|
||||
This document attempts to help you work with the Blender API in areas
|
||||
that can be troublesome and avoid practices that are known to give instability.
|
||||
This document attempts to help you work with the Blender API in areas that can be troublesome and avoid practices that are known to give instability.
|
||||
|
||||
|
||||
.. _using_operators:
|
||||
@@ -11,15 +10,16 @@ that can be troublesome and avoid practices that are known to give instability.
|
||||
Using Operators
|
||||
===============
|
||||
|
||||
Blender's operators are tools for users to access, that Python can access them too is very useful
|
||||
nevertheless operators have limitations that can make them cumbersome to script.
|
||||
Blender's operators are tools for users to access, that python can access them too is very useful nevertheless operators have limitations that can make them cumbersome to script.
|
||||
|
||||
Main limits are...
|
||||
|
||||
- Can't pass data such as objects, meshes or materials to operate on (operators use the context instead)
|
||||
- The return value from calling an operator gives the success (if it finished or was canceled),
|
||||
* Can't pass data such as objects, meshes or materials to operate on (operators use the context instead)
|
||||
|
||||
* The return value from calling an operator gives the success (if it finished or was canceled),
|
||||
in some cases it would be more logical from an API perspective to return the result of the operation.
|
||||
- Operators poll function can fail where an API function would raise an exception giving details on exactly why.
|
||||
|
||||
* Operators poll function can fail where an API function would raise an exception giving details on exactly why.
|
||||
|
||||
|
||||
Why does an operator's poll fail?
|
||||
@@ -32,28 +32,20 @@ When calling an operator gives an error like this:
|
||||
|
||||
Which raises the question as to what the correct context might be?
|
||||
|
||||
Typically operators check for the active area type, a selection or active object they can operate on,
|
||||
but some operators are more picky about when they run.
|
||||
Typically operators check for the active area type, a selection or active object they can operate on, but some operators are more picky about when they run.
|
||||
|
||||
In most cases you can figure out what context an operator needs
|
||||
simply be seeing how it's used in Blender and thinking about what it does.
|
||||
In most cases you can figure out what context an operator needs simply be seeing how it's used in Blender and thinking about what it does.
|
||||
|
||||
|
||||
Unfortunately if you're still stuck - the only way to **really** know
|
||||
whats going on is to read the source code for the poll function and see what its checking.
|
||||
Unfortunately if you're still stuck - the only way to **really** know whats going on is to read the source code for the poll function and see what its checking.
|
||||
|
||||
For Python operators it's not so hard to find the source
|
||||
since it's included with Blender and the source file/line is included in the operator reference docs.
|
||||
For python operators it's not so hard to find the source since it's included with Blender and the source file/line is included in the operator reference docs.
|
||||
|
||||
Downloading and searching the C code isn't so simple,
|
||||
especially if you're not familiar with the C language but by searching the
|
||||
operator name or description you should be able to find the poll function with no knowledge of C.
|
||||
Downloading and searching the C code isn't so simple, especially if you're not familiar with the C language but by searching the operator name or description you should be able to find the poll function with no knowledge of C.
|
||||
|
||||
.. note::
|
||||
|
||||
Blender does have the functionality for poll functions to describe why they fail,
|
||||
but its currently not used much, if you're interested to help improve our API
|
||||
feel free to add calls to ``CTX_wm_operator_poll_msg_set`` where its not obvious why poll fails.
|
||||
Blender does have the functionality for poll functions to describe why they fail, but its currently not used much, if you're interested to help improve our API feel free to add calls to ``CTX_wm_operator_poll_msg_set`` where its not obvious why poll fails.
|
||||
|
||||
>>> bpy.ops.gpencil.draw()
|
||||
RuntimeError: Operator bpy.ops.gpencil.draw.poll() Failed to find Grease Pencil data to draw into
|
||||
@@ -62,45 +54,36 @@ operator name or description you should be able to find the poll function with n
|
||||
The operator still doesn't work!
|
||||
--------------------------------
|
||||
|
||||
Certain operators in Blender are only intended for use in a specific context,
|
||||
some operators for example are only called from the properties window where they check the current material,
|
||||
modifier or constraint.
|
||||
Certain operators in Blender are only intended for use in a specific context, some operators for example are only called from the properties window where they check the current material, modifier or constraint.
|
||||
|
||||
Examples of this are:
|
||||
|
||||
- :mod:`bpy.ops.texture.slot_move`
|
||||
- :mod:`bpy.ops.constraint.limitdistance_reset`
|
||||
- :mod:`bpy.ops.object.modifier_copy`
|
||||
- :mod:`bpy.ops.buttons.file_browse`
|
||||
* :mod:`bpy.ops.texture.slot_move`
|
||||
* :mod:`bpy.ops.constraint.limitdistance_reset`
|
||||
* :mod:`bpy.ops.object.modifier_copy`
|
||||
* :mod:`bpy.ops.buttons.file_browse`
|
||||
|
||||
Another possibility is that you are the first person to attempt to use this operator
|
||||
in a script and some modifications need to be made to the operator to run in a different context,
|
||||
if the operator should logically be able to run but fails when accessed from a script
|
||||
it should be reported to the bug tracker.
|
||||
Another possibility is that you are the first person to attempt to use this operator in a script and some modifications need to be made to the operator to run in a different context, if the operator should logically be able to run but fails when accessed from a script it should be reported to the bug tracker.
|
||||
|
||||
|
||||
Stale Data
|
||||
==========
|
||||
|
||||
|
||||
No updates after setting values
|
||||
-------------------------------
|
||||
|
||||
Sometimes you want to modify values from Python and immediately access the updated values, eg:
|
||||
Sometimes you want to modify values from python and immediately access the updated values, eg:
|
||||
|
||||
Once changing the objects :class:`bpy.types.Object.location`
|
||||
you may want to access its transformation right after from :class:`bpy.types.Object.matrix_world`,
|
||||
but this doesn't work as you might expect.
|
||||
Once changing the objects :class:`bpy.types.Object.location` you may want to access its transformation right after from :class:`bpy.types.Object.matrix_world`, but this doesn't work as you might expect.
|
||||
|
||||
Consider the calculations that might go into working out the object's final transformation, this includes:
|
||||
|
||||
- animation function curves.
|
||||
- drivers and their Python expressions.
|
||||
- constraints
|
||||
- parent objects and all of their f-curves, constraints etc.
|
||||
* animation function curves.
|
||||
* drivers and their pythons expressions.
|
||||
* constraints
|
||||
* parent objects and all of their f-curves, constraints etc.
|
||||
|
||||
To avoid expensive recalculations every time a property is modified,
|
||||
Blender defers making the actual calculations until they are needed.
|
||||
To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
|
||||
|
||||
However, while the script runs you may want to access the updated values.
|
||||
In this case you need to call :class:`bpy.types.Scene.update` after modifying values, for example:
|
||||
@@ -111,9 +94,7 @@ In this case you need to call :class:`bpy.types.Scene.update` after modifying va
|
||||
bpy.context.scene.update()
|
||||
|
||||
|
||||
Now all dependent data (child objects, modifiers, drivers... etc)
|
||||
has been recalculated and is available to the script.
|
||||
|
||||
Now all dependent data (child objects, modifiers, drivers... etc) has been recalculated and is available to the script.
|
||||
|
||||
Can I redraw during the script?
|
||||
-------------------------------
|
||||
@@ -122,33 +103,23 @@ The official answer to this is no, or... *"You don't want to do that"*.
|
||||
|
||||
To give some background on the topic...
|
||||
|
||||
While a script executes Blender waits for it to finish and is effectively locked until its done,
|
||||
while in this state Blender won't redraw or respond to user input.
|
||||
Normally this is not such a problem because scripts distributed with Blender
|
||||
tend not to run for an extended period of time,
|
||||
nevertheless scripts *can* take ages to execute and its nice to see whats going on in the view port.
|
||||
While a script executes Blender waits for it to finish and is effectively locked until its done, while in this state Blender won't redraw or respond to user input.
|
||||
Normally this is not such a problem because scripts distributed with Blender tend not to run for an extended period of time, nevertheless scripts *can* take ages to execute and its nice to see whats going on in the view port.
|
||||
|
||||
Tools that lock Blender in a loop and redraw are highly discouraged
|
||||
since they conflict with Blenders ability to run multiple operators
|
||||
at once and update different parts of the interface as the tool runs.
|
||||
Tools that lock Blender in a loop and redraw are highly discouraged since they conflict with Blenders ability to run multiple operators at once and update different parts of the interface as the tool runs.
|
||||
|
||||
So the solution here is to write a **modal** operator, that is - an operator which defines a modal() function,
|
||||
See the modal operator template in the text editor.
|
||||
So the solution here is to write a **modal** operator, that is - an operator which defines a modal() function, See the modal operator template in the text editor.
|
||||
|
||||
Modal operators execute on user input or setup their own timers to run frequently,
|
||||
they can handle the events or pass through to be handled by the keymap or other modal operators.
|
||||
Modal operators execute on user input or setup their own timers to run frequently, they can handle the events or pass through to be handled by the keymap or other modal operators.
|
||||
|
||||
Transform, Painting, Fly-Mode and File-Select are example of a modal operators.
|
||||
|
||||
Writing modal operators takes more effort than a simple ``for`` loop
|
||||
that happens to redraw but is more flexible and integrates better with Blenders design.
|
||||
Writing modal operators takes more effort than a simple ``for`` loop that happens to redraw but is more flexible and integrates better with Blenders design.
|
||||
|
||||
|
||||
**Ok, Ok! I still want to draw from Python**
|
||||
**Ok, Ok! I still want to draw from python**
|
||||
|
||||
If you insist - yes its possible, but scripts that use this hack wont be considered
|
||||
for inclusion in Blender and any issues with using it wont be considered bugs,
|
||||
this is also not guaranteed to work in future releases.
|
||||
If you insist - yes its possible, but scripts that use this hack wont be considered for inclusion in Blender and any issues with using it wont be considered bugs, this is also not guaranteed to work in future releases.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -158,18 +129,16 @@ this is also not guaranteed to work in future releases.
|
||||
Modes and Mesh Access
|
||||
=====================
|
||||
|
||||
When working with mesh data you may run into the problem where a script fails to run as expected in edit-mode.
|
||||
This is caused by edit-mode having its own data which is only written back to the mesh when exiting edit-mode.
|
||||
When working with mesh data you may run into the problem where a script fails to run as expected in edit-mode. This is caused by edit-mode having its own data which is only written back to the mesh when exiting edit-mode.
|
||||
|
||||
A common example is that exporters may access a mesh through ``obj.data`` (a :class:`bpy.types.Mesh`)
|
||||
but the user is in edit-mode, where the mesh data is available but out of sync with the edit mesh.
|
||||
A common example is that exporters may access a mesh through ``obj.data`` (a :class:`bpy.types.Mesh`) but the user is in edit-mode, where the mesh data is available but out of sync with the edit mesh.
|
||||
|
||||
In this situation you can...
|
||||
|
||||
- Exit edit-mode before running the tool.
|
||||
- Explicitly update the mesh by calling :class:`bmesh.types.BMesh.to_mesh`.
|
||||
- Modify the script to support working on the edit-mode data directly, see: :mod:`bmesh.from_edit_mesh`.
|
||||
- Report the context as incorrect and only allow the script to run outside edit-mode.
|
||||
* Exit edit-mode before running the tool.
|
||||
* Explicitly update the mesh by calling :class:`bmesh.types.BMesh.to_mesh`.
|
||||
* Modify the script to support working on the edit-mode data directly, see: :mod:`bmesh.from_edit_mesh`.
|
||||
* Report the context as incorrect and only allow the script to run outside edit-mode.
|
||||
|
||||
|
||||
.. _info_gotcha_mesh_faces:
|
||||
@@ -177,55 +146,35 @@ In this situation you can...
|
||||
NGons and Tessellation Faces
|
||||
============================
|
||||
|
||||
Since 2.63 NGons are supported, this adds some complexity
|
||||
since in some cases you need to access triangles/quads still (some exporters for example).
|
||||
Since 2.63 NGons are supported, this adds some complexity since in some cases you need to access triangles/quads still (some exporters for example).
|
||||
|
||||
There are now 3 ways to access faces:
|
||||
|
||||
- :class:`bpy.types.MeshPolygon` -
|
||||
this is the data structure which now stores faces in object mode
|
||||
(access as ``mesh.polygons`` rather than ``mesh.faces``).
|
||||
- :class:`bpy.types.MeshTessFace` -
|
||||
the result of triangulating (tessellated) polygons,
|
||||
the main method of face access in 2.62 or older (access as ``mesh.tessfaces``).
|
||||
- :class:`bmesh.types.BMFace` -
|
||||
the polygons as used in editmode.
|
||||
* :class:`bpy.types.MeshPolygon` - this is the data structure which now stores faces in object mode (access as ``mesh.polygons`` rather then ``mesh.faces``).
|
||||
* :class:`bpy.types.MeshTessFace` - the result of triangulating (tessellated) polygons, the main method of face access in 2.62 or older (access as ``mesh.tessfaces``).
|
||||
* :class:`bmesh.types.BMFace` - the polygons as used in editmode.
|
||||
|
||||
For the purpose of the following documentation,
|
||||
these will be referred to as polygons, tessfaces and bmesh-faces respectively.
|
||||
For the purpose of the following documentation, these will be referred to as polygons, tessfaces and bmesh-faces respectively.
|
||||
|
||||
5+ sided faces will be referred to as ``ngons``.
|
||||
|
||||
|
||||
Support Overview
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:stub-columns: 1
|
||||
+--------------+------------------------------+--------------------------------+--------------------------------+
|
||||
|Usage |:class:`bpy.types.MeshPolygon`|:class:`bpy.types.MeshTessFace` |:class:`bmesh.types.BMFace` |
|
||||
+==============+==============================+================================+================================+
|
||||
|Import/Create |Bad (inflexible) |Fine (supported as upgrade path)|Best |
|
||||
+--------------+------------------------------+--------------------------------+--------------------------------+
|
||||
|Manipulate |Bad (inflexible) |Bad (loses ngons) |Best |
|
||||
+--------------+------------------------------+--------------------------------+--------------------------------+
|
||||
|Export/Output |Good (ngons) |Good (When ngons can't be used) |Good (ngons, memory overhead) |
|
||||
+--------------+------------------------------+--------------------------------+--------------------------------+
|
||||
|
||||
* - Usage
|
||||
- :class:`bpy.types.MeshPolygon`
|
||||
- :class:`bpy.types.MeshTessFace`
|
||||
- :class:`bmesh.types.BMFace`
|
||||
* - Import/Create
|
||||
- Poor *(inflexible)*
|
||||
- Good *(supported as upgrade path)*
|
||||
- Best
|
||||
* - Manipulate
|
||||
- Poor *(inflexible)*
|
||||
- Poor *(loses ngons)*
|
||||
- Best
|
||||
* - Export/Output
|
||||
- Good *(ngon support)*
|
||||
- Good *(When ngons can't be used)*
|
||||
- Good *(ngons, extra memory overhead)*
|
||||
|
||||
.. note::
|
||||
|
||||
Using the :mod:`bmesh` api is completely separate api from :mod:`bpy`,
|
||||
typically you would would use one or the other based on the level of editing needed,
|
||||
not simply for a different way to access faces.
|
||||
Using the :mod:`bmesh` api is completely separate api from :mod:`bpy`, typically you would would use one or the other based on the level of editing needed, not simply for a different way to access faces.
|
||||
|
||||
|
||||
Creating
|
||||
@@ -233,18 +182,9 @@ Creating
|
||||
|
||||
All 3 datatypes can be used for face creation.
|
||||
|
||||
- polygons are the most efficient way to create faces but the data structure is _very_ rigid and inflexible,
|
||||
you must have all your vertes and faces ready and create them all at once.
|
||||
This is further complicated by the fact that each polygon does not store its own verts (as with tessfaces),
|
||||
rather they reference an index and size in :class:`bpy.types.Mesh.loops` which are a fixed array too.
|
||||
- tessfaces ideally should not be used for creating faces since they are really only tessellation cache of polygons,
|
||||
however for scripts upgrading from 2.62 this is by far the most straightforward option.
|
||||
This works by creating tessfaces and when finished -
|
||||
they can be converted into polygons by calling :class:`bpy.types.Mesh.update`.
|
||||
The obvious limitation is ngons can't be created this way.
|
||||
- bmesh-faces are most likely the easiest way for new scripts to create faces,
|
||||
since faces can be added one by one and the api has features intended for mesh manipulation.
|
||||
While :class:`bmesh.types.BMesh` uses more memory it can be managed by only operating on one mesh at a time.
|
||||
* polygons are the most efficient way to create faces but the data structure is _very_ rigid and inflexible, you must have all your vertes and faces ready and create them all at once. This is further complicated by the fact that each polygon does not store its own verts (as with tessfaces), rather they reference an index and size in :class:`bpy.types.Mesh.loops` which are a fixed array too.
|
||||
* tessfaces ideally should not be used for creating faces since they are really only tessellation cache of polygons, however for scripts upgrading from 2.62 this is by far the most straightforward option. This works by creating tessfaces and when finished - they can be converted into polygons by calling :class:`bpy.types.Mesh.update`. The obvious limitation is ngons can't be created this way.
|
||||
* bmesh-faces are most likely the easiest way for new scripts to create faces, since faces can be added one by one and the api has features intended for mesh manipulation. While :class:`bmesh.types.BMesh` uses more memory it can be managed by only operating on one mesh at a time.
|
||||
|
||||
|
||||
Editing
|
||||
@@ -252,24 +192,18 @@ Editing
|
||||
|
||||
Editing is where the 3 data types vary most.
|
||||
|
||||
- Polygons are very limited for editing,
|
||||
changing materials and options like smooth works but for anything else
|
||||
they are too inflexible and are only intended for storage.
|
||||
- Tessfaces should not be used for editing geometry because doing so will cause existing ngons to be tessellated.
|
||||
- BMesh-Faces are by far the best way to manipulate geometry.
|
||||
|
||||
* polygons are very limited for editing, changing materials and options like smooth works but for anything else they are too inflexible and are only intended for storage.
|
||||
* tessfaces should not be used for editing geometry because doing so will cause existing ngons to be tessellated.
|
||||
* bmesh-faces are by far the best way to manipulate geometry.
|
||||
|
||||
Exporting
|
||||
---------
|
||||
|
||||
All 3 data types can be used for exporting,
|
||||
the choice mostly depends on whether the target format supports ngons or not.
|
||||
All 3 data types can be used for exporting, the choice mostly depends on whether the target format supports ngons or not.
|
||||
|
||||
- Polygons are the most direct & efficient way to export providing they convert into the output format easily enough.
|
||||
- Tessfaces work well for exporting to formats which dont support ngons,
|
||||
in fact this is the only place where their use is encouraged.
|
||||
- BMesh-Faces can work for exporting too but may not be necessary if polygons can be used
|
||||
since using bmesh gives some overhead because its not the native storage format in object mode.
|
||||
* polygons are the most direct & efficient way to export providing they convert into the output format easily enough.
|
||||
* tessfaces work well for exporting to formats which dont support ngons, in fact this is the only place where their use is encouraged.
|
||||
* bmesh-faces can work for exporting too but may not be necessary if polygons can be used since using bmesh gives some overhead because its not the native storage format in object mode.
|
||||
|
||||
|
||||
Upgrading Importers from 2.62
|
||||
@@ -279,9 +213,9 @@ Importers can be upgraded to work with only minor changes.
|
||||
|
||||
The main change to be made is used the tessellation versions of each attribute.
|
||||
|
||||
- mesh.faces --> :class:`bpy.types.Mesh.tessfaces`
|
||||
- mesh.uv_textures --> :class:`bpy.types.Mesh.tessface_uv_textures`
|
||||
- mesh.vertex_colors --> :class:`bpy.types.Mesh.tessface_vertex_colors`
|
||||
* mesh.faces --> :class:`bpy.types.Mesh.tessfaces`
|
||||
* mesh.uv_textures --> :class:`bpy.types.Mesh.tessface_uv_textures`
|
||||
* mesh.vertex_colors --> :class:`bpy.types.Mesh.tessface_vertex_colors`
|
||||
|
||||
Once the data is created call :class:`bpy.types.Mesh.update` to convert the tessfaces into polygons.
|
||||
|
||||
@@ -289,9 +223,7 @@ Once the data is created call :class:`bpy.types.Mesh.update` to convert the tess
|
||||
Upgrading Exporters from 2.62
|
||||
-----------------------------
|
||||
|
||||
For exporters the most direct way to upgrade is to use tessfaces as with importing
|
||||
however its important to know that tessfaces may **not** exist for a mesh,
|
||||
the array will be empty as if there are no faces.
|
||||
For exporters the most direct way to upgrade is to use tessfaces as with importing however its important to know that tessfaces may **not** exist for a mesh, the array will be empty as if there are no faces.
|
||||
|
||||
So before accessing tessface data call: :class:`bpy.types.Mesh.update` ``(calc_tessface=True)``.
|
||||
|
||||
@@ -299,8 +231,7 @@ So before accessing tessface data call: :class:`bpy.types.Mesh.update` ``(calc_t
|
||||
EditBones, PoseBones, Bone... Bones
|
||||
===================================
|
||||
|
||||
Armature Bones in Blender have three distinct data structures that contain them.
|
||||
If you are accessing the bones through one of them, you may not have access to the properties you really need.
|
||||
Armature Bones in Blender have three distinct data structures that contain them. If you are accessing the bones through one of them, you may not have access to the properties you really need.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -310,9 +241,7 @@ If you are accessing the bones through one of them, you may not have access to t
|
||||
Edit Bones
|
||||
----------
|
||||
|
||||
``bpy.context.object.data.edit_bones`` contains a editbones;
|
||||
to access them you must set the armature mode to edit mode first (editbones do not exist in object or pose mode).
|
||||
Use these to create new bones, set their head/tail or roll, change their parenting relationships to other bones, etc.
|
||||
``bpy.context.object.data.edit_bones`` contains a editbones; to access them you must set the armature mode to edit mode first (editbones do not exist in object or pose mode). Use these to create new bones, set their head/tail or roll, change their parenting relationships to other bones, etc.
|
||||
|
||||
Example using :class:`bpy.types.EditBone` in armature editmode:
|
||||
|
||||
@@ -332,9 +261,7 @@ Returns an editbone only in edit mode.
|
||||
Bones (Object Mode)
|
||||
-------------------
|
||||
|
||||
``bpy.context.object.data.bones`` contains bones.
|
||||
These *live* in object mode, and have various properties you can change,
|
||||
note that the head and tail properties are read-only.
|
||||
``bpy.context.object.data.bones`` contains bones. These *live* in object mode, and have various properties you can change, note that the head and tail properties are read-only.
|
||||
|
||||
Example using :class:`bpy.types.Bone` in object or pose mode:
|
||||
|
||||
@@ -354,9 +281,7 @@ Accessible but read-only
|
||||
Pose Bones
|
||||
----------
|
||||
|
||||
``bpy.context.object.pose.bones`` contains pose bones.
|
||||
This is where animation data resides, i.e. animatable transformations
|
||||
are applied to pose bones, as are constraints and ik-settings.
|
||||
``bpy.context.object.pose.bones`` contains pose bones. This is where animation data resides, i.e. animatable transformations are applied to pose bones, as are constraints and ik-settings.
|
||||
|
||||
Examples using :class:`bpy.types.PoseBone` in object or pose mode:
|
||||
|
||||
@@ -371,27 +296,19 @@ Examples using :class:`bpy.types.PoseBone` in object or pose mode:
|
||||
|
||||
.. note::
|
||||
|
||||
Notice the pose is accessed from the object rather than the object data,
|
||||
this is why blender can have 2 or more objects sharing the same armature in different poses.
|
||||
Notice the pose is accessed from the object rather than the object data, this is why blender can have 2 or more objects sharing the same armature in different poses.
|
||||
|
||||
.. note::
|
||||
|
||||
Strictly speaking PoseBone's are not bones, they are just the state of the armature,
|
||||
stored in the :class:`bpy.types.Object` rather than the :class:`bpy.types.Armature`,
|
||||
the real bones are however accessible from the pose bones - :class:`bpy.types.PoseBone.bone`
|
||||
Strictly speaking PoseBone's are not bones, they are just the state of the armature, stored in the :class:`bpy.types.Object` rather than the :class:`bpy.types.Armature`, the real bones are however accessible from the pose bones - :class:`bpy.types.PoseBone.bone`
|
||||
|
||||
|
||||
Armature Mode Switching
|
||||
-----------------------
|
||||
|
||||
While writing scripts that deal with armatures you may find you have to switch between modes,
|
||||
when doing so take care when switching out of edit-mode not to keep references
|
||||
to the edit-bones or their head/tail vectors.
|
||||
Further access to these will crash blender so its important the script
|
||||
clearly separates sections of the code which operate in different modes.
|
||||
While writing scripts that deal with armatures you may find you have to switch between modes, when doing so take care when switching out of editmode not to keep references to the edit-bones or their head/tail vectors. Further access to these will crash blender so its important the script clearly separates sections of the code which operate in different modes.
|
||||
|
||||
This is mainly an issue with editmode since pose data can be manipulated without having to be in pose mode,
|
||||
however for operator access you may still need to enter pose mode.
|
||||
This is mainly an issue with editmode since pose data can be manipulated without having to be in pose mode, however for operator access you may still need to enter pose mode.
|
||||
|
||||
|
||||
Data Names
|
||||
@@ -426,13 +343,10 @@ Or with name assignment...
|
||||
Data names may not match the assigned values if they exceed the maximum length, are already used or an empty string.
|
||||
|
||||
|
||||
Its better practice not to reference objects by names at all,
|
||||
once created you can store the data in a list, dictionary, on a class etc,
|
||||
there is rarely a reason to have to keep searching for the same data by name.
|
||||
Its better practice not to reference objects by names at all, once created you can store the data in a list, dictionary, on a class etc, there is rarely a reason to have to keep searching for the same data by name.
|
||||
|
||||
If you do need to use name references, its best to use a dictionary to maintain
|
||||
a mapping between the names of the imported assets and the newly created data,
|
||||
this way you don't run this risk of referencing existing data from the blend file, or worse modifying it.
|
||||
|
||||
If you do need to use name references, its best to use a dictionary to maintain a mapping between the names of the imported assets and the newly created data, this way you don't run this risk of referencing existing data from the blend file, or worse modifying it.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -444,22 +358,18 @@ this way you don't run this risk of referencing existing data from the blend fil
|
||||
|
||||
# normally some code, or function calls...
|
||||
|
||||
# use own dictionary rather than bpy.data
|
||||
# use own dictionary rather then bpy.data
|
||||
mesh = mesh_name_mapping[meshid]
|
||||
|
||||
|
||||
Library Collisions
|
||||
------------------
|
||||
|
||||
Blender keeps data names unique - :class:`bpy.types.ID.name` so you can't name two objects,
|
||||
meshes, scenes etc the same thing by accident.
|
||||
Blender keeps data names unique - :class:`bpy.types.ID.name` so you can't name two objects, meshes, scenes etc the same thing by accident.
|
||||
|
||||
However when linking in library data from another blend file naming collisions can occur,
|
||||
so its best to avoid referencing data by name at all.
|
||||
However when linking in library data from another blend file naming collisions can occur, so its best to avoid referencing data by name at all.
|
||||
|
||||
This can be tricky at times and not even blender handles this correctly in some case
|
||||
(when selecting the modifier object for eg you can't select between multiple objects with the same name),
|
||||
but its still good to try avoid problems in this area.
|
||||
This can be tricky at times and not even blender handles this correctly in some case (when selecting the modifier object for eg you can't select between multiple objects with the same name), but its still good to try avoid problems in this area.
|
||||
|
||||
|
||||
If you need to select between local and library data, there is a feature in ``bpy.data`` members to allow for this.
|
||||
@@ -484,23 +394,21 @@ If you need to select between local and library data, there is a feature in ``bp
|
||||
Relative File Paths
|
||||
===================
|
||||
|
||||
Blenders relative file paths are not compatible with standard Python modules such as ``sys`` and ``os``.
|
||||
Blenders relative file paths are not compatible with standard python modules such as ``sys`` and ``os``.
|
||||
|
||||
Built in Python functions don't understand blenders ``//`` prefix which denotes the blend file path.
|
||||
Built in python functions don't understand blenders ``//`` prefix which denotes the blend file path.
|
||||
|
||||
A common case where you would run into this problem is when exporting a material with associated image paths.
|
||||
|
||||
>>> bpy.path.abspath(image.filepath)
|
||||
>>> bpy.path.abspath(image.filepath)
|
||||
|
||||
|
||||
When using blender data from linked libraries there is an unfortunate complication
|
||||
since the path will be relative to the library rather than the open blend file.
|
||||
When the data block may be from an external blend file pass the library argument from the :class:`bpy.types.ID`.
|
||||
When using blender data from linked libraries there is an unfortunate complication since the path will be relative to the library rather then the open blend file. When the data block may be from an external blend file pass the library argument from the :class:`bpy.types.ID`.
|
||||
|
||||
>>> bpy.path.abspath(image.filepath, library=image.library)
|
||||
>>> bpy.path.abspath(image.filepath, library=image.library)
|
||||
|
||||
|
||||
These returns the absolute path which can be used with native Python modules.
|
||||
These returns the absolute path which can be used with native python modules.
|
||||
|
||||
|
||||
Unicode Problems
|
||||
@@ -541,28 +449,23 @@ Here are 2 ways around filesystem encoding issues:
|
||||
>>> bpy.context.object.name = filepath_utf8
|
||||
|
||||
|
||||
Unicode encoding/decoding is a big topic with comprehensive Python documentation,
|
||||
to avoid getting stuck too deep in encoding problems - here are some suggestions:
|
||||
Unicode encoding/decoding is a big topic with comprehensive python documentation, to avoid getting stuck too deep in encoding problems - here are some suggestions:
|
||||
|
||||
- Always use utf-8 encoding or convert to utf-8 where the input is unknown.
|
||||
- Avoid manipulating filepaths as strings directly, use ``os.path`` functions instead.
|
||||
- Use ``os.fsencode()`` / ``os.fsdecode()`` instead of built in string decoding functions when operating on paths.
|
||||
- To print paths or to include them in the user interface use ``repr(path)`` first
|
||||
or ``"%r" % path`` with string formatting.
|
||||
* Always use utf-8 encoiding or convert to utf-8 where the input is unknown.
|
||||
|
||||
.. note::
|
||||
* Avoid manipulating filepaths as strings directly, use ``os.path`` functions instead.
|
||||
|
||||
Sometimes it's preferrable to avoid string encoding issues by using bytes instead of Python strings,
|
||||
when reading some input its less trouble to read it as binary data
|
||||
though you will still need to decide how to treat any strings you want to use with Blender,
|
||||
some importers do this.
|
||||
* Use ``os.fsencode()`` / ``os.fsdecode()`` rather then the built in string decoding functions when operating on paths.
|
||||
|
||||
* To print paths or to include them in the user interface use ``repr(path)`` first or ``"%r" % path`` with string formatting.
|
||||
|
||||
* **Possibly** - use bytes instead of python strings, when reading some input its less trouble to read it as binary data though you will still need to decide how to treat any strings you want to use with Blender, some importers do this.
|
||||
|
||||
|
||||
Strange errors using 'threading' module
|
||||
=======================================
|
||||
|
||||
Python threading with Blender only works properly when the threads finish up before the script does.
|
||||
By using ``threading.join()`` for example.
|
||||
Python threading with Blender only works properly when the threads finish up before the script does. By using ``threading.join()`` for example.
|
||||
|
||||
Heres an example of threading supported by Blender:
|
||||
|
||||
@@ -601,8 +504,7 @@ Heres an example of threading supported by Blender:
|
||||
t.join()
|
||||
|
||||
|
||||
This an example of a timer which runs many times a second and moves
|
||||
the default cube continuously while Blender runs **(Unsupported)**.
|
||||
This an example of a timer which runs many times a second and moves the default cube continuously while Blender runs **(Unsupported)**.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -619,48 +521,38 @@ the default cube continuously while Blender runs **(Unsupported)**.
|
||||
|
||||
my_timer()
|
||||
|
||||
Use cases like the one above which leave the thread running once the script finishes
|
||||
may seem to work for a while but end up causing random crashes or errors in Blender's own drawing code.
|
||||
Use cases like the one above which leave the thread running once the script finishes may seem to work for a while but end up causing random crashes or errors in Blender's own drawing code.
|
||||
|
||||
So far, no work has gone into making Blender's Python integration thread safe,
|
||||
so until its properly supported, best not make use of this.
|
||||
So far, no work has gone into making Blender's python integration thread safe, so until its properly supported, best not make use of this.
|
||||
|
||||
.. note::
|
||||
|
||||
Pythons threads only allow co-currency and won't speed up your scripts on multi-processor systems,
|
||||
the ``subprocess`` and ``multiprocess`` modules can be used with Blender and make use of multiple CPU's too.
|
||||
Pythons threads only allow co-currency and won't speed up your scripts on multi-processor systems, the ``subprocess`` and ``multiprocess`` modules can be used with Blender and make use of multiple CPU's too.
|
||||
|
||||
|
||||
Help! My script crashes Blender
|
||||
===============================
|
||||
|
||||
Ideally it would be impossible to crash Blender from Python
|
||||
however there are some problems with the API where it can be made to crash.
|
||||
Ideally it would be impossible to crash Blender from python however there are some problems with the API where it can be made to crash.
|
||||
|
||||
Strictly speaking this is a bug in the API but fixing it would mean adding memory verification
|
||||
on every access since most crashes are caused by the Python objects referencing Blenders memory directly,
|
||||
whenever the memory is freed, further Python access to it can crash the script.
|
||||
But fixing this would make the scripts run very slow,
|
||||
or writing a very different kind of API which doesn't reference the memory directly.
|
||||
Strictly speaking this is a bug in the API but fixing it would mean adding memory verification on every access since most crashes are caused by the python objects referencing Blenders memory directly, whenever the memory is freed, further python access to it can crash the script. But fixing this would make the scripts run very slow, or writing a very different kind of API which doesn't reference the memory directly.
|
||||
|
||||
Here are some general hints to avoid running into these problems.
|
||||
|
||||
- Be aware of memory limits,
|
||||
especially when working with large lists since Blender can crash simply by running out of memory.
|
||||
- Many hard to fix crashes end up being because of referencing freed data,
|
||||
when removing data be sure not to hold any references to it.
|
||||
- Modules or classes that remain active while Blender is used,
|
||||
should not hold references to data the user may remove, instead,
|
||||
fetch data from the context each time the script is activated.
|
||||
- Crashes may not happen every time, they may happen more on some configurations/operating-systems.
|
||||
* Be aware of memory limits, especially when working with large lists since Blender can crash simply by running out of memory.
|
||||
|
||||
* Many hard to fix crashes end up being because of referencing freed data, when removing data be sure not to hold any references to it.
|
||||
|
||||
* Modules or classes that remain active while Blender is used, should not hold references to data the user may remove, instead, fetch data from the context each time the script is activated.
|
||||
|
||||
* Crashes may not happen every time, they may happen more on some configurations/operating-systems.
|
||||
|
||||
.. note::
|
||||
|
||||
To find the line of your script that crashes you can use the ``faulthandler`` module.
|
||||
See `faulthandler docs <http://docs.python.org/dev/library/faulthandler.html>`_.
|
||||
|
||||
While the crash may be in Blenders C/C++ code,
|
||||
this can help a lot to track down the area of the script that causes the crash.
|
||||
While the crash may be in Blenders C/C++ code, this can help a lot to track down the area of the script that causes the crash.
|
||||
|
||||
|
||||
Undo/Redo
|
||||
@@ -680,36 +572,28 @@ This example shows how you can tell undo changes the memory locations.
|
||||
>>> hash(bpy.context.object)
|
||||
-9223372036849951740
|
||||
|
||||
As suggested above, simply not holding references to data when Blender is used
|
||||
interactively by the user is the only way to ensure the script doesn't become unstable.
|
||||
As suggested above, simply not holding references to data when Blender is used interactively by the user is the only way to ensure the script doesn't become unstable.
|
||||
|
||||
|
||||
Undo & Library Data
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
One of the advantages with Blenders library linking system that undo
|
||||
can skip checking changes in library data since it is assumed to be static.
|
||||
One of the advantages with Blenders library linking system that undo can skip checking changes in library data since it is assumed to be static.
|
||||
|
||||
Tools in Blender are not allowed to modify library data.
|
||||
|
||||
Python however does not enforce this restriction.
|
||||
|
||||
This can be useful in some cases, using a script to adjust material values for example.
|
||||
But its also possible to use a script to make library data point to newly created local data,
|
||||
which is not supported since a call to undo will remove the local data
|
||||
but leave the library referencing it and likely crash.
|
||||
But its also possible to use a script to make library data point to newly created local data, which is not supported since a call to undo will remove the local data but leave the library referencing it and likely crash.
|
||||
|
||||
So it's best to consider modifying library data an advanced usage of the API
|
||||
and only to use it when you know what you're doing.
|
||||
So it's best to consider modifying library data an advanced usage of the API and only to use it when you know what you're doing.
|
||||
|
||||
|
||||
Edit Mode / Memory Access
|
||||
-------------------------
|
||||
|
||||
Switching edit-mode ``bpy.ops.object.mode_set(mode='EDIT')`` / ``bpy.ops.object.mode_set(mode='OBJECT')``
|
||||
will re-allocate objects data,
|
||||
any references to a meshes vertices/polygons/uvs, armatures bones,
|
||||
curves points etc cannot be accessed after switching edit-mode.
|
||||
Switching edit-mode ``bpy.ops.object.mode_set(mode='EDIT')`` / ``bpy.ops.object.mode_set(mode='OBJECT')`` will re-allocate objects data, any references to a meshes vertices/polygons/uvs, armatures bones, curves points etc cannot be accessed after switching edit-mode.
|
||||
|
||||
Only the reference to the data its self can be re-accessed, the following example will crash.
|
||||
|
||||
@@ -724,8 +608,7 @@ Only the reference to the data its self can be re-accessed, the following exampl
|
||||
print(polygons)
|
||||
|
||||
|
||||
So after switching edit-mode you need to re-access any object data variables,
|
||||
the following example shows how to avoid the crash above.
|
||||
So after switching edit-mode you need to re-access any object data variables, the following example shows how to avoid the crash above.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -739,15 +622,13 @@ the following example shows how to avoid the crash above.
|
||||
print(polygons)
|
||||
|
||||
|
||||
These kinds of problems can happen for any functions which re-allocate
|
||||
the object data but are most common when switching edit-mode.
|
||||
These kinds of problems can happen for any functions which re-allocate the object data but are most common when switching edit-mode.
|
||||
|
||||
|
||||
Array Re-Allocation
|
||||
-------------------
|
||||
|
||||
When adding new points to a curve or vertices's/edges/polygons to a mesh,
|
||||
internally the array which stores this data is re-allocated.
|
||||
When adding new points to a curve or vertices's/edges/polygons to a mesh, internally the array which stores this data is re-allocated.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -758,20 +639,15 @@ internally the array which stores this data is re-allocated.
|
||||
# this will crash!
|
||||
point.co = 1.0, 2.0, 3.0
|
||||
|
||||
This can be avoided by re-assigning the point variables after adding the new one or by storing
|
||||
indices's to the points rather than the points themselves.
|
||||
This can be avoided by re-assigning the point variables after adding the new one or by storing indices's to the points rather then the points themselves.
|
||||
|
||||
The best way is to sidestep the problem altogether add all the points to the curve at once.
|
||||
This means you don't have to worry about array re-allocation and its faster too
|
||||
since reallocating the entire array for every point added is inefficient.
|
||||
The best way is to sidestep the problem altogether add all the points to the curve at once. This means you don't have to worry about array re-allocation and its faster too since reallocating the entire array for every point added is inefficient.
|
||||
|
||||
|
||||
Removing Data
|
||||
-------------
|
||||
|
||||
**Any** data that you remove shouldn't be modified or accessed afterwards,
|
||||
this includes f-curves, drivers, render layers, timeline markers, modifiers, constraints
|
||||
along with objects, scenes, groups, bones.. etc.
|
||||
**Any** data that you remove shouldn't be modified or accessed afterwards, this includes f-curves, drivers, render layers, timeline markers, modifiers, constraints along with objects, scenes, groups, bones.. etc.
|
||||
|
||||
The ``remove()`` api calls will invalidate the data they free to prevent common mistakes.
|
||||
|
||||
@@ -782,13 +658,12 @@ The following example shows how this precortion works.
|
||||
mesh = bpy.data.meshes.new(name="MyMesh")
|
||||
# normally the script would use the mesh here...
|
||||
bpy.data.meshes.remove(mesh)
|
||||
print(mesh.name) # <- give an exception rather than crashing:
|
||||
print(mesh.name) # <- give an exception rather then crashing:
|
||||
|
||||
# ReferenceError: StructRNA of type Mesh has been removed
|
||||
|
||||
|
||||
But take care because this is limited to scripts accessing the variable which is removed,
|
||||
the next example will still crash.
|
||||
But take care because this is limited to scripts accessing the variable which is removed, the next example will still crash.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -801,11 +676,9 @@ the next example will still crash.
|
||||
sys.exit
|
||||
========
|
||||
|
||||
Some Python modules will call ``sys.exit()`` themselves when an error occurs,
|
||||
while not common behavior this is something to watch out for because it may seem
|
||||
as if Blender is crashing since ``sys.exit()`` will close Blender immediately.
|
||||
Some python modules will call ``sys.exit()`` themselves when an error occurs, while not common behavior this is something to watch out for because it may seem as if blender is crashing since ``sys.exit()`` will quit blender immediately.
|
||||
|
||||
For example, the ``argparse`` module will print an error and exit if the arguments are invalid.
|
||||
For example, the ``optparse`` module will print an error and exit if the arguments are invalid.
|
||||
|
||||
An ugly way of troubleshooting this is to set ``sys.exit = None`` and see what line of python code is quitting, you could of course replace ``sys.exit`` with your own function but manipulating python in this way is bad practice.
|
||||
|
||||
An ugly way of troubleshooting this is to set ``sys.exit = None`` and see what line of Python code is quitting,
|
||||
you could of course replace ``sys.exit`` with your own function but manipulating Python in this way is bad practice.
|
||||
|
@@ -59,7 +59,7 @@ text editor or entering commands in the Python console.
|
||||
|
||||
Both the *Text Editor* and *Python Console* are space types you can select from the view header.
|
||||
|
||||
Rather than manually configuring your spaces for Python development,
|
||||
Rather then manually configuring your spaces for Python development,
|
||||
you may prefer to use the *Scripting* screen, included default with Blender,
|
||||
accessible from the top headers screen selector.
|
||||
|
||||
|
@@ -81,7 +81,7 @@ Editing a text file externally and having the same text open in Blender does wor
|
||||
so here are 2 ways you can easily use an external file from Blender.
|
||||
|
||||
Using the following examples you'll still need textblock in Blender to execute,
|
||||
but reference an external file rather than including it directly.
|
||||
but reference an external file rather then including it directly.
|
||||
|
||||
|
||||
Executing External Scripts
|
||||
@@ -306,7 +306,7 @@ Python Safety (Build Option)
|
||||
Since it's possible to access data which has been removed (see Gotcha's),
|
||||
this can be hard to track down the cause of crashes.
|
||||
|
||||
To raise Python exceptions on accessing freed data (rather than crashing),
|
||||
To raise Python exceptions on accessing freed data (rather then crashing),
|
||||
enable the CMake build option WITH_PYTHON_SAFETY.
|
||||
|
||||
This enables data tracking which makes data access about 2x slower
|
||||
|
@@ -163,9 +163,6 @@ def main():
|
||||
|
||||
for i, l in enumerate(b):
|
||||
l = l.strip()
|
||||
# casts
|
||||
l = l.replace("(int)", "")
|
||||
|
||||
l = l.replace("{", "(")
|
||||
l = l.replace("}", ")")
|
||||
|
||||
|
@@ -261,10 +261,8 @@ else:
|
||||
"bpy.utils.previews",
|
||||
"bpy_extras",
|
||||
"gpu",
|
||||
"gpu.offscreen",
|
||||
"mathutils",
|
||||
"mathutils.geometry",
|
||||
"mathutils.bvhtree",
|
||||
"mathutils.kdtree",
|
||||
"mathutils.noise",
|
||||
"freestyle",
|
||||
@@ -473,18 +471,6 @@ else:
|
||||
_BPY_PROP_COLLECTION_ID = "collection"
|
||||
|
||||
|
||||
def escape_rst(text):
|
||||
""" Escape plain text which may contain characters used by RST.
|
||||
"""
|
||||
return text.translate(escape_rst.trans)
|
||||
escape_rst.trans = str.maketrans({
|
||||
"`": "\\`",
|
||||
"|": "\\|",
|
||||
"*": "\\*",
|
||||
"\\": "\\\\",
|
||||
})
|
||||
|
||||
|
||||
def is_struct_seq(value):
|
||||
return isinstance(value, tuple) and type(tuple) != tuple and hasattr(value, "n_fields")
|
||||
|
||||
@@ -645,7 +631,7 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
|
||||
if type(py_func) == MethodType:
|
||||
return
|
||||
|
||||
arg_str = inspect.formatargspec(*inspect.getfullargspec(py_func))
|
||||
arg_str = inspect.formatargspec(*inspect.getargspec(py_func))
|
||||
|
||||
if not is_class:
|
||||
func_type = "function"
|
||||
@@ -1152,7 +1138,7 @@ def pycontext2sphinx(basepath):
|
||||
|
||||
|
||||
def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
|
||||
""" write a bullet point list of enum + descriptions
|
||||
""" write a bullet point list of enum + descrptons
|
||||
"""
|
||||
|
||||
if use_empty_descriptions:
|
||||
@@ -1167,7 +1153,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
|
||||
if ok:
|
||||
return "".join(["* ``%s`` %s.\n" %
|
||||
(identifier,
|
||||
", ".join(escape_rst(val) for val in (name, description) if val),
|
||||
", ".join(val for val in (name, description) if val),
|
||||
)
|
||||
for identifier, name, description in prop.enum_items
|
||||
])
|
||||
@@ -1613,7 +1599,7 @@ def write_rst_contents(basepath):
|
||||
fw("\n")
|
||||
|
||||
# fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME)
|
||||
fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" % BLENDER_ZIP_FILENAME)
|
||||
fw("`A compressed ZIP file of this site is available <%s>`_\n" % BLENDER_ZIP_FILENAME)
|
||||
|
||||
fw("\n")
|
||||
|
||||
@@ -1658,11 +1644,9 @@ def write_rst_contents(basepath):
|
||||
|
||||
standalone_modules = (
|
||||
# mathutils
|
||||
"mathutils", "mathutils.geometry", "mathutils.bvhtree", "mathutils.kdtree", "mathutils.noise",
|
||||
"mathutils", "mathutils.geometry", "mathutils.kdtree", "mathutils.noise",
|
||||
# misc
|
||||
"freestyle", "bgl", "blf",
|
||||
"gpu", "gpu.offscreen",
|
||||
"aud", "bpy_extras",
|
||||
"freestyle", "bgl", "blf", "gpu", "aud", "bpy_extras",
|
||||
# bmesh, submodules are in own page
|
||||
"bmesh",
|
||||
)
|
||||
@@ -1802,7 +1786,6 @@ def write_rst_importable_modules(basepath):
|
||||
# C_modules
|
||||
"aud" : "Audio System",
|
||||
"blf" : "Font Drawing",
|
||||
"gpu.offscreen" : "GPU Off-Screen Buffer",
|
||||
"bmesh" : "BMesh Module",
|
||||
"bmesh.types" : "BMesh Types",
|
||||
"bmesh.utils" : "BMesh Utilities",
|
||||
@@ -1813,7 +1796,6 @@ def write_rst_importable_modules(basepath):
|
||||
"bpy.props" : "Property Definitions",
|
||||
"mathutils" : "Math Types & Utilities",
|
||||
"mathutils.geometry" : "Geometry Utilities",
|
||||
"mathutils.bvhtree" : "BVHTree Utilities",
|
||||
"mathutils.kdtree" : "KDTree Utilities",
|
||||
"mathutils.noise" : "Noise Utilities",
|
||||
"freestyle" : "Freestyle Module",
|
||||
|
3
extern/CMakeLists.txt
vendored
3
extern/CMakeLists.txt
vendored
@@ -29,7 +29,6 @@ remove_strict_flags()
|
||||
add_subdirectory(rangetree)
|
||||
add_subdirectory(wcwidth)
|
||||
add_subdirectory(libmv)
|
||||
add_subdirectory(Eigen3)
|
||||
|
||||
if(WITH_OPENNL)
|
||||
add_subdirectory(colamd)
|
||||
@@ -78,7 +77,7 @@ if(WITH_LZMA)
|
||||
add_subdirectory(lzma)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||
if(WITH_CYCLES OR WITH_COMPOSITOR)
|
||||
add_subdirectory(clew)
|
||||
add_subdirectory(cuew)
|
||||
endif()
|
||||
|
43
extern/Eigen3/CMakeLists.txt
vendored
43
extern/Eigen3/CMakeLists.txt
vendored
@@ -1,43 +0,0 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2015, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Bastien Montagne.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
)
|
||||
|
||||
set(SRC
|
||||
eigen3_capi.h
|
||||
|
||||
intern/eigenvalues.cc
|
||||
intern/svd.cc
|
||||
|
||||
intern/eigenvalues.h
|
||||
intern/svd.h
|
||||
)
|
||||
|
||||
blender_add_lib(extern_eigen3 "${SRC}" "${INC}" "${INC_SYS}")
|
35
extern/Eigen3/SConscript
vendored
35
extern/Eigen3/SConscript
vendored
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2015, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Bastien Montagne.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
Import('env')
|
||||
|
||||
sources = env.Glob('intern/*.cc')
|
||||
|
||||
incs = '.'
|
||||
defs = []
|
||||
|
||||
env.BlenderLib('extern_eigen3', sources, Split(incs), defs, libtype=['extern','player'], priority=[10, 185])
|
33
extern/Eigen3/eigen3_capi.h
vendored
33
extern/Eigen3/eigen3_capi.h
vendored
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_C_API_H__
|
||||
#define __EIGEN3_C_API_H__
|
||||
|
||||
#include "intern/eigenvalues.h"
|
||||
#include "intern/svd.h"
|
||||
|
||||
#endif /* __EIGEN3_C_API_H__ */
|
70
extern/Eigen3/intern/eigenvalues.cc
vendored
70
extern/Eigen3/intern/eigenvalues.cc
vendored
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_EIGENVALUES_C_API_CC__
|
||||
#define __EIGEN3_EIGENVALUES_C_API_CC__
|
||||
|
||||
/* Eigen gives annoying huge amount of warnings here, silence them! */
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Eigenvalues>
|
||||
|
||||
#include "eigenvalues.h"
|
||||
|
||||
using Eigen::SelfAdjointEigenSolver;
|
||||
|
||||
using Eigen::MatrixXf;
|
||||
using Eigen::VectorXf;
|
||||
using Eigen::Map;
|
||||
|
||||
using Eigen::Success;
|
||||
|
||||
bool EG3_self_adjoint_eigen_solve(const int size, const float *matrix, float *r_eigen_values, float *r_eigen_vectors)
|
||||
{
|
||||
SelfAdjointEigenSolver<MatrixXf> eigen_solver;
|
||||
|
||||
/* Blender and Eigen matrices are both column-major. */
|
||||
eigen_solver.compute(Map<MatrixXf>((float *)matrix, size, size));
|
||||
|
||||
if (eigen_solver.info() != Success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (r_eigen_values) {
|
||||
Map<VectorXf>(r_eigen_values, size) = eigen_solver.eigenvalues().transpose();
|
||||
}
|
||||
|
||||
if (r_eigen_vectors) {
|
||||
Map<MatrixXf>(r_eigen_vectors, size, size) = eigen_solver.eigenvectors();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* __EIGEN3_EIGENVALUES_C_API_CC__ */
|
40
extern/Eigen3/intern/eigenvalues.h
vendored
40
extern/Eigen3/intern/eigenvalues.h
vendored
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_EIGENVALUES_C_API_H__
|
||||
#define __EIGEN3_EIGENVALUES_C_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool EG3_self_adjoint_eigen_solve(const int size, const float *matrix, float *r_eigen_values, float *r_eigen_vectors);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EIGEN3_EIGENVALUES_C_API_H__ */
|
72
extern/Eigen3/intern/svd.cc
vendored
72
extern/Eigen3/intern/svd.cc
vendored
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_SVD_C_API_CC__
|
||||
#define __EIGEN3_SVD_C_API_CC__
|
||||
|
||||
/* Eigen gives annoying huge amount of warnings here, silence them! */
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlogical-op"
|
||||
#endif
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/SVD>
|
||||
|
||||
#include "svd.h"
|
||||
|
||||
using Eigen::JacobiSVD;
|
||||
|
||||
using Eigen::NoQRPreconditioner;
|
||||
|
||||
using Eigen::ComputeThinU;
|
||||
using Eigen::ComputeThinV;
|
||||
|
||||
using Eigen::MatrixXf;
|
||||
using Eigen::VectorXf;
|
||||
using Eigen::Map;
|
||||
|
||||
void EG3_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V)
|
||||
{
|
||||
/* Since our matrix is squared, we can use thinU/V. */
|
||||
unsigned int flags = (r_U ? ComputeThinU : 0) | (r_V ? ComputeThinV : 0);
|
||||
|
||||
/* Blender and Eigen matrices are both column-major. */
|
||||
JacobiSVD<MatrixXf, NoQRPreconditioner> svd(Map<MatrixXf>((float *)matrix, size, size), flags);
|
||||
|
||||
if (r_U) {
|
||||
Map<MatrixXf>(r_U, size, size) = svd.matrixU();
|
||||
}
|
||||
|
||||
if (r_S) {
|
||||
Map<VectorXf>(r_S, size) = svd.singularValues();
|
||||
}
|
||||
|
||||
if (r_V) {
|
||||
Map<MatrixXf>(r_V, size, size) = svd.matrixV();
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __EIGEN3_SVD_C_API_CC__ */
|
40
extern/Eigen3/intern/svd.h
vendored
40
extern/Eigen3/intern/svd.h
vendored
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Blender Foundation,
|
||||
* Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef __EIGEN3_SVD_C_API_H__
|
||||
#define __EIGEN3_SVD_C_API_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void EG3_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EIGEN3_SVD_C_API_H__ */
|
3
extern/SConscript
vendored
3
extern/SConscript
vendored
@@ -11,7 +11,6 @@ SConscript(['colamd/SConscript'])
|
||||
SConscript(['rangetree/SConscript'])
|
||||
SConscript(['wcwidth/SConscript'])
|
||||
SConscript(['libmv/SConscript'])
|
||||
SConscript(['Eigen3/SConscript'])
|
||||
|
||||
if env['WITH_BF_GAMEENGINE']:
|
||||
SConscript(['recastnavigation/SConscript'])
|
||||
@@ -25,7 +24,7 @@ if env['WITH_BF_ELTOPO']:
|
||||
if env['WITH_BF_BULLET']:
|
||||
SConscript(['bullet2/src/SConscript'])
|
||||
|
||||
if env['WITH_BF_COMPOSITOR'] or env['WITH_BF_CYCLES'] or env['WITH_BF_OPENSUBDIV']:
|
||||
if env['WITH_BF_COMPOSITOR'] or env['WITH_BF_CYCLES']:
|
||||
SConscript (['clew/SConscript'])
|
||||
SConscript (['cuew/SConscript'])
|
||||
|
||||
|
2
extern/clew/include/clew.h
vendored
2
extern/clew/include/clew.h
vendored
@@ -2781,7 +2781,7 @@ CLEW_FUN_EXPORT PFNCLGETGLCONTEXTINFOKHR __clewGetGLContextInfoKH
|
||||
#define CLEW_ERROR_ATEXIT_FAILED -2 //!< Error code for failing to queue the closing of the dynamic library to atexit()
|
||||
|
||||
//! \brief Load OpenCL dynamic library and set function entry points
|
||||
int clewInit (void);
|
||||
int clewInit ();
|
||||
//! \brief Convert an OpenCL error code to its string equivalent
|
||||
const char* clewErrorString (cl_int error);
|
||||
|
||||
|
4
extern/glew-es/SConscript
vendored
4
extern/glew-es/SConscript
vendored
@@ -6,9 +6,7 @@ Import('env')
|
||||
|
||||
sources = ['src/glew.c']
|
||||
|
||||
defs = []
|
||||
defs += env['BF_GL_DEFINITIONS']
|
||||
|
||||
defs = env['BF_GL_DEFINITIONS']
|
||||
if env['WITH_BF_GLEW_MX']:
|
||||
defs += ['GLEW_MX']
|
||||
incs = ['include']
|
||||
|
4
extern/glew/SConscript
vendored
4
extern/glew/SConscript
vendored
@@ -6,9 +6,7 @@ Import('env')
|
||||
|
||||
sources = ['src/glew.c']
|
||||
|
||||
defs = []
|
||||
defs += env['BF_GL_DEFINITIONS']
|
||||
|
||||
defs = env['BF_GL_DEFINITIONS']
|
||||
if env['WITH_BF_GLEW_MX']:
|
||||
defs += ['GLEW_MX']
|
||||
|
||||
|
2381
extern/glew/include/GL/glew.h
vendored
2381
extern/glew/include/GL/glew.h
vendored
File diff suppressed because it is too large
Load Diff
135
extern/glew/include/GL/glxew.h
vendored
135
extern/glew/include/GL/glxew.h
vendored
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
** The OpenGL Extension Wrangler Library
|
||||
** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
|
||||
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
** Copyright (C) 2002, Lev Povalahev
|
||||
@@ -201,12 +200,12 @@ typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
@@ -387,19 +386,6 @@ typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx);
|
||||
|
||||
#endif /* GLX_AMD_gpu_association */
|
||||
|
||||
/* --------------------- GLX_ARB_context_flush_control --------------------- */
|
||||
|
||||
#ifndef GLX_ARB_context_flush_control
|
||||
#define GLX_ARB_context_flush_control 1
|
||||
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
|
||||
#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control)
|
||||
|
||||
#endif /* GLX_ARB_context_flush_control */
|
||||
|
||||
/* ------------------------- GLX_ARB_create_context ------------------------ */
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
@@ -451,8 +437,8 @@ typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBCo
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_ARB_fbconfig_float 1
|
||||
|
||||
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
|
||||
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
|
||||
#define GLX_RGBA_FLOAT_BIT 0x00000004
|
||||
#define GLX_RGBA_FLOAT_TYPE 0x20B9
|
||||
|
||||
#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float)
|
||||
|
||||
@@ -679,19 +665,6 @@ typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context
|
||||
|
||||
#endif /* GLX_EXT_scene_marker */
|
||||
|
||||
/* -------------------------- GLX_EXT_stereo_tree -------------------------- */
|
||||
|
||||
#ifndef GLX_EXT_stereo_tree
|
||||
#define GLX_EXT_stereo_tree 1
|
||||
|
||||
#define GLX_STEREO_NOTIFY_EXT 0x00000000
|
||||
#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
|
||||
#define GLX_STEREO_TREE_EXT 0x20F5
|
||||
|
||||
#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree)
|
||||
|
||||
#endif /* GLX_EXT_stereo_tree */
|
||||
|
||||
/* -------------------------- GLX_EXT_swap_control ------------------------- */
|
||||
|
||||
#ifndef GLX_EXT_swap_control
|
||||
@@ -858,38 +831,6 @@ typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo
|
||||
|
||||
#endif /* GLX_MESA_pixmap_colormap */
|
||||
|
||||
/* ------------------------ GLX_MESA_query_renderer ------------------------ */
|
||||
|
||||
#ifndef GLX_MESA_query_renderer
|
||||
#define GLX_MESA_query_renderer 1
|
||||
|
||||
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
|
||||
#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
|
||||
#define GLX_RENDERER_VERSION_MESA 0x8185
|
||||
#define GLX_RENDERER_ACCELERATED_MESA 0x8186
|
||||
#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
|
||||
#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
|
||||
#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
|
||||
#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
|
||||
#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
|
||||
#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
|
||||
#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
|
||||
#define GLX_RENDERER_ID_MESA 0x818E
|
||||
|
||||
typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value);
|
||||
typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
|
||||
typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value);
|
||||
typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
|
||||
|
||||
#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA)
|
||||
#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA)
|
||||
#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA)
|
||||
#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA)
|
||||
|
||||
#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer)
|
||||
|
||||
#endif /* GLX_MESA_query_renderer */
|
||||
|
||||
/* ------------------------ GLX_MESA_release_buffers ----------------------- */
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
@@ -934,21 +875,6 @@ typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
|
||||
|
||||
#endif /* GLX_MESA_swap_control */
|
||||
|
||||
/* --------------------------- GLX_NV_copy_buffer -------------------------- */
|
||||
|
||||
#ifndef GLX_NV_copy_buffer
|
||||
#define GLX_NV_copy_buffer 1
|
||||
|
||||
typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
|
||||
#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV)
|
||||
#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV)
|
||||
|
||||
#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer)
|
||||
|
||||
#endif /* GLX_NV_copy_buffer */
|
||||
|
||||
/* --------------------------- GLX_NV_copy_image --------------------------- */
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
@@ -962,19 +888,6 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
|
||||
|
||||
#endif /* GLX_NV_copy_image */
|
||||
|
||||
/* ------------------------ GLX_NV_delay_before_swap ----------------------- */
|
||||
|
||||
#ifndef GLX_NV_delay_before_swap
|
||||
#define GLX_NV_delay_before_swap 1
|
||||
|
||||
typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds);
|
||||
|
||||
#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV)
|
||||
|
||||
#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap)
|
||||
|
||||
#endif /* GLX_NV_delay_before_swap */
|
||||
|
||||
/* -------------------------- GLX_NV_float_buffer -------------------------- */
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
@@ -1080,10 +993,10 @@ typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoC
|
||||
|
||||
#endif /* GLX_NV_video_capture */
|
||||
|
||||
/* ---------------------------- GLX_NV_video_out --------------------------- */
|
||||
/* -------------------------- GLX_NV_video_output -------------------------- */
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_NV_video_out 1
|
||||
#ifndef GLX_NV_video_output
|
||||
#define GLX_NV_video_output 1
|
||||
|
||||
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
@@ -1110,9 +1023,9 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
|
||||
#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
|
||||
#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
|
||||
|
||||
#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out)
|
||||
#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
|
||||
|
||||
#endif /* GLX_NV_video_out */
|
||||
#endif /* GLX_NV_video_output */
|
||||
|
||||
/* -------------------------- GLX_OML_swap_method -------------------------- */
|
||||
|
||||
@@ -1198,10 +1111,10 @@ typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, i
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
@@ -1238,8 +1151,8 @@ typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLX
|
||||
|
||||
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
|
||||
#define GLX_PIPE_RECT_SGIX 0x00000001
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
|
||||
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
|
||||
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
|
||||
@@ -1305,8 +1218,8 @@ typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Disp
|
||||
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
@@ -1560,11 +1473,6 @@ GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA;
|
||||
GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA;
|
||||
GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA;
|
||||
GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
|
||||
@@ -1572,13 +1480,8 @@ GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
|
||||
GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
|
||||
GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV;
|
||||
GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV;
|
||||
|
||||
GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
|
||||
GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
|
||||
|
||||
@@ -1671,7 +1574,6 @@ GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
|
||||
@@ -1691,7 +1593,6 @@ GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
|
||||
@@ -1701,20 +1602,17 @@ GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_output;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control;
|
||||
GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
|
||||
@@ -1755,12 +1653,11 @@ GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx,
|
||||
|
||||
#else /* GLEW_MX */
|
||||
|
||||
GLEWAPI GLenum GLEWAPIENTRY glxewInit ();
|
||||
GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
|
||||
|
||||
#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
|
||||
#define GLXEW_GET_FUN(x) x
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
|
||||
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
|
||||
|
36
extern/glew/include/GL/wglew.h
vendored
36
extern/glew/include/GL/wglew.h
vendored
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
** The OpenGL Extension Wrangler Library
|
||||
** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net>
|
||||
** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||
** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||
** Copyright (C) 2002, Lev Povalahev
|
||||
@@ -183,19 +182,6 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in
|
||||
|
||||
#endif /* WGL_ARB_buffer_region */
|
||||
|
||||
/* --------------------- WGL_ARB_context_flush_control --------------------- */
|
||||
|
||||
#ifndef WGL_ARB_context_flush_control
|
||||
#define WGL_ARB_context_flush_control 1
|
||||
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
|
||||
#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control)
|
||||
|
||||
#endif /* WGL_ARB_context_flush_control */
|
||||
|
||||
/* ------------------------- WGL_ARB_create_context ------------------------ */
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
@@ -942,19 +928,6 @@ typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcNa
|
||||
|
||||
#endif /* WGL_NV_copy_image */
|
||||
|
||||
/* ------------------------ WGL_NV_delay_before_swap ----------------------- */
|
||||
|
||||
#ifndef WGL_NV_delay_before_swap
|
||||
#define WGL_NV_delay_before_swap 1
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
|
||||
|
||||
#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV)
|
||||
|
||||
#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap)
|
||||
|
||||
#endif /* WGL_NV_delay_before_swap */
|
||||
|
||||
/* -------------------------- WGL_NV_float_buffer -------------------------- */
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
@@ -1318,8 +1291,6 @@ WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
|
||||
|
||||
WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
|
||||
|
||||
WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV;
|
||||
|
||||
WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
|
||||
WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
|
||||
WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
|
||||
@@ -1363,7 +1334,6 @@ WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
|
||||
@@ -1401,7 +1371,6 @@ WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
|
||||
WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
|
||||
@@ -1434,12 +1403,11 @@ GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx,
|
||||
|
||||
#else /* GLEW_MX */
|
||||
|
||||
GLEWAPI GLenum GLEWAPIENTRY wglewInit ();
|
||||
GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
|
||||
|
||||
#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
|
||||
#define WGLEW_GET_FUN(x) x
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
|
||||
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
|
||||
|
4848
extern/glew/src/glew.c
vendored
4848
extern/glew/src/glew.c
vendored
File diff suppressed because it is too large
Load Diff
3
extern/libmv/libmv/image/array_nd.h
vendored
3
extern/libmv/libmv/image/array_nd.h
vendored
@@ -61,8 +61,7 @@ class ArrayND : public BaseArray {
|
||||
Resize(s0, s1, s2);
|
||||
}
|
||||
|
||||
ArrayND(T* data, int s0, int s1, int s2)
|
||||
: shape_(0), strides_(0), data_(data), own_data_(false) {
|
||||
ArrayND(T* data, int s0, int s1, int s2) : data_(data), own_data_(false) {
|
||||
Resize(s0, s1, s2);
|
||||
}
|
||||
|
||||
|
4
extern/libopenjpeg/CMakeLists.txt
vendored
4
extern/libopenjpeg/CMakeLists.txt
vendored
@@ -31,7 +31,9 @@ set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
add_definitions(${OPENJPEG_DEFINES})
|
||||
if(WIN32)
|
||||
add_definitions(-DOPJ_STATIC)
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
bio.c
|
||||
|
2
extern/libredcode/CMakeLists.txt
vendored
2
extern/libredcode/CMakeLists.txt
vendored
@@ -41,6 +41,4 @@ set(SRC
|
||||
format.h
|
||||
)
|
||||
|
||||
add_definitions(${OPENJPEG_DEFINES})
|
||||
|
||||
blender_add_lib(extern_redcode "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
2
extern/libredcode/format.c
vendored
2
extern/libredcode/format.c
vendored
@@ -78,7 +78,7 @@ static unsigned char* read_packet(FILE * fp, char * expect)
|
||||
len = read_be32(len);
|
||||
|
||||
if (strcmp(expect, head) != 0) {
|
||||
/* fprintf(stderr, "Read: %s, expect: %s\n", head, expect); */
|
||||
fprintf(stderr, "Read: %s, expect: %s\n", head, expect);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -77,11 +77,8 @@ if(WITH_OPENNL)
|
||||
add_subdirectory(opennl)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
add_subdirectory(opensubdiv)
|
||||
endif()
|
||||
|
||||
# only windows needs utf16 converter
|
||||
if(WIN32)
|
||||
add_subdirectory(utfconv)
|
||||
endif()
|
||||
|
||||
|
@@ -27,7 +27,8 @@
|
||||
|
||||
Import ('env')
|
||||
|
||||
SConscript(['string/SConscript',
|
||||
SConscript(['audaspace/SConscript',
|
||||
'string/SConscript',
|
||||
'ghost/SConscript',
|
||||
'glew-mx/SConscript',
|
||||
'guardedalloc/SConscript',
|
||||
@@ -44,9 +45,6 @@ SConscript(['string/SConscript',
|
||||
# currently only contains headers
|
||||
# SConscript('container/SConscript')
|
||||
|
||||
if env['WITH_BF_AUDASPACE']:
|
||||
SConscript(['audaspace/SConscript'])
|
||||
|
||||
if env ['WITH_BF_REMESH']:
|
||||
SConscript(['dualcon/SConscript'])
|
||||
|
||||
@@ -65,5 +63,3 @@ if env['WITH_BF_BULLET']:
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
|
||||
SConscript(['utfconv/SConscript'])
|
||||
|
||||
if env['WITH_BF_OPENSUBDIV']:
|
||||
SConscript (['opensubdiv/SConscript'])
|
||||
|
@@ -123,13 +123,13 @@ atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_add_uint64(uint64_t *p, uint64_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x) + x;
|
||||
return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x);
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_sub_uint64(uint64_t *p, uint64_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x)) - x;
|
||||
return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x));
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
@@ -215,7 +215,7 @@ atomic_sub_uint64(uint64_t *p, uint64_t x)
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
atomic_cas_uint32(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
{
|
||||
assert(sizeof(uint64_t) == sizeof(unsigned long));
|
||||
|
||||
@@ -235,7 +235,7 @@ atomic_sub_uint64(uint64_t *p, uint64_t x)
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint64_t
|
||||
atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
atomic_cas_uint32(uint64_t *v, uint64_t old, uint64_t _new)
|
||||
{
|
||||
return __sync_val_compare_and_swap(v, old, _new);
|
||||
}
|
||||
@@ -268,13 +268,13 @@ atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new)
|
||||
ATOMIC_INLINE uint32_t
|
||||
atomic_add_uint32(uint32_t *p, uint32_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd(p, x) + x;
|
||||
return InterlockedExchangeAdd(p, x);
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint32_t
|
||||
atomic_sub_uint32(uint32_t *p, uint32_t x)
|
||||
{
|
||||
return InterlockedExchangeAdd(p, -((int32_t)x)) - x;
|
||||
return InterlockedExchangeAdd(p, -((int32_t)x));
|
||||
}
|
||||
|
||||
ATOMIC_INLINE uint32_t
|
||||
|
@@ -21,35 +21,6 @@
|
||||
|
||||
remove_extra_strict_flags()
|
||||
|
||||
if(WITH_SYSTEM_AUDASPACE)
|
||||
|
||||
set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${AUDASPACE_C_INCLUDE_DIRS}
|
||||
${AUDASPACE_PY_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/AUD_Set.cpp
|
||||
intern/AUD_Set.h
|
||||
)
|
||||
|
||||
if(WITH_PYTHON)
|
||||
list(APPEND INC_SYS
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
)
|
||||
list(APPEND SRC
|
||||
intern/AUD_PyInit.cpp
|
||||
intern/AUD_PyInit.h
|
||||
)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
set(INC
|
||||
.
|
||||
FX
|
||||
@@ -164,8 +135,6 @@ set(SRC
|
||||
intern/AUD_SequencerHandle.h
|
||||
intern/AUD_SequencerReader.cpp
|
||||
intern/AUD_SequencerReader.h
|
||||
intern/AUD_Set.cpp
|
||||
intern/AUD_Set.h
|
||||
intern/AUD_SilenceFactory.cpp
|
||||
intern/AUD_SilenceFactory.h
|
||||
intern/AUD_SilenceReader.cpp
|
||||
@@ -347,6 +316,5 @@ if(WITH_PYTHON)
|
||||
)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@@ -21,15 +21,9 @@
|
||||
#
|
||||
# ***** END LGPL LICENSE BLOCK *****
|
||||
|
||||
from os import path
|
||||
Import ('env')
|
||||
|
||||
sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp')
|
||||
|
||||
# AUD_PyInit is for external audaspace only
|
||||
sources.remove(path.join('intern', 'AUD_PyInit.cpp'))
|
||||
|
||||
|
||||
incs = '. intern FX ' + env['BF_PTHREADS_INC'] + ' ' + env['BF_BOOST_INC']
|
||||
defs = []
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user