* Merging trunk up to r38981.
* Fixing a minor issue in a previous commit.
This commit is contained in:
commit
eb9d591898
@ -910,28 +910,15 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
set(PYTHON_VERSION 3.2)
|
||||
if(PYTHON_VERSION MATCHES 3.2)
|
||||
# we use precompiled libraries for py 3.2 and up by default
|
||||
# we use precompiled libraries for py 3.2 and up by default
|
||||
|
||||
# normally cached but not since we include them with blender
|
||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
|
||||
set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
else()
|
||||
# otherwise, use custom system framework
|
||||
# *not used but maintained incase some dev wants to*
|
||||
|
||||
set(PYTHON "/System/Library/Frameworks/Python.framework/Versions/" CACHE PATH)
|
||||
set(PYTHON_INCLUDE_DIR "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE PATH)
|
||||
# set(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
|
||||
set(PYTHON_LIBRARY "" CACHE FILEPATH)
|
||||
set(PYTHON_LIBPATH "${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config" CACHE PATH)
|
||||
set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python" CACHE STRING)
|
||||
unset(PYTHON)
|
||||
endif()
|
||||
# normally cached but not since we include them with blender
|
||||
set(PYTHON_VERSION 3.2)
|
||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
|
||||
set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
||||
|
||||
# uncached vars
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||
@ -986,7 +973,17 @@ elseif(APPLE)
|
||||
set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKLIBS stdc++ SystemStubs)
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
NAMES
|
||||
SystemStubs
|
||||
PATHS
|
||||
)
|
||||
mark_as_advanced(SYSTEMSTUBS_LIBRARY)
|
||||
if(SYSTEMSTUBS_LIBRARY)
|
||||
set(PLATFORM_LINKLIBS stdc++ SystemStubs)
|
||||
else()
|
||||
set(PLATFORM_LINKLIBS stdc++)
|
||||
endif()
|
||||
|
||||
if(WITH_COCOA)
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
|
||||
|
11
SConstruct
11
SConstruct
@ -111,6 +111,11 @@ btools.print_targets(B.targets, B.bc)
|
||||
|
||||
# handling cmd line arguments & config file
|
||||
|
||||
# bitness stuff
|
||||
tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python
|
||||
if tempbitness in (32, 64): # only set if 32 or 64 has been given
|
||||
bitness = int(tempbitness)
|
||||
|
||||
# first check cmdline for toolset and we create env to work on
|
||||
quickie = B.arguments.get('BF_QUICK', None)
|
||||
quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
|
||||
@ -659,11 +664,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
|
||||
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
dllsources += ['${BF_FFMPEG_LIBPATH}/avcodec-52.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/avformat-52.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/avdevice-52.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/avutil-50.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/swscale-0.dll']
|
||||
dllsources += env['BF_FFMPEG_DLL'].split()
|
||||
|
||||
# Since the thumb handler is loaded by Explorer, architecture is
|
||||
# strict: the x86 build fails on x64 Windows. We need to ship
|
||||
|
@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
|
||||
WITH_BF_FFMPEG = True
|
||||
WITH_BF_STATICFFMPEG = True
|
||||
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
|
||||
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib32'
|
||||
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
|
||||
@ -81,6 +81,12 @@ WITH_BF_STATICJEMALLOC = True
|
||||
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
|
||||
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib32'
|
||||
|
||||
# Use 3d mouse library
|
||||
WITH_BF_3DMOUSE = True
|
||||
WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
@ -13,7 +13,18 @@ WITH_BF_STATICPYTHON = True
|
||||
WITH_BF_COLLADA = False
|
||||
|
||||
# FFMPEG configuration
|
||||
WITH_BF_FFMPEG = False
|
||||
WITH_BF_FFMPEG = True
|
||||
WITH_BF_STATICFFMPEG = True
|
||||
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
|
||||
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib32'
|
||||
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
|
||||
'${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}/libfaad.a'
|
||||
|
||||
# Don't depend on system's libstdc++
|
||||
WITH_BF_STATICCXX = True
|
||||
@ -65,6 +76,12 @@ WITH_BF_STATICJEMALLOC = True
|
||||
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
|
||||
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib32'
|
||||
|
||||
# Use 3d mouse library
|
||||
WITH_BF_3DMOUSE = True
|
||||
WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
@ -13,7 +13,18 @@ WITH_BF_STATICPYTHON = True
|
||||
WITH_BF_COLLADA = False
|
||||
|
||||
# FFMPEG configuration
|
||||
WITH_BF_FFMPEG = False
|
||||
WITH_BF_FFMPEG = True
|
||||
WITH_BF_STATICFFMPEG = True
|
||||
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
|
||||
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib64'
|
||||
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
|
||||
'${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}/libfaad.a'
|
||||
|
||||
# Don't depend on system's libstdc++
|
||||
WITH_BF_STATICCXX = True
|
||||
@ -65,6 +76,12 @@ WITH_BF_STATICJEMALLOC = True
|
||||
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
|
||||
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib64'
|
||||
|
||||
# Use 3d mouse library
|
||||
WITH_BF_3DMOUSE = True
|
||||
WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
@ -22,7 +22,7 @@ BF_EXPAT_LIB = ''
|
||||
WITH_BF_FFMPEG = True
|
||||
WITH_BF_STATICFFMPEG = True
|
||||
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg'
|
||||
BF_FFMPEG = '/home/sources/staticlibs/ffmpeg-0.8'
|
||||
BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib64'
|
||||
BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
|
||||
'${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
|
||||
@ -81,6 +81,12 @@ WITH_BF_STATICJEMALLOC = True
|
||||
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
|
||||
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib64'
|
||||
|
||||
# Use 3d mouse library
|
||||
WITH_BF_3DMOUSE = True
|
||||
WITH_BF_STATIC3DMOUSE = True
|
||||
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
|
||||
|
||||
# Compilation and optimization
|
||||
BF_DEBUG = False
|
||||
REL_CFLAGS = ['-O2']
|
||||
|
@ -108,5 +108,29 @@ else:
|
||||
|
||||
sys.exit(0)
|
||||
else:
|
||||
# Switch to new FFmpeg library
|
||||
if builder.find('win') != -1:
|
||||
if builder.find('win32') != -1:
|
||||
LCGDIR = '#../lib/windows'
|
||||
elif builder.find('win64') != -1:
|
||||
LCGDIR = '#../lib/win64'
|
||||
|
||||
all_ffmpeg_libs = ['avcodec-53',
|
||||
'avdevice-53',
|
||||
'avformat-53',
|
||||
'avutil-51',
|
||||
'swscale-2']
|
||||
|
||||
ffmpeg_lib = []
|
||||
ffmpeg_dll = []
|
||||
|
||||
for lib in all_ffmpeg_libs:
|
||||
ffmpeg_lib.append(lib + '.lib')
|
||||
ffmpeg_dll.append('${BF_FFMPEG_LIBPATH}/' + lib + '.lib')
|
||||
|
||||
scons_options.append('BF_FFMPEG=' + LCGDIR + '/ffmpeg-0.8')
|
||||
scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
|
||||
scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
|
||||
|
||||
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
|
||||
sys.exit(retcode)
|
||||
|
@ -72,6 +72,30 @@ if builder.find('scons') != -1:
|
||||
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
|
||||
sys.exit(retcode)
|
||||
else:
|
||||
# Switch to new FFmpeg library
|
||||
if builder.find('win') != -1:
|
||||
if builder.find('win32') != -1:
|
||||
LCGDIR = '#../lib/windows'
|
||||
elif builder.find('win64') != -1:
|
||||
LCGDIR = '#../lib/win64'
|
||||
|
||||
all_ffmpeg_libs = ['avcodec-53',
|
||||
'avdevice-53',
|
||||
'avformat-53',
|
||||
'avutil-51',
|
||||
'swscale-2']
|
||||
|
||||
ffmpeg_lib = []
|
||||
ffmpeg_dll = []
|
||||
|
||||
for lib in all_ffmpeg_libs:
|
||||
ffmpeg_lib.append(lib + '.lib')
|
||||
ffmpeg_dll.append('${BF_FFMPEG_LIBPATH}/' + lib + '.lib')
|
||||
|
||||
scons_options.append('BF_FFMPEG=' + LCGDIR + '/ffmpeg-0.8')
|
||||
scons_options.append('BF_FFMPEG_LIB=' + (' '.join(ffmpeg_lib)))
|
||||
scons_options.append('BF_FFMPEG_DLL=' + (' '.join(ffmpeg_dll)))
|
||||
|
||||
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
|
||||
sys.exit(retcode)
|
||||
|
||||
|
@ -194,7 +194,11 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
|
||||
#SpaceNavigator and friends
|
||||
WITH_BF_3DMOUSE = True
|
||||
BF_3DMOUSE = '/usr'
|
||||
BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
|
||||
BF_3DMOUSE_LIB = 'spnav'
|
||||
BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
@ -227,8 +231,6 @@ CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
|
||||
if WITH_BF_3DMOUSE:
|
||||
LLIBS = LLIBS + [BF_3DMOUSE_LIB];
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
|
@ -7,6 +7,7 @@ BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-52.dll ${BF_FFMPEG_LIBPATH}/avcodec-52.dll ${BF_FFMPEG_LIBPATH}/avdevice-52.dll ${BF_FFMPEG_LIBPATH}/avutil-50.dll ${BF_FFMPEG_LIBPATH}/swscale-0.dll'
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.2'
|
||||
|
@ -7,6 +7,7 @@ BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc '
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-52.dll ${BF_FFMPEG_LIBPATH}/avcodec-52.dll ${BF_FFMPEG_LIBPATH}/avdevice-52.dll ${BF_FFMPEG_LIBPATH}/avutil-50.dll ${BF_FFMPEG_LIBPATH}/swscale-0.dll'
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.2'
|
||||
|
@ -206,6 +206,12 @@ def setup_staticlibs(lenv):
|
||||
if lenv['WITH_BF_STATICJEMALLOC']:
|
||||
statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC'])
|
||||
|
||||
if lenv['OURPLATFORM']=='linux2':
|
||||
if lenv['WITH_BF_3DMOUSE']:
|
||||
libincs += Split(lenv['BF_3DMOUSE_LIBPATH'])
|
||||
if lenv['WITH_BF_STATIC3DMOUSE']:
|
||||
statlibs += Split(lenv['BF_3DMOUSE_LIB_STATIC'])
|
||||
|
||||
return statlibs, libincs
|
||||
|
||||
def setup_syslibs(lenv):
|
||||
@ -271,6 +277,11 @@ def setup_syslibs(lenv):
|
||||
if not lenv['WITH_BF_STATICJEMALLOC']:
|
||||
syslibs += Split(lenv['BF_JEMALLOC_LIB'])
|
||||
|
||||
if lenv['OURPLATFORM']=='linux2':
|
||||
if lenv['WITH_BF_3DMOUSE']:
|
||||
if not lenv['WITH_BF_STATIC3DMOUSE']:
|
||||
syslibs += Split(lenv['BF_3DMOUSE_LIB'])
|
||||
|
||||
syslibs += lenv['LLIBS']
|
||||
|
||||
return syslibs
|
||||
|
@ -87,7 +87,7 @@ def validate_arguments(args, bc):
|
||||
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
|
||||
'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
|
||||
'WITH_BF_DDS', 'WITH_BF_CINEON', 'WITH_BF_HDR',
|
||||
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC',
|
||||
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC', 'BF_FFMPEG_DLL',
|
||||
'WITH_BF_STATICFFMPEG', 'BF_FFMPEG_LIB_STATIC',
|
||||
'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
|
||||
'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
|
||||
@ -136,7 +136,7 @@ def validate_arguments(args, bc):
|
||||
'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',
|
||||
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE'
|
||||
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
|
||||
]
|
||||
|
||||
# Have options here that scons expects to be lists
|
||||
@ -159,7 +159,7 @@ def validate_arguments(args, bc):
|
||||
'BF_BSC', 'BF_CONFIG',
|
||||
'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG',
|
||||
'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG',
|
||||
'BF_UNIT_TEST']
|
||||
'BF_UNIT_TEST', 'BF_BITNESS']
|
||||
|
||||
okdict = {}
|
||||
|
||||
@ -291,6 +291,7 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
|
||||
('BF_FFMPEG', 'FFMPEG base path', ''),
|
||||
('BF_FFMPEG_LIB', 'FFMPEG library', ''),
|
||||
('BF_FFMPEG_DLL', 'FFMPEG dll libraries to be installed', ''),
|
||||
('BF_FFMPEG_EXTRA', 'FFMPEG flags that must be preserved', ''),
|
||||
|
||||
('BF_FFMPEG_INC', 'FFMPEG includes', ''),
|
||||
@ -438,6 +439,12 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
|
||||
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
|
||||
('BF_3DMOUSE', '3d mouse library base path', ''),
|
||||
('BF_3DMOUSE_INC', '3d mouse library include path', ''),
|
||||
('BF_3DMOUSE_LIB', '3d mouse library', ''),
|
||||
('BF_3DMOUSE_LIBPATH', '3d mouse library path', ''),
|
||||
('BF_3DMOUSE_LIB_STATIC', '3d mouse static library', ''),
|
||||
|
||||
('CFLAGS', 'C only flags', []),
|
||||
('CCFLAGS', 'Generic C and C++ flags', []),
|
||||
|
@ -219,7 +219,7 @@ div.sphinxsidebarwrapper.fixed {
|
||||
}
|
||||
|
||||
{%- if theme_stickysidebar|tobool %}
|
||||
/* this is nice, but it it leads to hidden headings when jumping
|
||||
/* this is nice, but it leads to hidden headings when jumping
|
||||
to an anchor */
|
||||
/*
|
||||
div.related {
|
||||
|
@ -44,7 +44,6 @@ set(SRC
|
||||
intern/GHOST_ISystem.cpp
|
||||
intern/GHOST_ISystemPaths.cpp
|
||||
intern/GHOST_ModifierKeys.cpp
|
||||
intern/GHOST_NDOFManager.cpp
|
||||
intern/GHOST_Path-api.cpp
|
||||
intern/GHOST_Path-api.cpp
|
||||
intern/GHOST_Rect.cpp
|
||||
@ -74,12 +73,10 @@ set(SRC
|
||||
intern/GHOST_EventDragnDrop.h
|
||||
intern/GHOST_EventKey.h
|
||||
intern/GHOST_EventManager.h
|
||||
intern/GHOST_EventNDOF.h
|
||||
intern/GHOST_EventString.h
|
||||
intern/GHOST_EventTrackpad.h
|
||||
intern/GHOST_EventWheel.h
|
||||
intern/GHOST_ModifierKeys.h
|
||||
intern/GHOST_NDOFManager.h
|
||||
intern/GHOST_System.h
|
||||
intern/GHOST_SystemPaths.h
|
||||
intern/GHOST_TimerManager.h
|
||||
@ -99,6 +96,14 @@ endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
add_definitions(-DWITH_INPUT_NDOF)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_NDOFManager.cpp
|
||||
|
||||
intern/GHOST_EventNDOF.h
|
||||
intern/GHOST_NDOFManager.h
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
${NDOF_INCLUDE_DIRS}
|
||||
)
|
||||
|
@ -80,6 +80,9 @@ else:
|
||||
|
||||
if env['WITH_BF_3DMOUSE']:
|
||||
defs.append('WITH_INPUT_NDOF')
|
||||
|
||||
if env['OURPLATFORM']=='linux2':
|
||||
incs += ' ' + env['BF_3DMOUSE_INC']
|
||||
else:
|
||||
sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
|
||||
try:
|
||||
@ -88,7 +91,7 @@ else:
|
||||
elif window_system=='darwin':
|
||||
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerCocoa.mm')
|
||||
else:
|
||||
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerX11.mm')
|
||||
sources.remove('intern' + os.sep + 'GHOST_NDOFManagerX11.cpp')
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
@ -79,17 +79,15 @@ static const char* ndof_button_names[] = {
|
||||
"NDOF_BUTTON_8",
|
||||
"NDOF_BUTTON_9",
|
||||
"NDOF_BUTTON_10",
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
static const NDOF_ButtonT SpaceNavigator_HID_map[] =
|
||||
{
|
||||
static const NDOF_ButtonT SpaceNavigator_HID_map[] = {
|
||||
NDOF_BUTTON_MENU,
|
||||
NDOF_BUTTON_FIT
|
||||
};
|
||||
};
|
||||
|
||||
static const NDOF_ButtonT SpaceExplorer_HID_map[] =
|
||||
{
|
||||
static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
|
||||
NDOF_BUTTON_1,
|
||||
NDOF_BUTTON_2,
|
||||
NDOF_BUTTON_TOP,
|
||||
@ -105,10 +103,9 @@ static const NDOF_ButtonT SpaceExplorer_HID_map[] =
|
||||
NDOF_BUTTON_PLUS,
|
||||
NDOF_BUTTON_MINUS,
|
||||
NDOF_BUTTON_ROTATE
|
||||
};
|
||||
};
|
||||
|
||||
static const NDOF_ButtonT SpacePilotPro_HID_map[] =
|
||||
{
|
||||
static const NDOF_ButtonT SpacePilotPro_HID_map[] = {
|
||||
NDOF_BUTTON_MENU,
|
||||
NDOF_BUTTON_FIT,
|
||||
NDOF_BUTTON_TOP,
|
||||
@ -140,12 +137,11 @@ static const NDOF_ButtonT SpacePilotPro_HID_map[] =
|
||||
NDOF_BUTTON_DOMINANT,
|
||||
NDOF_BUTTON_PLUS,
|
||||
NDOF_BUTTON_MINUS
|
||||
};
|
||||
};
|
||||
|
||||
static const NDOF_ButtonT SpacePilot_HID_map[] =
|
||||
// this is the older SpacePilot (sans Pro)
|
||||
// thanks to polosson for the info in this table
|
||||
{
|
||||
/* this is the older SpacePilot (sans Pro)
|
||||
* thanks to polosson for the info in this table */
|
||||
static const NDOF_ButtonT SpacePilot_HID_map[] = {
|
||||
NDOF_BUTTON_1,
|
||||
NDOF_BUTTON_2,
|
||||
NDOF_BUTTON_3,
|
||||
@ -167,7 +163,7 @@ static const NDOF_ButtonT SpacePilot_HID_map[] =
|
||||
NDOF_BUTTON_DOMINANT,
|
||||
NDOF_BUTTON_ROTATE,
|
||||
NDOF_BUTTON_NONE // the CONFIG button -- what does it do?
|
||||
};
|
||||
};
|
||||
|
||||
GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
|
||||
: m_system(sys)
|
||||
@ -180,29 +176,21 @@ GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
|
||||
, m_motionState(GHOST_kNotStarted)
|
||||
, m_motionEventPending(false)
|
||||
, m_deadZone(0.f)
|
||||
{
|
||||
{
|
||||
// to avoid the rare situation where one triple is updated and
|
||||
// the other is not, initialize them both here:
|
||||
memset(m_translation, 0, sizeof(m_translation));
|
||||
memset(m_rotation, 0, sizeof(m_rotation));
|
||||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
GHOST_PRINT("WITH_INPUT_NDOF is defined!");
|
||||
#else
|
||||
GHOST_PRINT("WITH_INPUT_NDOF is not defined.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short product_id)
|
||||
{
|
||||
{
|
||||
// default to NDOF_UnknownDevice so rogue button events will get discarded
|
||||
// "mystery device" owners can help build a HID_map for their hardware
|
||||
|
||||
switch (vendor_id)
|
||||
{
|
||||
switch (vendor_id) {
|
||||
case 0x046D: // Logitech (3Dconnexion)
|
||||
switch (product_id)
|
||||
{
|
||||
switch (product_id) {
|
||||
// -- current devices --
|
||||
case 0xC626:
|
||||
puts("ndof: using SpaceNavigator");
|
||||
@ -239,182 +227,183 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
|
||||
|
||||
default:
|
||||
printf("ndof: unknown Logitech product %04hx\n", product_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
|
||||
}
|
||||
|
||||
if (m_deviceType == NDOF_UnknownDevice)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
m_buttonMask = ~(-1 << m_buttonCount);
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_deviceType == NDOF_UnknownDevice) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
m_buttonMask = ~(-1 << m_buttonCount);
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::updateTranslation(short t[3], GHOST_TUns64 time)
|
||||
{
|
||||
{
|
||||
memcpy(m_translation, t, sizeof(m_translation));
|
||||
m_motionTime = time;
|
||||
m_motionEventPending = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::updateRotation(short r[3], GHOST_TUns64 time)
|
||||
{
|
||||
{
|
||||
memcpy(m_rotation, r, sizeof(m_rotation));
|
||||
m_motionTime = time;
|
||||
m_motionEventPending = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
|
||||
{
|
||||
{
|
||||
GHOST_EventNDOFButton* event = new GHOST_EventNDOFButton(time, window);
|
||||
GHOST_TEventNDOFButtonData* data = (GHOST_TEventNDOFButtonData*) event->getData();
|
||||
|
||||
data->action = press ? GHOST_kPress : GHOST_kRelease;
|
||||
data->button = button;
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("%s %s\n", ndof_button_names[button], press ? "pressed" : "released");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_system.pushEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
|
||||
{
|
||||
{
|
||||
GHOST_TEventType type = press ? GHOST_kEventKeyDown : GHOST_kEventKeyUp;
|
||||
GHOST_EventKey* event = new GHOST_EventKey(time, type, window, key);
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("keyboard %s\n", press ? "down" : "up");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_system.pushEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64 time)
|
||||
{
|
||||
{
|
||||
GHOST_IWindow* window = m_system.getWindowManager()->getActiveWindow();
|
||||
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
if (m_deviceType != NDOF_UnknownDevice)
|
||||
printf("ndof: button %d -> ", button_number);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (m_deviceType)
|
||||
{
|
||||
switch (m_deviceType) {
|
||||
case NDOF_SpaceNavigator:
|
||||
sendButtonEvent(SpaceNavigator_HID_map[button_number], press, time, window);
|
||||
break;
|
||||
case NDOF_SpaceExplorer:
|
||||
switch (button_number)
|
||||
{
|
||||
switch (button_number) {
|
||||
case 6: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
|
||||
case 7: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
|
||||
case 8: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
|
||||
case 9: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
|
||||
default: sendButtonEvent(SpaceExplorer_HID_map[button_number], press, time, window);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NDOF_SpacePilotPro:
|
||||
switch (button_number)
|
||||
{
|
||||
switch (button_number) {
|
||||
case 22: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
|
||||
case 23: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
|
||||
case 24: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
|
||||
case 25: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
|
||||
default: sendButtonEvent(SpacePilotPro_HID_map[button_number], press, time, window);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NDOF_SpacePilot:
|
||||
switch (button_number)
|
||||
{
|
||||
switch (button_number) {
|
||||
case 10: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
|
||||
case 11: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
|
||||
case 12: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
|
||||
case 13: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
|
||||
case 20: puts("ndof: ignoring CONFIG button"); break;
|
||||
default: sendButtonEvent(SpacePilot_HID_map[button_number], press, time, window);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NDOF_UnknownDevice:
|
||||
printf("ndof: button %d on unknown device (ignoring)\n", button_number);
|
||||
}
|
||||
|
||||
int mask = 1 << button_number;
|
||||
if (press)
|
||||
m_buttons |= mask; // set this button's bit
|
||||
else
|
||||
m_buttons &= ~mask; // clear this button's bit
|
||||
}
|
||||
|
||||
int mask = 1 << button_number;
|
||||
if (press) {
|
||||
m_buttons |= mask; // set this button's bit
|
||||
}
|
||||
else {
|
||||
m_buttons &= ~mask; // clear this button's bit
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::updateButtons(int button_bits, GHOST_TUns64 time)
|
||||
{
|
||||
{
|
||||
button_bits &= m_buttonMask; // discard any "garbage" bits
|
||||
|
||||
int diff = m_buttons ^ button_bits;
|
||||
|
||||
for (int button_number = 0; button_number < m_buttonCount; ++button_number)
|
||||
{
|
||||
for (int button_number = 0; button_number < m_buttonCount; ++button_number) {
|
||||
int mask = 1 << button_number;
|
||||
|
||||
if (diff & mask)
|
||||
{
|
||||
if (diff & mask) {
|
||||
bool press = button_bits & mask;
|
||||
updateButton(button_number, press, time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GHOST_NDOFManager::setDeadZone(float dz)
|
||||
{
|
||||
if (dz < 0.f)
|
||||
{
|
||||
if (dz < 0.f) {
|
||||
// negative values don't make sense, so clamp at zero
|
||||
dz = 0.f;
|
||||
else if (dz > 0.5f)
|
||||
}
|
||||
else if (dz > 0.5f) {
|
||||
// warn the rogue user/programmer, but allow it
|
||||
printf("ndof: dead zone of %.2f is rather high...\n", dz);
|
||||
|
||||
}
|
||||
m_deadZone = dz;
|
||||
|
||||
printf("ndof: dead zone set to %.2f\n", dz);
|
||||
}
|
||||
}
|
||||
|
||||
static bool atHomePosition(GHOST_TEventNDOFMotionData* ndof)
|
||||
{
|
||||
#define HOME(foo) (ndof->foo == 0)
|
||||
{
|
||||
#define HOME(foo) (ndof->foo == 0)
|
||||
return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
|
||||
}
|
||||
#undef HOME
|
||||
}
|
||||
|
||||
static bool nearHomePosition(GHOST_TEventNDOFMotionData* ndof, float threshold)
|
||||
{
|
||||
if (threshold == 0.f)
|
||||
{
|
||||
if (threshold == 0.f) {
|
||||
return atHomePosition(ndof);
|
||||
else
|
||||
{
|
||||
#define HOME1(foo) (fabsf(ndof->foo) < threshold)
|
||||
return HOME1(tx) && HOME1(ty) && HOME1(tz) && HOME1(rx) && HOME1(ry) && HOME1(rz);
|
||||
}
|
||||
}
|
||||
else {
|
||||
#define HOME1(foo) (fabsf(ndof->foo) < threshold)
|
||||
return HOME1(tx) && HOME1(ty) && HOME1(tz) && HOME1(rx) && HOME1(ry) && HOME1(rz);
|
||||
#undef HOME1
|
||||
}
|
||||
}
|
||||
|
||||
bool GHOST_NDOFManager::sendMotionEvent()
|
||||
{
|
||||
{
|
||||
if (!m_motionEventPending)
|
||||
return false;
|
||||
|
||||
m_motionEventPending = false; // any pending motion is handled right now
|
||||
|
||||
GHOST_IWindow* window = m_system.getWindowManager()->getActiveWindow();
|
||||
if (window == NULL)
|
||||
|
||||
if (window == NULL) {
|
||||
return false; // delivery will fail, so don't bother sending
|
||||
}
|
||||
|
||||
GHOST_EventNDOFMotion* event = new GHOST_EventNDOFMotion(m_motionTime, window);
|
||||
GHOST_TEventNDOFMotionData* data = (GHOST_TEventNDOFMotionData*) event->getData();
|
||||
@ -438,51 +427,48 @@ bool GHOST_NDOFManager::sendMotionEvent()
|
||||
|
||||
// determine what kind of motion event to send (Starting, InProgress, Finishing)
|
||||
// and where that leaves this NDOF manager (NotStarted, InProgress, Finished)
|
||||
switch (m_motionState)
|
||||
{
|
||||
switch (m_motionState) {
|
||||
case GHOST_kNotStarted:
|
||||
case GHOST_kFinished:
|
||||
if (handMotion)
|
||||
{
|
||||
if (handMotion) {
|
||||
data->progress = GHOST_kStarting;
|
||||
m_motionState = GHOST_kInProgress;
|
||||
// prev motion time will be ancient, so just make up something reasonable
|
||||
data->dt = 0.0125f;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
// send no event and keep current state
|
||||
delete event;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GHOST_kInProgress:
|
||||
if (handMotion)
|
||||
{
|
||||
if (handMotion) {
|
||||
data->progress = GHOST_kInProgress;
|
||||
// keep InProgress state
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
data->progress = GHOST_kFinishing;
|
||||
m_motionState = GHOST_kFinished;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_NDOF_MOTION
|
||||
#ifdef DEBUG_NDOF_MOTION
|
||||
printf("ndof motion sent -- %s\n", progress_string[data->progress]);
|
||||
|
||||
// show details about this motion event
|
||||
printf(" T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f\n",
|
||||
data->tx, data->ty, data->tz,
|
||||
data->rx, data->ry, data->rz,
|
||||
data->dt);
|
||||
#endif
|
||||
data->tx, data->ty, data->tz,
|
||||
data->rx, data->ry, data->rz,
|
||||
data->dt);
|
||||
#endif
|
||||
|
||||
m_system.pushEvent(event);
|
||||
|
||||
m_prevMotionTime = m_motionTime;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ static GHOST_NDOFManager* ndof_manager = NULL;
|
||||
static bool has_old_driver = true;
|
||||
|
||||
static void NDOF_DeviceAdded(io_connect_t connection)
|
||||
{
|
||||
{
|
||||
printf("ndof: device added\n"); // change these: printf --> informational reports
|
||||
|
||||
#if 0 // device preferences will be useful some day
|
||||
@ -55,27 +55,27 @@ static void NDOF_DeviceAdded(io_connect_t connection)
|
||||
unsigned short productID = result & 0xffff;
|
||||
|
||||
ndof_manager->setDevice(vendorID, productID);
|
||||
}
|
||||
}
|
||||
|
||||
static void NDOF_DeviceRemoved(io_connect_t connection)
|
||||
{
|
||||
{
|
||||
printf("ndof: device removed\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, void* messageArgument)
|
||||
{
|
||||
{
|
||||
switch (messageType)
|
||||
{
|
||||
{
|
||||
case kConnexionMsgDeviceState:
|
||||
{
|
||||
{
|
||||
ConnexionDeviceState* s = (ConnexionDeviceState*)messageArgument;
|
||||
|
||||
GHOST_TUns64 now = ghost_system->getMilliSeconds();
|
||||
|
||||
switch (s->command)
|
||||
{
|
||||
{
|
||||
case kConnexionCmdHandleAxis:
|
||||
{
|
||||
{
|
||||
// convert to blender view coordinates
|
||||
short t[3] = {s->axis[0], -(s->axis[2]), s->axis[1]};
|
||||
short r[3] = {-(s->axis[3]), s->axis[5], -(s->axis[4])};
|
||||
@ -85,23 +85,23 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
|
||||
|
||||
ghost_system->notifyExternalEventProcessed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case kConnexionCmdHandleButtons:
|
||||
{
|
||||
{
|
||||
int button_bits = has_old_driver ? s->buttons8 : s->buttons;
|
||||
ndof_manager->updateButtons(button_bits, now);
|
||||
ghost_system->notifyExternalEventProcessed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
case kConnexionCmdAppSpecific:
|
||||
printf("ndof: app-specific command, param = %hd, value = %d\n", s->param, s->value);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("ndof: mystery device command %d\n", s->command);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kConnexionMsgPrefsChanged:
|
||||
// printf("ndof: prefs changed\n"); // this includes app switches
|
||||
// TODO: look through updated prefs for things blender cares about
|
||||
@ -117,58 +117,56 @@ static void NDOF_DeviceEvent(io_connect_t connection, natural_t messageType, voi
|
||||
break;
|
||||
default:
|
||||
printf("ndof: mystery event %d\n", messageType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GHOST_NDOFManagerCocoa::GHOST_NDOFManagerCocoa(GHOST_System& sys)
|
||||
: GHOST_NDOFManager(sys)
|
||||
{
|
||||
: GHOST_NDOFManager(sys)
|
||||
{
|
||||
if (available())
|
||||
{
|
||||
{
|
||||
// give static functions something to talk to:
|
||||
ghost_system = dynamic_cast<GHOST_SystemCocoa*>(&sys);
|
||||
ndof_manager = this;
|
||||
|
||||
OSErr error = InstallConnexionHandlers(NDOF_DeviceEvent, NDOF_DeviceAdded, NDOF_DeviceRemoved);
|
||||
if (error)
|
||||
{
|
||||
if (error) {
|
||||
printf("ndof: error %d while installing handlers\n", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Pascal string *and* a four-letter constant. How old-skool.
|
||||
m_clientID = RegisterConnexionClient('blnd', (UInt8*) "\007blender",
|
||||
kConnexionClientModeTakeOver, kConnexionMaskAll);
|
||||
kConnexionClientModeTakeOver, kConnexionMaskAll);
|
||||
|
||||
// printf("ndof: client id = %d\n", m_clientID);
|
||||
|
||||
if (SetConnexionClientButtonMask != NULL)
|
||||
{
|
||||
if (SetConnexionClientButtonMask != NULL) {
|
||||
has_old_driver = false;
|
||||
SetConnexionClientButtonMask(m_clientID, kConnexionMaskAllButtons);
|
||||
}
|
||||
else
|
||||
}
|
||||
else {
|
||||
printf("ndof: old 3Dx driver installed, some buttons may not work\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
printf("ndof: 3Dx driver not found\n");
|
||||
// This isn't a hard error, just means the user doesn't have a 3D mouse.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GHOST_NDOFManagerCocoa::~GHOST_NDOFManagerCocoa()
|
||||
{
|
||||
{
|
||||
UnregisterConnexionClient(m_clientID);
|
||||
CleanupConnexionHandlers();
|
||||
ghost_system = NULL;
|
||||
ndof_manager = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool GHOST_NDOFManagerCocoa::available()
|
||||
{
|
||||
{
|
||||
// extern OSErr InstallConnexionHandlers() __attribute__((weak_import));
|
||||
// ^^ not needed since the entire framework is weak-linked
|
||||
return InstallConnexionHandlers != NULL;
|
||||
// this means that the driver is installed and dynamically linked to blender
|
||||
}
|
||||
}
|
||||
|
@ -27,13 +27,15 @@
|
||||
|
||||
|
||||
GHOST_NDOFManagerWin32::GHOST_NDOFManagerWin32(GHOST_System& sys)
|
||||
: GHOST_NDOFManager(sys)
|
||||
{}
|
||||
: GHOST_NDOFManager(sys)
|
||||
{
|
||||
setDeadZone(0.1f);
|
||||
}
|
||||
|
||||
// whether multi-axis functionality is available (via the OS or driver)
|
||||
// does not imply that a device is plugged in or being used
|
||||
bool GHOST_NDOFManagerWin32::available()
|
||||
{
|
||||
{
|
||||
// always available since RawInput is built into Windows
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -30,70 +30,64 @@
|
||||
|
||||
|
||||
GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
|
||||
: GHOST_NDOFManager(sys)
|
||||
, m_available(false)
|
||||
{
|
||||
:
|
||||
GHOST_NDOFManager(sys),
|
||||
m_available(false)
|
||||
{
|
||||
setDeadZone(0.1f); // how to calibrate on Linux? throw away slight motion!
|
||||
|
||||
if (spnav_open() != -1)
|
||||
{
|
||||
if (spnav_open() != -1) {
|
||||
// determine exactly which device (if any) is plugged in
|
||||
|
||||
#define MAX_LINE_LENGTH 100
|
||||
#define MAX_LINE_LENGTH 100
|
||||
|
||||
// look for USB devices with Logitech's vendor ID
|
||||
FILE* command_output = popen("lsusb -d 046d:","r");
|
||||
if (command_output)
|
||||
{
|
||||
if (command_output) {
|
||||
char line[MAX_LINE_LENGTH] = {0};
|
||||
while (fgets(line, MAX_LINE_LENGTH, command_output))
|
||||
{
|
||||
while (fgets(line, MAX_LINE_LENGTH, command_output)) {
|
||||
unsigned short vendor_id = 0, product_id = 0;
|
||||
if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2)
|
||||
if (setDevice(vendor_id, product_id))
|
||||
{
|
||||
if (setDevice(vendor_id, product_id)) {
|
||||
m_available = true;
|
||||
break; // stop looking once the first 3D mouse is found
|
||||
}
|
||||
}
|
||||
pclose(command_output);
|
||||
}
|
||||
}
|
||||
pclose(command_output);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else {
|
||||
printf("ndof: spacenavd not found\n");
|
||||
// This isn't a hard error, just means the user doesn't have a 3D mouse.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GHOST_NDOFManagerX11::~GHOST_NDOFManagerX11()
|
||||
{
|
||||
{
|
||||
if (m_available)
|
||||
spnav_close();
|
||||
}
|
||||
}
|
||||
|
||||
bool GHOST_NDOFManagerX11::available()
|
||||
{
|
||||
{
|
||||
return m_available;
|
||||
}
|
||||
}
|
||||
|
||||
//bool GHOST_NDOFManagerX11::identifyDevice()
|
||||
// {
|
||||
//{
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
bool GHOST_NDOFManagerX11::processEvents()
|
||||
{
|
||||
{
|
||||
GHOST_TUns64 now = m_system.getMilliSeconds();
|
||||
|
||||
bool anyProcessed = false;
|
||||
spnav_event e;
|
||||
while (spnav_poll_event(&e))
|
||||
{
|
||||
switch (e.type)
|
||||
{
|
||||
while (spnav_poll_event(&e)) {
|
||||
switch (e.type) {
|
||||
case SPNAV_EVENT_MOTION:
|
||||
{
|
||||
{
|
||||
// convert to blender view coords
|
||||
short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
|
||||
short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
|
||||
@ -101,12 +95,12 @@ bool GHOST_NDOFManagerX11::processEvents()
|
||||
updateTranslation(t, now);
|
||||
updateRotation(r, now);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case SPNAV_EVENT_BUTTON:
|
||||
updateButton(e.button.bnum, e.button.press, now);
|
||||
break;
|
||||
}
|
||||
anyProcessed = true;
|
||||
}
|
||||
return anyProcessed;
|
||||
anyProcessed = true;
|
||||
}
|
||||
return anyProcessed;
|
||||
}
|
||||
|
@ -28,11 +28,11 @@
|
||||
|
||||
#include "GHOST_NDOFManager.h"
|
||||
|
||||
// Event capture is handled within the NDOF manager on Linux,
|
||||
// so there's no need for SystemX11 to look for them.
|
||||
/* Event capture is handled within the NDOF manager on Linux,
|
||||
* so there's no need for SystemX11 to look for them. */
|
||||
|
||||
class GHOST_NDOFManagerX11 : public GHOST_NDOFManager
|
||||
{
|
||||
{
|
||||
public:
|
||||
GHOST_NDOFManagerX11(GHOST_System&);
|
||||
~GHOST_NDOFManagerX11();
|
||||
@ -40,10 +40,10 @@ public:
|
||||
bool processEvents();
|
||||
|
||||
private:
|
||||
// bool identifyDevice();
|
||||
// bool identifyDevice();
|
||||
|
||||
bool m_available;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -730,11 +730,9 @@ GHOST_Event* GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, GHOST_
|
||||
{
|
||||
GHOST_System* system = (GHOST_System*)getSystem();
|
||||
|
||||
if (type == GHOST_kEventWindowActivate)
|
||||
{
|
||||
puts("activating window");
|
||||
if (type == GHOST_kEventWindowActivate) {
|
||||
system->getWindowManager()->setActiveWindow(window);
|
||||
}
|
||||
}
|
||||
|
||||
return new GHOST_Event(system->getMilliSeconds(), type, window);
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ def display_name(name):
|
||||
|
||||
def display_name_from_filepath(name):
|
||||
"""
|
||||
Returns the path stripped of directort and extension,
|
||||
Returns the path stripped of directory and extension,
|
||||
ensured to be utf8 compatible.
|
||||
"""
|
||||
name = _os.path.splitext(basename(name))[0]
|
||||
@ -204,7 +204,7 @@ def resolve_ncase(path):
|
||||
|
||||
def ensure_ext(filepath, ext, case_sensitive=False):
|
||||
"""
|
||||
Return the path with the extension added its its not alredy set.
|
||||
Return the path with the extension added if it is not already set.
|
||||
|
||||
:arg ext: The extension to check for.
|
||||
:type ext: string
|
||||
|
@ -37,6 +37,15 @@ import bpy
|
||||
from bpy.props import StringProperty, BoolProperty, EnumProperty
|
||||
|
||||
|
||||
def _check_axis_conversion(op):
|
||||
if hasattr(op, "axis_forward") and hasattr(op, "axis_up"):
|
||||
return axis_conversion_ensure(op,
|
||||
"axis_forward",
|
||||
"axis_up",
|
||||
)
|
||||
return False
|
||||
|
||||
|
||||
class ExportHelper:
|
||||
filepath = StringProperty(
|
||||
name="File Path",
|
||||
@ -70,21 +79,22 @@ class ExportHelper:
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
def check(self, context):
|
||||
change_ext = False
|
||||
change_axis = _check_axis_conversion(self)
|
||||
|
||||
check_extension = self.check_extension
|
||||
|
||||
if check_extension is None:
|
||||
return False
|
||||
if check_extension is not None:
|
||||
filepath = bpy.path.ensure_ext(self.filepath,
|
||||
self.filename_ext
|
||||
if check_extension
|
||||
else "")
|
||||
|
||||
filepath = bpy.path.ensure_ext(self.filepath,
|
||||
self.filename_ext
|
||||
if check_extension
|
||||
else "")
|
||||
if filepath != self.filepath:
|
||||
self.filepath = filepath
|
||||
change_ext = True
|
||||
|
||||
if filepath != self.filepath:
|
||||
self.filepath = filepath
|
||||
return True
|
||||
|
||||
return False
|
||||
return (change_ext or change_axis)
|
||||
|
||||
|
||||
class ImportHelper:
|
||||
@ -99,6 +109,9 @@ class ImportHelper:
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
def check(self, context):
|
||||
return _check_axis_conversion(self)
|
||||
|
||||
|
||||
# Axis conversion function, not pretty LUT
|
||||
# use lookup tabes to convert between any axis
|
||||
|
@ -1,8 +1,7 @@
|
||||
import bpy
|
||||
is_ntsc = (bpy.context.scene.render.fps != 25)
|
||||
|
||||
bpy.context.scene.render.ffmpeg_format = "AVI"
|
||||
bpy.context.scene.render.ffmpeg_codec = "XVID"
|
||||
bpy.context.scene.render.ffmpeg_format = "XVID"
|
||||
|
||||
if is_ntsc:
|
||||
bpy.context.scene.render.ffmpeg_gopsize = 18
|
||||
|
@ -247,15 +247,17 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
|
||||
row.prop(mat, "diffuse_fresnel_factor", text="Factor")
|
||||
|
||||
if mat.use_diffuse_ramp:
|
||||
layout.separator()
|
||||
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
|
||||
layout.separator()
|
||||
col = layout.column()
|
||||
col.active = (not mat.use_shadeless)
|
||||
col.separator()
|
||||
col.template_color_ramp(mat, "diffuse_ramp", expand=True)
|
||||
col.separator()
|
||||
|
||||
row = layout.row()
|
||||
row = col.row()
|
||||
row.prop(mat, "diffuse_ramp_input", text="Input")
|
||||
row.prop(mat, "diffuse_ramp_blend", text="Blend")
|
||||
|
||||
layout.prop(mat, "diffuse_ramp_factor", text="Factor")
|
||||
col.prop(mat, "diffuse_ramp_factor", text="Factor")
|
||||
|
||||
|
||||
class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
|
||||
|
@ -52,6 +52,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad);
|
||||
/* glStipple defines */
|
||||
extern unsigned char stipple_halftone[128];
|
||||
extern unsigned char stipple_quarttone[128];
|
||||
extern unsigned char stipple_diag_stripes_pos[128];
|
||||
extern unsigned char stipple_diag_stripes_neg[128];
|
||||
|
||||
/**
|
||||
* Draw a lined (non-looping) arc with the given
|
||||
|
@ -148,6 +148,7 @@ void BIF_selectOrientation(void);
|
||||
#define P_ALIGN_SNAP (P_GEO_SNAP|(1 << 5))
|
||||
#define P_CONSTRAINT (1 << 6)
|
||||
#define P_OPTIONS (1 << 7)
|
||||
#define P_CORRECT_UV (1 << 8)
|
||||
|
||||
void Transform_Properties(struct wmOperatorType *ot, int flags);
|
||||
|
||||
|
@ -92,6 +92,44 @@ GLubyte stipple_quarttone[128] = {
|
||||
136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0};
|
||||
|
||||
|
||||
GLubyte stipple_diag_stripes_pos[128] = {
|
||||
0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
|
||||
0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
|
||||
0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
|
||||
0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
|
||||
0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
|
||||
0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
|
||||
0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
|
||||
0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
|
||||
0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
|
||||
0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
|
||||
0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
|
||||
0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
|
||||
0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
|
||||
0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
|
||||
0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
|
||||
0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f};
|
||||
|
||||
|
||||
GLubyte stipple_diag_stripes_neg[128] = {
|
||||
0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
|
||||
0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
|
||||
0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
|
||||
0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
|
||||
0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
|
||||
0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
|
||||
0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
|
||||
0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80,
|
||||
0xff, 0x00, 0xff, 0x00, 0xfe, 0x01, 0xfe, 0x01,
|
||||
0xfc, 0x03, 0xfc, 0x03, 0xf8, 0x07, 0xf8, 0x07,
|
||||
0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x1f, 0xe0, 0x1f,
|
||||
0xc0, 0x3f, 0xc0, 0x3f, 0x80, 0x7f, 0x80, 0x7f,
|
||||
0x00, 0xff, 0x00, 0xff, 0x01, 0xfe, 0x01, 0xfe,
|
||||
0x03, 0xfc, 0x03, 0xfc, 0x07, 0xf8, 0x07, 0xf8,
|
||||
0x0f, 0xf0, 0x0f, 0xf0, 0x1f, 0xe0, 0x1f, 0xe0,
|
||||
0x3f, 0xc0, 0x3f, 0xc0, 0x7f, 0x80, 0x7f, 0x80};
|
||||
|
||||
|
||||
void fdrawbezier(float vec[4][3])
|
||||
{
|
||||
float dist;
|
||||
|
@ -452,14 +452,10 @@ static int view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
|
||||
|
||||
wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
|
||||
|
||||
float dt = ndof->dt > 0.25f ? 0.0125f : ndof->dt;
|
||||
/* this is probably the first event for this motion, so set dt to something reasonable
|
||||
* TODO: replace such guesswork with a flag or field from the NDOF manager
|
||||
*/
|
||||
|
||||
float dt = ndof->dt;
|
||||
/* tune these until it feels right */
|
||||
const float zoom_sensitivity = 0.5f;
|
||||
const float pan_sensitivity = 300.f;
|
||||
const float zoom_sensitivity = 0.5f; // 50% per second (I think)
|
||||
const float pan_sensitivity = 300.f; // screen pixels per second
|
||||
|
||||
float pan_x = pan_sensitivity * dt * ndof->tvec[0] / sima->zoom;
|
||||
float pan_y = pan_sensitivity * dt * ndof->tvec[1] / sima->zoom;
|
||||
|
@ -719,7 +719,8 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
|
||||
{
|
||||
Speaker *spk= (Speaker *)id;
|
||||
|
||||
outliner_add_element(soops, &te->subtree, spk->adt, te, TSE_ANIM_DATA, 0);
|
||||
if(spk->adt)
|
||||
outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0);
|
||||
}
|
||||
break;
|
||||
case ID_WO:
|
||||
|
@ -640,6 +640,25 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
|
||||
/* draw sound wave */
|
||||
if(seq->type == SEQ_SOUND) drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin)/ar->winx);
|
||||
|
||||
/* draw lock */
|
||||
if(seq->flag & SEQ_LOCK) {
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
/* light stripes */
|
||||
glColor4ub(255, 255, 255, 32);
|
||||
glPolygonStipple(stipple_diag_stripes_pos);
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
/* dark stripes */
|
||||
glColor4ub(0, 0, 0, 32);
|
||||
glPolygonStipple(stipple_diag_stripes_neg);
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
glDisable(GL_POLYGON_STIPPLE);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
get_seq_color3ubv(scene, seq, col);
|
||||
if (G.moving && (seq->flag & SELECT)) {
|
||||
if(seq->flag & SEQ_OVERLAP) {
|
||||
|
@ -1190,7 +1190,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* dont set windows active in in here, is used by renderwin too */
|
||||
/* dont set windows active in here, is used by renderwin too */
|
||||
void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
|
||||
{
|
||||
if(rv3d->persp==RV3D_CAMOB) { /* obs/camera */
|
||||
|
@ -4264,7 +4264,7 @@ static int createSlideVerts(TransInfo *t)
|
||||
/* UV correction vars */
|
||||
GHash **uvarray= NULL;
|
||||
SlideData *sld = MEM_callocN(sizeof(*sld), "sld");
|
||||
int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
|
||||
const int uvlay_tot= (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) ? CustomData_number_of_layers(&em->fdata, CD_MTFACE) : 0;
|
||||
int uvlay_idx;
|
||||
TransDataSlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
|
||||
RegionView3D *v3d = t->ar ? t->ar->regiondata : NULL; /* background mode support */
|
||||
@ -4636,7 +4636,7 @@ static int createSlideVerts(TransInfo *t)
|
||||
sld->end[0] = (int) end[0];
|
||||
sld->end[1] = (int) end[1];
|
||||
|
||||
if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
|
||||
if (uvlay_tot) {
|
||||
int maxnum = 0;
|
||||
|
||||
uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
|
||||
@ -4826,8 +4826,6 @@ void initEdgeSlide(TransInfo *t)
|
||||
|
||||
int doEdgeSlide(TransInfo *t, float perc)
|
||||
{
|
||||
Mesh *me= t->obedit->data;
|
||||
EditMesh *em = me->edit_mesh;
|
||||
SlideData *sld = t->customData;
|
||||
EditVert *ev, *nearest = sld->nearest;
|
||||
EditVert *centerVert, *upVert, *downVert;
|
||||
@ -4838,7 +4836,7 @@ int doEdgeSlide(TransInfo *t, float perc)
|
||||
int prop=1, flip=0;
|
||||
/* UV correction vars */
|
||||
GHash **uvarray= sld->uvhash;
|
||||
int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
|
||||
const int uvlay_tot= sld->uvlay_tot;
|
||||
int uvlay_idx;
|
||||
TransDataSlideUv *suv;
|
||||
float uv_tmp[2];
|
||||
@ -4864,7 +4862,7 @@ int doEdgeSlide(TransInfo *t, float perc)
|
||||
tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
|
||||
interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
|
||||
|
||||
if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
|
||||
if (uvlay_tot) {
|
||||
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
|
||||
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
|
||||
if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
|
||||
@ -4894,7 +4892,7 @@ int doEdgeSlide(TransInfo *t, float perc)
|
||||
if(newlen < 0.0f) {newlen = 0.0;}
|
||||
if(flip == 0) {
|
||||
interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
|
||||
if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
|
||||
if (uvlay_tot) {
|
||||
/* dont do anything if no UVs */
|
||||
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
|
||||
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
|
||||
@ -4911,7 +4909,7 @@ int doEdgeSlide(TransInfo *t, float perc)
|
||||
} else{
|
||||
interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
|
||||
|
||||
if (uvlay_tot) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
|
||||
if (uvlay_tot) {
|
||||
/* dont do anything if no UVs */
|
||||
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
|
||||
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
|
||||
|
@ -1037,6 +1037,22 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
t->options |= CTX_NO_PET;
|
||||
}
|
||||
}
|
||||
|
||||
/* initialize UV transform from */
|
||||
if (RNA_struct_find_property(op->ptr, "correct_uv")) {
|
||||
if(RNA_property_is_set(op->ptr, "correct_uv")) {
|
||||
if(RNA_boolean_get(op->ptr, "correct_uv")) {
|
||||
t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
|
||||
}
|
||||
else {
|
||||
t->settings->uvcalc_flag &= ~UVCALC_TRANSFORM_CORRECT;
|
||||
}
|
||||
}
|
||||
else {
|
||||
RNA_boolean_set(op->ptr, "correct_uv", t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if(t->spacetype==SPACE_IMAGE)
|
||||
{
|
||||
|
@ -360,11 +360,17 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
TransInfo *t = op->customdata;
|
||||
|
||||
#if 0
|
||||
// stable 2D mouse coords map to different 3D coords while the 3D mouse is active
|
||||
// in other words, 2D deltas are no longer good enough!
|
||||
// disable until individual 'transformers' behave better
|
||||
|
||||
if (event->type == NDOF_MOTION)
|
||||
{
|
||||
/* puts("transform_modal: passing through NDOF_MOTION"); */
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* XXX insert keys are called here, and require context */
|
||||
t->context= C;
|
||||
@ -502,6 +508,11 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
|
||||
RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Object data texture space", "");
|
||||
}
|
||||
|
||||
if (flags & P_CORRECT_UV)
|
||||
{
|
||||
RNA_def_boolean(ot->srna, "correct_uv", 0, "Correct UV coords when transforming", "");
|
||||
}
|
||||
|
||||
// Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
|
||||
/*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
|
||||
//RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
@ -749,7 +760,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
|
||||
|
||||
RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
|
||||
|
||||
Transform_Properties(ot, P_MIRROR|P_SNAP);
|
||||
Transform_Properties(ot, P_MIRROR|P_SNAP|P_CORRECT_UV);
|
||||
}
|
||||
|
||||
void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
|
||||
|
@ -601,6 +601,9 @@ extern UserDef U; /* from blenkernel blender.c */
|
||||
/* actually... users probably don't care about what the mode
|
||||
is called, just that it feels right */
|
||||
#define NDOF_ORBIT_INVERT_AXES (1 << 6)
|
||||
/* zoom is up/down if this flag is set (otherwise forward/backward) */
|
||||
#define NDOF_ZOOM_UPDOWN (1 << 7)
|
||||
#define NDOF_INVERT_ZOOM (1 << 8)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -3291,7 +3291,7 @@ void RNA_def_scene(BlenderRNA *brna)
|
||||
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
|
||||
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
|
||||
RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Current Frame", "Current Frame");
|
||||
RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead");
|
||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update");
|
||||
|
||||
|
@ -730,7 +730,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
|
||||
|
||||
if(zpass==NULL) return;
|
||||
|
||||
/* check for at least one sun lamp that its atmosphere flag is is enabled */
|
||||
/* check for at least one sun lamp that its atmosphere flag is enabled */
|
||||
for(go=R.lights.first; go; go= go->next) {
|
||||
lar= go->lampren;
|
||||
if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP))
|
||||
|
@ -2324,12 +2324,27 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
|
||||
const float s = U.ndof_sensitivity;
|
||||
|
||||
data->tvec[0]= s * ghost->tx;
|
||||
data->tvec[1]= s * ghost->ty;
|
||||
data->tvec[2]= s * ghost->tz;
|
||||
|
||||
data->rvec[0]= s * ghost->rx;
|
||||
data->rvec[1]= s * ghost->ry;
|
||||
data->rvec[2]= s * ghost->rz;
|
||||
|
||||
if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
|
||||
{
|
||||
// swap Y and Z
|
||||
data->tvec[1]= s * ghost->tz;
|
||||
data->tvec[2]= s * ghost->ty;
|
||||
|
||||
// should this affect rotation also?
|
||||
// initial guess is 'yes', but get user feedback immediately!
|
||||
data->rvec[1]= s * ghost->rz;
|
||||
data->rvec[2]= s * ghost->ry;
|
||||
}
|
||||
else
|
||||
{
|
||||
data->tvec[1]= s * ghost->ty;
|
||||
data->tvec[2]= s * ghost->tz;
|
||||
|
||||
data->rvec[1]= s * ghost->ry;
|
||||
data->rvec[2]= s * ghost->rz;
|
||||
}
|
||||
|
||||
data->dt = ghost->dt;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user