Merged changes in the trunk up to revision 37388.
Conflicts resolved: release/scripts/startup/bl_ui/properties_render.py source/creator/SConscript source/blender/blenlib/intern/bpath.c source/blender/editors/space_outliner/outliner.c
This commit is contained in:
@@ -55,33 +55,19 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/")
|
||||
# quiet output for Makefiles, 'make -s' helps too
|
||||
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||
|
||||
# ignore system set flag, use our own
|
||||
# must be before project(...)
|
||||
# if the user wants to add their own its ok after first run.
|
||||
if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
|
||||
set(_reset_standard_libraries OFF)
|
||||
else()
|
||||
set(_reset_standard_libraries ON)
|
||||
endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
include(build_files/cmake/macros.cmake)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize project.
|
||||
|
||||
blender_project_hack_pre()
|
||||
|
||||
project(Blender)
|
||||
|
||||
|
||||
if (_reset_standard_libraries)
|
||||
# Must come after project(...)
|
||||
#
|
||||
# MINGW workaround for -ladvapi32 being included which surprisingly causes
|
||||
# string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
|
||||
# with a meaningless stack trace. by overriding this flag we ensure we only
|
||||
# have libs we define and that cmake & scons builds match.
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
|
||||
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
|
||||
endif()
|
||||
unset(_reset_standard_libraries)
|
||||
|
||||
blender_project_hack_post()
|
||||
|
||||
enable_testing()
|
||||
|
||||
@@ -91,10 +77,6 @@ enable_testing()
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE )
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
include(build_files/cmake/macros.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
|
||||
@@ -106,7 +88,7 @@ option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
|
||||
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default (recommend to leave off)" OFF)
|
||||
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
|
||||
mark_as_advanced(WITH_PYTHON_SECURITY) # some distrobutions see this as a security issue, rather then have them patch it, make a build option.
|
||||
mark_as_advanced(WITH_PYTHON_SECURITY) # some distrobutions see this as a security issue, rather than have them patch it, make a build option.
|
||||
|
||||
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
|
||||
option(WITH_PYTHON_MODULE "Enable building as a python module (experemental, only enable for development)" OFF)
|
||||
@@ -116,6 +98,10 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effect
|
||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
|
||||
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
|
||||
# (unix defaults to OpenMP On)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
@@ -202,6 +188,9 @@ if(APPLE)
|
||||
option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for conflicting/unsupported configurations
|
||||
|
||||
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
|
||||
endif()
|
||||
@@ -223,6 +212,17 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
|
||||
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_QUICKTIME AND MINGW)
|
||||
message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
|
||||
"because it is currently unsupported, remove this "
|
||||
"line if youre a developer who wants to add support.")
|
||||
endif()
|
||||
|
||||
# may as well build python module without a UI
|
||||
if(WITH_PYTHON_MODULE)
|
||||
set(WITH_HEADLESS ON)
|
||||
endif()
|
||||
|
||||
# remove old vars
|
||||
unset(WITH_INSTALL CACHE)
|
||||
|
||||
@@ -427,15 +427,19 @@ if(UNIX AND NOT APPLE)
|
||||
unset(JEMALLOC)
|
||||
endif()
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
|
||||
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB}")
|
||||
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++")
|
||||
|
||||
if(WITH_X11_XINPUT)
|
||||
list(APPEND LLIBS ${X11_Xinput_LIB})
|
||||
if(NOT WITH_HEADLESS)
|
||||
find_package(X11 REQUIRED)
|
||||
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
|
||||
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
|
||||
|
||||
list(APPEND LLIBS ${X11_X11_LIB})
|
||||
|
||||
if(WITH_X11_XINPUT)
|
||||
list(APPEND LLIBS ${X11_Xinput_LIB})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
@@ -984,6 +988,12 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Common.
|
||||
|
||||
if(APPLE OR WIN32)
|
||||
if(NOT IS_DIRECTORY "${LIBDIR}")
|
||||
message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_RAYOPTIMIZATION)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(SUPPORT_SSE_BUILD)
|
||||
@@ -1031,7 +1041,7 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenGL.
|
||||
find_package(OpenGL)
|
||||
blender_include_dirs("${OPENGL_INCLUDE_DIR}")
|
||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||
# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
|
||||
# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
|
||||
|
||||
@@ -1144,9 +1154,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
|
||||
#-------------------------------------------------------------------------------
|
||||
# Global Defines
|
||||
|
||||
# better not define flags here but this is a debugging option thats off by default.
|
||||
# better not set includes here but this debugging option is off by default.
|
||||
if(WITH_CXX_GUARDEDALLOC)
|
||||
set(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/intern/guardedalloc)
|
||||
endif()
|
||||
|
||||
if(WITH_ASSERT_ABORT)
|
||||
|
||||
10
GNUmakefile
10
GNUmakefile
@@ -68,14 +68,12 @@ all:
|
||||
@echo Configuring Blender ...
|
||||
|
||||
if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
|
||||
mkdir -p $(BUILD_DIR) ; \
|
||||
cd $(BUILD_DIR) ; \
|
||||
cmake $(BLENDER_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
|
||||
cmake -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
|
||||
fi
|
||||
|
||||
@echo
|
||||
@echo Building Blender ...
|
||||
cd $(BUILD_DIR) ; make -s -j $(NPROCS) install
|
||||
make -C $(BUILD_DIR) -s -j $(NPROCS) install
|
||||
@echo
|
||||
@echo run blender from "$(BUILD_DIR)/bin/blender"
|
||||
@echo
|
||||
@@ -91,7 +89,7 @@ package_pacman:
|
||||
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
|
||||
|
||||
package_archive:
|
||||
cd $(BUILD_DIR) ; make -s package_archive
|
||||
make -C $(BUILD_DIR) -s package_archive
|
||||
@echo archive in "$(BUILD_DIR)/release"
|
||||
|
||||
# forward build targets
|
||||
@@ -109,6 +107,6 @@ test_cmake:
|
||||
@echo "written: test_cmake_consistency.log"
|
||||
|
||||
clean:
|
||||
cd $(BUILD_DIR) ; make clean
|
||||
make -C $(BUILD_DIR) clean
|
||||
|
||||
.PHONY: all
|
||||
|
||||
@@ -306,10 +306,6 @@ if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
|
||||
env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
|
||||
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
|
||||
|
||||
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
|
||||
B.root_build_dir = env['BF_BUILDDIR']
|
||||
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
|
||||
@@ -409,17 +405,18 @@ if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
|
||||
B.propose_priorities()
|
||||
|
||||
dobj = B.buildinfo(env, "dynamic") + B.resources
|
||||
creob = B.creator(env)
|
||||
thestatlibs, thelibincs = B.setup_staticlibs(env)
|
||||
thesyslibs = B.setup_syslibs(env)
|
||||
|
||||
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
||||
env.BlenderProg(B.root_build_dir, "blender", mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
if env['WITH_BF_PLAYER']:
|
||||
playerlist = B.create_blender_liblist(env, 'player')
|
||||
playerlist += B.create_blender_liblist(env, 'player2')
|
||||
playerlist += B.create_blender_liblist(env, 'intern')
|
||||
playerlist += B.create_blender_liblist(env, 'extern')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", playerlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
|
||||
##### Now define some targets
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
|
||||
'${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a'
|
||||
'${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libfaad.a'
|
||||
|
||||
# Don't depend on system's libstdc++
|
||||
WITH_BF_STATICCXX = True
|
||||
|
||||
@@ -29,7 +29,8 @@ BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/
|
||||
'${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a'
|
||||
'${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libfaad.a'
|
||||
|
||||
# Don't depend on system's libstdc++
|
||||
WITH_BF_STATICCXX = True
|
||||
|
||||
@@ -53,7 +53,7 @@ c['builders'] = []
|
||||
buildernames = []
|
||||
|
||||
|
||||
def add_builder(c, name, libdir, factory):
|
||||
def add_builder(c, name, libdir, factory, branch=''):
|
||||
slavenames = []
|
||||
|
||||
for slave in master_private.slaves:
|
||||
@@ -61,16 +61,18 @@ def add_builder(c, name, libdir, factory):
|
||||
slavenames.append(slave['name'])
|
||||
|
||||
if len(slavenames) > 0:
|
||||
f = factory(name, libdir)
|
||||
f = factory(name, libdir, branch)
|
||||
c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
|
||||
buildernames.append(name)
|
||||
|
||||
# common steps
|
||||
|
||||
|
||||
def svn_step():
|
||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
||||
|
||||
def svn_step(branch=''):
|
||||
if branch:
|
||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/branches/%%BRANCH%%', mode='update', defaultBranch=branch, workdir='blender')
|
||||
else:
|
||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
||||
|
||||
def lib_svn_step(dir):
|
||||
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
||||
@@ -78,7 +80,7 @@ def lib_svn_step(dir):
|
||||
# generic builder
|
||||
|
||||
|
||||
def generic_builder(id, libdir=""):
|
||||
def generic_builder(id, libdir='', branch=''):
|
||||
filename = 'buildbot_upload_' + id + '.zip'
|
||||
compile_script = '../blender/build_files/buildbot/slave_compile.py'
|
||||
test_script = '../blender/build_files/buildbot/slave_test.py'
|
||||
@@ -86,13 +88,13 @@ def generic_builder(id, libdir=""):
|
||||
unpack_script = 'master_unpack.py'
|
||||
|
||||
f = BuildFactory()
|
||||
f.addStep(svn_step())
|
||||
f.addStep(svn_step(branch))
|
||||
if libdir != '':
|
||||
f.addStep(lib_svn_step(libdir))
|
||||
|
||||
f.addStep(Compile(command=['python', compile_script, id]))
|
||||
f.addStep(Test(command=['python', test_script, id]))
|
||||
f.addStep(ShellCommand(name='package', command=['python', pack_script, id], description='packaging', descriptionDone='packaged'))
|
||||
f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
|
||||
if id.find('cmake') != -1:
|
||||
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
|
||||
else:
|
||||
@@ -102,12 +104,19 @@ def generic_builder(id, libdir=""):
|
||||
|
||||
# builders
|
||||
|
||||
add_builder(c, 'mac_x86_64_cmake', 'darwin-9.x.universal', generic_builder)
|
||||
add_builder(c, 'mac_i386_cmake', 'darwin-9.x.universal', generic_builder)
|
||||
add_builder(c, 'mac_ppc_cmake', 'darwin-9.x.universal', generic_builder)
|
||||
add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
|
||||
add_builder(c, 'mac_x86_64_scons', 'darwin-9.x.universal', generic_builder)
|
||||
add_builder(c, 'salad_mac_x86_64_scons', 'darwin-9.x.universal', generic_builder, 'soc-2011-salad')
|
||||
add_builder(c, 'mac_i386_scons', 'darwin-9.x.universal', generic_builder)
|
||||
add_builder(c, 'mac_ppc_scons', 'darwin-9.x.universal', generic_builder)
|
||||
#add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
|
||||
add_builder(c, 'linux_i386_scons', '', generic_builder)
|
||||
add_builder(c, 'salad_linux_i386_scons', '', generic_builder, 'soc-2011-salad')
|
||||
add_builder(c, 'linux_x86_64_scons', '', generic_builder)
|
||||
add_builder(c, 'salad_linux_x86_64_scons', '', generic_builder, 'soc-2011-salad')
|
||||
add_builder(c, 'win32_scons', 'windows', generic_builder)
|
||||
add_builder(c, 'salad_win32_scons', 'windows', generic_builder, 'soc-2011-salad')
|
||||
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder)
|
||||
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
|
||||
|
||||
# SCHEDULERS
|
||||
#
|
||||
@@ -149,7 +158,7 @@ authz_cfg = authz.Authz(
|
||||
pingBuilder=False,
|
||||
stopBuild=False,
|
||||
stopAllBuilds=False,
|
||||
cancelPendingBuild=False,
|
||||
cancelPendingBuild=True,
|
||||
)
|
||||
|
||||
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
||||
|
||||
@@ -43,6 +43,7 @@ def get_platform(filename):
|
||||
# platform out, but there may be some variations, so we fiddle a
|
||||
# bit to handle current and hopefully future names
|
||||
filename = strip_extension(filename)
|
||||
filename = strip_extension(filename)
|
||||
|
||||
tokens = filename.split("-")
|
||||
platforms = ('osx', 'mac', 'bsd',
|
||||
@@ -63,6 +64,21 @@ def get_platform(filename):
|
||||
|
||||
return '-'.join(platform_tokens)
|
||||
|
||||
def get_branch(filename):
|
||||
tokens = filename.split("-")
|
||||
branch = ""
|
||||
|
||||
for token in tokens:
|
||||
if branch == "":
|
||||
branch = token
|
||||
else:
|
||||
branch = branch + "-" + token
|
||||
|
||||
if token == "blender":
|
||||
return branch
|
||||
|
||||
return ""
|
||||
|
||||
# get filename
|
||||
if len(sys.argv) < 2:
|
||||
sys.stderr.write("Not enough arguments, expecting file to unpack\n")
|
||||
@@ -88,8 +104,9 @@ if len(z.namelist()) != 1:
|
||||
package = z.namelist()[0]
|
||||
packagename = os.path.basename(package)
|
||||
|
||||
# detect platform
|
||||
# detect platform and branch
|
||||
platform = get_platform(packagename)
|
||||
branch = get_branch(packagename)
|
||||
|
||||
if platform == '':
|
||||
sys.stderr.write('Failed to detect platform ' +
|
||||
@@ -113,10 +130,10 @@ except Exception, ex:
|
||||
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
|
||||
sys.exit(1)
|
||||
|
||||
# remove other files from the same platform
|
||||
# remove other files from the same platform and branch
|
||||
try:
|
||||
for f in os.listdir(directory):
|
||||
if platform.lower() in f.lower():
|
||||
if get_platform(f) == platform and get_branch(f) == branch:
|
||||
if f != packagename:
|
||||
os.remove(os.path.join(directory, f))
|
||||
except Exception, ex:
|
||||
|
||||
@@ -38,11 +38,11 @@ if builder.find('cmake') != -1:
|
||||
# set build options
|
||||
cmake_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
|
||||
|
||||
if builder == 'mac_x86_64_cmake':
|
||||
if builder.endswith('mac_x86_64_cmake'):
|
||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
|
||||
elif builder == 'mac_i386_cmake':
|
||||
elif builder.endswith('mac_i386_cmake'):
|
||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=i386')
|
||||
elif builder == 'mac_ppc_cmake':
|
||||
elif builder.endswith('mac_ppc_cmake'):
|
||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
|
||||
|
||||
# configure and make
|
||||
@@ -57,7 +57,7 @@ else:
|
||||
scons_cmd = ['python', 'scons/scons.py']
|
||||
scons_options = []
|
||||
|
||||
if builder.startswith('linux'):
|
||||
if builder.find('linux') != -1:
|
||||
import shutil
|
||||
|
||||
# We're using the same rules as release builder, so tweak
|
||||
@@ -75,10 +75,10 @@ else:
|
||||
config_dir = os.path.join(buildbot_dir, 'config')
|
||||
|
||||
configs = []
|
||||
if builder == 'linux_x86_64_scons':
|
||||
if builder.endswith('linux_x86_64_scons'):
|
||||
configs = ['user-config-player-x86_64.py',
|
||||
'user-config-x86_64.py']
|
||||
elif builder == 'linux_i386_scons':
|
||||
elif builder.endswith('linux_i386_scons'):
|
||||
configs = ['user-config-player-i686.py',
|
||||
'user-config-i686.py']
|
||||
|
||||
|
||||
@@ -33,13 +33,17 @@ if len(sys.argv) < 2:
|
||||
sys.exit(1)
|
||||
|
||||
builder = sys.argv[1]
|
||||
branch = ''
|
||||
|
||||
if len(sys.argv) >= 3:
|
||||
branch = sys.argv[2]
|
||||
|
||||
# scons does own packaging
|
||||
if builder.find('scons') != -1:
|
||||
os.chdir('../blender')
|
||||
scons_options = ['BF_QUICK=slnt', 'buildslave']
|
||||
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave']
|
||||
|
||||
if builder.startswith('linux'):
|
||||
if builder.find('linux') != -1:
|
||||
buildbot_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
config_dir = os.path.join(buildbot_dir, 'config')
|
||||
build_dir = os.path.join('..', 'build', builder)
|
||||
@@ -52,9 +56,9 @@ if builder.find('scons') != -1:
|
||||
|
||||
config = None
|
||||
|
||||
if builder == 'linux_x86_64_scons':
|
||||
if builder.endswith('linux_x86_64_scons'):
|
||||
config = 'user-config-x86_64.py'
|
||||
elif builder == 'linux_i386_scons':
|
||||
elif builder.endswith('linux_i386_scons'):
|
||||
config = 'user-config-x86_64.py'
|
||||
|
||||
if config is not None:
|
||||
|
||||
@@ -33,7 +33,7 @@ Windows not supported so far
|
||||
from project_info import *
|
||||
|
||||
import os
|
||||
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
|
||||
from os.path import join, dirname, normpath, relpath, exists
|
||||
|
||||
|
||||
def create_nb_project_main():
|
||||
@@ -50,7 +50,6 @@ def create_nb_project_main():
|
||||
includes.sort()
|
||||
|
||||
PROJECT_NAME = "Blender"
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
|
||||
# --------------- NB spesific
|
||||
defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
|
||||
@@ -76,7 +75,7 @@ def create_nb_project_main():
|
||||
if not exists(PROJECT_DIR_NB):
|
||||
os.mkdir(PROJECT_DIR_NB)
|
||||
|
||||
SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR)
|
||||
# SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR)
|
||||
|
||||
f = open(join(PROJECT_DIR_NB, "project.xml"), 'w')
|
||||
|
||||
|
||||
@@ -34,54 +34,52 @@ example linux usage
|
||||
from project_info import *
|
||||
|
||||
import os
|
||||
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def create_qtc_project_main():
|
||||
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
|
||||
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
|
||||
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
|
||||
files_rel.sort()
|
||||
|
||||
# --- qtcreator specific, simple format
|
||||
if SIMPLE_PROJECTFILE:
|
||||
# --- qtcreator specific, simple format
|
||||
PROJECT_NAME = "Blender"
|
||||
f = open(join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
f = open(join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(sorted(list(set(dirname(f) for f in files_rel if is_c_header(f))))))
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f) for f in files_rel if is_c_header(f))))))
|
||||
|
||||
qtc_prj = join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
|
||||
if not exists(qtc_cfg):
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
|
||||
if not os.path.exists(qtc_cfg):
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
else:
|
||||
includes, defines = cmake_advanced_info()
|
||||
|
||||
# for some reason it doesnt give all internal includes
|
||||
includes = list(set(includes) | set(dirname(f) for f in files_rel if is_c_header(f)))
|
||||
includes = list(set(includes) | set(os.path.dirname(f) for f in files_rel if is_c_header(f)))
|
||||
includes.sort()
|
||||
|
||||
PROJECT_NAME = "Blender"
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
f = open(join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
f = open(join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w')
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w')
|
||||
f.write("\n".join(sorted(includes)))
|
||||
|
||||
qtc_prj = join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
defines_final = [("#define %s %s" % item) for item in defines]
|
||||
@@ -95,21 +93,21 @@ def create_qtc_project_main():
|
||||
|
||||
def create_qtc_project_python():
|
||||
files = list(source_list(SOURCE_DIR, filename_check=is_py))
|
||||
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
|
||||
files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
|
||||
files_rel.sort()
|
||||
|
||||
# --- qtcreator specific, simple format
|
||||
PROJECT_NAME = "Blender_Python"
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
f = open(join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
qtc_prj = join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
f = open(qtc_prj, 'w')
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
if not exists(qtc_cfg):
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
if not os.path.exists(qtc_cfg):
|
||||
f = open(qtc_cfg, 'w')
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ cd ~/blender-svn/build-cmake
|
||||
|
||||
# cmake without copying files for fast rebuilds
|
||||
# the files from svn will be used in place
|
||||
cmake ../blender -DWITH_INSTALL:BOOL=FALSE
|
||||
cmake ../blender
|
||||
|
||||
# make blender, will take some time
|
||||
make
|
||||
|
||||
@@ -13,19 +13,22 @@ macro(blender_include_dirs
|
||||
include_directories(${all_incs})
|
||||
endmacro()
|
||||
|
||||
# only MSVC uses SOURCE_GROUP
|
||||
macro(blender_add_lib_nolist
|
||||
name
|
||||
sources
|
||||
macro(blender_include_dirs_sys
|
||||
includes)
|
||||
|
||||
# message(STATUS "Configuring library ${name}")
|
||||
foreach(inc ${ARGV})
|
||||
get_filename_component(abs_inc ${inc} ABSOLUTE)
|
||||
list(APPEND all_incs ${abs_inc})
|
||||
endforeach()
|
||||
include_directories(SYSTEM ${all_incs})
|
||||
endmacro()
|
||||
|
||||
blender_include_dirs("${includes}")
|
||||
add_library(${name} ${sources})
|
||||
macro(blender_source_group
|
||||
sources)
|
||||
|
||||
# Group by location on disk
|
||||
source_group("Source Files" FILES CMakeLists.txt)
|
||||
|
||||
foreach(SRC ${sources})
|
||||
get_filename_component(SRC_EXT ${SRC} EXT)
|
||||
if(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp")
|
||||
@@ -36,28 +39,42 @@ macro(blender_add_lib_nolist
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# # works fine but having the includes listed is helpful for IDE's (QtCreator/MSVC)
|
||||
# macro(blender_add_lib_nolist
|
||||
# name
|
||||
# sources
|
||||
# includes)
|
||||
#
|
||||
# message(STATUS "Configuring library ${name}")
|
||||
# include_directories(${includes})
|
||||
# add_library(${name} ${sources})
|
||||
# endmacro()
|
||||
|
||||
# only MSVC uses SOURCE_GROUP
|
||||
macro(blender_add_lib_nolist
|
||||
name
|
||||
sources
|
||||
includes
|
||||
includes_sys)
|
||||
|
||||
# message(STATUS "Configuring library ${name}")
|
||||
|
||||
# include_directories(${includes})
|
||||
# include_directories(SYSTEM ${includes_sys})
|
||||
blender_include_dirs("${includes}")
|
||||
blender_include_dirs_sys("${includes_sys}")
|
||||
|
||||
add_library(${name} ${sources})
|
||||
|
||||
# works fine without having the includes
|
||||
# listed is helpful for IDE's (QtCreator/MSVC)
|
||||
blender_source_group("${sources}")
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(blender_add_lib
|
||||
name
|
||||
sources
|
||||
includes)
|
||||
includes
|
||||
includes_sys)
|
||||
|
||||
blender_add_lib_nolist(${name} "${sources}" "${includes}")
|
||||
blender_add_lib_nolist(${name} "${sources}" "${includes}" "${includes_sys}")
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(SETUP_LIBDIRS)
|
||||
# see "cmake --help-policy CMP0003"
|
||||
if(COMMAND cmake_policy)
|
||||
@@ -388,3 +405,71 @@ macro(get_blender_version)
|
||||
|
||||
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
|
||||
endmacro()
|
||||
|
||||
|
||||
# hacks to override initial project settings
|
||||
# these macros must be called directly before/after project(Blender)
|
||||
macro(blender_project_hack_pre)
|
||||
# ----------------
|
||||
# MINGW HACK START
|
||||
# ignore system set flag, use our own
|
||||
# must be before project(...)
|
||||
# if the user wants to add their own its ok after first run.
|
||||
if(DEFINED CMAKE_C_STANDARD_LIBRARIES)
|
||||
set(_reset_standard_libraries OFF)
|
||||
else()
|
||||
set(_reset_standard_libraries ON)
|
||||
endif()
|
||||
|
||||
# ------------------
|
||||
# GCC -O3 HACK START
|
||||
# needed because O3 can cause problems but
|
||||
# allow the builder to set O3 manually after.
|
||||
if(DEFINED CMAKE_C_FLAGS_RELEASE)
|
||||
set(_reset_standard_cflags_rel OFF)
|
||||
else()
|
||||
set(_reset_standard_cflags_rel ON)
|
||||
endif()
|
||||
if(DEFINED CMAKE_CXX_FLAGS_RELEASE)
|
||||
set(_reset_standard_cxxflags_rel OFF)
|
||||
else()
|
||||
set(_reset_standard_cxxflags_rel ON)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(blender_project_hack_post)
|
||||
# --------------
|
||||
# MINGW HACK END
|
||||
if (_reset_standard_libraries)
|
||||
# Must come after project(...)
|
||||
#
|
||||
# MINGW workaround for -ladvapi32 being included which surprisingly causes
|
||||
# string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
|
||||
# with a meaningless stack trace. by overriding this flag we ensure we only
|
||||
# have libs we define and that cmake & scons builds match.
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
|
||||
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
|
||||
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
|
||||
endif()
|
||||
unset(_reset_standard_libraries)
|
||||
|
||||
|
||||
# ----------------
|
||||
# GCC -O3 HACK END
|
||||
if(_reset_standard_cflags_rel)
|
||||
string(REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE)
|
||||
mark_as_advanced(CMAKE_C_FLAGS_RELEASE)
|
||||
endif()
|
||||
|
||||
if(_reset_standard_cxxflags_rel)
|
||||
string(REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE)
|
||||
mark_as_advanced(CMAKE_CXX_FLAGS_RELEASE)
|
||||
endif()
|
||||
|
||||
unset(_reset_standard_cflags_rel)
|
||||
unset(_reset_standard_cxxflags_rel)
|
||||
endmacro()
|
||||
|
||||
@@ -46,7 +46,7 @@ __all__ = (
|
||||
|
||||
import sys
|
||||
import os
|
||||
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
|
||||
from os.path import join, dirname, normpath, abspath, splitext, exists
|
||||
|
||||
SOURCE_DIR = join(dirname(__file__), "..", "..")
|
||||
SOURCE_DIR = normpath(SOURCE_DIR)
|
||||
|
||||
@@ -35,7 +35,7 @@ BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ CCFLAGS = ['/nologo', '/Ob1', '/J', '/W0', '/Gd', '/we4013', '/wd4018', '/wd4244
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od']
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
|
||||
@@ -258,7 +258,10 @@ def setup_syslibs(lenv):
|
||||
syslibs += Split(lenv['BF_PTHREADS_LIB'])
|
||||
if lenv['WITH_BF_COLLADA']:
|
||||
syslibs.append(lenv['BF_PCRE_LIB'])
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
if lenv['BF_DEBUG']:
|
||||
syslibs += [colladalib+'_d' for colladalib in Split(lenv['BF_OPENCOLLADA_LIB'])]
|
||||
else:
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
syslibs.append(lenv['BF_EXPAT_LIB'])
|
||||
|
||||
if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
|
||||
@@ -287,6 +290,50 @@ def propose_priorities():
|
||||
print "\t\t",new_priority, v
|
||||
new_priority += 5
|
||||
|
||||
# emits the necessary file objects for creator.c, to be used in creating
|
||||
# the final blender executable
|
||||
def creator(env):
|
||||
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
|
||||
|
||||
incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', '#/source/blender/freestyle', env['BF_OPENGL_INC']]
|
||||
|
||||
defs = []
|
||||
if env['WITH_BF_QUICKTIME']:
|
||||
incs.append(env['BF_QUICKTIME_INC'])
|
||||
defs.append('WITH_QUICKTIME')
|
||||
|
||||
if env['WITH_BF_BINRELOC']:
|
||||
incs.append('#/extern/binreloc/include')
|
||||
defs.append('WITH_BINRELOC')
|
||||
|
||||
if env['WITH_BF_OPENEXR']:
|
||||
defs.append('WITH_OPENEXR')
|
||||
|
||||
if env['WITH_BF_TIFF']:
|
||||
defs.append('WITH_TIFF')
|
||||
|
||||
if not env['WITH_BF_SDL']:
|
||||
defs.append('DISABLE_SDL')
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
incs.append('#/source/blender/python')
|
||||
defs.append('WITH_PYTHON')
|
||||
if env['BF_DEBUG']:
|
||||
defs.append('_DEBUG')
|
||||
|
||||
if env['BF_BUILDINFO']:
|
||||
defs.append('BUILD_DATE')
|
||||
defs.append('NAN_BUILDINFO')
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs.append(env['BF_PTHREADS_INC'])
|
||||
|
||||
env.Append(CPPDEFINES=defs)
|
||||
env.Append(CPPPATH=incs)
|
||||
obj = [env.Object(root_build_dir+'source/creator/creator/creator', ['#source/creator/creator.c'])]
|
||||
|
||||
return obj
|
||||
|
||||
## TODO: see if this can be made in an emitter
|
||||
def buildinfo(lenv, build_type):
|
||||
"""
|
||||
@@ -324,7 +371,7 @@ def buildinfo(lenv, build_type):
|
||||
|
||||
lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])
|
||||
|
||||
obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, [root_build_dir+'source/creator/buildinfo.c'])]
|
||||
obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, ['#source/creator/buildinfo.c'])]
|
||||
|
||||
return obj
|
||||
|
||||
@@ -449,10 +496,16 @@ def WinPyBundle(target=None, source=None, env=None):
|
||||
shutil.rmtree(py_target, False, printexception)
|
||||
exclude_re=[re.compile('.*/test/.*'),
|
||||
re.compile('^config/.*'),
|
||||
re.compile('^config-*/.*'),
|
||||
re.compile('^distutils/.*'),
|
||||
re.compile('^idlelib/.*'),
|
||||
re.compile('^lib2to3/.*'),
|
||||
re.compile('^tkinter/.*')]
|
||||
re.compile('^tkinter/.*'),
|
||||
re.compile('^_tkinter_d.pyd'),
|
||||
re.compile('^turtledemo'),
|
||||
re.compile('^turtle.py'),
|
||||
]
|
||||
|
||||
print "Unpacking '" + py_tar + "' to '" + py_target + "'"
|
||||
untar_pybundle(py_tar,py_target,exclude_re)
|
||||
|
||||
@@ -569,17 +622,17 @@ def UnixPyBundle(target=None, source=None, env=None):
|
||||
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
|
||||
run("rm -rf '%s/distutils'" % py_target)
|
||||
run("rm -rf '%s/lib2to3'" % py_target)
|
||||
run("rm -rf '%s/idlelib'" % py_target)
|
||||
run("rm -rf '%s/tkinter'" % py_target)
|
||||
run("rm -rf '%s/config'" % py_target)
|
||||
|
||||
run("rm -rf '%s/config-*'" % py_target)
|
||||
run("rm -rf '%s/site-packages'" % py_target)
|
||||
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
|
||||
|
||||
run("rm -rf '%s/idlelib'" % py_target)
|
||||
run("rm -rf '%s/tkinter'" % py_target)
|
||||
run("rm -rf '%s/turtledemo'" % py_target)
|
||||
run("rm -r '%s/turtle.py'" % py_target)
|
||||
run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
|
||||
|
||||
run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -type d -name 'turtledemo' -prune -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target)
|
||||
run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target)
|
||||
@@ -708,23 +761,19 @@ class BlenderEnvironment(SConsEnvironment):
|
||||
global vcp
|
||||
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
||||
lenv = self.Clone()
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE'])
|
||||
if lenv['BF_DEBUG']:
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb','/NODEFAULTLIB:libcmt'])
|
||||
if lenv['OURPLATFORM']=='linux2':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['OURPLATFORM']=='sunos5':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['CXX'].endswith('CC'):
|
||||
lenv.Replace(LINK = '$CXX')
|
||||
if lenv['OURPLATFORM']=='darwin':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
|
||||
|
||||
@@ -134,7 +134,8 @@ def validate_arguments(args, bc):
|
||||
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
||||
'BF_NO_ELBEEM',
|
||||
'WITH_BF_CXX_GUARDEDALLOC',
|
||||
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC'
|
||||
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
|
||||
'BUILDBOT_BRANCH'
|
||||
]
|
||||
|
||||
# Have options here that scons expects to be lists
|
||||
@@ -501,7 +502,9 @@ def read_opts(env, cfg, args):
|
||||
|
||||
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
|
||||
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
|
||||
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False))
|
||||
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
|
||||
|
||||
('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
|
||||
) # end of opts.AddOptions()
|
||||
|
||||
return localopts
|
||||
@@ -546,7 +549,7 @@ def buildslave(target=None, source=None, env=None):
|
||||
Builder for buildbot integration. Used by buildslaves of http://builder.blender.org only.
|
||||
"""
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'darwin'):
|
||||
extension = '.zip'
|
||||
else:
|
||||
extension = '.tar.bz2'
|
||||
@@ -560,9 +563,15 @@ def buildslave(target=None, source=None, env=None):
|
||||
platform = 'linux-glibc27-x86_64'
|
||||
elif bitness == '32bit':
|
||||
platform = 'linux-glibc27-i686'
|
||||
if platform == 'darwin':
|
||||
platform = 'OSX-' + env['MACOSX_ARCHITECTURE']
|
||||
|
||||
branch = env['BUILDBOT_BRANCH']
|
||||
|
||||
outdir = os.path.abspath(env['BF_INSTALLDIR'])
|
||||
package_name = 'blender-' + VERSION+'-'+REVISION + '-' + platform
|
||||
if branch != '':
|
||||
package_name = branch + '-' + package_name
|
||||
package_dir = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name)
|
||||
package_archive = os.path.normpath(outdir + os.sep + '..' + os.sep + package_name + extension)
|
||||
|
||||
@@ -605,9 +614,12 @@ def NSIS_Installer(target=None, source=None, env=None):
|
||||
doneroot = False
|
||||
rootdirconts = []
|
||||
datafiles = ''
|
||||
deldatafiles = ''
|
||||
deldatadirs = ''
|
||||
l = len(bf_installdir)
|
||||
|
||||
for dp,dn,df in os.walk(bf_installdir):
|
||||
# install
|
||||
if not doneroot:
|
||||
for f in df:
|
||||
rootdirconts.append(os.path.join(dp,f))
|
||||
@@ -615,15 +627,22 @@ def NSIS_Installer(target=None, source=None, env=None):
|
||||
else:
|
||||
if len(df)>0:
|
||||
dp_tmp = dp[l:]
|
||||
if dp_tmp.find('python\\lib') > -1:
|
||||
datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n"
|
||||
else:
|
||||
datafiles += "\n"+r'SetOutPath $BLENDERHOME'+dp[l:]+"\n\n"
|
||||
datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n"
|
||||
|
||||
for f in df:
|
||||
outfile = os.path.join(dp,f)
|
||||
datafiles += ' File '+outfile + "\n"
|
||||
|
||||
# uninstall
|
||||
deldir = dp[l+1:]
|
||||
|
||||
if len(deldir)>0:
|
||||
deldatadirs = "RMDir $INSTDIR\\" + deldir + "\n" + deldatadirs
|
||||
deldatadirs = "RMDir /r $INSTDIR\\" + deldir + "\\__pycache__\n" + deldatadirs
|
||||
|
||||
for f in df:
|
||||
deldatafiles += 'Delete \"$INSTDIR\\' + os.path.join(deldir, f) + "\"\n"
|
||||
|
||||
#### change to suit install dir ####
|
||||
inst_dir = install_base_dir + env['BF_INSTALLDIR']
|
||||
|
||||
@@ -660,6 +679,8 @@ def NSIS_Installer(target=None, source=None, env=None):
|
||||
ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
|
||||
|
||||
ns_cnt = string.replace(ns_cnt, "[DODATAFILES]", datafiles)
|
||||
ns_cnt = string.replace(ns_cnt, "[DELDATAFILES]", deldatafiles)
|
||||
ns_cnt = string.replace(ns_cnt, "[DELDATADIRS]", deldatadirs)
|
||||
|
||||
tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
|
||||
new_nsis = open(tmpnsi, 'w')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH "BLENDER" "1" "April 05, 2011" "Blender Blender 2\&.56 (sub 6)"
|
||||
.TH "BLENDER" "1" "June 03, 2011" "Blender Blender 2\&.57 (sub 1)"
|
||||
|
||||
.SH NAME
|
||||
blender \- a 3D modelling and rendering package
|
||||
@@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
|
||||
http://www.blender.org
|
||||
.SH OPTIONS
|
||||
|
||||
Blender 2.56 (sub 6)
|
||||
Blender 2.57 (sub 1)
|
||||
Usage: blender [args ...] [file] [args ...]
|
||||
.br
|
||||
.SS "Render Options:"
|
||||
@@ -160,6 +160,12 @@ Force opening without borders
|
||||
Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-con or \-\-start\-console
|
||||
.br
|
||||
Start with the console window open (ignored if \-b is set)
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Game Engine Specific Options:"
|
||||
@@ -191,7 +197,7 @@ Turn debugging on
|
||||
.br
|
||||
* Disables mouse grab (to interact with a debugger in some cases)
|
||||
.br
|
||||
* Keeps python sys.stdin rather then setting it to None
|
||||
* Keeps python sys.stdin rather than setting it to None
|
||||
.br
|
||||
|
||||
.TP
|
||||
@@ -210,12 +216,6 @@ Skip reading the "startup.blend" in the users home directory
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-\-env\-system\-config
|
||||
.br
|
||||
Set the BLENDER_SYSTEM_CONFIG environment variable
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-env\-system\-datafiles
|
||||
.br
|
||||
@@ -281,7 +281,7 @@ Print this help text and exit
|
||||
.TP
|
||||
.B \-y or \-\-enable\-autoexec
|
||||
.br
|
||||
Enable automatic python script execution (default)
|
||||
Enable automatic python script execution, (default)
|
||||
.br
|
||||
|
||||
.TP
|
||||
@@ -376,7 +376,6 @@ Arguments are executed in the order they are given. eg
|
||||
.br
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
\fIBLENDER_USER_CONFIG\fR Directory for user configuration files.
|
||||
\fIBLENDER_SYSTEM_CONFIG\fR Directory for system wide configuration files.
|
||||
\fIBLENDER_USER_SCRIPTS\fR Directory for user scripts.
|
||||
\fIBLENDER_SYSTEM_SCRIPTS\fR Directory for system wide scripts.
|
||||
\fIBLENDER_USER_DATAFILES\fR Directory for user data files (icons, translations, ..).
|
||||
|
||||
@@ -21,3 +21,19 @@ with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
for attr in dir(data_to):
|
||||
setattr(data_to, attr, getattr(data_from, attr))
|
||||
|
||||
|
||||
# the 'data_to' variables lists are
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
data_to.scenes = ["Scene"]
|
||||
|
||||
|
||||
# the loaded objects can be accessed from 'data_to' outside of the context
|
||||
# since loading the data replaces the strings for the datablocks or None
|
||||
# if the datablock could not be loaded.
|
||||
with bpy.data.libraries.load(filepath) as (data_from, data_to):
|
||||
data_to.meshes = data_from.meshes
|
||||
# now operate directly on the loaded data
|
||||
for mesh in data_to.meshes:
|
||||
if mesh is not None:
|
||||
print(mesh.name)
|
||||
|
||||
@@ -34,7 +34,8 @@ For HTML generation
|
||||
|
||||
- Generate html docs by running...
|
||||
|
||||
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api
|
||||
sphinx-build sphinx-in sphinx-out
|
||||
|
||||
assuming that you have sphinx 1.0.7 installed
|
||||
|
||||
@@ -64,8 +65,9 @@ else:
|
||||
"bpy.props",
|
||||
"bpy.utils",
|
||||
"bpy.context",
|
||||
# "bpy.types", # supports filtering
|
||||
"bpy.types", # supports filtering
|
||||
"bpy.ops", # supports filtering
|
||||
#"bpy_extras",
|
||||
"bge",
|
||||
"aud",
|
||||
"bgl",
|
||||
@@ -206,10 +208,24 @@ def write_indented_lines(ident, fn, text, strip=True):
|
||||
'''
|
||||
if text is None:
|
||||
return
|
||||
for l in text.split("\n"):
|
||||
if strip:
|
||||
fn(ident + l.strip() + "\n")
|
||||
else:
|
||||
|
||||
lines = text.split("\n")
|
||||
|
||||
# strip empty lines from the start/end
|
||||
while lines and not lines[0].strip():
|
||||
del lines[0]
|
||||
while lines and not lines[-1].strip():
|
||||
del lines[-1]
|
||||
|
||||
if strip:
|
||||
ident_strip = 1000
|
||||
for l in lines:
|
||||
if l.strip():
|
||||
ident_strip = min(ident_strip, len(l) - len(l.lstrip()))
|
||||
for l in lines:
|
||||
fn(ident + l[ident_strip:] + "\n")
|
||||
else:
|
||||
for l in lines:
|
||||
fn(ident + l + "\n")
|
||||
|
||||
|
||||
@@ -254,7 +270,7 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
|
||||
|
||||
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
|
||||
if py_func.__doc__:
|
||||
write_indented_lines(ident + " ", fw, py_func.__doc__.strip())
|
||||
write_indented_lines(ident + " ", fw, py_func.__doc__)
|
||||
fw("\n")
|
||||
|
||||
|
||||
@@ -269,8 +285,10 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
|
||||
if type(descr) == GetSetDescriptorType:
|
||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, doc, False)
|
||||
fw("\n")
|
||||
elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType):
|
||||
write_indented_lines(ident, fw, doc, False)
|
||||
fw("\n")
|
||||
else:
|
||||
raise TypeError("type was not GetSetDescriptorType, MethodDescriptorType or ClassMethodDescriptorType")
|
||||
|
||||
@@ -318,11 +336,17 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
attribute_set = set()
|
||||
filepath = os.path.join(BASEPATH, module_name + ".rst")
|
||||
|
||||
module_all = getattr(module, "__all__", None)
|
||||
module_dir = sorted(dir(module))
|
||||
|
||||
if module_all:
|
||||
module_dir = module_all
|
||||
|
||||
file = open(filepath, "w")
|
||||
|
||||
fw = file.write
|
||||
|
||||
write_title(fw, title, "=")
|
||||
write_title(fw, "%s (%s)" % (title, module_name), "=")
|
||||
|
||||
fw(".. module:: %s\n\n" % module_name)
|
||||
|
||||
@@ -333,6 +357,35 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write submodules
|
||||
# we could also scan files but this ensures __all__ is used correctly
|
||||
if module_all is not None:
|
||||
submod_name = None
|
||||
submod = None
|
||||
submod_ls = []
|
||||
for submod_name in module_all:
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as submod" % (module.__name__, submod_name)
|
||||
exec(exec_str, ns, ns)
|
||||
submod = ns["submod"]
|
||||
if type(submod) == types.ModuleType:
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
del submod_name
|
||||
del submod
|
||||
|
||||
if submod_ls:
|
||||
fw(".. toctree::\n")
|
||||
fw(" :maxdepth: 1\n\n")
|
||||
|
||||
for submod_name, submod in submod_ls:
|
||||
submod_name_full = "%s.%s" % (module_name, submod_name)
|
||||
fw(" %s.rst\n\n" % submod_name_full)
|
||||
|
||||
pymodule2sphinx(BASEPATH, submod_name_full, submod, "%s submodule" % module_name)
|
||||
del submod_ls
|
||||
# done writing submodules!
|
||||
|
||||
# write members of the module
|
||||
# only tested with PyStructs which are not exactly modules
|
||||
for key, descr in sorted(type(module).__dict__.items()):
|
||||
@@ -350,15 +403,15 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
if descr.__doc__:
|
||||
fw(".. data:: %s\n\n" % key)
|
||||
write_indented_lines(" ", fw, descr.__doc__, False)
|
||||
attribute_set.add(key)
|
||||
fw("\n")
|
||||
attribute_set.add(key)
|
||||
|
||||
del key, descr
|
||||
|
||||
classes = []
|
||||
|
||||
for attribute in sorted(dir(module)):
|
||||
for attribute in module_dir:
|
||||
if not attribute.startswith("_"):
|
||||
|
||||
if attribute in attribute_set:
|
||||
continue
|
||||
|
||||
@@ -982,6 +1035,8 @@ def rna2sphinx(BASEPATH):
|
||||
fw(" blf.rst\n\n")
|
||||
if "aud" not in EXCLUDE_MODULES:
|
||||
fw(" aud.rst\n\n")
|
||||
if "bpy_extras" not in EXCLUDE_MODULES:
|
||||
fw(" bpy_extras.rst\n\n")
|
||||
|
||||
# game engine
|
||||
if "bge" not in EXCLUDE_MODULES:
|
||||
@@ -1078,41 +1133,45 @@ def rna2sphinx(BASEPATH):
|
||||
# python modules
|
||||
if "bpy.utils" not in EXCLUDE_MODULES:
|
||||
from bpy import utils as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities")
|
||||
|
||||
if "bpy.path" not in EXCLUDE_MODULES:
|
||||
from bpy import path as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities (bpy.path)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.path", module, "Path Utilities")
|
||||
|
||||
if "bpy_extras" not in EXCLUDE_MODULES:
|
||||
import bpy_extras as module
|
||||
pymodule2sphinx(BASEPATH, "bpy_extras", module, "Extra Utilities")
|
||||
|
||||
# C modules
|
||||
if "bpy.app" not in EXCLUDE_MODULES:
|
||||
from bpy import app as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data (bpy.app)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
|
||||
|
||||
if "bpy.props" not in EXCLUDE_MODULES:
|
||||
from bpy import props as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions (bpy.props)")
|
||||
pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
|
||||
|
||||
if "mathutils" not in EXCLUDE_MODULES:
|
||||
import mathutils as module
|
||||
pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities (mathutils)")
|
||||
pymodule2sphinx(BASEPATH, "mathutils", module, "Math Types & Utilities")
|
||||
|
||||
if "mathutils.geometry" not in EXCLUDE_MODULES:
|
||||
import mathutils.geometry as module
|
||||
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities (mathutils.geometry)")
|
||||
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
|
||||
|
||||
if "mathutils.geometry" not in EXCLUDE_MODULES:
|
||||
import blf as module
|
||||
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing (blf)")
|
||||
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
|
||||
|
||||
# XXX TODO
|
||||
#import bgl as module
|
||||
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper (bgl)")
|
||||
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
|
||||
#del module
|
||||
|
||||
if "aud" not in EXCLUDE_MODULES:
|
||||
import aud as module
|
||||
pymodule2sphinx(BASEPATH, "aud", module, "Audio System (aud)")
|
||||
pymodule2sphinx(BASEPATH, "aud", module, "Audio System")
|
||||
del module
|
||||
|
||||
## game engine
|
||||
|
||||
14
extern/binreloc/CMakeLists.txt
vendored
14
extern/binreloc/CMakeLists.txt
vendored
@@ -18,17 +18,21 @@
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
set(INC
|
||||
./include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
binreloc.c
|
||||
|
||||
include/binreloc.h
|
||||
)
|
||||
|
||||
set(INC
|
||||
./include
|
||||
)
|
||||
|
||||
add_definitions(-DENABLE_BINRELOC)
|
||||
|
||||
|
||||
blender_add_lib(extern_binreloc "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_binreloc "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
7
extern/bullet2/CMakeLists.txt
vendored
7
extern/bullet2/CMakeLists.txt
vendored
@@ -29,6 +29,10 @@ set(INC
|
||||
src
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
|
||||
src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
|
||||
@@ -146,7 +150,6 @@ set(SRC
|
||||
src/LinearMath/btQuickprof.cpp
|
||||
src/LinearMath/btSerializer.cpp
|
||||
|
||||
|
||||
src/Bullet-C-Api.h
|
||||
src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
|
||||
src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
|
||||
@@ -330,4 +333,4 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||
endif()
|
||||
|
||||
blender_add_lib(extern_bullet "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_bullet "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -1026,7 +1026,7 @@ void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxUp(int axis, BP_FP_INT_TYPE ed
|
||||
|
||||
|
||||
/// The btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.
|
||||
/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.
|
||||
/// It uses arrays rather than lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.
|
||||
/// For large worlds and many objects, use bt32BitAxisSweep3 or btDbvtBroadphase instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.
|
||||
class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>
|
||||
{
|
||||
@@ -1038,7 +1038,7 @@ public:
|
||||
|
||||
/// The bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune.
|
||||
/// This comes at the cost of more memory per handle, and a bit slower performance.
|
||||
/// It uses arrays rather then lists for storage of the 3 axis.
|
||||
/// It uses arrays rather than lists for storage of the 3 axis.
|
||||
class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -487,7 +487,7 @@ btScalar btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,
|
||||
{
|
||||
(void)resultOut;
|
||||
(void)dispatchInfo;
|
||||
///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
|
||||
///rather than checking ALL pairs, only calculate TOI when motion exceeds threshold
|
||||
|
||||
///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
|
||||
///col0->m_worldTransform,
|
||||
|
||||
8
extern/glew/CMakeLists.txt
vendored
8
extern/glew/CMakeLists.txt
vendored
@@ -28,8 +28,12 @@ set(INC
|
||||
./include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND INC ${X11_X11_INCLUDE_PATH})
|
||||
list(APPEND INC_SYS ${X11_X11_INCLUDE_PATH})
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
@@ -42,4 +46,4 @@ set(SRC
|
||||
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
|
||||
blender_add_lib(extern_glew "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_glew "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
204
extern/glew/include/GL/glew.h
vendored
204
extern/glew/include/GL/glew.h
vendored
@@ -1158,11 +1158,13 @@ GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei heigh
|
||||
|
||||
/* ---------------------------------- GLU ---------------------------------- */
|
||||
|
||||
#ifndef GLEW_NO_GLU
|
||||
/* this is where we can safely include GLU */
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <OpenGL/glu.h>
|
||||
#else
|
||||
#include <GL/glu.h>
|
||||
# if defined(__APPLE__) && defined(__MACH__)
|
||||
# include <OpenGL/glu.h>
|
||||
# else
|
||||
# include <GL/glu.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
|
||||
@@ -2445,6 +2447,18 @@ typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
|
||||
|
||||
#endif /* GL_3DFX_texture_compression_FXT1 */
|
||||
|
||||
/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */
|
||||
|
||||
#ifndef GL_AMD_blend_minmax_factor
|
||||
#define GL_AMD_blend_minmax_factor 1
|
||||
|
||||
#define GL_FACTOR_MIN_AMD 0x901C
|
||||
#define GL_FACTOR_MAX_AMD 0x901D
|
||||
|
||||
#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor)
|
||||
|
||||
#endif /* GL_AMD_blend_minmax_factor */
|
||||
|
||||
/* ----------------------- GL_AMD_conservative_depth ----------------------- */
|
||||
|
||||
#ifndef GL_AMD_conservative_depth
|
||||
@@ -2587,6 +2601,21 @@ typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monito
|
||||
|
||||
#endif /* GL_AMD_performance_monitor */
|
||||
|
||||
/* ------------------------ GL_AMD_sample_positions ------------------------ */
|
||||
|
||||
#ifndef GL_AMD_sample_positions
|
||||
#define GL_AMD_sample_positions 1
|
||||
|
||||
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val);
|
||||
|
||||
#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD)
|
||||
|
||||
#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions)
|
||||
|
||||
#endif /* GL_AMD_sample_positions */
|
||||
|
||||
/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */
|
||||
|
||||
#ifndef GL_AMD_seamless_cubemap_per_texture
|
||||
@@ -3262,12 +3291,6 @@ typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum t
|
||||
#ifndef GL_ARB_draw_instanced
|
||||
#define GL_ARB_draw_instanced 1
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
|
||||
|
||||
#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)
|
||||
#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)
|
||||
|
||||
#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced)
|
||||
|
||||
#endif /* GL_ARB_draw_instanced */
|
||||
@@ -3827,8 +3850,12 @@ typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum in
|
||||
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
|
||||
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
|
||||
|
||||
#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)
|
||||
#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)
|
||||
#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB)
|
||||
|
||||
#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays)
|
||||
@@ -6211,8 +6238,8 @@ typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
|
||||
typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
|
||||
typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
|
||||
|
||||
#define glPNTrianglesfATI GLEW_GET_FUN(__glPNTrianglewesfATI)
|
||||
#define glPNTrianglesiATI GLEW_GET_FUN(__glPNTrianglewesiATI)
|
||||
#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI)
|
||||
#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI)
|
||||
|
||||
#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles)
|
||||
|
||||
@@ -7599,12 +7626,10 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLen
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
|
||||
|
||||
#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT)
|
||||
#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT)
|
||||
#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)
|
||||
#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT)
|
||||
|
||||
#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4)
|
||||
@@ -8450,6 +8475,10 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level,
|
||||
#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
|
||||
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
|
||||
#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)
|
||||
|
||||
#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array)
|
||||
|
||||
#endif /* GL_EXT_texture_array */
|
||||
@@ -9316,6 +9345,21 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight);
|
||||
|
||||
#endif /* GL_EXT_vertex_weighting */
|
||||
|
||||
/* ------------------------- GL_EXT_x11_sync_object ------------------------ */
|
||||
|
||||
#ifndef GL_EXT_x11_sync_object
|
||||
#define GL_EXT_x11_sync_object 1
|
||||
|
||||
#define GL_SYNC_X11_FENCE_EXT 0x90E1
|
||||
|
||||
typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
|
||||
|
||||
#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT)
|
||||
|
||||
#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object)
|
||||
|
||||
#endif /* GL_EXT_x11_sync_object */
|
||||
|
||||
/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */
|
||||
|
||||
#ifndef GL_GREMEDY_frame_terminator
|
||||
@@ -10796,6 +10840,32 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void);
|
||||
|
||||
#endif /* GL_NV_texture_expand_normal */
|
||||
|
||||
/* ----------------------- GL_NV_texture_multisample ----------------------- */
|
||||
|
||||
#ifndef GL_NV_texture_multisample
|
||||
#define GL_NV_texture_multisample 1
|
||||
|
||||
#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
|
||||
#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
|
||||
typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
|
||||
|
||||
#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV)
|
||||
#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV)
|
||||
#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV)
|
||||
#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV)
|
||||
#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV)
|
||||
#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV)
|
||||
|
||||
#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample)
|
||||
|
||||
#endif /* GL_NV_texture_multisample */
|
||||
|
||||
/* ------------------------ GL_NV_texture_rectangle ------------------------ */
|
||||
|
||||
#ifndef GL_NV_texture_rectangle
|
||||
@@ -11505,6 +11575,71 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei
|
||||
|
||||
#endif /* GL_NV_vertex_program4 */
|
||||
|
||||
/* -------------------------- GL_NV_video_capture -------------------------- */
|
||||
|
||||
#ifndef GL_NV_video_capture
|
||||
#define GL_NV_video_capture 1
|
||||
|
||||
#define GL_VIDEO_BUFFER_NV 0x9020
|
||||
#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
|
||||
#define GL_FIELD_UPPER_NV 0x9022
|
||||
#define GL_FIELD_LOWER_NV 0x9023
|
||||
#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
|
||||
#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
|
||||
#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
|
||||
#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
|
||||
#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
|
||||
#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
|
||||
#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
|
||||
#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
|
||||
#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
|
||||
#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
|
||||
#define GL_PARTIAL_SUCCESS_NV 0x902E
|
||||
#define GL_SUCCESS_NV 0x902F
|
||||
#define GL_FAILURE_NV 0x9030
|
||||
#define GL_YCBYCR8_422_NV 0x9031
|
||||
#define GL_YCBAYCR8A_4224_NV 0x9032
|
||||
#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
|
||||
#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
|
||||
#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
|
||||
#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
|
||||
#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
|
||||
#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
|
||||
#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
|
||||
#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
|
||||
#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
|
||||
#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
|
||||
|
||||
typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
|
||||
typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
|
||||
typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
|
||||
typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
|
||||
typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params);
|
||||
typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params);
|
||||
typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params);
|
||||
typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params);
|
||||
typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time);
|
||||
typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params);
|
||||
typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params);
|
||||
typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params);
|
||||
|
||||
#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV)
|
||||
#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV)
|
||||
#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV)
|
||||
#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV)
|
||||
#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV)
|
||||
#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV)
|
||||
#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV)
|
||||
#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV)
|
||||
#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV)
|
||||
#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV)
|
||||
#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV)
|
||||
#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV)
|
||||
|
||||
#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture)
|
||||
|
||||
#endif /* GL_NV_video_capture */
|
||||
|
||||
/* ------------------------ GL_OES_byte_coordinates ------------------------ */
|
||||
|
||||
#ifndef GL_OES_byte_coordinates
|
||||
@@ -13052,6 +13187,8 @@ GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupS
|
||||
GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD;
|
||||
GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD;
|
||||
GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD;
|
||||
|
||||
@@ -13132,9 +13269,6 @@ GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBase
|
||||
GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect;
|
||||
GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;
|
||||
GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;
|
||||
GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;
|
||||
GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer;
|
||||
@@ -13234,6 +13368,8 @@ GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram;
|
||||
GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax;
|
||||
GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;
|
||||
GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange;
|
||||
@@ -13711,8 +13847,8 @@ GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderCon
|
||||
GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI;
|
||||
GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI;
|
||||
GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI;
|
||||
GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI;
|
||||
GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI;
|
||||
GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI;
|
||||
@@ -14093,7 +14229,6 @@ GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;
|
||||
GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT;
|
||||
@@ -14214,6 +14349,8 @@ GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT;
|
||||
@@ -14311,6 +14448,8 @@ GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY;
|
||||
@@ -14573,6 +14712,13 @@ GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV;
|
||||
GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV;
|
||||
GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV;
|
||||
GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV;
|
||||
GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV;
|
||||
GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV;
|
||||
GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV;
|
||||
GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV;
|
||||
@@ -14705,6 +14851,19 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;
|
||||
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV;
|
||||
GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV;
|
||||
GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV;
|
||||
GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV;
|
||||
GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV;
|
||||
GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV;
|
||||
GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV;
|
||||
GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV;
|
||||
GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV;
|
||||
GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV;
|
||||
GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV;
|
||||
GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES;
|
||||
GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES;
|
||||
GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES;
|
||||
@@ -14866,12 +15025,14 @@ GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4;
|
||||
@@ -15106,6 +15267,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes;
|
||||
@@ -15174,6 +15336,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2;
|
||||
@@ -15191,6 +15354,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture;
|
||||
GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format;
|
||||
|
||||
39
extern/glew/include/GL/glxew.h
vendored
39
extern/glew/include/GL/glxew.h
vendored
@@ -876,6 +876,33 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
|
||||
|
||||
#endif /* GLX_NV_vertex_array_range */
|
||||
|
||||
/* -------------------------- GLX_NV_video_capture ------------------------- */
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
#define GLX_NV_video_capture 1
|
||||
|
||||
#define GLX_DEVICE_ID_NV 0x20CD
|
||||
#define GLX_UNIQUE_ID_NV 0x20CE
|
||||
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
|
||||
typedef XID GLXVideoCaptureDeviceNV;
|
||||
|
||||
typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
|
||||
typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
|
||||
typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
|
||||
|
||||
#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
|
||||
#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
|
||||
#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
|
||||
#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
|
||||
#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
|
||||
|
||||
#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
|
||||
|
||||
#endif /* GLX_NV_video_capture */
|
||||
|
||||
/* -------------------------- GLX_NV_video_output -------------------------- */
|
||||
|
||||
#ifndef GLX_NV_video_output
|
||||
@@ -926,8 +953,7 @@ typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf,
|
||||
|
||||
/* -------------------------- GLX_OML_sync_control ------------------------- */
|
||||
|
||||
#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
#include <inttypes.h>
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
|
||||
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
|
||||
@@ -1374,6 +1400,12 @@ extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
|
||||
extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
|
||||
extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
|
||||
|
||||
extern PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
|
||||
extern PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
|
||||
extern PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
|
||||
extern PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
|
||||
extern PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
|
||||
|
||||
extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
|
||||
extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
|
||||
extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
|
||||
@@ -1381,13 +1413,11 @@ extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
|
||||
extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
|
||||
extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
|
||||
|
||||
#ifdef GLX_OML_sync_control
|
||||
extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
|
||||
extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
|
||||
extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
|
||||
extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
|
||||
extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
|
||||
#endif
|
||||
|
||||
extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
|
||||
extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
|
||||
@@ -1480,6 +1510,7 @@ GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_NV_video_capture;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
|
||||
GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
|
||||
|
||||
78
extern/glew/include/GL/wglew.h
vendored
78
extern/glew/include/GL/wglew.h
vendored
@@ -141,7 +141,7 @@ typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids);
|
||||
//XXX-blender, added: typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
|
||||
#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD)
|
||||
@@ -831,6 +831,37 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO
|
||||
|
||||
#endif /* WGL_I3D_swap_frame_usage */
|
||||
|
||||
/* --------------------------- WGL_NV_DX_interop --------------------------- */
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_NV_DX_interop 1
|
||||
|
||||
#define WGL_ACCESS_READ_ONLY_NV 0x0000
|
||||
#define WGL_ACCESS_READ_WRITE_NV 0x0001
|
||||
#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||
|
||||
#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)
|
||||
#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)
|
||||
#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)
|
||||
#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)
|
||||
#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)
|
||||
#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)
|
||||
#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)
|
||||
#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)
|
||||
|
||||
#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)
|
||||
|
||||
#endif /* WGL_NV_DX_interop */
|
||||
|
||||
/* --------------------------- WGL_NV_copy_image --------------------------- */
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
@@ -996,6 +1027,32 @@ typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
|
||||
#endif /* WGL_NV_vertex_array_range */
|
||||
|
||||
/* -------------------------- WGL_NV_video_capture ------------------------- */
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
|
||||
#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)
|
||||
#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)
|
||||
#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)
|
||||
#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)
|
||||
#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)
|
||||
|
||||
#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)
|
||||
|
||||
#endif /* WGL_NV_video_capture */
|
||||
|
||||
/* -------------------------- WGL_NV_video_output -------------------------- */
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
@@ -1080,7 +1137,7 @@ WGLEW_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContext
|
||||
WGLEW_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
|
||||
WGLEW_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
|
||||
WGLEW_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
|
||||
//XXX-blender, added: WGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
|
||||
WGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
|
||||
WGLEW_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
|
||||
@@ -1168,6 +1225,15 @@ WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
|
||||
WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
|
||||
WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
|
||||
|
||||
WGLEW_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;
|
||||
WGLEW_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;
|
||||
WGLEW_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;
|
||||
WGLEW_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;
|
||||
WGLEW_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;
|
||||
WGLEW_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
|
||||
|
||||
WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
|
||||
@@ -1190,6 +1256,12 @@ WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
|
||||
WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
|
||||
WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
|
||||
|
||||
WGLEW_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;
|
||||
WGLEW_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;
|
||||
|
||||
WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
|
||||
WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
|
||||
WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
|
||||
@@ -1237,6 +1309,7 @@ WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_DX_interop;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_copy_image;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
|
||||
@@ -1246,6 +1319,7 @@ WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_video_capture;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_NV_video_output;
|
||||
WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
|
||||
|
||||
|
||||
1436
extern/glew/src/glew.c
vendored
1436
extern/glew/src/glew.c
vendored
File diff suppressed because it is too large
Load Diff
6
extern/libopenjpeg/CMakeLists.txt
vendored
6
extern/libopenjpeg/CMakeLists.txt
vendored
@@ -28,6 +28,10 @@ set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
bio.c
|
||||
cio.c
|
||||
@@ -73,4 +77,4 @@ set(SRC
|
||||
tgt.h
|
||||
)
|
||||
|
||||
blender_add_lib(extern_openjpeg "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_openjpeg "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
5
extern/libredcode/CMakeLists.txt
vendored
5
extern/libredcode/CMakeLists.txt
vendored
@@ -26,6 +26,9 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
../libopenjpeg
|
||||
)
|
||||
|
||||
@@ -39,4 +42,4 @@ set(SRC
|
||||
format.h
|
||||
)
|
||||
|
||||
blender_add_lib(extern_redcode "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_redcode "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
6
extern/lzma/CMakeLists.txt
vendored
6
extern/lzma/CMakeLists.txt
vendored
@@ -28,6 +28,10 @@ set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
Alloc.c
|
||||
LzFind.c
|
||||
@@ -44,4 +48,4 @@ set(SRC
|
||||
Types.h
|
||||
)
|
||||
|
||||
blender_add_lib(extern_lzma "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_lzma "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
6
extern/lzo/CMakeLists.txt
vendored
6
extern/lzo/CMakeLists.txt
vendored
@@ -28,6 +28,10 @@ set(INC
|
||||
include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
minilzo/minilzo.c
|
||||
|
||||
@@ -36,4 +40,4 @@ set(SRC
|
||||
minilzo/minilzo.h
|
||||
)
|
||||
|
||||
blender_add_lib(extern_minilzo "${SRC}" "${INC}")
|
||||
blender_add_lib(extern_minilzo "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -23,9 +23,13 @@
|
||||
set(INC
|
||||
.
|
||||
intern
|
||||
FX SRC
|
||||
FX
|
||||
SRC
|
||||
../ffmpeg
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${PTHREADS_INC}
|
||||
${LIBSAMPLERATE_INC}
|
||||
)
|
||||
|
||||
set(SRC
|
||||
@@ -155,8 +159,9 @@ set(SRC
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
list(APPEND INC ffmpeg ${FFMPEG_INC})
|
||||
set(FFMPEGSRC
|
||||
list(APPEND INC ffmpeg)
|
||||
list(APPEND INC_SYS ${FFMPEG_INC})
|
||||
list(APPEND SRC
|
||||
ffmpeg/AUD_FFMPEGFactory.cpp
|
||||
ffmpeg/AUD_FFMPEGReader.cpp
|
||||
|
||||
@@ -167,8 +172,9 @@ endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
add_definitions(-DWITH_SDL)
|
||||
list(APPEND INC SDL ${SDL_INCLUDE_DIR})
|
||||
set(SDLSRC
|
||||
list(APPEND INC SDL)
|
||||
list(APPEND INC_SYS ${SDL_INCLUDE_DIR})
|
||||
list(APPEND SRC
|
||||
SDL/AUD_SDLDevice.cpp
|
||||
|
||||
SDL/AUD_SDLDevice.h
|
||||
@@ -177,8 +183,9 @@ endif()
|
||||
|
||||
if(WITH_OPENAL)
|
||||
add_definitions(-DWITH_OPENAL)
|
||||
list(APPEND INC OpenAL ${OPENAL_INCLUDE_DIR})
|
||||
set(OPENALSRC
|
||||
list(APPEND INC OpenAL)
|
||||
list(APPEND INC_SYS ${OPENAL_INCLUDE_DIR})
|
||||
list(APPEND SRC
|
||||
OpenAL/AUD_OpenALDevice.cpp
|
||||
|
||||
OpenAL/AUD_OpenALDevice.h
|
||||
@@ -187,8 +194,9 @@ endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
add_definitions(-DWITH_JACK)
|
||||
list(APPEND INC jack ${JACK_INC})
|
||||
set(JACKSRC
|
||||
list(APPEND INC jack)
|
||||
list(APPEND INC_SYS ${JACK_INC})
|
||||
list(APPEND SRC
|
||||
jack/AUD_JackDevice.cpp
|
||||
|
||||
jack/AUD_JackDevice.h
|
||||
@@ -197,8 +205,9 @@ endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
add_definitions(-DWITH_SNDFILE)
|
||||
list(APPEND INC sndfile ${SNDFILE_INC})
|
||||
set(SNDFILESRC
|
||||
list(APPEND INC sndfile)
|
||||
list(APPEND INC_SYS ${SNDFILE_INC})
|
||||
list(APPEND SRC
|
||||
sndfile/AUD_SndFileFactory.cpp
|
||||
sndfile/AUD_SndFileReader.cpp
|
||||
|
||||
@@ -209,7 +218,8 @@ endif()
|
||||
|
||||
if(WITH_SAMPLERATE)
|
||||
add_definitions(-DWITH_SAMPLERATE)
|
||||
set(SRCFILESRC
|
||||
list(APPEND INC_SYS ${LIBSAMPLERATE_INC})
|
||||
list(APPEND SRC
|
||||
SRC/AUD_SRCResampleFactory.cpp
|
||||
SRC/AUD_SRCResampleReader.cpp
|
||||
|
||||
@@ -220,8 +230,9 @@ endif()
|
||||
|
||||
if(WITH_FFTW3 AND FALSE)
|
||||
add_definitions(-DWITH_FFTW3)
|
||||
list(APPEND INC fftw ${FFTW3_INC})
|
||||
set(FFTW3SRC
|
||||
list(APPEND INC fftw)
|
||||
list(APPEND INC_SYS ${FFTW3_INC})
|
||||
list(APPEND SRC
|
||||
fftw/AUD_BandPassFactory.cpp
|
||||
fftw/AUD_BandPassReader.cpp
|
||||
|
||||
@@ -231,8 +242,9 @@ if(WITH_FFTW3 AND FALSE)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
list(APPEND INC Python ${PYTHON_INCLUDE_DIRS})
|
||||
set(PYTHONSRC
|
||||
list(APPEND INC Python)
|
||||
list(APPEND INC_SYS ${PYTHON_INCLUDE_DIRS})
|
||||
list(APPEND SRC
|
||||
Python/AUD_PyAPI.cpp
|
||||
|
||||
Python/AUD_PyAPI.h
|
||||
@@ -240,16 +252,4 @@ if(WITH_PYTHON)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
${SRC}
|
||||
${FFMPEGSRC}
|
||||
${SNDFILESRC}
|
||||
${SRCFILESRC}
|
||||
${FFTW3SRC}
|
||||
${SDLSRC}
|
||||
${OPENALSRC}
|
||||
${JACKSRC}
|
||||
${PYTHONSRC}
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_audaspace "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -8,7 +8,7 @@ defs = []
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
sources += env.Glob('ffmpeg/*.cpp')
|
||||
incs += ' ffmpeg ' + env['BF_FFMPEG_INC']
|
||||
incs += ' ffmpeg #/intern/ffmpeg ' + env['BF_FFMPEG_INC']
|
||||
defs.append('WITH_FFMPEG')
|
||||
|
||||
if env['WITH_BF_SDL']:
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include "ffmpeg_compat.h"
|
||||
}
|
||||
|
||||
int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer& buffer)
|
||||
@@ -52,6 +53,10 @@ int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer& buffer)
|
||||
|
||||
int read_length, data_size;
|
||||
|
||||
AVPacket tmp_pkt;
|
||||
|
||||
av_init_packet(&tmp_pkt);
|
||||
|
||||
// as long as there is still data in the package
|
||||
while(audio_pkg_size > 0)
|
||||
{
|
||||
@@ -64,15 +69,14 @@ int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer& buffer)
|
||||
|
||||
// read samples from the packet
|
||||
data_size = buf_size - buf_pos;
|
||||
/*read_length = avcodec_decode_audio3(m_codecCtx,
|
||||
(int16_t*)(((data_t*)buffer.getBuffer())+buf_pos),
|
||||
&data_size,
|
||||
packet);*/
|
||||
read_length = avcodec_decode_audio2(m_codecCtx,
|
||||
(int16_t*)(((data_t*)buffer.getBuffer()) + buf_pos),
|
||||
&data_size,
|
||||
audio_pkg_data,
|
||||
audio_pkg_size);
|
||||
|
||||
tmp_pkt.data = audio_pkg_data;
|
||||
tmp_pkt.size = audio_pkg_size;
|
||||
|
||||
read_length = avcodec_decode_audio3(
|
||||
m_codecCtx,
|
||||
(int16_t*)(((data_t*)buffer.getBuffer()) + buf_pos),
|
||||
&data_size, &tmp_pkt);
|
||||
|
||||
// read error, next packet!
|
||||
if(read_length < 0)
|
||||
@@ -112,7 +116,7 @@ void AUD_FFMPEGReader::init()
|
||||
|
||||
for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
|
||||
{
|
||||
if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
|
||||
if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
&& (m_stream < 0))
|
||||
{
|
||||
m_stream=i;
|
||||
|
||||
@@ -36,6 +36,10 @@ set(INC
|
||||
../../source/blender/makesdna
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/BOP_BBox.cpp
|
||||
intern/BOP_BSPNode.cpp
|
||||
@@ -75,4 +79,4 @@ set(SRC
|
||||
intern/BOP_Vertex.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_bop "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_bop "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -27,10 +27,15 @@
|
||||
set(INC
|
||||
./intern
|
||||
../container
|
||||
../guardedalloc
|
||||
../moto/include
|
||||
../memutil
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/BSP_CSGMesh.cpp
|
||||
intern/BSP_MeshPrimitives.cpp
|
||||
@@ -43,4 +48,4 @@ set(SRC
|
||||
intern/BSP_MeshPrimitives.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_bsp "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_bsp "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -3,7 +3,7 @@ Import ('env')
|
||||
|
||||
sources = env.Glob('intern/*.cpp')
|
||||
|
||||
incs = 'intern ../container ../moto/include ../memutil'
|
||||
incs = 'intern ../container ../moto/include ../memutil ../guardedalloc'
|
||||
|
||||
env.BlenderLib ('bf_intern_bsp', sources, Split(incs), [], libtype=['core','player'], priority=[200,100] )
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ set(INC
|
||||
../guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/CTR_List.cpp
|
||||
|
||||
@@ -40,4 +44,4 @@ set(SRC
|
||||
CTR_UHeap.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_ctr "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_ctr "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "MEM_sys_types.h"
|
||||
|
||||
enum {
|
||||
|
||||
empty_tag = 0x0,
|
||||
@@ -100,9 +102,9 @@ public:
|
||||
|
||||
#if defined(_WIN64)
|
||||
CTR_TaggedIndex(
|
||||
const unsigned __int64 val
|
||||
const uint64_t val
|
||||
) :
|
||||
m_val ( ((unsigned __int64)val & index_mask)
|
||||
m_val ( ((uint64_t)val & index_mask)
|
||||
| ( (empty_tag << tag_shift)
|
||||
& (~index_mask) ) ) {
|
||||
}
|
||||
@@ -140,8 +142,8 @@ public:
|
||||
}
|
||||
|
||||
#if defined(_WIN64)
|
||||
operator unsigned __int64 () const {
|
||||
return (unsigned __int64)(m_val & index_mask);
|
||||
operator uint64_t () const {
|
||||
return (uint64_t)(m_val & index_mask);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,10 +27,15 @@
|
||||
set(INC
|
||||
.
|
||||
../container
|
||||
../guardedalloc
|
||||
../memutil
|
||||
../moto/include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/LOD_EdgeCollapser.cpp
|
||||
intern/LOD_ExternNormalEditor.cpp
|
||||
@@ -56,4 +61,4 @@ set(SRC
|
||||
intern/LOD_QuadricEditor.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_decimate "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_decimate "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -3,6 +3,6 @@ Import ('env')
|
||||
|
||||
sources = env.Glob('intern/*.cpp')
|
||||
|
||||
incs = '. ../moto/include ../container ../memutil'
|
||||
incs = '. ../moto/include ../container ../memutil ../guardedalloc'
|
||||
|
||||
env.BlenderLib ('bf_intern_decimate', sources, Split(incs) , [], libtype=['core', 'player'], priority = [200, 100] )
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
|
||||
set(INC
|
||||
extern
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${PNG_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
@@ -88,11 +91,11 @@ set(SRC
|
||||
|
||||
add_definitions(-DNOGUI -DELBEEM_BLENDER=1)
|
||||
if(WINDOWS)
|
||||
add_definitions(-DUSE_MSVC6FIXES)
|
||||
add_definitions(-DUSE_MSVC6FIXES)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENMP)
|
||||
add_definitions(-DPARALLEL=1)
|
||||
add_definitions(-DPARALLEL=1)
|
||||
endif()
|
||||
|
||||
blender_add_lib_nolist(bf_intern_elbeem "${SRC}" "${INC}")
|
||||
blender_add_lib_nolist(bf_intern_elbeem "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
133
intern/ffmpeg/ffmpeg_compat.h
Normal file
133
intern/ffmpeg/ffmpeg_compat.h
Normal file
@@ -0,0 +1,133 @@
|
||||
#ifndef __ffmpeg_compat_h_included__
|
||||
#define __ffmpeg_compat_h_included__ 1
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* compatibility macros to make every ffmpeg installation appear
|
||||
* like the most current installation (wrapping some functionality sometimes)
|
||||
* it also includes all ffmpeg header files at once, no need to do it
|
||||
* seperately.
|
||||
*
|
||||
* Copyright (c) 2011 Peter Schlaile
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavutil/rational.h>
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 101))
|
||||
#define FFMPEG_HAVE_PARSE_UTILS 1
|
||||
#include <libavutil/parseutils.h>
|
||||
#endif
|
||||
|
||||
#include <libswscale/swscale.h>
|
||||
#include <libavcodec/opt.h>
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105))
|
||||
#define FFMPEG_HAVE_AVIO 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVCODEC_VERSION_MAJOR > 53) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR > 1)) || ((LIBAVCODEC_VERSION_MAJOR == 53) && (LIBAVCODEC_VERSION_MINOR == 1) && (LIBAVCODEC_VERSION_MICRO >= 1))
|
||||
#define FFMPEG_HAVE_DEFAULT_VAL_UNION 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 101))
|
||||
#define FFMPEG_HAVE_AV_DUMP_FORMAT 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 45))
|
||||
#define FFMPEG_HAVE_AV_GUESS_FORMAT 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVCODEC_VERSION_MAJOR > 52) || ((LIBAVCODEC_VERSION_MAJOR >= 52) && (LIBAVCODEC_VERSION_MINOR >= 23))
|
||||
#define FFMPEG_HAVE_DECODE_AUDIO3 1
|
||||
#define FFMPEG_HAVE_DECODE_VIDEO2 1
|
||||
#endif
|
||||
|
||||
#if (LIBAVCODEC_VERSION_MAJOR > 52) || ((LIBAVCODEC_VERSION_MAJOR >= 52) && (LIBAVCODEC_VERSION_MINOR >= 64))
|
||||
#define FFMPEG_HAVE_AVMEDIA_TYPES 1
|
||||
#endif
|
||||
|
||||
#if ((LIBAVCODEC_VERSION_MAJOR > 52) || (LIBAVCODEC_VERSION_MAJOR >= 52) && (LIBAVCODEC_VERSION_MINOR >= 29)) && \
|
||||
((LIBSWSCALE_VERSION_MAJOR > 0) || (LIBSWSCALE_VERSION_MAJOR >= 0) && (LIBSWSCALE_VERSION_MINOR >= 10))
|
||||
#define FFMPEG_SWSCALE_COLOR_SPACE_SUPPORT
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_AVIO
|
||||
#define AVIO_FLAG_WRITE URL_WRONLY
|
||||
#define avio_open url_fopen
|
||||
#define avio_tell url_ftell
|
||||
#define avio_close url_fclose
|
||||
#endif
|
||||
|
||||
/* there are some version inbetween, which have avio_... functions but no
|
||||
AVIO_FLAG_... */
|
||||
#ifndef AVIO_FLAG_WRITE
|
||||
#define AVIO_FLAG_WRITE URL_WRONLY
|
||||
#endif
|
||||
|
||||
#ifndef AV_PKT_FLAG_KEY
|
||||
#define AV_PKT_FLAG_KEY PKT_FLAG_KEY
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_AV_DUMP_FORMAT
|
||||
#define av_dump_format dump_format
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_AV_GUESS_FORMAT
|
||||
#define av_guess_format guess_format
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_PARSE_UTILS
|
||||
#define av_parse_video_rate av_parse_video_frame_rate
|
||||
#endif
|
||||
|
||||
#ifdef FFMPEG_HAVE_DEFAULT_VAL_UNION
|
||||
#define FFMPEG_DEF_OPT_VAL_INT(OPT) OPT->default_val.i64
|
||||
#define FFMPEG_DEF_OPT_VAL_DOUBLE(OPT) OPT->default_val.dbl
|
||||
#else
|
||||
#define FFMPEG_DEF_OPT_VAL_INT(OPT) OPT->default_val
|
||||
#define FFMPEG_DEF_OPT_VAL_DOUBLE(OPT) OPT->default_val
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_AVMEDIA_TYPES
|
||||
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
|
||||
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_DECODE_AUDIO3
|
||||
static inline
|
||||
int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr, AVPacket *avpkt)
|
||||
{
|
||||
return avcodec_decode_audio2(avctx, samples,
|
||||
frame_size_ptr, avpkt->data,
|
||||
avpkt->size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FFMPEG_HAVE_DECODE_VIDEO2
|
||||
static inline
|
||||
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
AVPacket *avpkt)
|
||||
{
|
||||
return avcodec_decode_video(avctx, picture, got_picture_ptr,
|
||||
avpkt->data, avpkt->size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -29,6 +29,9 @@ set(INC
|
||||
../string
|
||||
../../source/blender/imbuf
|
||||
../../source/blender/makesdna
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${GLEW_INCLUDE_PATH}
|
||||
)
|
||||
|
||||
@@ -86,7 +89,42 @@ set(SRC
|
||||
intern/GHOST_WindowManager.h
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
if(WITH_HEADLESS)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerNULL.h
|
||||
intern/GHOST_SystemNULL.h
|
||||
intern/GHOST_WindowNULL.h
|
||||
)
|
||||
add_definitions(-DWITH_HEADLESS)
|
||||
|
||||
# ack, this is still system dependant
|
||||
if(APPLE)
|
||||
if(WITH_COCOA)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsCocoa.mm
|
||||
intern/GHOST_SystemPathsCocoa.h
|
||||
)
|
||||
else()
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsCarbon.cpp
|
||||
intern/GHOST_SystemPathsCarbon.h
|
||||
)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsX11.cpp
|
||||
intern/GHOST_SystemPathsX11.h
|
||||
)
|
||||
elseif(WIN32)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemPathsWin32.cpp
|
||||
|
||||
intern/GHOST_SystemPathsWin32.h
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif(APPLE)
|
||||
if(WITH_COCOA)
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerCocoa.mm
|
||||
@@ -123,7 +161,7 @@ elseif(UNIX)
|
||||
add_definitions(-DWITH_X11_XINPUT)
|
||||
endif()
|
||||
|
||||
list(APPEND INC ${X11_X11_INCLUDE_PATH})
|
||||
list(APPEND INC_SYS ${X11_X11_INCLUDE_PATH})
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerX11.cpp
|
||||
@@ -143,7 +181,7 @@ elseif(UNIX)
|
||||
|
||||
if(X11_XF86keysym_INCLUDE_PATH)
|
||||
add_definitions(-DWITH_XF86KEYSYM)
|
||||
list(APPEND INC ${X11_XF86keysym_INCLUDE_PATH})
|
||||
list(APPEND INC_SYS ${X11_XF86keysym_INCLUDE_PATH})
|
||||
endif()
|
||||
|
||||
elseif(WIN32)
|
||||
@@ -151,7 +189,7 @@ elseif(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
|
||||
endif()
|
||||
|
||||
list(APPEND INC ${WINTAB_INC})
|
||||
list(APPEND INC_SYS ${WINTAB_INC})
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerWin32.cpp
|
||||
@@ -169,5 +207,5 @@ elseif(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
|
||||
51
intern/ghost/intern/GHOST_DisplayManagerNULL.h
Normal file
51
intern/ghost/intern/GHOST_DisplayManagerNULL.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_DisplayManagerNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_DisplayManagerNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_DISPLAY_MANAGER_NULL_H_
|
||||
#define _GHOST_DISPLAY_MANAGER_NULL_H_
|
||||
|
||||
#include "GHOST_DisplayManager.h"
|
||||
#include "GHOST_SystemNULL.h"
|
||||
|
||||
class GHOST_SystemNULL;
|
||||
|
||||
class GHOST_DisplayManagerNULL : public GHOST_DisplayManager
|
||||
{
|
||||
public:
|
||||
GHOST_DisplayManagerNULL( GHOST_SystemNULL *system ) : GHOST_DisplayManager(), m_system(system) { /* nop */ }
|
||||
GHOST_TSuccess getNumDisplays( GHOST_TUns8& numDisplays ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess getNumDisplaySettings( GHOST_TUns8 display, GHOST_TInt32& numSettings ) const{ return GHOST_kFailure; }
|
||||
GHOST_TSuccess getDisplaySetting( GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); }
|
||||
GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; }
|
||||
|
||||
private :
|
||||
GHOST_SystemNULL * m_system;
|
||||
};
|
||||
|
||||
#endif /* _GHOST_DISPLAY_MANAGER_NULL_H_ */
|
||||
@@ -41,7 +41,9 @@
|
||||
|
||||
#include "GHOST_ISystem.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef WITH_HEADLESS
|
||||
# include "GHOST_SystemNULL.h"
|
||||
#elif defined(WIN32)
|
||||
# include "GHOST_SystemWin32.h"
|
||||
#else
|
||||
# ifdef __APPLE__
|
||||
@@ -63,7 +65,9 @@ GHOST_TSuccess GHOST_ISystem::createSystem()
|
||||
{
|
||||
GHOST_TSuccess success;
|
||||
if (!m_system) {
|
||||
#ifdef WIN32
|
||||
#ifdef WITH_HEADLESS
|
||||
m_system = new GHOST_SystemNULL();
|
||||
#elif defined(WIN32)
|
||||
m_system = new GHOST_SystemWin32 ();
|
||||
#else
|
||||
# ifdef __APPLE__
|
||||
|
||||
@@ -81,7 +81,9 @@ GHOST_NDOFManager::deviceOpen(GHOST_IWindow* window,
|
||||
#if 0
|
||||
printf("%i client \n", Pid);
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
#if defined(WITH_HEADLESS)
|
||||
/* do nothing */
|
||||
#elif defined(_WIN32) || defined(__APPLE__)
|
||||
m_DeviceHandle = ndofDeviceOpen((void *)¤tNdofValues);
|
||||
#else
|
||||
GHOST_SystemX11 *sys;
|
||||
|
||||
93
intern/ghost/intern/GHOST_SystemNULL.h
Normal file
93
intern/ghost/intern/GHOST_SystemNULL.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_SystemNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_SystemNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_SYSTEM_NULL_H_
|
||||
#define _GHOST_SYSTEM_NULL_H_
|
||||
|
||||
#include "GHOST_System.h"
|
||||
#include "../GHOST_Types.h"
|
||||
#include "GHOST_DisplayManagerNULL.h"
|
||||
#include "GHOST_WindowNULL.h"
|
||||
|
||||
class GHOST_WindowNULL;
|
||||
|
||||
class GHOST_SystemNULL : public GHOST_System {
|
||||
public:
|
||||
|
||||
GHOST_SystemNULL( ) : GHOST_System() { /* nop */ }
|
||||
~GHOST_SystemNULL() { /* nop */ }
|
||||
bool processEvents(bool waitForEvent) { return false; }
|
||||
int toggleConsole(int action) { return 0; }
|
||||
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys& keys) const { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess getButtons(GHOST_Buttons& buttons) const { return GHOST_kSuccess; }
|
||||
GHOST_TUns8 *getClipboard(bool selection) const { return NULL; }
|
||||
void putClipboard(GHOST_TInt8 *buffer, bool selection) const { /* nop */ }
|
||||
GHOST_TUns64 getMilliSeconds( ) const { return 0; }
|
||||
GHOST_TUns8 getNumDisplays( ) const { return GHOST_TUns8(1); }
|
||||
GHOST_TSuccess getCursorPosition( GHOST_TInt32& x, GHOST_TInt32& y ) const { return GHOST_kFailure; }
|
||||
GHOST_TSuccess setCursorPosition( GHOST_TInt32 x, GHOST_TInt32 y ) { return GHOST_kFailure; }
|
||||
void getMainDisplayDimensions( GHOST_TUns32& width, GHOST_TUns32& height ) const { /* nop */ }
|
||||
|
||||
GHOST_TSuccess init() {
|
||||
GHOST_TSuccess success = GHOST_System::init();
|
||||
|
||||
if (success) {
|
||||
m_displayManager = new GHOST_DisplayManagerNULL(this);
|
||||
|
||||
if (m_displayManager) {
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
GHOST_IWindow* createWindow(
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples,
|
||||
const GHOST_TEmbedderWindowID parentWindow
|
||||
) {
|
||||
return new GHOST_WindowNULL (this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -795,6 +795,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
}
|
||||
|
||||
default: {
|
||||
#ifdef WITH_X11_XINPUT
|
||||
if(xe->type == window->GetXTablet().MotionEvent)
|
||||
{
|
||||
XDeviceMotionEvent* data = (XDeviceMotionEvent*)xe;
|
||||
@@ -818,7 +819,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
}
|
||||
else if(xe->type == window->GetXTablet().ProxOutEvent)
|
||||
window->GetXTablet().CommonData.Active= GHOST_kTabletModeNone;
|
||||
|
||||
#endif // WITH_X11_XINPUT
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,9 +461,13 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||
|
||||
GHOST_WindowCocoa::~GHOST_WindowCocoa()
|
||||
{
|
||||
if (m_customCursor) delete m_customCursor;
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (m_customCursor) {
|
||||
[m_customCursor release];
|
||||
m_customCursor = nil;
|
||||
}
|
||||
|
||||
[m_openGLView release];
|
||||
|
||||
if (m_window) {
|
||||
|
||||
96
intern/ghost/intern/GHOST_WindowNULL.h
Normal file
96
intern/ghost/intern/GHOST_WindowNULL.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* $Id$
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Campbell Barton
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_WindowNULL.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_WindowNULL class.
|
||||
*/
|
||||
|
||||
#ifndef _GHOST_WINDOWNULL_H_
|
||||
#define _GHOST_WINDOWNULL_H_
|
||||
|
||||
#include "GHOST_Window.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class STR_String;
|
||||
class GHOST_SystemNULL;
|
||||
|
||||
class GHOST_WindowNULL : public GHOST_Window
|
||||
{
|
||||
public:
|
||||
const GHOST_TabletData* GetTabletData() { return NULL; }
|
||||
|
||||
GHOST_WindowNULL(
|
||||
GHOST_SystemNULL *system,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
const GHOST_TEmbedderWindowID parentWindow,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples
|
||||
) :
|
||||
GHOST_Window(title,left,top,width,height,state,type,stereoVisual,numOfAASamples),
|
||||
m_system (system)
|
||||
{
|
||||
setTitle(title);
|
||||
}
|
||||
|
||||
protected:
|
||||
GHOST_TSuccess installDrawingContext( GHOST_TDrawingContextType type ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess removeDrawingContext( ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCursorGrab( GHOST_TGrabCursorMode mode ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCursorShape( GHOST_TStandardCursor shape ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY ) { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setWindowCustomCursorShape( GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color ){ return GHOST_kSuccess; }
|
||||
|
||||
bool getValid( ) const { return true; }
|
||||
void setTitle( const STR_String& title ){ /* nothing */ }
|
||||
void getTitle( STR_String& title ) const { title= "untitled"; }
|
||||
void getWindowBounds( GHOST_Rect& bounds ) const { getClientBounds(bounds); }
|
||||
void getClientBounds( GHOST_Rect& bounds ) const { /* nothing */ }
|
||||
GHOST_TSuccess setClientWidth( GHOST_TUns32 width ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess setClientHeight( GHOST_TUns32 height ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess setClientSize( GHOST_TUns32 width, GHOST_TUns32 height ){ return GHOST_kFailure; }
|
||||
void screenToClient( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
|
||||
void clientToScreen( GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY ) const { outX = inX; outY = inY; }
|
||||
GHOST_TSuccess swapBuffers( ){ return GHOST_kFailure; }
|
||||
GHOST_TSuccess activateDrawingContext( ){ return GHOST_kFailure; }
|
||||
~GHOST_WindowNULL( ){ /* nothing */ }
|
||||
GHOST_TSuccess setWindowCursorVisibility( bool visible ){ return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setState(GHOST_TWindowState state) { return GHOST_kSuccess; }
|
||||
GHOST_TWindowState getState() const { return GHOST_kWindowStateNormal; }
|
||||
GHOST_TSuccess invalidate() { return GHOST_kSuccess; }
|
||||
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) { return GHOST_kSuccess; }
|
||||
|
||||
|
||||
private :
|
||||
GHOST_SystemNULL * m_system;
|
||||
};
|
||||
|
||||
|
||||
#endif // _GHOST_WINDOWNULL_H_
|
||||
@@ -183,8 +183,11 @@ GHOST_WindowX11(
|
||||
int natom;
|
||||
int glxVersionMajor, glxVersionMinor; // As in GLX major.minor
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
/* initialize incase X11 fails to load */
|
||||
memset(&m_xtablet, 0, sizeof(m_xtablet));
|
||||
#endif
|
||||
|
||||
m_visual= NULL;
|
||||
|
||||
if (!glXQueryVersion(m_display, &glxVersionMajor, &glxVersionMinor)) {
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/glx.h>
|
||||
// For tablets
|
||||
#include <X11/extensions/XInput.h>
|
||||
#ifdef WITH_X11_XINPUT
|
||||
# include <X11/extensions/XInput.h>
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -190,7 +192,7 @@ public:
|
||||
Window
|
||||
getXWindow(
|
||||
);
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
class XTablet
|
||||
{
|
||||
public:
|
||||
@@ -214,6 +216,10 @@ public:
|
||||
|
||||
const GHOST_TabletData* GetTabletData()
|
||||
{ return &m_xtablet.CommonData; }
|
||||
#else // WITH_X11_XINPUT
|
||||
const GHOST_TabletData* GetTabletData()
|
||||
{ return NULL; }
|
||||
#endif // WITH_X11_XINPUT
|
||||
|
||||
/*
|
||||
* Need this in case that we want start the window
|
||||
@@ -321,7 +327,9 @@ private :
|
||||
getEmptyCursor(
|
||||
);
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
void initXInputDevices();
|
||||
#endif
|
||||
|
||||
GLXContext m_context;
|
||||
Window m_window;
|
||||
@@ -350,8 +358,10 @@ private :
|
||||
/** Cache of XC_* ID's to XCursor structures */
|
||||
std::map<unsigned int, Cursor> m_standard_cursors;
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
/* Tablet devices */
|
||||
XTablet m_xtablet;
|
||||
#endif
|
||||
|
||||
void icccmSetState(int state);
|
||||
int icccmGetState() const;
|
||||
|
||||
@@ -24,7 +24,13 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC .)
|
||||
set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
./intern/mallocn.c
|
||||
@@ -41,12 +47,12 @@ if(WIN32 AND NOT UNIX)
|
||||
)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_guardedalloc "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_guardedalloc "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
# Override C++ alloc, optional.
|
||||
if(WITH_CXX_GUARDEDALLOC)
|
||||
set(SRC
|
||||
cpp/mallocn.cpp
|
||||
)
|
||||
blender_add_lib(bf_intern_guardedalloc_cpp "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_guardedalloc_cpp "${SRC}" "${INC}" "${INC_SYS}")
|
||||
endif()
|
||||
|
||||
@@ -30,6 +30,10 @@ set(INC
|
||||
../moto/include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/IK_QJacobian.cpp
|
||||
intern/IK_QJacobianSolver.cpp
|
||||
@@ -70,4 +74,4 @@ set(SRC
|
||||
intern/TNT/version.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_ik "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_ik "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -28,6 +28,10 @@ set(INC
|
||||
../../extern/Eigen2
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
Armature.cpp
|
||||
Cache.cpp
|
||||
@@ -222,4 +226,4 @@ set(SRC
|
||||
../../extern/Eigen2/Eigen/src/Sparse/UmfPackSupport.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_itasc "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_itasc "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -29,6 +29,10 @@ set(INC
|
||||
..
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/MEM_CacheLimiterC-Api.cpp
|
||||
intern/MEM_RefCountedC-Api.cpp
|
||||
@@ -43,4 +47,4 @@ set(SRC
|
||||
MEM_SmartPtr.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_memutil "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_memutil "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -28,11 +28,15 @@ set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
mikktspace.c
|
||||
|
||||
mikktspace.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_mikktspace "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_mikktspace "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ set(INC
|
||||
include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/MT_Assert.cpp
|
||||
intern/MT_CmMatrix4x4.cpp
|
||||
@@ -67,4 +71,4 @@ set(SRC
|
||||
include/NM_Scalar.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_moto "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_moto "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -36,6 +36,10 @@ set(INC
|
||||
superlu
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/opennl.c
|
||||
superlu/colamd.c
|
||||
@@ -79,4 +83,4 @@ set(SRC
|
||||
superlu/util.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_opennl "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_opennl "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -28,6 +28,9 @@ set(INC
|
||||
intern
|
||||
../memutil
|
||||
../../extern/bullet2/src
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${PNG_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
@@ -89,5 +92,5 @@ if(WITH_FFTW3)
|
||||
list(APPEND INC ${FFTW3_INC})
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_intern_smoke "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_smoke "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ set(INC
|
||||
.
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
intern/STR_String.cpp
|
||||
|
||||
@@ -35,4 +39,4 @@ set(SRC
|
||||
STR_String.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_intern_string "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_intern_string "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -135,7 +135,7 @@ def resolve_ncase(path):
|
||||
filename = os.path.basename(path) # filename may be a directory or a file
|
||||
dirpath = os.path.dirname(path)
|
||||
|
||||
suffix = ""
|
||||
suffix = path[:0] # "" but ensure byte/str match
|
||||
if not filename: # dir ends with a slash?
|
||||
if len(dirpath) < len(path):
|
||||
suffix = path[:len(path) - len(dirpath)]
|
||||
|
||||
@@ -379,7 +379,9 @@ def preset_find(name, preset_path, display_name=False):
|
||||
def keyconfig_set(filepath):
|
||||
from os.path import basename, splitext
|
||||
|
||||
print("loading preset:", filepath)
|
||||
if _bpy.app.debug:
|
||||
print("loading preset:", filepath)
|
||||
|
||||
keyconfigs = _bpy.context.window_manager.keyconfigs
|
||||
|
||||
keyconfigs_old = keyconfigs[:]
|
||||
|
||||
@@ -18,10 +18,90 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
__all__ = (
|
||||
"load_image",
|
||||
)
|
||||
|
||||
def image_load(filepath, dirpath, place_holder=False, recursive=False, convert_callback=None):
|
||||
# limited replacement for BPyImage.comprehensiveImageLoad
|
||||
def load_image(imagepath,
|
||||
dirname="",
|
||||
place_holder=False,
|
||||
recursive=False,
|
||||
ncase_cmp=True,
|
||||
convert_callback=None,
|
||||
verbose=False,
|
||||
):
|
||||
"""
|
||||
Return an image from the file path with options to search multiple paths and
|
||||
return a placeholder if its not found.
|
||||
|
||||
:arg filepath: The image filename
|
||||
If a path precedes it, this will be searched as well.
|
||||
:type filepath: string
|
||||
:arg dirname: is the directory where the image may be located - any file at
|
||||
the end will be ignored.
|
||||
:type dirname: string
|
||||
:arg place_holder: if True a new place holder image will be created.
|
||||
this is usefull so later you can relink the image to its original data.
|
||||
:type place_holder: bool
|
||||
:arg recursive: If True, directories will be recursivly searched.
|
||||
Be carefull with this if you have files in your root directory because
|
||||
it may take a long time.
|
||||
:type recursive: bool
|
||||
:arg ncase_cmp: on non windows systems, find the correct case for the file.
|
||||
:type ncase_cmp: bool
|
||||
:arg convert_callback: a function that takes an existing path and returns a new one.
|
||||
Use this when loading image formats blender may not support, the CONVERT_CALLBACK
|
||||
can take the path for a GIF (for example), convert it to a PNG and return the PNG's path.
|
||||
For formats blender can read, simply return the path that is given.
|
||||
:type convert_callback: function
|
||||
:return: an image or None
|
||||
:rtype: :class:`Image`
|
||||
"""
|
||||
import os
|
||||
import bpy
|
||||
try:
|
||||
return bpy.data.images.load(filepath)
|
||||
except RuntimeError:
|
||||
return bpy.data.images.new("Untitled", 128, 128)
|
||||
|
||||
# TODO: recursive
|
||||
|
||||
def _image_load(path):
|
||||
import bpy
|
||||
|
||||
if convert_callback:
|
||||
path = convert_callback(path)
|
||||
|
||||
image = bpy.data.images.load(path)
|
||||
|
||||
if verbose:
|
||||
print(" image loaded '%s'" % path)
|
||||
|
||||
return image
|
||||
|
||||
if verbose:
|
||||
print("load_image('%s', '%s', ...)" % (imagepath, dirname))
|
||||
|
||||
if os.path.exists(imagepath):
|
||||
return _image_load(imagepath)
|
||||
|
||||
variants = [imagepath]
|
||||
|
||||
if dirname:
|
||||
variants += [os.path.join(dirname, imagepath), os.path.join(dirname, os.path.basename(imagepath))]
|
||||
|
||||
for filepath_test in variants:
|
||||
if ncase_cmp:
|
||||
ncase_variants = filepath_test, bpy.path.resolve_ncase(filepath_test)
|
||||
else:
|
||||
ncase_variants = (filepath_test, )
|
||||
|
||||
for nfilepath in ncase_variants:
|
||||
if os.path.exists(nfilepath):
|
||||
return _image_load(nfilepath)
|
||||
|
||||
if place_holder:
|
||||
image = bpy.data.images.new(os.path.basename(filepath), 128, 128)
|
||||
# allow the path to be resolved later
|
||||
image.filepath = imagepath
|
||||
return image
|
||||
|
||||
# TODO comprehensiveImageLoad also searched in bpy.config.textureDir
|
||||
return None
|
||||
|
||||
@@ -18,6 +18,20 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
__all__ = (
|
||||
"ExportHelper",
|
||||
"ImportHelper",
|
||||
"axis_conversion",
|
||||
"create_derived_objects",
|
||||
"free_derived_objects",
|
||||
"unpack_list",
|
||||
"unpack_face_list",
|
||||
"path_reference",
|
||||
"path_reference_copy",
|
||||
"path_reference_mode",
|
||||
"unique_name"
|
||||
)
|
||||
|
||||
import bpy
|
||||
from bpy.props import StringProperty, BoolProperty, EnumProperty
|
||||
|
||||
@@ -101,29 +115,29 @@ _axis_convert_matrix = (
|
||||
# where all 4 values are or'd into a single value...
|
||||
# (i1<<0 | i1<<3 | i1<<6 | i1<<9)
|
||||
_axis_convert_lut = (
|
||||
{0x5c, 0x9a, 0x119, 0x15d, 0x20b, 0x2a2, 0x2c8, 0x365, 0x413, 0x46c, 0x4d0, 0x529, 0x644, 0x682, 0x701, 0x745, 0x823, 0x88a, 0x8e0, 0x94d, 0xa2b, 0xa54, 0xae8, 0xb11},
|
||||
{0x9c, 0xac, 0x159, 0x169, 0x22b, 0x2e8, 0x40b, 0x465, 0x4c8, 0x522, 0x684, 0x694, 0x741, 0x751, 0x813, 0x8d0, 0xa23, 0xa4d, 0xae0, 0xb0a},
|
||||
{0x99, 0xa9, 0x15c, 0x16c, 0x213, 0x2d0, 0x423, 0x44a, 0x4e0, 0x50d, 0x681, 0x691, 0x744, 0x754, 0x82b, 0x8e8, 0xa0b, 0xa62, 0xac8, 0xb25},
|
||||
{0x59, 0x85, 0x11c, 0x142, 0x223, 0x28d, 0x2e0, 0x34a, 0x42b, 0x469, 0x4e8, 0x52c, 0x641, 0x69d, 0x704, 0x75a, 0x80b, 0x8a5, 0x8c8, 0x962, 0xa13, 0xa51, 0xad0, 0xb14},
|
||||
{0xa5, 0x162, 0x21c, 0x285, 0x2d9, 0x342, 0x463, 0x46b, 0x520, 0x528, 0x68d, 0x74a, 0x804, 0x89d, 0x8c1, 0x95a, 0xa4b, 0xa53, 0xb08, 0xb10},
|
||||
{0x4b, 0x53, 0x108, 0x110, 0x29c, 0x2ac, 0x359, 0x369, 0x41a, 0x422, 0x4dd, 0x4e5, 0x663, 0x66b, 0x720, 0x728, 0x884, 0x894, 0x941, 0x951, 0xa02, 0xa0a, 0xac5, 0xacd},
|
||||
{0x63, 0x6b, 0x120, 0x128, 0x299, 0x2a9, 0x35c, 0x36c, 0x405, 0x40d, 0x4c2, 0x4ca, 0x64b, 0x653, 0x708, 0x710, 0x881, 0x891, 0x944, 0x954, 0xa1d, 0xa25, 0xada, 0xae2},
|
||||
{0x8a, 0x14d, 0x219, 0x29a, 0x2dc, 0x35d, 0x44b, 0x453, 0x508, 0x510, 0x6a2, 0x765, 0x801, 0x882, 0x8c4, 0x945, 0xa63, 0xa6b, 0xb20, 0xb28},
|
||||
{0x5a, 0x62, 0x8b, 0x11d, 0x125, 0x148, 0x22c, 0x28b, 0x293, 0x2e9, 0x348, 0x350, 0x41c, 0x42c, 0x45a, 0x4d9, 0x4e9, 0x51d, 0x642, 0x64a, 0x6a3, 0x705, 0x70d, 0x760, 0x814, 0x8a3, 0x8ab, 0x8d1, 0x960, 0x968, 0xa04, 0xa14, 0xa42, 0xac1, 0xad1, 0xb05},
|
||||
{0x54, 0xab, 0x111, 0x168, 0x21d, 0x225, 0x2da, 0x2e2, 0x45c, 0x519, 0x66c, 0x693, 0x729, 0x750, 0x805, 0x80d, 0x8c2, 0x8ca, 0xa44, 0xb01},
|
||||
{0x51, 0x93, 0x114, 0x150, 0x202, 0x20a, 0x2c5, 0x2cd, 0x459, 0x51c, 0x669, 0x6ab, 0x72c, 0x768, 0x81a, 0x822, 0x8dd, 0x8e5, 0xa41, 0xb04},
|
||||
{0x45, 0x4d, 0xa3, 0x102, 0x10a, 0x160, 0x229, 0x2a3, 0x2ab, 0x2ec, 0x360, 0x368, 0x419, 0x429, 0x445, 0x4dc, 0x4ec, 0x502, 0x65d, 0x665, 0x68b, 0x71a, 0x722, 0x748, 0x811, 0x88b, 0x893, 0x8d4, 0x948, 0x950, 0xa01, 0xa11, 0xa5d, 0xac4, 0xad4, 0xb1a},
|
||||
{0x5d, 0x65, 0xa0, 0x11a, 0x122, 0x163, 0x214, 0x2a0, 0x2a8, 0x2d1, 0x363, 0x36b, 0x404, 0x414, 0x45d, 0x4c1, 0x4d1, 0x51a, 0x645, 0x64d, 0x688, 0x702, 0x70a, 0x74b, 0x82c, 0x888, 0x890, 0x8e9, 0x94b, 0x953, 0xa1c, 0xa2c, 0xa45, 0xad9, 0xae9, 0xb02},
|
||||
{0x6c, 0x90, 0x129, 0x153, 0x21a, 0x222, 0x2dd, 0x2e5, 0x444, 0x501, 0x654, 0x6a8, 0x711, 0x76b, 0x802, 0x80a, 0x8c5, 0x8cd, 0xa5c, 0xb19},
|
||||
{0x69, 0xa8, 0x12c, 0x16b, 0x205, 0x20d, 0x2c2, 0x2ca, 0x441, 0x504, 0x651, 0x690, 0x714, 0x753, 0x81d, 0x825, 0x8da, 0x8e2, 0xa59, 0xb1c},
|
||||
{0x42, 0x4a, 0x88, 0x105, 0x10d, 0x14b, 0x211, 0x288, 0x290, 0x2d4, 0x34b, 0x353, 0x401, 0x411, 0x442, 0x4c4, 0x4d4, 0x505, 0x65a, 0x662, 0x6a0, 0x71d, 0x725, 0x763, 0x829, 0x8a0, 0x8a8, 0x8ec, 0x963, 0x96b, 0xa19, 0xa29, 0xa5a, 0xadc, 0xaec, 0xb1d},
|
||||
{0xa2, 0x165, 0x204, 0x282, 0x2c1, 0x345, 0x448, 0x450, 0x50b, 0x513, 0x68a, 0x74d, 0x81c, 0x89a, 0x8d9, 0x95d, 0xa60, 0xa68, 0xb23, 0xb2b},
|
||||
{0x60, 0x68, 0x123, 0x12b, 0x284, 0x294, 0x341, 0x351, 0x41d, 0x425, 0x4da, 0x4e2, 0x648, 0x650, 0x70b, 0x713, 0x89c, 0x8ac, 0x959, 0x969, 0xa05, 0xa0d, 0xac2, 0xaca},
|
||||
{0x48, 0x50, 0x10b, 0x113, 0x281, 0x291, 0x344, 0x354, 0x402, 0x40a, 0x4c5, 0x4cd, 0x660, 0x668, 0x723, 0x72b, 0x899, 0x8a9, 0x95c, 0x96c, 0xa1a, 0xa22, 0xadd, 0xae5},
|
||||
{0x8d, 0x14a, 0x201, 0x29d, 0x2c4, 0x35a, 0x460, 0x468, 0x523, 0x52b, 0x6a5, 0x762, 0x819, 0x885, 0x8dc, 0x942, 0xa48, 0xa50, 0xb0b, 0xb13},
|
||||
{0x44, 0x9d, 0x101, 0x15a, 0x220, 0x2a5, 0x2e3, 0x362, 0x428, 0x454, 0x4eb, 0x511, 0x65c, 0x685, 0x719, 0x742, 0x808, 0x88d, 0x8cb, 0x94a, 0xa10, 0xa6c, 0xad3, 0xb29},
|
||||
{0x84, 0x94, 0x141, 0x151, 0x210, 0x2d3, 0x420, 0x462, 0x4e3, 0x525, 0x69c, 0x6ac, 0x759, 0x769, 0x828, 0x8eb, 0xa08, 0xa4a, 0xacb, 0xb0d},
|
||||
{0x81, 0x91, 0x144, 0x154, 0x228, 0x2eb, 0x408, 0x44d, 0x4cb, 0x50a, 0x699, 0x6a9, 0x75c, 0x76c, 0x810, 0x8d3, 0xa20, 0xa65, 0xae3, 0xb22},
|
||||
{0x8C8, 0x4D0, 0x2E0, 0xAE8, 0x701, 0x511, 0x119, 0xB29, 0x682, 0x88A, 0x09A, 0x2A2, 0x80B, 0x413, 0x223, 0xA2B, 0x644, 0x454, 0x05C, 0xA6C, 0x745, 0x94D, 0x15D, 0x365},
|
||||
{0xAC8, 0x8D0, 0x4E0, 0x2E8, 0x741, 0x951, 0x159, 0x369, 0x702, 0xB0A, 0x11A, 0x522, 0xA0B, 0x813, 0x423, 0x22B, 0x684, 0x894, 0x09C, 0x2AC, 0x645, 0xA4D, 0x05D, 0x465},
|
||||
{0x4C8, 0x2D0, 0xAE0, 0x8E8, 0x681, 0x291, 0x099, 0x8A9, 0x642, 0x44A, 0x05A, 0xA62, 0x40B, 0x213, 0xA23, 0x82B, 0x744, 0x354, 0x15C, 0x96C, 0x705, 0x50D, 0x11D, 0xB25},
|
||||
{0x2C8, 0xAD0, 0x8E0, 0x4E8, 0x641, 0xA51, 0x059, 0x469, 0x742, 0x34A, 0x15A, 0x962, 0x20B, 0xA13, 0x823, 0x42B, 0x704, 0xB14, 0x11C, 0x52C, 0x685, 0x28D, 0x09D, 0x8A5},
|
||||
{0x708, 0xB10, 0x120, 0x528, 0x8C1, 0xAD1, 0x2D9, 0x4E9, 0x942, 0x74A, 0x35A, 0x162, 0x64B, 0xA53, 0x063, 0x46B, 0x804, 0xA14, 0x21C, 0x42C, 0x885, 0x68D, 0x29D, 0x0A5},
|
||||
{0xB08, 0x110, 0x520, 0x728, 0x941, 0x151, 0x359, 0x769, 0x802, 0xA0A, 0x21A, 0x422, 0xA4B, 0x053, 0x463, 0x66B, 0x884, 0x094, 0x29C, 0x6AC, 0x8C5, 0xACD, 0x2DD, 0x4E5},
|
||||
{0x508, 0x710, 0xB20, 0x128, 0x881, 0x691, 0x299, 0x0A9, 0x8C2, 0x4CA, 0x2DA, 0xAE2, 0x44B, 0x653, 0xA63, 0x06B, 0x944, 0x754, 0x35C, 0x16C, 0x805, 0x40D, 0x21D, 0xA25},
|
||||
{0x108, 0x510, 0x720, 0xB28, 0x801, 0x411, 0x219, 0xA29, 0x882, 0x08A, 0x29A, 0x6A2, 0x04B, 0x453, 0x663, 0xA6B, 0x8C4, 0x4D4, 0x2DC, 0xAEC, 0x945, 0x14D, 0x35D, 0x765},
|
||||
{0x748, 0x350, 0x160, 0x968, 0xAC1, 0x2D1, 0x4D9, 0x8E9, 0xA42, 0x64A, 0x45A, 0x062, 0x68B, 0x293, 0x0A3, 0x8AB, 0xA04, 0x214, 0x41C, 0x82C, 0xB05, 0x70D, 0x51D, 0x125},
|
||||
{0x948, 0x750, 0x360, 0x168, 0xB01, 0x711, 0x519, 0x129, 0xAC2, 0x8CA, 0x4DA, 0x2E2, 0x88B, 0x693, 0x2A3, 0x0AB, 0xA44, 0x654, 0x45C, 0x06C, 0xA05, 0x80D, 0x41D, 0x225},
|
||||
{0x348, 0x150, 0x960, 0x768, 0xA41, 0x051, 0x459, 0x669, 0xA02, 0x20A, 0x41A, 0x822, 0x28B, 0x093, 0x8A3, 0x6AB, 0xB04, 0x114, 0x51C, 0x72C, 0xAC5, 0x2CD, 0x4DD, 0x8E5},
|
||||
{0x148, 0x950, 0x760, 0x368, 0xA01, 0x811, 0x419, 0x229, 0xB02, 0x10A, 0x51A, 0x722, 0x08B, 0x893, 0x6A3, 0x2AB, 0xAC4, 0x8D4, 0x4DC, 0x2EC, 0xA45, 0x04D, 0x45D, 0x665},
|
||||
{0x688, 0x890, 0x0A0, 0x2A8, 0x4C1, 0x8D1, 0xAD9, 0x2E9, 0x502, 0x70A, 0xB1A, 0x122, 0x74B, 0x953, 0x163, 0x36B, 0x404, 0x814, 0xA1C, 0x22C, 0x445, 0x64D, 0xA5D, 0x065},
|
||||
{0x888, 0x090, 0x2A0, 0x6A8, 0x501, 0x111, 0xB19, 0x729, 0x402, 0x80A, 0xA1A, 0x222, 0x94B, 0x153, 0x363, 0x76B, 0x444, 0x054, 0xA5C, 0x66C, 0x4C5, 0x8CD, 0xADD, 0x2E5},
|
||||
{0x288, 0x690, 0x8A0, 0x0A8, 0x441, 0x651, 0xA59, 0x069, 0x4C2, 0x2CA, 0xADA, 0x8E2, 0x34B, 0x753, 0x963, 0x16B, 0x504, 0x714, 0xB1C, 0x12C, 0x405, 0x20D, 0xA1D, 0x825},
|
||||
{0x088, 0x290, 0x6A0, 0x8A8, 0x401, 0x211, 0xA19, 0x829, 0x442, 0x04A, 0xA5A, 0x662, 0x14B, 0x353, 0x763, 0x96B, 0x4C4, 0x2D4, 0xADC, 0x8EC, 0x505, 0x10D, 0xB1D, 0x725},
|
||||
{0x648, 0x450, 0x060, 0xA68, 0x2C1, 0x4D1, 0x8D9, 0xAE9, 0x282, 0x68A, 0x89A, 0x0A2, 0x70B, 0x513, 0x123, 0xB2B, 0x204, 0x414, 0x81C, 0xA2C, 0x345, 0x74D, 0x95D, 0x165},
|
||||
{0xA48, 0x650, 0x460, 0x068, 0x341, 0x751, 0x959, 0x169, 0x2C2, 0xACA, 0x8DA, 0x4E2, 0xB0B, 0x713, 0x523, 0x12B, 0x284, 0x694, 0x89C, 0x0AC, 0x205, 0xA0D, 0x81D, 0x425},
|
||||
{0x448, 0x050, 0xA60, 0x668, 0x281, 0x091, 0x899, 0x6A9, 0x202, 0x40A, 0x81A, 0xA22, 0x50B, 0x113, 0xB23, 0x72B, 0x344, 0x154, 0x95C, 0x76C, 0x2C5, 0x4CD, 0x8DD, 0xAE5},
|
||||
{0x048, 0xA50, 0x660, 0x468, 0x201, 0xA11, 0x819, 0x429, 0x342, 0x14A, 0x95A, 0x762, 0x10B, 0xB13, 0x723, 0x52B, 0x2C4, 0xAD4, 0x8DC, 0x4EC, 0x285, 0x08D, 0x89D, 0x6A5},
|
||||
{0x808, 0xA10, 0x220, 0x428, 0x101, 0xB11, 0x719, 0x529, 0x142, 0x94A, 0x75A, 0x362, 0x8CB, 0xAD3, 0x2E3, 0x4EB, 0x044, 0xA54, 0x65C, 0x46C, 0x085, 0x88D, 0x69D, 0x2A5},
|
||||
{0xA08, 0x210, 0x420, 0x828, 0x141, 0x351, 0x759, 0x969, 0x042, 0xA4A, 0x65A, 0x462, 0xACB, 0x2D3, 0x4E3, 0x8EB, 0x084, 0x294, 0x69C, 0x8AC, 0x105, 0xB0D, 0x71D, 0x525},
|
||||
{0x408, 0x810, 0xA20, 0x228, 0x081, 0x891, 0x699, 0x2A9, 0x102, 0x50A, 0x71A, 0xB22, 0x4CB, 0x8D3, 0xAE3, 0x2EB, 0x144, 0x954, 0x75C, 0x36C, 0x045, 0x44D, 0x65D, 0xA65},
|
||||
)
|
||||
|
||||
_axis_convert_num = {'X': 0, 'Y': 1, 'Z': 2, '-X': 3, '-Y': 4, '-Z': 5}
|
||||
@@ -141,30 +155,13 @@ def axis_conversion(from_forward='Y', from_up='Z', to_forward='Y', to_up='Z'):
|
||||
return Matrix().to_3x3()
|
||||
|
||||
value = reduce(int.__or__, (_axis_convert_num[a] << (i * 3) for i, a in enumerate((from_forward, from_up, to_forward, to_up))))
|
||||
|
||||
for i, axis_lut in enumerate(_axis_convert_lut):
|
||||
if value in axis_lut:
|
||||
return Matrix(_axis_convert_matrix[i])
|
||||
assert("internal error")
|
||||
|
||||
|
||||
# limited replacement for BPyImage.comprehensiveImageLoad
|
||||
def load_image(imagepath, dirname):
|
||||
import os
|
||||
|
||||
if os.path.exists(imagepath):
|
||||
return bpy.data.images.load(imagepath)
|
||||
|
||||
variants = [imagepath, os.path.join(dirname, imagepath), os.path.join(dirname, os.path.basename(imagepath))]
|
||||
|
||||
for filepath in variants:
|
||||
for nfilepath in (filepath, bpy.path.resolve_ncase(filepath)):
|
||||
if os.path.exists(nfilepath):
|
||||
return bpy.data.images.load(nfilepath)
|
||||
|
||||
# TODO comprehensiveImageLoad also searched in bpy.config.textureDir
|
||||
return None
|
||||
|
||||
|
||||
# return a tuple (free, object list), free is True if memory should be freed later with free_derived_objects()
|
||||
def create_derived_objects(scene, ob):
|
||||
if ob.parent and ob.parent.dupli_type != 'NONE':
|
||||
@@ -302,3 +299,43 @@ def path_reference_copy(copy_set, report=print):
|
||||
os.makedirs(dir_to)
|
||||
|
||||
shutil.copy(file_src, file_dst)
|
||||
|
||||
|
||||
def unique_name(key, name, name_dict, name_max=-1, clean_func=None):
|
||||
"""
|
||||
Helper function for storing unique names which may have special characters
|
||||
stripped and restricted to a maximum length.
|
||||
|
||||
:arg key: unique item this name belongs to, name_dict[key] will be reused
|
||||
when available.
|
||||
This can be the object, mesh, material, etc instance its self.
|
||||
:type key: any hashable object assosiated with the *name*.
|
||||
:arg name: The name used to create a unique value in *name_dict*.
|
||||
:type name: string
|
||||
:arg name_dict: This is used to cache namespace to ensure no collisions
|
||||
occur, this should be an empty dict initially and only modified by this
|
||||
function.
|
||||
:type name_dict: dict
|
||||
:arg clean_func: Function to call on *name* before creating a unique value.
|
||||
:type clean_func: function
|
||||
"""
|
||||
name_new = name_dict.get(key)
|
||||
if name_new is None:
|
||||
count = 1
|
||||
name_dict_values = name_dict.values()
|
||||
name_new = name_new_orig = name if clean_func is None else clean_func(name)
|
||||
|
||||
if name_max == -1:
|
||||
while name_new in name_dict_values:
|
||||
name_new = "%s.%03d" % (name_new_orig, count)
|
||||
count += 1
|
||||
else:
|
||||
name_new = name_new[:name_max]
|
||||
while name_new in name_dict_values:
|
||||
count_str = "%03d" % count
|
||||
name_new = "%.*s.%s" % (name_max - (len(count_str) + 1), name_new_orig, count_str)
|
||||
count += 1
|
||||
|
||||
name_dict[key] = name_new
|
||||
|
||||
return name_new
|
||||
|
||||
@@ -18,13 +18,25 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
__all__ = (
|
||||
"mesh_linked_faces",
|
||||
"edge_face_count_dict",
|
||||
"edge_face_count",
|
||||
"edge_loops_from_faces",
|
||||
"edge_loops_from_edges",
|
||||
"ngon_tesselate",
|
||||
)
|
||||
|
||||
def mesh_linked_faces(mesh):
|
||||
'''
|
||||
Splits the mesh into connected parts,
|
||||
these parts are returned as lists of faces.
|
||||
used for seperating cubes from other mesh elements in the 1 mesh
|
||||
'''
|
||||
"""
|
||||
Splits the mesh into connected faces, use this for seperating cubes from
|
||||
other mesh elements within 1 mesh datablock.
|
||||
|
||||
:arg mesh: the mesh used to group with.
|
||||
:type mesh: :class:`Mesh`
|
||||
:return: lists of lists containing faces.
|
||||
:rtype: list
|
||||
"""
|
||||
|
||||
# Build vert face connectivity
|
||||
vert_faces = [[] for i in range(len(mesh.vertices))]
|
||||
@@ -67,3 +79,357 @@ def mesh_linked_faces(mesh):
|
||||
# return all face groups that are not null
|
||||
# this is all the faces that are connected in their own lists.
|
||||
return [fg for fg in face_groups if fg]
|
||||
|
||||
|
||||
def edge_face_count_dict(mesh):
|
||||
"""
|
||||
:return: dict of edge keys with their value set to the number of
|
||||
faces using each edge.
|
||||
:rtype: dict
|
||||
"""
|
||||
face_edge_keys = [face.edge_keys for face in mesh.faces]
|
||||
face_edge_count = {}
|
||||
for face_keys in face_edge_keys:
|
||||
for key in face_keys:
|
||||
try:
|
||||
face_edge_count[key] += 1
|
||||
except:
|
||||
face_edge_count[key] = 1
|
||||
|
||||
return face_edge_count
|
||||
|
||||
|
||||
def edge_face_count(mesh):
|
||||
"""
|
||||
:return: list face users for each item in mesh.edges.
|
||||
:rtype: list
|
||||
"""
|
||||
edge_face_count_dict = edge_face_count_dict(mesh)
|
||||
get = dict.get
|
||||
return [get(edge_face_count_dict, ed.key, 0) for ed in mesh.edges]
|
||||
|
||||
|
||||
def edge_loops_from_faces(mesh, faces=None, seams=()):
|
||||
"""
|
||||
Edge loops defined by faces
|
||||
|
||||
Takes me.faces or a list of faces and returns the edge loops
|
||||
These edge loops are the edges that sit between quads, so they dont touch
|
||||
1 quad, note: not connected will make 2 edge loops,
|
||||
both only containing 2 edges.
|
||||
|
||||
return a list of edge key lists
|
||||
[[(0, 1), (4, 8), (3, 8)], ...]
|
||||
|
||||
:arg mesh: the mesh used to get edge loops from.
|
||||
:type mesh: :class:`Mesh`
|
||||
:arg faces: optional face list to only use some of the meshes faces.
|
||||
:type faces: :class:`MeshFaces`, sequence or or NoneType
|
||||
:return: return a list of edge vertex index lists.
|
||||
:rtype: list
|
||||
"""
|
||||
|
||||
OTHER_INDEX = 2, 3, 0, 1 # opposite face index
|
||||
|
||||
if faces is None:
|
||||
faces = mesh.faces
|
||||
|
||||
edges = {}
|
||||
|
||||
for f in faces:
|
||||
# if len(f) == 4:
|
||||
if f.vertices_raw[3] != 0:
|
||||
edge_keys = f.edge_keys
|
||||
for i, edkey in enumerate(f.edge_keys):
|
||||
edges.setdefault(edkey, []).append(edge_keys[OTHER_INDEX[i]])
|
||||
|
||||
for edkey in seams:
|
||||
edges[edkey] = []
|
||||
|
||||
# Collect edge loops here
|
||||
edge_loops = []
|
||||
|
||||
for edkey, ed_adj in edges.items():
|
||||
if 0 < len(ed_adj) < 3: # 1 or 2
|
||||
# Seek the first edge
|
||||
context_loop = [edkey, ed_adj[0]]
|
||||
edge_loops.append(context_loop)
|
||||
if len(ed_adj) == 2:
|
||||
other_dir = ed_adj[1]
|
||||
else:
|
||||
other_dir = None
|
||||
|
||||
ed_adj[:] = []
|
||||
|
||||
flipped = False
|
||||
|
||||
while 1:
|
||||
# from knowing the last 2, look for th next.
|
||||
ed_adj = edges[context_loop[-1]]
|
||||
if len(ed_adj) != 2:
|
||||
|
||||
if other_dir and flipped == False: # the original edge had 2 other edges
|
||||
flipped = True # only flip the list once
|
||||
context_loop.reverse()
|
||||
ed_adj[:] = []
|
||||
context_loop.append(other_dir) # save 1 lookiup
|
||||
|
||||
ed_adj = edges[context_loop[-1]]
|
||||
if len(ed_adj) != 2:
|
||||
ed_adj[:] = []
|
||||
break
|
||||
else:
|
||||
ed_adj[:] = []
|
||||
break
|
||||
|
||||
i = ed_adj.index(context_loop[-2])
|
||||
context_loop.append(ed_adj[not i])
|
||||
|
||||
# Dont look at this again
|
||||
ed_adj[:] = []
|
||||
|
||||
return edge_loops
|
||||
|
||||
|
||||
def edge_loops_from_edges(mesh, edges=None):
|
||||
"""
|
||||
Edge loops defined by edges
|
||||
|
||||
Takes me.edges or a list of edges and returns the edge loops
|
||||
|
||||
return a list of vertex indices.
|
||||
[ [1, 6, 7, 2], ...]
|
||||
|
||||
closed loops have matching start and end values.
|
||||
"""
|
||||
line_polys = []
|
||||
|
||||
# Get edges not used by a face
|
||||
if edges is None:
|
||||
edges = mesh.edges
|
||||
|
||||
if not hasattr(edges, "pop"):
|
||||
edges = edges[:]
|
||||
|
||||
edge_dict = {ed.key: ed for ed in mesh.edges if ed.select}
|
||||
|
||||
while edges:
|
||||
current_edge = edges.pop()
|
||||
vert_end, vert_start = current_edge.vertices[:]
|
||||
line_poly = [vert_start, vert_end]
|
||||
|
||||
ok = True
|
||||
while ok:
|
||||
ok = False
|
||||
#for i, ed in enumerate(edges):
|
||||
i = len(edges)
|
||||
while i:
|
||||
i -= 1
|
||||
ed = edges[i]
|
||||
v1, v2 = ed.vertices
|
||||
if v1 == vert_end:
|
||||
line_poly.append(v2)
|
||||
vert_end = line_poly[-1]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
# break
|
||||
elif v2 == vert_end:
|
||||
line_poly.append(v1)
|
||||
vert_end = line_poly[-1]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
elif v1 == vert_start:
|
||||
line_poly.insert(0, v2)
|
||||
vert_start = line_poly[0]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
# break
|
||||
elif v2 == vert_start:
|
||||
line_poly.insert(0, v1)
|
||||
vert_start = line_poly[0]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
line_polys.append(line_poly)
|
||||
|
||||
return line_polys
|
||||
|
||||
|
||||
def ngon_tesselate(from_data, indices, fix_loops=True):
|
||||
'''
|
||||
Takes a polyline of indices (fgon)
|
||||
and returns a list of face indicie lists.
|
||||
Designed to be used for importers that need indices for an fgon to create from existing verts.
|
||||
|
||||
from_data: either a mesh, or a list/tuple of vectors.
|
||||
indices: a list of indices to use this list is the ordered closed polyline to fill, and can be a subset of the data given.
|
||||
fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly.
|
||||
'''
|
||||
|
||||
from mathutils import Vector
|
||||
vector_to_tuple = Vector.to_tuple
|
||||
|
||||
if not indices:
|
||||
return []
|
||||
|
||||
def mlen(co):
|
||||
return abs(co[0]) + abs(co[1]) + abs(co[2]) # manhatten length of a vector, faster then length
|
||||
|
||||
def vert_treplet(v, i):
|
||||
return v, vector_to_tuple(v, 6), i, mlen(v)
|
||||
|
||||
def ed_key_mlen(v1, v2):
|
||||
if v1[3] > v2[3]:
|
||||
return v2[1], v1[1]
|
||||
else:
|
||||
return v1[1], v2[1]
|
||||
|
||||
if not PREF_FIX_LOOPS:
|
||||
'''
|
||||
Normal single concave loop filling
|
||||
'''
|
||||
if type(from_data) in (tuple, list):
|
||||
verts = [Vector(from_data[i]) for ii, i in enumerate(indices)]
|
||||
else:
|
||||
verts = [from_data.vertices[i].co for ii, i in enumerate(indices)]
|
||||
|
||||
for i in range(len(verts) - 1, 0, -1): # same as reversed(xrange(1, len(verts))):
|
||||
if verts[i][1] == verts[i - 1][0]:
|
||||
verts.pop(i - 1)
|
||||
|
||||
fill = fill_polygon([verts])
|
||||
|
||||
else:
|
||||
'''
|
||||
Seperate this loop into multiple loops be finding edges that are used twice
|
||||
This is used by lightwave LWO files a lot
|
||||
'''
|
||||
|
||||
if type(from_data) in (tuple, list):
|
||||
verts = [vert_treplet(Vector(from_data[i]), ii) for ii, i in enumerate(indices)]
|
||||
else:
|
||||
verts = [vert_treplet(from_data.vertices[i].co, ii) for ii, i in enumerate(indices)]
|
||||
|
||||
edges = [(i, i - 1) for i in range(len(verts))]
|
||||
if edges:
|
||||
edges[0] = (0, len(verts) - 1)
|
||||
|
||||
if not verts:
|
||||
return []
|
||||
|
||||
edges_used = set()
|
||||
edges_doubles = set()
|
||||
# We need to check if any edges are used twice location based.
|
||||
for ed in edges:
|
||||
edkey = ed_key_mlen(verts[ed[0]], verts[ed[1]])
|
||||
if edkey in edges_used:
|
||||
edges_doubles.add(edkey)
|
||||
else:
|
||||
edges_used.add(edkey)
|
||||
|
||||
# Store a list of unconnected loop segments split by double edges.
|
||||
# will join later
|
||||
loop_segments = []
|
||||
|
||||
v_prev = verts[0]
|
||||
context_loop = [v_prev]
|
||||
loop_segments = [context_loop]
|
||||
|
||||
for v in verts:
|
||||
if v != v_prev:
|
||||
# Are we crossing an edge we removed?
|
||||
if ed_key_mlen(v, v_prev) in edges_doubles:
|
||||
context_loop = [v]
|
||||
loop_segments.append(context_loop)
|
||||
else:
|
||||
if context_loop and context_loop[-1][1] == v[1]:
|
||||
#raise "as"
|
||||
pass
|
||||
else:
|
||||
context_loop.append(v)
|
||||
|
||||
v_prev = v
|
||||
# Now join loop segments
|
||||
|
||||
def join_seg(s1, s2):
|
||||
if s2[-1][1] == s1[0][1]:
|
||||
s1, s2 = s2, s1
|
||||
elif s1[-1][1] == s2[0][1]:
|
||||
pass
|
||||
else:
|
||||
return False
|
||||
|
||||
# If were stuill here s1 and s2 are 2 segments in the same polyline
|
||||
s1.pop() # remove the last vert from s1
|
||||
s1.extend(s2) # add segment 2 to segment 1
|
||||
|
||||
if s1[0][1] == s1[-1][1]: # remove endpoints double
|
||||
s1.pop()
|
||||
|
||||
s2[:] = [] # Empty this segment s2 so we dont use it again.
|
||||
return True
|
||||
|
||||
joining_segments = True
|
||||
while joining_segments:
|
||||
joining_segments = False
|
||||
segcount = len(loop_segments)
|
||||
|
||||
for j in range(segcount - 1, -1, -1): # reversed(range(segcount)):
|
||||
seg_j = loop_segments[j]
|
||||
if seg_j:
|
||||
for k in range(j - 1, -1, -1): # reversed(range(j)):
|
||||
if not seg_j:
|
||||
break
|
||||
seg_k = loop_segments[k]
|
||||
|
||||
if seg_k and join_seg(seg_j, seg_k):
|
||||
joining_segments = True
|
||||
|
||||
loop_list = loop_segments
|
||||
|
||||
for verts in loop_list:
|
||||
while verts and verts[0][1] == verts[-1][1]:
|
||||
verts.pop()
|
||||
|
||||
loop_list = [verts for verts in loop_list if len(verts) > 2]
|
||||
# DONE DEALING WITH LOOP FIXING
|
||||
|
||||
# vert mapping
|
||||
vert_map = [None] * len(indices)
|
||||
ii = 0
|
||||
for verts in loop_list:
|
||||
if len(verts) > 2:
|
||||
for i, vert in enumerate(verts):
|
||||
vert_map[i + ii] = vert[2]
|
||||
ii += len(verts)
|
||||
|
||||
fill = tesselate_polygon([[v[0] for v in loop] for loop in loop_list])
|
||||
#draw_loops(loop_list)
|
||||
#raise 'done loop'
|
||||
# map to original indices
|
||||
fill = [[vert_map[i] for i in reversed(f)] for f in fill]
|
||||
|
||||
if not fill:
|
||||
print('Warning Cannot scanfill, fallback on a triangle fan.')
|
||||
fill = [[0, i - 1, i] for i in range(2, len(indices))]
|
||||
else:
|
||||
# Use real scanfill.
|
||||
# See if its flipped the wrong way.
|
||||
flip = None
|
||||
for fi in fill:
|
||||
if flip != None:
|
||||
break
|
||||
for i, vi in enumerate(fi):
|
||||
if vi == 0 and fi[i - 1] == 1:
|
||||
flip = False
|
||||
break
|
||||
elif vi == 1 and fi[i - 1] == 0:
|
||||
flip = True
|
||||
break
|
||||
|
||||
if not flip:
|
||||
for i, fi in enumerate(fill):
|
||||
fill[i] = tuple([ii for ii in reversed(fi)])
|
||||
|
||||
return fill
|
||||
|
||||
@@ -18,11 +18,27 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
__all__ = (
|
||||
"add_object_align_init",
|
||||
"object_data_add",
|
||||
)
|
||||
|
||||
|
||||
import bpy
|
||||
import mathutils
|
||||
|
||||
|
||||
def add_object_align_init(context, operator):
|
||||
"""
|
||||
Return a matrix using the operator settings and view context.
|
||||
|
||||
:arg context: The context to use.
|
||||
:type context: :class:`Context`
|
||||
:arg operator: The operator, checked for location and rotation properties.
|
||||
:type operator: :class:`Operator`
|
||||
:return: the matrix from the context and settings.
|
||||
:rtype: :class:`Matrix`
|
||||
"""
|
||||
space_data = context.space_data
|
||||
if space_data.type != 'VIEW_3D':
|
||||
space_data = None
|
||||
@@ -64,7 +80,19 @@ def add_object_align_init(context, operator):
|
||||
|
||||
|
||||
def object_data_add(context, obdata, operator=None):
|
||||
"""
|
||||
Add an object using the view context and preference to to initialize the
|
||||
location, rotation and layer.
|
||||
|
||||
:arg context: The context to use.
|
||||
:type context: :class:`Context`
|
||||
:arg obdata: the data used for the new object.
|
||||
:type obdata: valid object data type or None.
|
||||
:arg operator: The operator, checked for location and rotation properties.
|
||||
:type operator: :class:`Operator`
|
||||
:return: the newly created object in the scene.
|
||||
:rtype: :class:`ObjectBase`
|
||||
"""
|
||||
scene = context.scene
|
||||
|
||||
# ugh, could be made nicer
|
||||
|
||||
@@ -18,17 +18,12 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
|
||||
def _is_persp_matrix(persmat, eps=0.00001):
|
||||
"""
|
||||
crummy way to check if its a perspective matrix
|
||||
"""
|
||||
return not (
|
||||
abs(persmat[0][3]) < eps and \
|
||||
abs(persmat[1][3]) < eps and \
|
||||
abs(persmat[2][3]) < eps and \
|
||||
abs(persmat[3][3] - 1.0) < eps)
|
||||
|
||||
__all__ = (
|
||||
"region_2d_to_vector_3d",
|
||||
"region_2d_to_location_3d",
|
||||
"location_3d_to_region_2d",
|
||||
"location_3d_to_region_2d",
|
||||
)
|
||||
|
||||
def region_2d_to_vector_3d(region, rv3d, coord):
|
||||
"""
|
||||
@@ -39,7 +34,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
|
||||
:type region: :class:`Region`
|
||||
:arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
|
||||
:type rv3d: :class:`RegionView3D`
|
||||
:arg coord: 2d coordinates relative to the region;
|
||||
:arg coord: 2d coordinates relative to the region:
|
||||
(event.mouse_region_x, event.mouse_region_y) for example.
|
||||
:type coord: 2d vector
|
||||
:return: normalized 3d vector.
|
||||
@@ -47,17 +42,21 @@ def region_2d_to_vector_3d(region, rv3d, coord):
|
||||
"""
|
||||
from mathutils import Vector
|
||||
|
||||
persmat = rv3d.perspective_matrix.copy()
|
||||
viewvec = rv3d.view_matrix.inverted()[2].xyz.normalized()
|
||||
if rv3d.is_perspective:
|
||||
persinv = rv3d.perspective_matrix.inverted()
|
||||
|
||||
if _is_persp_matrix(persmat):
|
||||
dx = (2.0 * coord[0] / region.width) - 1.0
|
||||
dy = (2.0 * coord[1] / region.height) - 1.0
|
||||
out = Vector(((2.0 * coord[0] / region.width) - 1.0,
|
||||
(2.0 * coord[1] / region.height) - 1.0,
|
||||
-0.5
|
||||
))
|
||||
|
||||
perspinv_x, perspinv_y = persmat.inverted().to_3x3()[0:2]
|
||||
return ((perspinv_x * dx + perspinv_y * dy) - viewvec).normalized()
|
||||
w = (out[0] * persinv[0][3]) + \
|
||||
(out[1] * persinv[1][3]) + \
|
||||
(out[2] * persinv[2][3]) + persinv[3][3]
|
||||
|
||||
return ((out * persinv) / w) - rv3d.view_matrix.inverted()[3].xyz
|
||||
else:
|
||||
return viewvec
|
||||
return rv3d.view_matrix.inverted()[2].xyz.normalized()
|
||||
|
||||
|
||||
def region_2d_to_location_3d(region, rv3d, coord, depth_location):
|
||||
@@ -78,22 +77,28 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
|
||||
:return: normalized 3d vector.
|
||||
:rtype: :class:`Vector`
|
||||
"""
|
||||
from mathutils import Vector
|
||||
from mathutils.geometry import intersect_point_line
|
||||
|
||||
persmat = rv3d.perspective_matrix.copy()
|
||||
coord_vec = region_2d_to_vector_3d(region, rv3d, coord)
|
||||
depth_location = Vector(depth_location)
|
||||
|
||||
if rv3d.is_perspective:
|
||||
from mathutils.geometry import intersect_line_plane
|
||||
|
||||
if _is_persp_matrix(persmat):
|
||||
origin_start = rv3d.view_matrix.inverted()[3].to_3d()
|
||||
origin_end = origin_start + coord_vec
|
||||
view_vec = rv3d.view_matrix.inverted()[2]
|
||||
return intersect_line_plane(origin_start, origin_end, depth_location, view_vec, 1)
|
||||
else:
|
||||
dx = (2.0 * coord[0] / region.width) - 1.0
|
||||
dy = (2.0 * coord[1] / region.height) - 1.0
|
||||
persinv = persmat.inverted()
|
||||
viewinv = rv3d.view_matrix.inverted()
|
||||
origin_start = (persinv[0].xyz * dx) + (persinv[1].xyz * dy) + viewinv[3].xyz
|
||||
|
||||
origin_end = origin_start + region_2d_to_vector_3d(region, rv3d, coord)
|
||||
|
||||
return intersect_point_line(depth_location, origin_start, origin_end)[0]
|
||||
origin_end = origin_start + coord_vec
|
||||
return intersect_point_line(depth_location, origin_start, origin_end)[0]
|
||||
|
||||
|
||||
def location_3d_to_region_2d(region, rv3d, coord):
|
||||
|
||||
@@ -356,163 +356,6 @@ class Mesh(bpy_types.ID):
|
||||
def edge_keys(self):
|
||||
return [edge_key for face in self.faces for edge_key in face.edge_keys]
|
||||
|
||||
@property
|
||||
def edge_face_count_dict(self):
|
||||
face_edge_keys = [face.edge_keys for face in self.faces]
|
||||
face_edge_count = {}
|
||||
for face_keys in face_edge_keys:
|
||||
for key in face_keys:
|
||||
try:
|
||||
face_edge_count[key] += 1
|
||||
except:
|
||||
face_edge_count[key] = 1
|
||||
|
||||
return face_edge_count
|
||||
|
||||
@property
|
||||
def edge_face_count(self):
|
||||
edge_face_count_dict = self.edge_face_count_dict
|
||||
return [edge_face_count_dict.get(ed.key, 0) for ed in self.edges]
|
||||
|
||||
def edge_loops_from_faces(self, faces=None, seams=()):
|
||||
"""
|
||||
Edge loops defined by faces
|
||||
|
||||
Takes me.faces or a list of faces and returns the edge loops
|
||||
These edge loops are the edges that sit between quads, so they dont touch
|
||||
1 quad, note: not connected will make 2 edge loops, both only containing 2 edges.
|
||||
|
||||
return a list of edge key lists
|
||||
[ [(0,1), (4, 8), (3,8)], ...]
|
||||
|
||||
return a list of edge vertex index lists
|
||||
"""
|
||||
|
||||
OTHER_INDEX = 2, 3, 0, 1 # opposite face index
|
||||
|
||||
if faces is None:
|
||||
faces = self.faces
|
||||
|
||||
edges = {}
|
||||
|
||||
for f in faces:
|
||||
# if len(f) == 4:
|
||||
if f.vertices_raw[3] != 0:
|
||||
edge_keys = f.edge_keys
|
||||
for i, edkey in enumerate(f.edge_keys):
|
||||
edges.setdefault(edkey, []).append(edge_keys[OTHER_INDEX[i]])
|
||||
|
||||
for edkey in seams:
|
||||
edges[edkey] = []
|
||||
|
||||
# Collect edge loops here
|
||||
edge_loops = []
|
||||
|
||||
for edkey, ed_adj in edges.items():
|
||||
if 0 < len(ed_adj) < 3: # 1 or 2
|
||||
# Seek the first edge
|
||||
context_loop = [edkey, ed_adj[0]]
|
||||
edge_loops.append(context_loop)
|
||||
if len(ed_adj) == 2:
|
||||
other_dir = ed_adj[1]
|
||||
else:
|
||||
other_dir = None
|
||||
|
||||
ed_adj[:] = []
|
||||
|
||||
flipped = False
|
||||
|
||||
while 1:
|
||||
# from knowing the last 2, look for th next.
|
||||
ed_adj = edges[context_loop[-1]]
|
||||
if len(ed_adj) != 2:
|
||||
|
||||
if other_dir and flipped == False: # the original edge had 2 other edges
|
||||
flipped = True # only flip the list once
|
||||
context_loop.reverse()
|
||||
ed_adj[:] = []
|
||||
context_loop.append(other_dir) # save 1 lookiup
|
||||
|
||||
ed_adj = edges[context_loop[-1]]
|
||||
if len(ed_adj) != 2:
|
||||
ed_adj[:] = []
|
||||
break
|
||||
else:
|
||||
ed_adj[:] = []
|
||||
break
|
||||
|
||||
i = ed_adj.index(context_loop[-2])
|
||||
context_loop.append(ed_adj[not i])
|
||||
|
||||
# Dont look at this again
|
||||
ed_adj[:] = []
|
||||
|
||||
return edge_loops
|
||||
|
||||
def edge_loops_from_edges(self, edges=None):
|
||||
"""
|
||||
Edge loops defined by edges
|
||||
|
||||
Takes me.edges or a list of edges and returns the edge loops
|
||||
|
||||
return a list of vertex indices.
|
||||
[ [1, 6, 7, 2], ...]
|
||||
|
||||
closed loops have matching start and end values.
|
||||
"""
|
||||
line_polys = []
|
||||
|
||||
# Get edges not used by a face
|
||||
if edges is None:
|
||||
edges = self.edges
|
||||
|
||||
if not hasattr(edges, "pop"):
|
||||
edges = edges[:]
|
||||
|
||||
edge_dict = {ed.key: ed for ed in self.edges if ed.select}
|
||||
|
||||
while edges:
|
||||
current_edge = edges.pop()
|
||||
vert_end, vert_start = current_edge.vertices[:]
|
||||
line_poly = [vert_start, vert_end]
|
||||
|
||||
ok = True
|
||||
while ok:
|
||||
ok = False
|
||||
#for i, ed in enumerate(edges):
|
||||
i = len(edges)
|
||||
while i:
|
||||
i -= 1
|
||||
ed = edges[i]
|
||||
v1, v2 = ed.vertices
|
||||
if v1 == vert_end:
|
||||
line_poly.append(v2)
|
||||
vert_end = line_poly[-1]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
# break
|
||||
elif v2 == vert_end:
|
||||
line_poly.append(v1)
|
||||
vert_end = line_poly[-1]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
elif v1 == vert_start:
|
||||
line_poly.insert(0, v2)
|
||||
vert_start = line_poly[0]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
# break
|
||||
elif v2 == vert_start:
|
||||
line_poly.insert(0, v1)
|
||||
vert_start = line_poly[0]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
line_polys.append(line_poly)
|
||||
|
||||
return line_polys
|
||||
|
||||
|
||||
class MeshEdge(StructRNA):
|
||||
__slots__ = ()
|
||||
|
||||
@@ -37,6 +37,11 @@ def is_dict(obj):
|
||||
return hasattr(obj, 'keys') and hasattr(getattr(obj, 'keys'), '__call__')
|
||||
|
||||
|
||||
def is_struct_seq(obj):
|
||||
"""Returns whether obj is a structured sequence subclass: sys.float_info"""
|
||||
return isinstance(obj, tuple) and hasattr(obj, 'n_fields')
|
||||
|
||||
|
||||
def complete_names(word, namespace):
|
||||
"""Complete variable names or attributes
|
||||
|
||||
@@ -174,7 +179,7 @@ def complete(word, namespace, private=True):
|
||||
if type(obj) in (bool, float, int, str):
|
||||
return []
|
||||
# an extra char '[', '(' or '.' will be added
|
||||
if hasattr(obj, '__getitem__'):
|
||||
if hasattr(obj, '__getitem__') and not is_struct_seq(obj):
|
||||
# list or dictionary
|
||||
matches = complete_indices(word, namespace, obj)
|
||||
elif hasattr(obj, '__call__'):
|
||||
|
||||
@@ -126,7 +126,14 @@ def expand(line, cursor, namespace, private=True):
|
||||
if len(matches) == 1:
|
||||
scrollback = ''
|
||||
else:
|
||||
scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
||||
# causes blender bug [#27495] since string keys may contain '.'
|
||||
# scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
||||
scrollback = ' '.join(
|
||||
[m[len(word):]
|
||||
if (word and m.startswith(word))
|
||||
else m.split('.')[-1]
|
||||
for m in matches])
|
||||
|
||||
no_calltip = True
|
||||
prefix = os.path.commonprefix(matches)[len(word):]
|
||||
if prefix:
|
||||
|
||||
@@ -80,7 +80,7 @@ def get_console(console_id):
|
||||
if console_data:
|
||||
console, stdout, stderr = console_data
|
||||
|
||||
# XXX, bug in python 3.1.2 ? (worked in 3.1.1)
|
||||
# XXX, bug in python 3.1.2, 3.2 ? (worked in 3.1.1)
|
||||
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
|
||||
import io
|
||||
stdout = io.StringIO()
|
||||
|
||||
@@ -36,6 +36,7 @@ class MeshSelectInteriorFaces(bpy.types.Operator):
|
||||
return (ob and ob.type == 'MESH')
|
||||
|
||||
def execute(self, context):
|
||||
from bpy_extras import mesh_utils
|
||||
ob = context.active_object
|
||||
context.tool_settings.mesh_select_mode = False, False, True
|
||||
is_editmode = (ob.mode == 'EDIT')
|
||||
@@ -47,7 +48,7 @@ class MeshSelectInteriorFaces(bpy.types.Operator):
|
||||
face_list = mesh.faces[:]
|
||||
face_edge_keys = [face.edge_keys for face in face_list]
|
||||
|
||||
edge_face_count = mesh.edge_face_count_dict
|
||||
edge_face_count = mesh_utils.edge_face_count_dict(mesh)
|
||||
|
||||
def test_interior(index):
|
||||
for key in face_edge_keys[index]:
|
||||
|
||||
@@ -326,7 +326,7 @@ class AddPresetOperator(AddPresetBase, bpy.types.Operator):
|
||||
|
||||
ret = []
|
||||
for prop_id, prop in operator_rna.properties.items():
|
||||
if (not prop.is_hidden) and prop_id not in properties_blacklist:
|
||||
if (not (prop.is_hidden or prop.is_skip_save)) and prop_id not in properties_blacklist:
|
||||
ret.append("op.%s" % prop_id)
|
||||
|
||||
return ret
|
||||
|
||||
@@ -25,6 +25,8 @@ import bpy
|
||||
|
||||
|
||||
def extend(obj, operator, EXTEND_MODE):
|
||||
from bpy_extras import mesh_utils
|
||||
|
||||
me = obj.data
|
||||
me_verts = me.vertices
|
||||
# script will fail without UVs
|
||||
@@ -170,7 +172,7 @@ def extend(obj, operator, EXTEND_MODE):
|
||||
edge_faces[edkey] = [i]
|
||||
|
||||
if EXTEND_MODE == 'LENGTH':
|
||||
edge_loops = me.edge_loops_from_faces(face_sel, [ed.key for ed in me.edges if ed.use_seam])
|
||||
edge_loops = mesh_utils.edge_loops_from_faces(me, face_sel, [ed.key for ed in me.edges if ed.use_seam])
|
||||
me_verts = me.vertices
|
||||
for loop in edge_loops:
|
||||
looplen = [0.0]
|
||||
|
||||
@@ -106,7 +106,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_boolean"
|
||||
bl_label = "Context Set Boolean"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = BoolProperty(name="Value",
|
||||
@@ -119,7 +119,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = IntProperty(name="Value", description="Assign value", default=0)
|
||||
@@ -132,7 +132,7 @@ class WM_OT_context_scale_int(bpy.types.Operator):
|
||||
'''Scale an int context value.'''
|
||||
bl_idname = "wm.context_scale_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = FloatProperty(name="Value", description="Assign value", default=1.0)
|
||||
@@ -168,7 +168,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_float"
|
||||
bl_label = "Context Set Float"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = FloatProperty(name="Value",
|
||||
@@ -182,7 +182,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_string"
|
||||
bl_label = "Context Set String"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@@ -195,7 +195,7 @@ class WM_OT_context_set_enum(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_enum"
|
||||
bl_label = "Context Set Enum"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@@ -209,7 +209,7 @@ class WM_OT_context_set_value(bpy.types.Operator):
|
||||
'''Set a context value.'''
|
||||
bl_idname = "wm.context_set_value"
|
||||
bl_label = "Context Set Value"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@@ -227,7 +227,7 @@ class WM_OT_context_toggle(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle"
|
||||
bl_label = "Context Toggle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
|
||||
@@ -246,7 +246,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_toggle_enum"
|
||||
bl_label = "Context Toggle Values"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value_1 = StringProperty(name="Value", \
|
||||
@@ -273,7 +273,7 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
|
||||
'''vertex keys, groups' etc.'''
|
||||
bl_idname = "wm.context_cycle_int"
|
||||
bl_label = "Context Int Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@@ -307,7 +307,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_cycle_enum"
|
||||
bl_label = "Context Enum Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@@ -360,7 +360,7 @@ class WM_OT_context_cycle_array(bpy.types.Operator):
|
||||
Useful for cycling the active mesh edit mode.'''
|
||||
bl_idname = "wm.context_cycle_array"
|
||||
bl_label = "Context Array Cycle"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
reverse = rna_reverse_prop
|
||||
@@ -406,7 +406,7 @@ class WM_MT_context_menu_enum(bpy.types.Menu):
|
||||
class WM_OT_context_menu_enum(bpy.types.Operator):
|
||||
bl_idname = "wm.context_menu_enum"
|
||||
bl_label = "Context Enum Menu"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
data_path = rna_path_prop
|
||||
|
||||
def execute(self, context):
|
||||
@@ -420,7 +420,7 @@ class WM_OT_context_set_id(bpy.types.Operator):
|
||||
'''Toggle a context value.'''
|
||||
bl_idname = "wm.context_set_id"
|
||||
bl_label = "Set Library ID"
|
||||
bl_options = {'UNDO'}
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
|
||||
data_path = rna_path_prop
|
||||
value = StringProperty(name="Value",
|
||||
@@ -462,6 +462,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
bl_idname = "wm.context_modal_mouse"
|
||||
bl_label = "Context Modal Mouse"
|
||||
bl_options = {'INTERNAL'}
|
||||
|
||||
data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.")
|
||||
data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)")
|
||||
@@ -940,6 +941,14 @@ class WM_OT_copy_prev_settings(bpy.types.Operator):
|
||||
self.report({'ERROR'}, "Source path %r exists" % path_src)
|
||||
else:
|
||||
shutil.copytree(path_src, path_dst)
|
||||
|
||||
# in 2.57 and earlier windows installers, system scripts were copied
|
||||
# into the configuration directory, don't want to copy those
|
||||
system_script = os.path.join(path_dst, 'scripts/modules/bpy_types.py')
|
||||
if os.path.isfile(system_script):
|
||||
shutil.rmtree(os.path.join(path_dst, 'scripts'))
|
||||
shutil.rmtree(os.path.join(path_dst, 'plugins'))
|
||||
|
||||
# dont loose users work if they open the splash later.
|
||||
if bpy.data.is_saved is bpy.data.is_dirty is False:
|
||||
bpy.ops.wm.read_homefile()
|
||||
|
||||
@@ -85,26 +85,26 @@ def register():
|
||||
from bpy.props import StringProperty, EnumProperty
|
||||
WindowManager = bpy.types.WindowManager
|
||||
|
||||
def addon_filter_items(self, context):
|
||||
import addon_utils
|
||||
|
||||
items = [('All', "All", ""),
|
||||
('Enabled', "Enabled", ""),
|
||||
('Disabled', "Disabled", ""),
|
||||
]
|
||||
|
||||
items_unique = set()
|
||||
|
||||
for mod in addon_utils.modules(space_userpref.USERPREF_PT_addons._addons_fake_modules):
|
||||
info = addon_utils.module_bl_info(mod)
|
||||
items_unique.add(info["category"])
|
||||
|
||||
items.extend([(cat, cat, "") for cat in sorted(items_unique)])
|
||||
return items
|
||||
|
||||
WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter")
|
||||
WindowManager.addon_filter = EnumProperty(
|
||||
items=[('All', "All", ""),
|
||||
('Enabled', "Enabled", ""),
|
||||
('Disabled', "Disabled", ""),
|
||||
('3D View', "3D View", ""),
|
||||
('Add Curve', "Add Curve", ""),
|
||||
('Add Mesh', "Add Mesh", ""),
|
||||
('Animation', "Animation", ""),
|
||||
('Development', "Development", ""),
|
||||
('Game Engine', "Game Engine", ""),
|
||||
('Import-Export', "Import-Export", ""),
|
||||
('Mesh', "Mesh", ""),
|
||||
('Object', "Object", ""),
|
||||
('Render', "Render", ""),
|
||||
('Rigging', "Rigging", ""),
|
||||
('Text Editor', "Text Editor", ""),
|
||||
('System', "System", ""),
|
||||
('Other', "Other", ""),
|
||||
],
|
||||
items=addon_filter_items,
|
||||
name="Category",
|
||||
description="Filter add-ons by category",
|
||||
)
|
||||
|
||||
@@ -117,6 +117,10 @@ class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
col.prop(curve, "use_uv_as_generated")
|
||||
col.prop(curve, "use_auto_texspace")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(curve, "texspace_location")
|
||||
row.column().prop(curve, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_geometry_curve(CurveButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Geometry"
|
||||
|
||||
@@ -44,9 +44,9 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
|
||||
# layout.template_image(ob, "data", None)
|
||||
layout.template_ID(ob, "data", open="image.open", unlink="image.unlink")
|
||||
|
||||
row = layout.row(align = True)
|
||||
row = layout.row(align=True)
|
||||
row.prop(ob, "color", text="Transparency", index=3, slider=True)
|
||||
row = layout.row(align = True)
|
||||
row = layout.row(align=True)
|
||||
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
|
||||
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
|
||||
|
||||
|
||||
@@ -99,8 +99,9 @@ class DATA_PT_normals(MeshButtonsPanel, bpy.types.Panel):
|
||||
split.prop(mesh, "show_double_sided")
|
||||
|
||||
|
||||
class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Settings"
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Texture Space"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
@@ -109,8 +110,13 @@ class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
|
||||
mesh = context.mesh
|
||||
|
||||
layout.prop(mesh, "texture_mesh")
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(mesh, "use_auto_texspace")
|
||||
row = layout.row()
|
||||
row.column().prop(mesh, "texspace_location", text="Location")
|
||||
row.column().prop(mesh, "texspace_size", text="Size")
|
||||
|
||||
class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Vertex Groups"
|
||||
|
||||
@@ -71,6 +71,10 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
|
||||
layout.label(text="Update:")
|
||||
layout.prop(mball, "update_method", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(mball, "texspace_location")
|
||||
row.column().prop(mball, "texspace_size")
|
||||
|
||||
|
||||
class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Active Element"
|
||||
|
||||
@@ -483,11 +483,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
||||
col.label(text="Mode:")
|
||||
col.prop(md, "wrap_method", text="")
|
||||
|
||||
split = layout.split(percentage=0.25)
|
||||
|
||||
col = split.column()
|
||||
|
||||
if md.wrap_method == 'PROJECT':
|
||||
split = layout.split(percentage=0.25)
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Axis:")
|
||||
col.prop(md, "use_project_x")
|
||||
col.prop(md, "use_project_y")
|
||||
@@ -499,7 +498,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
||||
col.prop(md, "use_positive_direction")
|
||||
|
||||
col = split.column()
|
||||
|
||||
col.label(text="Cull Faces:")
|
||||
col.prop(md, "cull_face", expand=True)
|
||||
|
||||
|
||||
@@ -651,6 +651,24 @@ class ConstraintButtonsPanel():
|
||||
sub.prop(con, "from_min_z", text="Min")
|
||||
sub.prop(con, "from_max_z", text="Max")
|
||||
|
||||
col = layout.column()
|
||||
row = col.row()
|
||||
row.label(text="Source to Destination Mapping:")
|
||||
|
||||
# note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't
|
||||
# open it. Thus we are using the hardcoded value instead.
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_x_from", expand=False, text="")
|
||||
row.label(text=" %s X" % chr(187))
|
||||
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_y_from", expand=False, text="")
|
||||
row.label(text=" %s Y" % chr(187))
|
||||
|
||||
row = col.row()
|
||||
row.prop(con, "map_to_z_from", expand=False, text="")
|
||||
row.label(text=" %s Z" % chr(187))
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
@@ -661,7 +679,6 @@ class ConstraintButtonsPanel():
|
||||
|
||||
col = split.column()
|
||||
col.label(text="X:")
|
||||
col.row().prop(con, "map_to_x_from", expand=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(con, "to_min_x", text="Min")
|
||||
@@ -669,7 +686,6 @@ class ConstraintButtonsPanel():
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Y:")
|
||||
col.row().prop(con, "map_to_y_from", expand=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(con, "to_min_y", text="Min")
|
||||
@@ -677,7 +693,6 @@ class ConstraintButtonsPanel():
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Z:")
|
||||
col.row().prop(con, "map_to_z_from", expand=True)
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(con, "to_min_z", text="Min")
|
||||
|
||||
@@ -168,10 +168,8 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, bpy.types.Panel):
|
||||
if psys != None and psys.is_edited:
|
||||
if psys.is_global_hair:
|
||||
layout.operator("particle.connect_hair")
|
||||
layout.label(text="Hair is disconnected.")
|
||||
else:
|
||||
layout.operator("particle.disconnect_hair")
|
||||
layout.label(text="")
|
||||
elif psys != None and part.type == 'REACTOR':
|
||||
split.enabled = particle_panel_enabled(context, psys)
|
||||
split.prop(psys, "reactor_target_object")
|
||||
|
||||
@@ -459,8 +459,130 @@ class RENDER_PT_freestyle_linestyle(RenderButtonsPanel, bpy.types.Panel):
|
||||
pass
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
|
||||
row.operator("render.preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start", text="Start")
|
||||
sub.prop(scene, "frame_end", text="End")
|
||||
sub.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
if rd.fps_base == 1:
|
||||
fps_rate = round(rd.fps / rd.fps_base)
|
||||
else:
|
||||
fps_rate = round(rd.fps / rd.fps_base, 2)
|
||||
|
||||
# TODO: Change the following to iterate over existing presets
|
||||
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
|
||||
|
||||
if custom_framerate == True:
|
||||
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
|
||||
else:
|
||||
fps_label_text = str(fps_rate) + " fps"
|
||||
|
||||
sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
|
||||
|
||||
if custom_framerate or (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom"):
|
||||
sub.prop(rd, "fps")
|
||||
sub.prop(rd, "fps_base", text="/")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_antialiasing", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_antialiasing
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().prop(rd, "antialiasing_samples", expand=True)
|
||||
sub = col.row()
|
||||
sub.enabled = not rd.use_border
|
||||
sub.prop(rd, "use_full_sample")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "pixel_filter_type", text="")
|
||||
col.prop(rd, "filter_size", text="Size")
|
||||
|
||||
|
||||
class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sampled Motion Blur"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
rd = context.scene.render
|
||||
return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_motion_blur", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_motion_blur
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "motion_blur_samples")
|
||||
row.prop(rd, "motion_blur_shutter")
|
||||
|
||||
|
||||
class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Shading"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
@@ -541,8 +663,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -568,6 +689,50 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
|
||||
col = split.column()
|
||||
col.prop(rd, "use_freestyle", text="Freestyle")
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_stamp
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
col.prop(rd, "use_stamp_frame", text="Frame")
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_foreground", slider=True)
|
||||
col.prop(rd, "stamp_background", slider=True)
|
||||
col.separator()
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
|
||||
|
||||
class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Output"
|
||||
@@ -726,172 +891,6 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
|
||||
split.prop(rd, "ffmpeg_audio_volume", slider=True)
|
||||
|
||||
|
||||
class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Anti-Aliasing"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_antialiasing", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_antialiasing
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.row().prop(rd, "antialiasing_samples", expand=True)
|
||||
sub = col.row()
|
||||
sub.enabled = not rd.use_border
|
||||
sub.prop(rd, "use_full_sample")
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "pixel_filter_type", text="")
|
||||
col.prop(rd, "filter_size", text="Size")
|
||||
|
||||
|
||||
class RENDER_PT_motion_blur(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Sampled Motion Blur"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
rd = context.scene.render
|
||||
return not rd.use_full_sample and (rd.engine in cls.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_motion_blur", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
layout.active = rd.use_motion_blur
|
||||
|
||||
row = layout.row()
|
||||
row.prop(rd, "motion_blur_samples")
|
||||
row.prop(rd, "motion_blur_shutter")
|
||||
|
||||
|
||||
class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Dimensions"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
rd = scene.render
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
|
||||
row.operator("render.preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("render.preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Resolution:")
|
||||
sub.prop(rd, "resolution_x", text="X")
|
||||
sub.prop(rd, "resolution_y", text="Y")
|
||||
sub.prop(rd, "resolution_percentage", text="")
|
||||
|
||||
sub.label(text="Aspect Ratio:")
|
||||
sub.prop(rd, "pixel_aspect_x", text="X")
|
||||
sub.prop(rd, "pixel_aspect_y", text="Y")
|
||||
|
||||
row = col.row()
|
||||
row.prop(rd, "use_border", text="Border")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_border
|
||||
sub.prop(rd, "use_crop_to_border", text="Crop")
|
||||
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.label(text="Frame Range:")
|
||||
sub.prop(scene, "frame_start", text="Start")
|
||||
sub.prop(scene, "frame_end", text="End")
|
||||
sub.prop(scene, "frame_step", text="Step")
|
||||
|
||||
sub.label(text="Frame Rate:")
|
||||
if rd.fps_base == 1:
|
||||
fps_rate = round(rd.fps / rd.fps_base)
|
||||
else:
|
||||
fps_rate = round(rd.fps / rd.fps_base, 2)
|
||||
|
||||
# TODO: Change the following to iterate over existing presets
|
||||
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
|
||||
|
||||
if custom_framerate == True:
|
||||
fps_label_text = "Custom (" + str(fps_rate) + " fps)"
|
||||
else:
|
||||
fps_label_text = str(fps_rate) + " fps"
|
||||
|
||||
sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
|
||||
|
||||
if custom_framerate or (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom"):
|
||||
sub.prop(rd, "fps")
|
||||
sub.prop(rd, "fps_base", text="/")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.label(text="Time Remapping:")
|
||||
subrow = sub.row(align=True)
|
||||
subrow.prop(rd, "frame_map_old", text="Old")
|
||||
subrow.prop(rd, "frame_map_new", text="New")
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Stamp"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||
|
||||
def draw_header(self, context):
|
||||
rd = context.scene.render
|
||||
|
||||
self.layout.prop(rd, "use_stamp", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
layout.active = rd.use_stamp
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(rd, "use_stamp_time", text="Time")
|
||||
col.prop(rd, "use_stamp_date", text="Date")
|
||||
col.prop(rd, "use_stamp_render_time", text="RenderTime")
|
||||
col.prop(rd, "use_stamp_frame", text="Frame")
|
||||
col.prop(rd, "use_stamp_scene", text="Scene")
|
||||
col.prop(rd, "use_stamp_camera", text="Camera")
|
||||
col.prop(rd, "use_stamp_lens", text="Lens")
|
||||
col.prop(rd, "use_stamp_filename", text="Filename")
|
||||
col.prop(rd, "use_stamp_marker", text="Marker")
|
||||
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
|
||||
|
||||
col = split.column()
|
||||
col.active = rd.use_stamp
|
||||
col.prop(rd, "stamp_foreground", slider=True)
|
||||
col.prop(rd, "stamp_background", slider=True)
|
||||
col.separator()
|
||||
col.prop(rd, "stamp_font_size", text="Font Size")
|
||||
|
||||
row = layout.split(percentage=0.2)
|
||||
row.prop(rd, "use_stamp_note", text="Note")
|
||||
sub = row.row()
|
||||
sub.active = rd.use_stamp_note
|
||||
sub.prop(rd, "stamp_note_text", text="")
|
||||
|
||||
|
||||
class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
|
||||
bl_label = "Bake"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -906,6 +905,12 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
|
||||
|
||||
layout.prop(rd, "bake_type")
|
||||
|
||||
multires_bake = False
|
||||
if rd.bake_type in ['NORMALS', 'DISPLACEMENT']:
|
||||
layout.prop(rd, 'use_bake_multires')
|
||||
multires_bake = rd.use_bake_multires
|
||||
|
||||
if not multires_bake:
|
||||
if rd.bake_type == 'NORMALS':
|
||||
layout.prop(rd, "bake_normal_space")
|
||||
elif rd.bake_type in {'DISPLACEMENT', 'AO'}:
|
||||
@@ -929,6 +934,13 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
|
||||
sub.active = rd.use_bake_selected_to_active
|
||||
sub.prop(rd, "bake_distance")
|
||||
sub.prop(rd, "bake_bias")
|
||||
else:
|
||||
if rd.bake_type == 'DISPLACEMENT':
|
||||
layout.prop(rd, "use_bake_lores_mesh")
|
||||
|
||||
layout.prop(rd, "use_bake_clear")
|
||||
layout.prop(rd, "bake_margin")
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
bpy.utils.register_module(__name__)
|
||||
|
||||
@@ -437,7 +437,7 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
|
||||
rd = context.scene.render
|
||||
sima = context.space_data
|
||||
# display even when not in game mode because these settings effect the 3d view
|
||||
return (sima and sima.image) # and (rd.engine == 'BLENDER_GAME')
|
||||
return (sima and sima.image) # and (rd.engine == 'BLENDER_GAME')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -42,7 +42,7 @@ class TEXT_HT_header(bpy.types.Header):
|
||||
|
||||
if text and text.is_modified:
|
||||
row = layout.row()
|
||||
# row.color(redalert)
|
||||
row.alert = True
|
||||
row.operator("text.resolve_conflict", text="", icon='HELP')
|
||||
|
||||
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
|
||||
|
||||
@@ -199,6 +199,7 @@ class USERPREF_PT_interface(bpy.types.Panel):
|
||||
col.prop(view, "use_zoom_to_mouse")
|
||||
col.prop(view, "use_rotate_around_active")
|
||||
col.prop(view, "use_global_pivot")
|
||||
col.prop(view, "use_camera_lock_parent")
|
||||
|
||||
col.separator()
|
||||
|
||||
@@ -752,7 +753,7 @@ class USERPREF_PT_file(bpy.types.Panel):
|
||||
from bl_ui.space_userpref_keymap import InputKeyMapPanel
|
||||
|
||||
|
||||
class USERPREF_PT_input(InputKeyMapPanel):
|
||||
class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel):
|
||||
bl_space_type = 'USER_PREFERENCES'
|
||||
bl_label = "Input"
|
||||
|
||||
@@ -888,6 +889,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
|
||||
split = layout.split(percentage=0.2)
|
||||
col = split.column()
|
||||
col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
|
||||
col.label(text="Categories")
|
||||
col.prop(context.window_manager, "addon_filter", expand=True)
|
||||
|
||||
col.label(text="Supported Level")
|
||||
|
||||
@@ -138,7 +138,7 @@ class USERPREF_MT_keyconfigs(bpy.types.Menu):
|
||||
bpy.types.Menu.draw_preset(self, context)
|
||||
|
||||
|
||||
class InputKeyMapPanel(bpy.types.Panel):
|
||||
class InputKeyMapPanel:
|
||||
bl_space_type = 'USER_PREFERENCES'
|
||||
bl_label = "Input"
|
||||
bl_region_type = 'WINDOW'
|
||||
@@ -411,8 +411,8 @@ def export_properties(prefix, properties, lines=None):
|
||||
if lines is None:
|
||||
lines = []
|
||||
|
||||
for pname in properties.keys():
|
||||
if not properties.is_property_hidden(pname):
|
||||
for pname in properties.bl_rna.properties.keys():
|
||||
if pname != "rna_type" and not properties.is_property_hidden(pname):
|
||||
value = getattr(properties, pname)
|
||||
if isinstance(value, bpy.types.OperatorProperties):
|
||||
export_properties(prefix + "." + pname, value, lines)
|
||||
|
||||
@@ -685,6 +685,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1049,6 +1050,7 @@ class VIEW3D_MT_paint_weight(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1129,6 +1131,7 @@ class VIEW3D_MT_particle(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1182,6 +1185,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1373,6 +1377,7 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1844,6 +1849,7 @@ class VIEW3D_MT_edit_meta(bpy.types.Menu):
|
||||
|
||||
layout.operator("ed.undo")
|
||||
layout.operator("ed.redo")
|
||||
layout.operator("ed.undo_history")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -2318,7 +2324,8 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
|
||||
col.prop(toolsettings, "use_etch_autoname")
|
||||
col.prop(toolsettings, "etch_number")
|
||||
col.prop(toolsettings, "etch_side")
|
||||
col.operator("sketch.convert", text="Convert")
|
||||
|
||||
col.operator("sketch.convert", text="Convert")
|
||||
|
||||
|
||||
class VIEW3D_PT_context_properties(bpy.types.Panel):
|
||||
|
||||
@@ -1245,7 +1245,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
|
||||
if pe.type == 'PARTICLES':
|
||||
if ob.particle_systems:
|
||||
if len(ob.particle_systems) > 1:
|
||||
layout.template_list(ob, "particle_systems", ob.particle_systems, "active_index", type='ICONS')
|
||||
layout.template_list(ob, "particle_systems", ob.particle_systems, "active_index", rows=2, maxrows=3)
|
||||
|
||||
ptcache = ob.particle_systems.active.point_cache
|
||||
else:
|
||||
@@ -1254,7 +1254,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel):
|
||||
ptcache = md.point_cache
|
||||
|
||||
if ptcache and len(ptcache.point_caches) > 1:
|
||||
layout.template_list(ptcache, "point_caches", ptcache.point_caches, "active_index", type='ICONS')
|
||||
layout.template_list(ptcache, "point_caches", ptcache.point_caches, "active_index", rows=2, maxrows=3)
|
||||
|
||||
if not pe.is_editable:
|
||||
layout.label(text="Point cache must be baked")
|
||||
|
||||
@@ -33,11 +33,11 @@ RequestExecutionLevel admin
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
Page custom DataLocation DataLocationOnLeave
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
UninstPage custom un.OptionalRemoveConfig un.OptionalRemoveConfigOnLeave
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
@@ -62,7 +62,6 @@ UninstallIcon "[RELDIR]\00.installer.ico"
|
||||
LangString DESC_StartMenu ${LANG_ENGLISH} "Add shortcut items to the Start Menu. (Recommended)"
|
||||
LangString DESC_DesktopShortcut ${LANG_ENGLISH} "Add a shortcut to Blender on your desktop."
|
||||
LangString DESC_BlendRegister ${LANG_ENGLISH} "Blender can register itself with .blend files to allow double-clicking from Windows Explorer, etc."
|
||||
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Specify User Data Location"
|
||||
;--------------------------------
|
||||
;Data
|
||||
|
||||
@@ -76,15 +75,15 @@ DirText "Use the field below to specify the folder where you want Blender to be
|
||||
|
||||
SilentUnInstall normal
|
||||
|
||||
Var BLENDERHOME
|
||||
Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
|
||||
Var BLENDERCONFIG
|
||||
Var REMOVECONFIG
|
||||
|
||||
; Custom controls
|
||||
Var HWND
|
||||
|
||||
Var HWND_APPDATA
|
||||
Var HWND_INSTDIR
|
||||
Var HWND_HOMEDIR
|
||||
Var HWND_KEEPCONFIG
|
||||
Var HWND_REMOVECONFIG
|
||||
|
||||
Function .onInit
|
||||
ClearErrors
|
||||
@@ -103,9 +102,12 @@ Function .onInit
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
SetShellVarContext current
|
||||
StrCpy $BLENDERCONFIG "$APPDATA\Blender Foundation\Blender"
|
||||
SetShellVarContext all
|
||||
FunctionEnd
|
||||
|
||||
Function DataLocation
|
||||
Function un.OptionalRemoveConfig
|
||||
nsDialogs::Create /NOUNLOAD 1018
|
||||
Pop $HWND
|
||||
|
||||
@@ -113,45 +115,27 @@ Function DataLocation
|
||||
Abort
|
||||
${EndIf}
|
||||
|
||||
${NSD_CreateLabel} 0 0 100% 24u "Please specify where you wish to install Blender's user data files. Be aware that if you choose to use your Application Data directory, your preferences and scripts will only be accessible by the current user account."
|
||||
${NSD_CreateRadioButton} 0 50 100% 12u "Use Application Data directory (recommended)"
|
||||
Pop $HWND_APPDATA
|
||||
${NSD_CreateRadioButton} 0 80 100% 12u "Use installation directory"
|
||||
Pop $HWND_INSTDIR
|
||||
${NSD_CreateRadioButton} 0 110 100% 12u "I have defined a %HOME% variable, please install files there"
|
||||
Pop $HWND_HOMEDIR
|
||||
${NSD_CreateRadioButton} 0 50 100% 12u "Keep configuration files, autosaved .blend files and installed addons (recommended)"
|
||||
Pop $HWND_KEEPCONFIG
|
||||
${NSD_CreateRadioButton} 0 80 100% 12u "Remove all files, including configuration files, autosaved .blend files and installed addons"
|
||||
Pop $HWND_REMOVECONFIG
|
||||
|
||||
${If} ${AtMostWinME}
|
||||
GetDlgItem $0 $HWND $HWND_APPDATA
|
||||
EnableWindow $0 0
|
||||
SendMessage $HWND_INSTDIR ${BM_SETCHECK} 1 0
|
||||
${Else}
|
||||
SendMessage $HWND_APPDATA ${BM_SETCHECK} 1 0
|
||||
${EndIf}
|
||||
SendMessage $HWND_KEEPCONFIG ${BM_SETCHECK} 1 0
|
||||
|
||||
nsDialogs::Show
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function DataLocationOnLeave
|
||||
${NSD_GetState} $HWND_APPDATA $R0
|
||||
Function un.OptionalRemoveConfigOnLeave
|
||||
${NSD_GetState} $HWND_REMOVECONFIG $R0
|
||||
${If} $R0 == "1"
|
||||
SetShellVarContext current
|
||||
StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
|
||||
SetShellVarContext all
|
||||
StrCpy $REMOVECONFIG "1"
|
||||
${Else}
|
||||
${NSD_GetState} $HWND_INSTDIR $R0
|
||||
${If} $R0 == "1"
|
||||
StrCpy $BLENDERHOME $INSTDIR
|
||||
${Else}
|
||||
${NSD_GetState} $HWND_HOMEDIR $R0
|
||||
${If} $R0 == "1"
|
||||
ReadEnvStr $BLENDERHOME "HOME"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
StrCpy $REMOVECONFIG "0"
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Section "Blender [VERSION] (required)" InstallFiles
|
||||
SectionIn RO
|
||||
|
||||
@@ -160,7 +144,7 @@ Section "Blender [VERSION] (required)" InstallFiles
|
||||
; The contents of Blender installation root dir
|
||||
[ROOTDIRCONTS]
|
||||
|
||||
; All datafiles (python, scripts, config)
|
||||
; All datafiles (python, scripts, datafiles)
|
||||
[DODATAFILES]
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
@@ -169,7 +153,6 @@ Section "Blender [VERSION] (required)" InstallFiles
|
||||
${EndIf}
|
||||
; Write the installation path into the registry
|
||||
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
|
||||
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir" "$BLENDERHOME"
|
||||
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
|
||||
; Write the uninstall keys for Windows
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
|
||||
@@ -204,7 +187,7 @@ Section "Open .blend files with Blender" BlendRegister
|
||||
ExecWait '"$INSTDIR\blender.exe" -r'
|
||||
SectionEnd
|
||||
|
||||
UninstallText "This will uninstall Blender [VERSION], and all installed files. Before continuing make sure you have created backup of all the files you may want to keep: startup.blend, bookmarks.txt, recent-files.txt. Hit 'Uninstall' to continue."
|
||||
UninstallText "This will uninstall Blender [VERSION], and all installed files. Hit 'Uninstall' to continue."
|
||||
|
||||
Section "Uninstall"
|
||||
; Remove registry keys
|
||||
@@ -212,7 +195,6 @@ Section "Uninstall"
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
|
||||
ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir"
|
||||
ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
|
||||
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
|
||||
DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
|
||||
@@ -223,31 +205,23 @@ Section "Uninstall"
|
||||
|
||||
; Remove files
|
||||
[DELROOTDIRCONTS]
|
||||
[DELDATAFILES]
|
||||
[DELDATADIRS]
|
||||
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
|
||||
MessageBox MB_YESNO "Recursively erase contents of $BLENDERHOME\$SHORTVERSION\scripts? NOTE: This includes all installed scripts and *any* file and directory you have manually created, installed later or copied. This also including .blend files." IDNO NextNoScriptRemove
|
||||
RMDir /r "$BLENDERHOME\$SHORTVERSION\scripts"
|
||||
NextNoScriptRemove:
|
||||
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\config? NOTE: This includes your startup.blend, bookmarks and any other file and directory you may have created in that directory" IDNO NextNoConfigRemove
|
||||
RMDir /r "$BLENDERHOME\$SHORTVERSION\config"
|
||||
NextNoConfigRemove:
|
||||
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\plugins? NOTE: This includes files and subdirectories in this directory" IDNO NextNoPluginRemove
|
||||
RMDir /r "$BLENDERHOME\$SHORTVERSION\plugins"
|
||||
NextNoPluginRemove:
|
||||
; Try to remove dirs, but leave them if they contain anything
|
||||
RMDir "$BLENDERHOME\$SHORTVERSION\plugins"
|
||||
RMDir "$BLENDERHOME\$SHORTVERSION\config"
|
||||
RMDir "$BLENDERHOME\$SHORTVERSION\scripts"
|
||||
RMDir "$BLENDERHOME\$SHORTVERSION"
|
||||
RMDir "$BLENDERHOME"
|
||||
${If} $REMOVECONFIG == "1"
|
||||
RMDir /r "$BLENDERCONFIG\$SHORTVERSION"
|
||||
${Endif}
|
||||
|
||||
; Remove install directory if it's empty
|
||||
RMDir $INSTDIR
|
||||
; Remove shortcuts
|
||||
Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
|
||||
Delete "$DESKTOP\Blender.lnk"
|
||||
; Remove all link related directories and files
|
||||
RMDir /r "$SMPROGRAMS\Blender Foundation"
|
||||
; Clear out installation dir
|
||||
RMDir /r "$INSTDIR"
|
||||
RMDir "$SMPROGRAMS\Blender Foundation\Blender"
|
||||
RMDir "$SMPROGRAMS\Blender Foundation"
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; Refresh icons
|
||||
SectionEnd
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
set(INC
|
||||
.
|
||||
../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${JPEG_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
@@ -47,4 +50,4 @@ set(SRC
|
||||
intern/rgb32.h
|
||||
)
|
||||
|
||||
blender_add_lib(bf_avi "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_avi "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -29,6 +29,9 @@ set(INC
|
||||
../editors/include
|
||||
../blenkernel
|
||||
../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${GLEW_INCLUDE_PATH}
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
)
|
||||
@@ -47,7 +50,7 @@ set(SRC
|
||||
)
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND INC ${GETTEXT_INC})
|
||||
list(APPEND INC_SYS ${GETTEXT_INC})
|
||||
add_definitions(-DINTERNATIONAL)
|
||||
endif()
|
||||
|
||||
@@ -55,5 +58,5 @@ if(WIN32 AND NOT UNIX)
|
||||
add_definitions(-DUSE_GETTEXT_DLL)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_blenfont "${SRC}" "${INC}")
|
||||
blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ extern "C" {
|
||||
|
||||
/* these lines are grep'd, watch out for our not-so-awesome regex
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather then defining with quotes */
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 257
|
||||
#define BLENDER_SUBVERSION 1
|
||||
|
||||
@@ -89,6 +89,7 @@ extern int BKE_undo_valid(const char *name);
|
||||
extern void BKE_reset_undo(void);
|
||||
extern char *BKE_undo_menu_string(void);
|
||||
extern void BKE_undo_number(struct bContext *C, int nr);
|
||||
extern char *BKE_undo_get_name(int nr, int *active);
|
||||
extern void BKE_undo_save_quit(void);
|
||||
extern struct Main *BKE_undo_get_main(struct Scene **scene);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ float brush_curve_strength(struct Brush *br, float p, const float len); /* used
|
||||
/* sampling */
|
||||
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba, const int thread);
|
||||
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
|
||||
struct ImBuf **imbuf);
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
|
||||
/* painting */
|
||||
struct BrushPainter;
|
||||
@@ -82,7 +82,7 @@ BrushPainter *brush_painter_new(struct Brush *brush);
|
||||
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
|
||||
short texonly, int size);
|
||||
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
|
||||
double time, float pressure, void *user);
|
||||
double time, float pressure, void *user, int use_color_correction);
|
||||
void brush_painter_break_stroke(BrushPainter *painter);
|
||||
void brush_painter_free(BrushPainter *painter);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user