diff options
221 files changed, 4423 insertions, 2917 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 45b13e4b647..e0ec401ba66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,8 @@ ELSE() OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) ENDIF() +OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF) + IF (APPLE) OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON) OPTION(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF) @@ -217,7 +219,7 @@ IF(UNIX AND NOT APPLE) IF (WITH_OPENCOLLADA) SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory") SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib) - SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa Buffer) + SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer) SET(OPENCOLLADA_INC ${OPENCOLLADA}) SET(PCRE /usr CACHE FILEPATH "PCRE Directory") SET(PCRE_LIBPATH ${PCRE}/lib) @@ -558,7 +560,7 @@ IF(APPLE) SET(OPENCOLLADA ${LIBDIR}/opencollada) SET(OPENCOLLADA_INC ${OPENCOLLADA}/include) SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib) - SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2" ) + SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" ) #pcre is bundled with openCollada #SET(PCRE ${LIBDIR}/pcre) #SET(PCRE_LIBPATH ${PCRE}/lib) diff --git a/SConstruct b/SConstruct index c56ee99bb80..bb33e69e137 100644 --- a/SConstruct +++ b/SConstruct @@ -169,7 +169,9 @@ if crossbuild and env['PLATFORM'] != 'win32': env.Tool('crossmingw', ['tools']) # todo: determine proper libs/includes etc. # Needed for gui programs, console programs should do without it - env.Append(LINKFLAGS=['-mwindows']) + + # Now we don't need this option to have console window + # env.Append(LINKFLAGS=['-mwindows']) userconfig = B.arguments.get('BF_CONFIG', 'user-config.py') # first read platform config. B.arguments will override @@ -524,7 +526,11 @@ if env['OURPLATFORM']=='linux2': # TODO - add more libs, for now this lets blenderlite run if env['OURPLATFORM']=='linuxcross': dir=env['BF_INSTALLDIR'] - source = ['../lib/windows/pthreads/lib/pthreadGC2.dll'] + source = [] + + if env['WITH_BF_OPENMP']: + source += ['../lib/windows/pthreads/lib/pthreadGC2.dll'] + scriptinstall.append(env.Install(dir=dir, source=source)) #-- plugins @@ -577,45 +583,69 @@ elif env['OURPLATFORM']=='linux2': else: allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall] -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'): - if env['OURPLATFORM'] == 'win64-vc': - dllsources = [] - else: - dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll', - '${BF_PNG_LIBPATH}/libpng.dll', - '${BF_ZLIB_LIBPATH}/zlib.dll', - '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll'] - dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll'] +if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): + dllsources = [] + + if not env['OURPLATFORM'] in ('win32-mingw', 'win64-vc', 'linuxcross'): + # For MinGW and linuxcross static linking will be used + dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll'] + + #currently win64-vc doesn't appear to have libpng.dll + if env['OURPLATFORM'] != 'win64-vc': + dllsources += ['${BF_PNG_LIBPATH}/libpng.dll'] + + dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll', + '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll'] + + if env['OURPLATFORM'] != 'linuxcross': + # pthreads library is already added + dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll'] + if env['WITH_BF_SDL']: if env['OURPLATFORM'] == 'win64-vc': pass # we link statically already to SDL on win64 else: dllsources.append('${BF_SDL_LIBPATH}/SDL.dll') + if env['WITH_BF_PYTHON']: if env['BF_DEBUG']: dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll') else: dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll') + if env['WITH_BF_ICONV']: if env['OURPLATFORM'] == 'win64-vc': pass # we link statically to iconv on win64 - else: + elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'): + #gettext for MinGW and cross-compilation is compiled staticly dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll'] + if env['WITH_BF_OPENAL']: dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll') dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll') + if env['WITH_BF_SNDFILE']: dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll') + if env['WITH_BF_FFMPEG']: - dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll', - '${LCGDIR}/ffmpeg/lib/avformat-52.dll', - '${LCGDIR}/ffmpeg/lib/avdevice-52.dll', - '${LCGDIR}/ffmpeg/lib/avutil-50.dll', - '${LCGDIR}/ffmpeg/lib/swscale-0.dll', - '${LCGDIR}/ffmpeg/lib/libfaac-0.dll', - '${LCGDIR}/ffmpeg/lib/libfaad-2.dll', - '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll', - '${LCGDIR}/ffmpeg/lib/libx264-67.dll'] + 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'] + + if env['OURPLATFORM'] != 'linuxcross': + # + # TODO: Does it mean we haven't got support of this codecs if + # we're using cross-compilation? + # Or in case of native compilation this libraries are + # unneccessary to? + # + dllsources += ['${LCGDIR}/ffmpeg/lib/libfaac-0.dll', + '${LCGDIR}/ffmpeg/lib/libfaad-2.dll', + '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll', + '${LCGDIR}/ffmpeg/lib/libx264-67.dll'] + if env['WITH_BF_JACK']: dllsources += ['${LCGDIR}/jack/lib/libjack.dll'] windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources) diff --git a/config/darwin-config.py b/config/darwin-config.py index 53b75d455bf..1f867712166 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -73,6 +73,12 @@ LIBDIR = '${LCGDIR}' ################### Dependency settings ################## ############################################################################# +#Defaults openMP to true if compiler (currently only gcc 4.2) handles it +if CC == 'gcc-4.2': + WITH_BF_OPENMP = True # multithreading for fluids, cloth and smoke +else: + WITH_BF_OPENMP = False + # enable ffmpeg support WITH_BF_FFMPEG = True # -DWITH_FFMPEG FFMPEG_PRECOMPILED = True @@ -120,8 +126,6 @@ else: BF_PYTHON_LINKFLAGS = ['-u', '__dummy']+BF_PYTHON_LINKFLAGS -WITH_BF_OPENMP = '0' # multithreading for fluids, cloth and smoke ( only works with ICC atm ) - WITH_BF_OPENAL = True #different lib must be used following version of gcc # for gcc 3.3 @@ -264,7 +268,7 @@ BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_LIB = 'bf_collada' BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' -BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2' +BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa' BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada' BF_PCRE = LIBDIR + '/opencollada' BF_PCRE_LIB = 'pcre' @@ -274,7 +278,10 @@ BF_PCRE_LIBPATH = '${BF_PCRE}/lib' #BF_EXPAT_LIBPATH = '/usr/lib' #Ray trace optimization -WITH_BF_RAYOPTIMIZATION = False +if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386': + WITH_BF_RAYOPTIMIZATION = True +else: + WITH_BF_RAYOPTIMIZATION = False if MACOSX_ARCHITECTURE == 'i386': BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse'] elif MACOSX_ARCHITECTURE == 'x86_64': @@ -340,15 +347,9 @@ if MACOSX_ARCHITECTURE == 'x86_64': REL_CFLAGS = REL_CFLAGS+['-mssse3'] REL_CCFLAGS = REL_CCFLAGS+['-mssse3'] -##BF_DEPEND = True -## -##AR = ar -##ARFLAGS = ruv -##ARFLAGSQUIET = ru -## -#C_WARN = ['-Wdeclaration-after-statement'] - CC_WARN = ['-Wall'] +C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas'] +CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare'] ##FIX_STUBS_WARNINGS = -Wno-unused diff --git a/config/linux2-config.py b/config/linux2-config.py index abe79ba5806..4314199f386 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -156,7 +156,7 @@ BF_COLLADA = '#source/blender/collada' BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_LIB = 'bf_collada' BF_OPENCOLLADA = '/usr' -BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre Buffer ftoa' +BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' BF_PCRE = '' BF_PCRE_LIB = 'pcre' diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py index 571d644a9c4..fe5e954f3bc 100644 --- a/config/linuxcross-config.py +++ b/config/linuxcross-config.py @@ -5,14 +5,15 @@ BF_PYTHON = LIBDIR + '/python' BF_PYTHON_VERSION = '3.1' BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' BF_PYTHON_BINARY = 'python' -BF_PYTHON_LIB = 'python25' +BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw' +BF_PYTHON_DLL = 'python31' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' WITH_BF_OPENAL = True WITH_BF_STATICOPENAL = False BF_OPENAL = LIBDIR + '/openal' BF_OPENAL_INC = '${BF_OPENAL}/include' -BF_OPENAL_LIB = 'openal_static' +BF_OPENAL_LIB = 'OpenAL32 wrap_oal' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' # Warning, this static lib configuration is untested! users of this OS please confirm. BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' @@ -33,6 +34,18 @@ BF_SDL_INC = '${BF_SDL}/include' BF_SDL_LIB = 'SDL' BF_SDL_LIBPATH = '${BF_SDL}/lib' +WITH_BF_JACK = False +BF_JACK = LIBDIR + '/jack' +BF_JACK_INC = '${BF_JACK}/include' +BF_JACK_LIB = 'jack' +BF_JACK_LIBPATH = '${BF_JACK}/lib' + +WITH_BF_SNDFILE = False +BF_SNDFILE = LIBDIR + '/sndfile' +BF_SNDFILE_INC = '${BF_SNDFILE}/include' +BF_SNDFILE_LIB = 'sndfile-1' +BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' + BF_PTHREADS = LIBDIR + '/pthreads' BF_PTHREADS_INC = '${BF_PTHREADS}/include' BF_PTHREADS_LIB = 'pthreadGC2' @@ -61,8 +74,11 @@ BF_PNG_INC = '${BF_PNG}/include' BF_PNG_LIB = 'png' BF_PNG_LIBPATH = '${BF_PNG}/lib' +WITH_BF_TIFF = True BF_TIFF = LIBDIR + '/tiff' BF_TIFF_INC = '${BF_TIFF}/include' +BF_TIFF_LIB = 'libtiff' +BF_TIFF_LIBPATH = '${BF_TIFF}/lib' WITH_BF_ZLIB = True BF_ZLIB = LIBDIR + '/zlib' @@ -72,12 +88,12 @@ BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib' WITH_BF_INTERNATIONAL = True -BF_GETTEXT = LIBDIR + '/gettext' +BF_GETTEXT = LIBDIR + '/gcc/gettext' BF_GETTEXT_INC = '${BF_GETTEXT}/include' -BF_GETTEXT_LIB = 'gnu_gettext' +BF_GETTEXT_LIB = 'intl' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' -WITH_BF_GAMEENGINE = False +WITH_BF_GAMEENGINE = True WITH_BF_PLAYER = False WITH_BF_BULLET = True @@ -89,6 +105,7 @@ BF_WINTAB = LIBDIR + '/wintab' BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE' # enable freetype2 support for text objects +BF_WITH_FREETYPE = True BF_FREETYPE = LIBDIR + '/gcc/freetype' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' BF_FREETYPE_LIB = 'freetype' @@ -99,11 +116,35 @@ BF_QUICKTIME = '/usr/local' BF_QUICKTIME_INC = '${BF_QUICKTIME}/include' WITH_BF_ICONV = False -BF_ICONV = LIBDIR + "/iconv" +BF_ICONV = LIBDIR + "/gcc/iconv" BF_ICONV_INC = '${BF_ICONV}/include' BF_ICONV_LIB = 'iconv' BF_ICONV_LIBPATH = '${BF_ICONV}/lib' +WITH_BF_BINRELOC = False + +# enable ffmpeg support +WITH_BF_FFMPEG = True # -DWITH_FFMPEG +BF_FFMPEG = LIBDIR + '/ffmpeg' +BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0' +BF_FFMPEG_INC = '${BF_FFMPEG}/include' +BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib' + +WITH_BF_OPENJPEG = True +BF_OPENJPEG = '#extern/libopenjpeg' +BF_OPENJPEG_LIB = '' +BF_OPENJPEG_INC = '${BF_OPENJPEG}' +BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' + +WITH_BF_FFTW3 = False +BF_FFTW3 = LIBDIR + '/gcc/fftw3' +BF_FFTW3_INC = '${BF_FFTW3}/include' +BF_FFTW3_LIB = 'fftw3' +BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib' + +WITH_BF_REDCODE = False +BF_REDCODE_INC = '#extern' + # Mesa Libs should go here if your using them as well.... WITH_BF_STATICOPENGL = False BF_OPENGL = 'C:\\MingW' @@ -114,24 +155,42 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a' '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a', '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ] +WITH_BF_OPENMP = True +BF_OPENMP = LIBDIR + '/gcc/gomp' +BF_OPENMP_INC = '${BF_OPENMP}/include' +BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib' + +WITH_BF_COLLADA = False +BF_COLLADA = '#source/blender/collada' +BF_COLLADA_INC = '${BF_COLLADA}' +BF_COLLADA_LIB = 'bf_collada' + +BF_OPENCOLLADA = LIBDIR + '/gcc/opencollada' +BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' +BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa' +BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}' + +#Ray trace optimization +WITH_BF_RAYOPTIMIZATION = False +BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse'] + CC = 'i586-mingw32msvc-gcc' CXX = 'i586-mingw32msvc-g++' CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ] CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS'] -CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ] +CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ] REL_CFLAGS = [ '-O2' ] REL_CCFLAGS = [ '-O2' ] C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ] CC_WARN = [ '-Wall' ] - -LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ] +LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ] BF_DEBUG = False -BF_DEBUG_CCFLAGS= [] +BF_DEBUG_CCFLAGS = ['-g'] BF_PROFILE = False BF_PROFILE_CCFLAGS = ['-pg','-g'] diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index 00c70aaaf1f..9088db5a5d8 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -85,11 +85,23 @@ BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib' WITH_BF_INTERNATIONAL = True -BF_GETTEXT = LIBDIR + '/gettext' +BF_GETTEXT = LIBDIR + '/gcc/gettext' BF_GETTEXT_INC = '${BF_GETTEXT}/include' -BF_GETTEXT_LIB = 'gnu_gettext' +BF_GETTEXT_LIB = 'intl' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' +WITH_BF_OPENJPEG = True +BF_OPENJPEG = '#extern/libopenjpeg' +BF_OPENJPEG_LIB = '' +BF_OPENJPEG_INC = '${BF_OPENJPEG}' +BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' + +WITH_BF_FFTW3 = False +BF_FFTW3 = LIBDIR + '/gcc/fftw3' +BF_FFTW3_INC = '${BF_FFTW3}/include' +BF_FFTW3_LIB = 'fftw3' +BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib' + WITH_BF_GAMEENGINE = False WITH_BF_PLAYER = False @@ -117,6 +129,9 @@ BF_ICONV_INC = '${BF_ICONV}/include' BF_ICONV_LIB = 'iconv' BF_ICONV_LIBPATH = '${BF_ICONV}/lib' +WITH_BF_REDCODE = False +BF_REDCODE_INC = '#extern' + # Mesa Libs should go here if your using them as well.... WITH_BF_STATICOPENGL = False BF_OPENGL = 'C:\\MingW' @@ -132,9 +147,9 @@ BF_COLLADA = '#source/blender/collada' BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_LIB = 'bf_collada' -BF_OPENCOLLADA = LIBDIR + '/opencollada' +BF_OPENCOLLADA = LIBDIR + '/gcc/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' -BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre' +BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' #Ray trace optimization diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index f18ed3e2007..4799f91647c 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -145,7 +145,7 @@ BF_COLLADA_LIB = 'bf_collada' BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' -BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre' +BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre buffer ftoa' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' #Ray trace optimization diff --git a/intern/elbeem/SConscript b/intern/elbeem/SConscript index 0900ab1db5c..f0417f74001 100644 --- a/intern/elbeem/SConscript +++ b/intern/elbeem/SConscript @@ -5,14 +5,18 @@ Import('env') sources = env.Glob('intern/*.cpp') +incs = '' defs = 'NOGUI ELBEEM_BLENDER=1' if env['WITH_BF_OPENMP']: + if env['OURPLATFORM'] == 'linuxcross': + incs += ' ' + env['BF_OPENMP_INC'] + defs += ' PARALLEL' if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): defs += ' USE_MSVC6FIXES' -incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] +incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] incs += ' extern ' env.BlenderLib ('bf_elbeem', sources, Split(incs), Split(defs), libtype='intern', priority=0 ) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index bf57da23c69..460c0858d20 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -24,7 +24,7 @@ # # ***** END GPL LICENSE BLOCK ***** -SET(INC . ../string ../../extern/glew/include) +SET(INC . ../string ../../extern/glew/include ../../source/blender/imbuf ../../source/blender/makesdna) FILE(GLOB SRC intern/*.cpp intern/*.mm) diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 9bb8def00d0..ff60aaf9c03 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -173,7 +173,8 @@ typedef enum { GHOST_kEventDraggingUpdated, GHOST_kEventDraggingExited, GHOST_kEventDraggingDropDone, - GHOST_kEventDraggingDropOnIcon, + + GHOST_kEventOpenMainFile, // Needed for Cocoa to open double-clicked .blend file at startup GHOST_kEventTimer, diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index 6713ded0afa..1269c631190 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -57,7 +57,7 @@ else: if env['BF_GHOST_DEBUG']: defs.append('BF_GHOST_DEBUG') -incs = '. ../string #extern/glew/include ' + env['BF_OPENGL_INC'] +incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC'] if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'): incs = env['BF_WINTAB_INC'] + ' ' + incs env.BlenderLib ('bf_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] ) diff --git a/intern/ghost/intern/GHOST_EventDragnDrop.h b/intern/ghost/intern/GHOST_EventDragnDrop.h index 85c18efb118..31d3545e484 100644 --- a/intern/ghost/intern/GHOST_EventDragnDrop.h +++ b/intern/ghost/intern/GHOST_EventDragnDrop.h @@ -30,6 +30,10 @@ #define _GHOST_EVENT_DRAGNDROP_H_ #include "GHOST_Event.h" +extern "C" { +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" +}; /** * Drag & drop event @@ -55,7 +59,7 @@ * <br>Currently supported object types : * <li>UTF-8 string * <li>array of strings representing filenames (GHOST_TStringArray) - * <li>bitmap image + * <li>bitmap ImBuf */ class GHOST_EventDragnDrop : public GHOST_Event { @@ -89,7 +93,7 @@ public: switch (m_dragnDropEventData.dataType) { case GHOST_kDragnDropTypeBitmap: - //Not currently implemented + IMB_freeImBuf((ImBuf*)m_dragnDropEventData.data); break; case GHOST_kDragnDropTypeFilenames: { diff --git a/intern/ghost/intern/GHOST_EventPrinter.cpp b/intern/ghost/intern/GHOST_EventPrinter.cpp index 91b55474441..81dafb74333 100644 --- a/intern/ghost/intern/GHOST_EventPrinter.cpp +++ b/intern/ghost/intern/GHOST_EventPrinter.cpp @@ -148,26 +148,14 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event) } break; - case GHOST_kEventDraggingDropOnIcon: + case GHOST_kEventOpenMainFile: { - GHOST_TEventDragnDropData* dragnDropData = (GHOST_TEventDragnDropData*)((GHOST_IEvent*)event)->getData(); - std::cout << "GHOST_kEventDraggingDropOnIcon, dragged object type : " << dragnDropData->dataType; - switch (dragnDropData->dataType) { - case GHOST_kDragnDropTypeString: - std::cout << " string received = " << (char*)dragnDropData->data; - break; - case GHOST_kDragnDropTypeFilenames: - { - GHOST_TStringArray *strArray = (GHOST_TStringArray*)dragnDropData->data; - int i; - std::cout << "\nReceived " << strArray->count << " filenames"; - for (i=0;i<strArray->count;i++) - std::cout << " Filename #" << i << ": " << strArray->strings[i]; - } - break; - default: - break; - } + GHOST_TEventDataPtr eventData = ((GHOST_IEvent*)event)->getData(); + + if (eventData) + std::cout << "GHOST_kEventOpenMainFile for path : " << (char*)eventData; + else + std::cout << "GHOST_kEventOpenMainFile with no path specified!!"; } break; diff --git a/intern/ghost/intern/GHOST_EventString.h b/intern/ghost/intern/GHOST_EventString.h new file mode 100644 index 00000000000..452903d090d --- /dev/null +++ b/intern/ghost/intern/GHOST_EventString.h @@ -0,0 +1,66 @@ +/** + * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +/** + * @file GHOST_EventString.h + * Declaration of GHOST_EventString class. + */ + +#ifndef _GHOST_EVENTSTRING_H_ +#define _GHOST_EVENTSTRING_H_ + +#include "GHOST_Event.h" + + +/** + * Generic class for events with string data + * @author Damien Plisson + * @date Feb 1, 2010 + */ +class GHOST_EventString : public GHOST_Event +{ +public: + /** + * Constructor. + * @param msec The time this event was generated. + * @param type The type of this event. + * @param window The generating window (or NULL if system event). + * @param data_ptr Pointer to the (unformatted) data associated with the event + */ + GHOST_EventString(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TEventDataPtr data_ptr) + : GHOST_Event(msec, type, window) { + m_data = data_ptr; + } + + ~GHOST_EventString() + { + if (m_data) free(m_data); + } +}; + +#endif // _GHOST_EVENTSTRING_H_ + diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 23f95f95df4..4371d4d19c8 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -43,6 +43,7 @@ #include "GHOST_EventNDOF.h" #include "GHOST_EventTrackpad.h" #include "GHOST_EventDragnDrop.h" +#include "GHOST_EventString.h" #include "GHOST_TimerManager.h" #include "GHOST_TimerTask.h" @@ -1025,7 +1026,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType, GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data) { - if (!validWindow(window) && (eventType != GHOST_kEventDraggingDropOnIcon)) { + if (!validWindow(window)) { return GHOST_kFailure; } switch(eventType) @@ -1037,7 +1038,6 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType break; case GHOST_kEventDraggingDropDone: - case GHOST_kEventDraggingDropOnIcon: { GHOST_TUns8 * temp_buff; GHOST_TStringArray *strArray; @@ -1050,10 +1050,6 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType if (!data) return GHOST_kFailure; switch (draggedObjectType) { - case GHOST_kDragnDropTypeBitmap: - //TODO: implement bitmap conversion to a blender friendly format - return GHOST_kFailure; - break; case GHOST_kDragnDropTypeFilenames: droppedArray = (NSArray*)data; @@ -1102,6 +1098,124 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType eventData = (GHOST_TEventDataPtr) temp_buff; break; + + case GHOST_kDragnDropTypeBitmap: + { + NSImage *droppedImg = (NSImage*)data; + NSSize imgSize = [droppedImg size]; + ImBuf *ibuf = NULL; + GHOST_TUns8 *rasterRGB = NULL; + GHOST_TUns8 *rasterRGBA = NULL; + GHOST_TUns8 *toIBuf = NULL; + int x, y, to_i, from_i; + NSBitmapImageRep *blBitmapFormatImageRGB,*blBitmapFormatImageRGBA,*bitmapImage=nil; + NSEnumerator *enumerator; + NSImageRep *representation; + + ibuf = IMB_allocImBuf (imgSize.width , imgSize.height, 32, IB_rect, 0); + if (!ibuf) { + [droppedImg release]; + return GHOST_kFailure; + } + + /*Get the bitmap of the image*/ + enumerator = [[droppedImg representations] objectEnumerator]; + while ((representation = [enumerator nextObject])) { + if ([representation isKindOfClass:[NSBitmapImageRep class]]) { + bitmapImage = (NSBitmapImageRep *)representation; + break; + } + } + if (bitmapImage == nil) return GHOST_kFailure; + + if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) + && ![bitmapImage isPlanar]) { + /* Try a fast copy if the image is a meshed RGBA 32bit bitmap*/ + toIBuf = (GHOST_TUns8*)ibuf->rect; + rasterRGB = (GHOST_TUns8*)[bitmapImage bitmapData]; + for (y = 0; y < imgSize.height; y++) { + to_i = (imgSize.height-y-1)*imgSize.width; + from_i = y*imgSize.width; + memcpy(toIBuf+4*to_i, rasterRGB+4*from_i, 4*imgSize.width); + } + } + else { + /* Tell cocoa image resolution is same as current system one */ + [bitmapImage setSize:imgSize]; + + /* Convert the image in a RGBA 32bit format */ + /* As Core Graphics does not support contextes with non premutliplied alpha, + we need to get alpha key values in a separate batch */ + + /* First get RGB values w/o Alpha to avoid pre-multiplication, 32bit but last byte is unused */ + blBitmapFormatImageRGB = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL + pixelsWide:imgSize.width + pixelsHigh:imgSize.height + bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:(NSBitmapFormat)0 + bytesPerRow:4*imgSize.width + bitsPerPixel:32/*RGB format padded to 32bits*/]; + + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:blBitmapFormatImageRGB]]; + [bitmapImage draw]; + [NSGraphicsContext restoreGraphicsState]; + + rasterRGB = (GHOST_TUns8*)[blBitmapFormatImageRGB bitmapData]; + if (rasterRGB == NULL) { + [bitmapImage release]; + [blBitmapFormatImageRGB release]; + [droppedImg release]; + return GHOST_kFailure; + } + + /* Then get Alpha values by getting the RGBA image (that is premultiplied btw) */ + blBitmapFormatImageRGBA = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL + pixelsWide:imgSize.width + pixelsHigh:imgSize.height + bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bitmapFormat:(NSBitmapFormat)0 + bytesPerRow:4*imgSize.width + bitsPerPixel:32/* RGBA */]; + + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:blBitmapFormatImageRGBA]]; + [bitmapImage draw]; + [NSGraphicsContext restoreGraphicsState]; + + rasterRGBA = (GHOST_TUns8*)[blBitmapFormatImageRGBA bitmapData]; + if (rasterRGBA == NULL) { + [bitmapImage release]; + [blBitmapFormatImageRGB release]; + [blBitmapFormatImageRGBA release]; + [droppedImg release]; + return GHOST_kFailure; + } + + /*Copy the image to ibuf, flipping it vertically*/ + toIBuf = (GHOST_TUns8*)ibuf->rect; + for (y = 0; y < imgSize.height; y++) { + for (x = 0; x < imgSize.width; x++) { + to_i = (imgSize.height-y-1)*imgSize.width + x; + from_i = y*imgSize.width + x; + + toIBuf[4*to_i] = rasterRGB[4*from_i]; /* R */ + toIBuf[4*to_i+1] = rasterRGB[4*from_i+1]; /* G */ + toIBuf[4*to_i+2] = rasterRGB[4*from_i+2]; /* B */ + toIBuf[4*to_i+3] = rasterRGBA[4*from_i+3]; /* A */ + } + } + + [blBitmapFormatImageRGB release]; + [blBitmapFormatImageRGBA release]; + [droppedImg release]; + } + + eventData = (GHOST_TEventDataPtr) ibuf; + } + break; default: return GHOST_kFailure; @@ -1158,7 +1272,18 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr) NSString *filepath = (NSString*)filepathStr; int confirmOpen = NSAlertAlternateReturn; NSArray *windowsList; + char * temp_buff; + size_t filenameTextSize; + GHOST_Window* window= (GHOST_Window*)m_windowManager->getActiveWindow(); + + if (!window) { + return NO; + } + //Discard event if we are in cursor grab sequence, it'll lead to "stuck cursor" situation if the alert panel is raised + if (window && (window->getCursorGrabMode() != GHOST_kGrabDisable) && (window->getCursorGrabMode() != GHOST_kGrabNormal)) + return GHOST_kExitCancel; + //Check open windows if some changes are not saved if (m_windowManager->getAnyModifiedState()) { @@ -1175,7 +1300,20 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr) if (confirmOpen == NSAlertAlternateReturn) { - handleDraggingEvent(GHOST_kEventDraggingDropOnIcon,GHOST_kDragnDropTypeFilenames,NULL,0,0, [NSArray arrayWithObject:filepath]); + filenameTextSize = [filepath lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding]; + + temp_buff = (char*) malloc(filenameTextSize+1); + + if (temp_buff == NULL) { + return GHOST_kFailure; + } + + strncpy(temp_buff, [filepath cStringUsingEncoding:NSISOLatin1StringEncoding], filenameTextSize); + + temp_buff[filenameTextSize] = '\0'; + + pushEvent(new GHOST_EventString(getMilliSeconds(),GHOST_kEventOpenMainFile,window,(GHOST_TEventDataPtr) temp_buff)); + return YES; } else return NO; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 5dcc949ed45..da682fc150a 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -182,7 +182,7 @@ extern "C" { NSPoint mouseLocation = [sender draggingLocation]; systemCocoa->handleDraggingEvent(GHOST_kEventDraggingUpdated, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil); - return NSDragOperationCopy; + return associatedWindow->canAcceptDragOperation()?NSDragOperationCopy:NSDragOperationNone; } - (void)draggingExited:(id < NSDraggingInfo >)sender @@ -203,11 +203,16 @@ extern "C" { { NSPoint mouseLocation = [sender draggingLocation]; NSPasteboard *draggingPBoard = [sender draggingPasteboard]; + NSImage *droppedImg; id data; switch (m_draggedObjectType) { case GHOST_kDragnDropTypeBitmap: - data = [draggingPBoard dataForType:NSTIFFPboardType]; + if([NSImage canInitWithPasteboard:draggingPBoard]) { + droppedImg = [[NSImage alloc]initWithPasteboard:draggingPBoard]; + data = droppedImg; //[draggingPBoard dataForType:NSTIFFPboardType]; + } + else return NO; break; case GHOST_kDragnDropTypeFilenames: data = [draggingPBoard propertyListForType:NSFilenamesPboardType]; @@ -1100,6 +1105,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode //No need to perform grab without warp as it is always on in OS X if(mode != GHOST_kGrabNormal) { GHOST_TInt32 x_old,y_old; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; m_systemCocoa->getCursorPosition(x_old,y_old); screenToClient(x_old, y_old, m_cursorGrabInitPos[0], m_cursorGrabInitPos[1]); @@ -1110,8 +1116,13 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab(GHOST_TGrabCursorMode mode setWindowCursorVisibility(false); } + //Make window key if it wasn't to get the mouse move events + [m_window makeKeyWindow]; + //Dissociate cursor position even for warp mode, to allow mouse acceleration to work even when warping the cursor err = CGAssociateMouseAndMouseCursorPosition(false) == kCGErrorSuccess ? GHOST_kSuccess : GHOST_kFailure; + + [pool drain]; } } else { diff --git a/intern/ghost/intern/Makefile b/intern/ghost/intern/Makefile index d9f2bfe7cde..23d27e61590 100644 --- a/intern/ghost/intern/Makefile +++ b/intern/ghost/intern/Makefile @@ -69,4 +69,6 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MEMUTIL)/include CPPFLAGS += -I.. CPPFLAGS += -I$(OPENGL_HEADERS) +CPPFLAGS += -I../../../source/blender/imbuf +CPPFLAGS += -I../../../source/blender/makesdna diff --git a/intern/smoke/SConscript b/intern/smoke/SConscript index af5bf1aeb20..2fc8798fc78 100644 --- a/intern/smoke/SConscript +++ b/intern/smoke/SConscript @@ -3,12 +3,16 @@ Import ('env') sources = env.Glob('intern/*.cpp') +incs = '' defs = '' if env['WITH_BF_OPENMP']: + if env['OURPLATFORM'] == 'linuxcross': + incs += ' ' + env['BF_OPENMP_INC'] + defs += ' PARALLEL=1' -incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] +incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] incs += ' intern ../../extern/bullet2/src ../memutil ../guardealloc ' if env['WITH_BF_FFTW3']: diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj index 0d7f3c66ff0..5fda32fdefc 100644 --- a/projectfiles_vc9/blender/blender.vcproj +++ b/projectfiles_vc9/blender/blender.vcproj @@ -74,7 +74,7 @@ <Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib OpenCOLLADABaseUtils.lib OpenCOLLADAFramework.lib OpenCOLLADAStreamWriter.lib OpenCOLLADASaxFrameworkLoader.lib pcre.lib UTF.lib GeneratedSaxParser.lib MathMLSolver.lib xml2.lib"
+ AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib OpenCOLLADABaseUtils.lib OpenCOLLADAFramework.lib OpenCOLLADAStreamWriter.lib OpenCOLLADASaxFrameworkLoader.lib pcre.lib UTF.lib GeneratedSaxParser.lib MathMLSolver.lib xml2.lib buffer.lib ftoa.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9\blender.exe"
LinkIncremental="1"
@@ -169,7 +169,7 @@ <Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386
"
- AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib OpenCOLLADABaseUtils_d.lib OpenCOLLADAFramework_d.lib OpenCOLLADAStreamWriter_d.lib OpenCOLLADASaxFrameworkLoader_d.lib pcre_d.lib UTF_d.lib GeneratedSaxParser_d.lib MathMLSolver_d.lib xml2_d.lib"
+ AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib OpenCOLLADABaseUtils_d.lib OpenCOLLADAFramework_d.lib OpenCOLLADAStreamWriter_d.lib OpenCOLLADASaxFrameworkLoader_d.lib pcre_d.lib UTF_d.lib GeneratedSaxParser_d.lib MathMLSolver_d.lib xml2_d.lib buffer_d.lib ftoa_d.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9d\blender.exe"
LinkIncremental="2"
diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index e87f1bd6578..ea076e3da5d 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -898,7 +898,7 @@ class ExportOBJ(bpy.types.Operator): path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True) - + # context group use_selection = BoolProperty(name="Selection Only", description="", default= False) use_all_scenes = BoolProperty(name="All Scenes", description="", default= False) diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py index 28b601510bd..7c1f1d5a9f3 100644 --- a/release/scripts/io/export_ply.py +++ b/release/scripts/io/export_ply.py @@ -281,7 +281,6 @@ class ExportPLY(bpy.types.Operator): use_uvs = BoolProperty(name="UVs", description="Exort the active UV layer", default=True) use_colors = BoolProperty(name="Vertex Colors", description="Exort the active vertex color layer", default=True) - def poll(self, context): return context.active_object != None @@ -328,4 +327,3 @@ bpy.types.INFO_MT_file_export.append(menu_func) if __name__ == "__main__": bpy.ops.export.ply(path="/tmp/test.ply") - diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index 9d993d1a378..5e355001eb1 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -626,7 +626,7 @@ class x3d_class: texCoordList.append(uv) j=j+1 texIndexList.append(-1) - + if self.writingtexture == 0: self.file.write("\n\t\t\ttexCoordIndex=\"") texIndxStr="" @@ -1228,7 +1228,7 @@ class ExportX3D(bpy.types.Operator): # to the class instance from the operator settings before calling. path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True) - + apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True) triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=False) compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install.", default=False) diff --git a/release/scripts/io/netrender/__init__.py b/release/scripts/io/netrender/__init__.py index b182ef7f452..ef50df3435a 100644 --- a/release/scripts/io/netrender/__init__.py +++ b/release/scripts/io/netrender/__init__.py @@ -34,4 +34,4 @@ blacklist = [] init_file = "" init_data = True -init_address = True
\ No newline at end of file +init_address = True diff --git a/release/scripts/io/netrender/balancing.py b/release/scripts/io/netrender/balancing.py index 344bacde90a..d3041466326 100644 --- a/release/scripts/io/netrender/balancing.py +++ b/release/scripts/io/netrender/balancing.py @@ -24,7 +24,7 @@ import netrender.model class RatingRule: def __init__(self): self.enabled = True - + def rate(self, job): return 0 @@ -58,7 +58,7 @@ class Balancer: for rule in self.exceptions: if id(rule) == rule_id: return rule - + return None def addRule(self, rule): @@ -129,7 +129,7 @@ class NewJobPriority(PriorityRule): def __init__(self, limit = 1): super().__init__() self.limit = limit - + def setLimit(self, value): self.limit = int(value) @@ -175,7 +175,7 @@ class ExcludeSlavesLimit(ExclusionRule): def setLimit(self, value): self.limit = float(value) - + def str_limit(self): return "more than %.0f%% of all slaves" % (self.limit * 100) diff --git a/release/scripts/io/netrender/master.py b/release/scripts/io/netrender/master.py index f95627135ba..0e3602563b4 100644 --- a/release/scripts/io/netrender/master.py +++ b/release/scripts/io/netrender/master.py @@ -75,9 +75,9 @@ class MRenderJob(netrender.model.RenderJob): self.last_update = 0 self.save_path = "" self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end) for rfile in job_info.files] - + self.resolution = None - + def initInfo(self): if not self.resolution: self.resolution = tuple(getFileInfo(self.files[0].filepath, ["bpy.context.scene.render_data.resolution_x", "bpy.context.scene.render_data.resolution_y", "bpy.context.scene.render_data.resolution_percentage"])) @@ -113,11 +113,11 @@ class MRenderJob(netrender.model.RenderJob): break else: self.status = JOB_FINISHED - + def pause(self, status = None): if self.status not in {JOB_PAUSED, JOB_QUEUED}: - return - + return + if status == None: self.status = JOB_PAUSED if self.status == JOB_QUEUED else JOB_QUEUED elif status: @@ -238,7 +238,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if match: job_id = match.groups()[0] frame_number = int(match.groups()[1]) - + job = self.server.getJobID(job_id) if job: @@ -249,9 +249,9 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(http.client.ACCEPTED) elif frame.status == DONE: self.server.stats("", "Sending result to client") - + filename = job.save_path + "%04d" % frame_number + ".exr" - + f = open(filename, 'rb') self.send_head(content = "image/x-exr") shutil.copyfileobj(f, self.wfile) @@ -285,7 +285,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(http.client.ACCEPTED) elif frame.status == DONE: filename = job.save_path + "%04d" % frame_number + ".exr" - + thumbname = thumbnail(filename) if thumbname: @@ -527,7 +527,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): rule.setLimit(limit) except: pass # invalid type - + self.send_head() # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "/balance_enable": @@ -537,7 +537,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): rule = self.server.balancer.ruleByID(rule_id) if rule: rule.enabled = enabled - + self.send_head() # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path.startswith("/cancel"): @@ -545,13 +545,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if match: length = int(self.headers['content-length']) - + if length > 0: info_map = eval(str(self.rfile.read(length), encoding='utf8')) clear = info_map.get("clear", False) else: clear = False - + job_id = match.groups()[0] job = self.server.getJobID(job_id) @@ -572,13 +572,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if match: length = int(self.headers['content-length']) - + if length > 0: info_map = eval(str(self.rfile.read(length), encoding='utf8')) status = info_map.get("status", None) else: status = None - + job_id = match.groups()[0] job = self.server.getJobID(job_id) @@ -597,7 +597,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): elif self.path == "/clear": # cancel all jobs length = int(self.headers['content-length']) - + if length > 0: info_map = eval(str(self.rfile.read(length), encoding='utf8')) clear = info_map.get("clear", False) @@ -963,10 +963,10 @@ class RenderMasterServer(http.server.HTTPServer): def removeJob(self, job, clear_files = False): self.jobs.remove(job) self.jobs_map.pop(job.id) - + if clear_files: shutil.rmtree(job.save_path) - + for slave in self.slaves: if slave.job == job: slave.job = None diff --git a/release/scripts/io/netrender/master_html.py b/release/scripts/io/netrender/master_html.py index 029497db1ae..3557361b8e9 100644 --- a/release/scripts/io/netrender/master_html.py +++ b/release/scripts/io/netrender/master_html.py @@ -83,7 +83,7 @@ def get(handler): def endTable(): output("</table>") - + def checkbox(title, value, script=""): return """<input type="checkbox" title="%s" %s %s>""" % (title, "checked" if value else "", ("onclick=\"%s\"" % script) if script else "") @@ -114,29 +114,29 @@ def get(handler): headerTable("type", "enabled", "description", "limit") for rule in handler.server.balancer.rules: - rowTable( + rowTable( "rating", checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))), rule, - rule.str_limit() + + rule.str_limit() + """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " " ) for rule in handler.server.balancer.priorities: - rowTable( + rowTable( "priority", checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))), rule, - rule.str_limit() + + rule.str_limit() + """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " " ) for rule in handler.server.balancer.exceptions: - rowTable( + rowTable( "exception", checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))), rule, - rule.str_limit() + + rule.str_limit() + """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " " ) @@ -218,14 +218,14 @@ def get(handler): output("<h2>Render Information</h2>") job.initInfo() - + startTable() rowTable("resolution", "%ix%i at %i%%" % job.resolution) endTable() - + output("<h2>Files</h2>") startTable() diff --git a/release/scripts/io/netrender/slave.py b/release/scripts/io/netrender/slave.py index c0848d7874f..7a1e2798913 100644 --- a/release/scripts/io/netrender/slave.py +++ b/release/scripts/io/netrender/slave.py @@ -217,11 +217,11 @@ def render_slave(engine, netsettings, threads): # send image back to server filename = JOB_PREFIX + "%06d" % frame.number + ".exr" - + # thumbnail first if netsettings.slave_thumb: thumbname = thumbnail(filename) - + f = open(thumbname, 'rb') conn.request("PUT", "/thumb", f, headers=headers) f.close() @@ -232,7 +232,7 @@ def render_slave(engine, netsettings, threads): f.close() if conn.getresponse().status == http.client.NO_CONTENT: continue - + elif job.type == netrender.model.JOB_PROCESS: conn.request("PUT", "/render", headers=headers) if conn.getresponse().status == http.client.NO_CONTENT: @@ -255,7 +255,7 @@ def render_slave(engine, netsettings, threads): break conn.close() - + if netsettings.slave_clear: clearSlave(NODE_PREFIX) diff --git a/release/scripts/io/netrender/ui.py b/release/scripts/io/netrender/ui.py index e8b9f2a6ed3..db402a21757 100644 --- a/release/scripts/io/netrender/ui.py +++ b/release/scripts/io/netrender/ui.py @@ -44,14 +44,14 @@ def init_file(): def init_data(netsettings): init_file() - + if netrender.init_data: netrender.init_data = False netsettings.active_slave_index = 0 while(len(netsettings.slaves) > 0): netsettings.slaves.remove(0) - + netsettings.active_blacklisted_slave_index = 0 while(len(netsettings.slaves_blacklist) > 0): netsettings.slaves_blacklist.remove(0) @@ -59,18 +59,18 @@ def init_data(netsettings): netsettings.active_job_index = 0 while(len(netsettings.jobs) > 0): netsettings.jobs.remove(0) - + def verify_address(netsettings): init_file() if netrender.init_address: netrender.init_address = False - + try: conn = clientConnection(netsettings.server_address, netsettings.server_port, scan = False) except: conn = None - + if conn: conn.close() else: @@ -97,7 +97,7 @@ class RENDER_PT_network_settings(RenderButtonsPanel): scene = context.scene netsettings = scene.network_render - + verify_address(netsettings) layout.prop(netsettings, "mode", expand=True) @@ -106,13 +106,13 @@ class RENDER_PT_network_settings(RenderButtonsPanel): layout.operator("render.netclientstart", icon='PLAY') layout.prop(netsettings, "path") - + split = layout.split(percentage=0.7) - + col = split.column() col.label(text="Server Adress:") col.prop(netsettings, "server_address", text="") - + col = split.column() col.label(text="Port:") col.prop(netsettings, "server_port", text="") @@ -145,7 +145,7 @@ class RENDER_PT_network_slave_settings(RenderButtonsPanel): layout.prop(rd, "threads_mode", expand=True) sub = layout.column() sub.enabled = rd.threads_mode == 'THREADS_FIXED' - sub.prop(rd, "threads") + sub.prop(rd, "threads") @rnaType class RENDER_PT_network_master_settings(RenderButtonsPanel): bl_label = "Master Settings" @@ -164,7 +164,7 @@ class RENDER_PT_network_master_settings(RenderButtonsPanel): layout.prop(netsettings, "master_broadcast") layout.prop(netsettings, "master_clear") - + @rnaType class RENDER_PT_network_job(RenderButtonsPanel): bl_label = "Job Settings" @@ -182,7 +182,7 @@ class RENDER_PT_network_job(RenderButtonsPanel): netsettings = scene.network_render verify_address(netsettings) - + if netsettings.server_address != "[default]": layout.operator("render.netclientanim", icon='RENDER_ANIMATION') layout.operator("render.netclientsend", icon='FILE_BLEND') @@ -190,17 +190,17 @@ class RENDER_PT_network_job(RenderButtonsPanel): row = layout.row() row.operator("screen.render", text="Get Image", icon='RENDER_STILL') row.operator("screen.render", text="Get Animation", icon='RENDER_ANIMATION').animation = True - + split = layout.split(percentage=0.3) - + col = split.column() col.label(text="Name:") col.label(text="Category:") - + col = split.column() col.prop(netsettings, "job_name", text="") col.prop(netsettings, "job_category", text="") - + row = layout.row() row.prop(netsettings, "priority") row.prop(netsettings, "chunks") diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py index f6d88212441..c9c4a2931a7 100644 --- a/release/scripts/io/netrender/utils.py +++ b/release/scripts/io/netrender/utils.py @@ -104,7 +104,7 @@ def clientConnection(address, port, report = None, scan = True): # else: if not scan: return None - + address, port = clientScan() if address == "": return None @@ -174,28 +174,28 @@ def prefixPath(prefix_directory, file_path, prefix_path): return full_path def getFileInfo(filepath, infos): - process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__, "--"] + infos, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__, "--"] + infos, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout = bytes() while process.poll() == None: stdout += process.stdout.read(1024) # read leftovers if needed stdout += process.stdout.read() - + stdout = str(stdout, encoding="utf8") - + values = [eval(v[1:].strip()) for v in stdout.split("\n") if v.startswith("$")] - + return values - + def thumbnail(filename): root = os.path.splitext(filename)[0] imagename = os.path.split(filename)[1] thumbname = root + ".jpg" - + if os.path.exists(thumbname): return thumbname - + if bpy: sce = bpy.data.scenes[0] sce.render_data.file_format = "JPEG" @@ -203,10 +203,10 @@ def thumbnail(filename): bpy.ops.image.open(path = filename) img = bpy.data.images[imagename] img.save(thumbname, scene = sce) - + try: process = subprocess.Popen(["convert", thumbname, "-resize", "300x300", thumbname]) - process.wait() + process.wait() return thumbname except: pass diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 8d654fb3978..e307b253780 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -20,14 +20,13 @@ # internal blender C module import _bpy -from _bpy import types, props +from _bpy import types, props, app data = _bpy.data context = _bpy.context # python modules from bpy import utils -from bpy import app from bpy import ops as _ops_module @@ -37,7 +36,6 @@ ops = _ops_module.ops_fake_module import sys as _sys - def _main(): # security issue, dont allow the $CWD in the path. diff --git a/release/scripts/modules/bpy/app.py b/release/scripts/modules/bpy/app.py deleted file mode 100644 index 26011ca5c2e..00000000000 --- a/release/scripts/modules/bpy/app.py +++ /dev/null @@ -1,52 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> - -""" -This module contains application values that remain unchanged during runtime. - -.. data:: version - - The Blender version as a tuple of 3 numbers. eg. (2, 50, 11) - - -.. data:: version_string - - The Blender version formatted as a string. - -.. data:: home - - The blender home directory, normally matching $HOME - -.. data:: binary_path - - The location of blenders executable, useful for utilities that spawn new instances. - -.. data:: debug - - Boolean, set when blender is running in debug mode (started with -d) - -""" -# constants -import _bpy -version = _bpy._VERSION -version_string = _bpy._VERSION_STR -home = _bpy._HOME -binary_path = _bpy._BINPATH -debug = _bpy._DEBUG diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index b7cdbfc2f7a..efa4a51530b 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -135,7 +135,7 @@ class bpy_ops_submodule_op(object): def idname(self): # submod.foo -> SUBMOD_OT_foo return self.module.upper() + "_OT_" + self.func - + def idname_py(self): # submod.foo -> SUBMOD_OT_foo return self.module + "." + self.func diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index dee1b36592f..7f10be362df 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -27,6 +27,7 @@ import bpy as _bpy import os as _os import sys as _sys + def load_scripts(reload_scripts=False, refresh_scripts=False): import traceback import time @@ -65,7 +66,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): module_name = getattr(type_class, "__module__", "") if module_name and module_name != "bpy.types": # hard coded for C types - loaded_modules.add(module_name) + loaded_modules.add(module_name) for module_name in loaded_modules: print("Reloading:", module_name) @@ -87,7 +88,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): if f.endswith(".py"): # python module mod = test_import(f[0:-3]) - elif ("." not in f) and (_os.path.isdir(_os.path.join(path, f, "__init__.py"))): + elif ("." not in f) and (_os.path.isfile(_os.path.join(path, f, "__init__.py"))): # python package mod = test_import(f) else: diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 98363005d9f..f6567af6121 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -61,6 +61,7 @@ class Object(bpy_types.ID): name = self.name return [scene for scene in bpy.data.scenes if name in scene.objects] + class _GenericBone: """ functions for bones, common between Armature/Pose/Edit bones. @@ -89,24 +90,24 @@ class _GenericBone: i += 1 return 0 - + @property def x_axis(self): """ Vector pointing down the x-axis of the bone. """ - return self.matrix.rotation_part() * Vector(1,0,0) - + return self.matrix.rotation_part() * Vector(1.0, 0.0, 0.0) + @property def y_axis(self): """ Vector pointing down the x-axis of the bone. """ - return self.matrix.rotation_part() * Vector(0,1,0) - + return self.matrix.rotation_part() * Vector(0.0, 1.0, 0.0) + @property def z_axis(self): """ Vector pointing down the x-axis of the bone. """ - return self.matrix.rotation_part() * Vector(0,0,1) + return self.matrix.rotation_part() * Vector(0.0, 0.0, 1.0) @property def basename(self): @@ -244,6 +245,7 @@ class EditBone(StructRNA, _GenericBone): self.tail_radius *= scalar self.align_roll(matrix * z_vec) + def ord_ind(i1, i2): if i1 < i2: return i1, i2 @@ -388,6 +390,7 @@ class MeshEdge(StructRNA): class MeshFace(StructRNA): __slots__ = () + @property def center(self): """The midpoint of the face.""" @@ -464,7 +467,7 @@ class _GenericUI: def prepend(cls, draw_func): """Prepend a draw function to this menu, takes the same arguments as the menus draw function.""" draw_funcs = cls._dyn_ui_initialize() - draw_funcs.insert(0, draw_func) + draw_funcs.insert(0, draw_func) class Panel(StructRNA, _GenericUI): diff --git a/release/scripts/modules/rigify/__init__.py b/release/scripts/modules/rigify/__init__.py index 83065b47f3e..540a76df105 100644 --- a/release/scripts/modules/rigify/__init__.py +++ b/release/scripts/modules/rigify/__init__.py @@ -29,7 +29,7 @@ LAYER_TYPES = "main", "extra", "ik", "fk" ORG_LAYERS = [n==31 for n in range(0,32)] MCH_LAYERS = [n==30 for n in range(0,32)] DEF_LAYERS = [n==29 for n in range(0,32)] -ROOT_LAYERS = [n==28 for n in range(0,32)] +ROOT_LAYERS = [n==28 for n in range(0,32)] ORG_PREFIX = "ORG-" MCH_PREFIX = "MCH-" @@ -154,7 +154,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True): from collections import OrderedDict import rigify_utils reload(rigify_utils) - + print("Begin...") # Not needed but catches any errors before duplicating @@ -178,63 +178,63 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True): name = obj_orig["rig_object_name"] except KeyError: name = "rig" - + try: obj = scene.objects[name] except KeyError: obj = bpy.data.objects.new(name, type='ARMATURE') obj.data = bpy.data.armatures.new(name) scene.objects.link(obj) - + obj.data.pose_position = 'POSE' - + # Get rid of anim data in case the rig already existed print("Clear rig animation data.") obj.animation_data_clear() - + # Select generated rig object obj_orig.selected = False obj.selected = True scene.objects.active = obj - + # Remove all bones from the generated rig armature. bpy.ops.object.mode_set(mode='EDIT') for bone in obj.data.edit_bones: obj.data.edit_bones.remove(bone) bpy.ops.object.mode_set(mode='OBJECT') - + # Create temporary duplicates for merging temp_rig_1 = obj_orig.copy() temp_rig_1.data = obj_orig.data.copy() scene.objects.link(temp_rig_1) - + temp_rig_2 = obj_orig.copy() temp_rig_2.data = obj.data scene.objects.link(temp_rig_2) - + # Select the temp rigs for merging for objt in scene.objects: objt.selected = False # deselect all objects temp_rig_1.selected = True temp_rig_2.selected = True scene.objects.active = temp_rig_2 - + # Merge the temporary rigs bpy.ops.object.join(context) - + # Delete the second temp rig bpy.ops.object.delete() - + # Select the generated rig for objt in scene.objects: objt.selected = False # deselect all objects obj.selected = True scene.objects.active = obj - + # Copy over the pose_bone properties for bone in obj_orig.pose.bones: bone_gen = obj.pose.bones[bone.name] - + # Rotation mode and transform locks bone_gen.rotation_mode = bone.rotation_mode bone_gen.lock_rotation = tuple(bone.lock_rotation) @@ -242,28 +242,28 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True): bone_gen.lock_rotations_4d = bone.lock_rotations_4d bone_gen.lock_location = tuple(bone.lock_location) bone_gen.lock_scale = tuple(bone.lock_scale) - + # Custom properties for prop in bone.keys(): bone_gen[prop] = bone[prop] - + # Copy over bone properties for bone in obj_orig.data.bones: bone_gen = obj.data.bones[bone.name] - + # B-bone stuff bone_gen.bbone_segments = bone.bbone_segments bone_gen.bbone_in = bone.bbone_in bone_gen.bbone_out = bone.bbone_out - - + + # Create proxy deformation rig # TODO: remove this if META_DEF: obj_def = obj_orig.copy() obj_def.data = obj_orig.data.copy() scene.objects.link(obj_def) - + scene.update() print("On to the real work.") @@ -474,7 +474,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True): obj.data.pose_position = 'POSE' obj_orig.data.pose_position = 'POSE' context.user_preferences.edit.global_undo = global_undo - + print("Done.\n") return obj diff --git a/release/scripts/modules/rigify/arm_biped.py b/release/scripts/modules/rigify/arm_biped.py index 56a7fca25a4..83b1b30152b 100644 --- a/release/scripts/modules/rigify/arm_biped.py +++ b/release/scripts/modules/rigify/arm_biped.py @@ -20,7 +20,7 @@ import bpy from math import radians, pi -from rigify import RigifyError, get_layer_dict, ORG_PREFIX +from rigify import RigifyError, ORG_PREFIX from rigify_utils import bone_class_instance, copy_bone_simple, add_pole_target_bone, add_stretch_to, blend_bone_list, get_side_name, get_base_name from rna_prop_ui import rna_idprop_ui_prop_get from Mathutils import Vector @@ -277,14 +277,14 @@ def fk(obj, definitions, base_names, options): fk_chain.arm_b.layer = layer fk_chain.forearm_b.layer = layer fk_chain.hand_b.layer = layer - + # Forearm was getting wrong roll somehow. Hack to fix that. bpy.ops.object.mode_set(mode='EDIT') fk_chain.update() mt.update() fk_chain.forearm_e.roll = mt.forearm_e.roll bpy.ops.object.mode_set(mode='OBJECT') - + bpy.ops.object.mode_set(mode='EDIT') return None, fk_chain.arm, fk_chain.forearm, fk_chain.hand @@ -301,7 +301,7 @@ def deform(obj, definitions, base_names, options): center = uarm1.center uarm1.tail = center uarm2.head = center - + # Create forearm bones: two bones, each half of the forearm. farm1 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.01" % base_names[definitions[2]], parent=True) farm2 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.02" % base_names[definitions[2]], parent=True) @@ -311,16 +311,16 @@ def deform(obj, definitions, base_names, options): center = farm1.center farm1.tail = center farm2.head = center - + # Create twist bone twist = copy_bone_simple(obj.data, definitions[2], "MCH-arm_twist") twist.connected = False twist.parent = obj.data.edit_bones[definitions[3]] twist.length /= 2 - + # Create hand bone hand = copy_bone_simple(obj.data, definitions[3], "DEF-%s" % base_names[definitions[3]], parent=True) - + # Store names before leaving edit mode uarm1_name = uarm1.name uarm2_name = uarm2.name @@ -328,10 +328,10 @@ def deform(obj, definitions, base_names, options): farm2_name = farm2.name twist_name = twist.name hand_name = hand.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bones uarm1 = obj.pose.bones[uarm1_name] uarm2 = obj.pose.bones[uarm2_name] @@ -339,50 +339,50 @@ def deform(obj, definitions, base_names, options): farm2 = obj.pose.bones[farm2_name] twist = obj.pose.bones[twist_name] hand = obj.pose.bones[hand_name] - + # Upper arm constraints con = uarm1.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[2] - + con = uarm1.constraints.new('COPY_SCALE') con.name = "trackto" con.target = obj con.subtarget = definitions[1] - + con = uarm2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[1] - + # Forearm constraints con = farm1.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[2] - + con = farm1.constraints.new('COPY_SCALE') con.name = "copy_rot" con.target = obj con.subtarget = definitions[2] - + con = farm2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = twist.name - + con = farm2.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[3] - + # Hand constraint con = hand.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[3] - + bpy.ops.object.mode_set(mode='EDIT') return (uarm1_name, uarm2_name, farm1_name, farm2_name, hand_name) diff --git a/release/scripts/modules/rigify/copy.py b/release/scripts/modules/rigify/copy.py index c0192af7d18..b3dab355a01 100644 --- a/release/scripts/modules/rigify/copy.py +++ b/release/scripts/modules/rigify/copy.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict from rigify_utils import bone_class_instance, copy_bone_simple METARIG_NAMES = ("cpy",) @@ -50,28 +49,28 @@ def deform(obj, definitions, base_names, options): # Create deform bone. bone = copy_bone_simple(obj.data, definitions[0], "DEF-%s" % base_names[definitions[0]], parent=True) - + # Store name before leaving edit mode bone_name = bone.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bone bone = obj.pose.bones[bone_name] - + # Constrain to the original bone con = bone.constraints.new('COPY_TRANSFORMS') con.name = "copy_loc" con.target = obj con.subtarget = definitions[0] - + return (bone_name,) def control(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + arm = obj.data mt = bone_class_instance(obj, METARIG_NAMES) mt.cpy = definitions[0] @@ -97,10 +96,10 @@ def control(obj, definitions, base_names, options): cp.cpy_p.lock_rotation = tuple(mt.cpy_p.lock_rotation) cp.cpy_p.lock_rotation_w = mt.cpy_p.lock_rotation_w cp.cpy_p.lock_scale = tuple(mt.cpy_p.lock_scale) - + # Layers cp.cpy_b.layer = list(mt.cpy_b.layer) - + return (mt.cpy,) diff --git a/release/scripts/modules/rigify/eye_balls.py b/release/scripts/modules/rigify/eye_balls.py index 927235517b3..7d66be89f7d 100644 --- a/release/scripts/modules/rigify/eye_balls.py +++ b/release/scripts/modules/rigify/eye_balls.py @@ -20,10 +20,9 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "eye_balls" @@ -37,7 +36,7 @@ def get_unmarked_action(): if action.tag != True: return action return None - + def add_action(name=None): mark_actions() bpy.ops.action.new() @@ -66,46 +65,46 @@ def metarig_template(): def metarig_definition(obj, orig_bone_name): bone = obj.data.bones[orig_bone_name] chain = [] - + try: chain += [bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a parent (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a parent (bone: %s)" % (RIG_TYPE, orig_bone_name)) + return chain def deform(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones pb = obj.pose.bones - + # Get list of eyes if "eyes" in options: eye_base_names = options["eyes"].replace(" ", "").split(",") else: eye_base_names = [] - + # Get their ORG- names eyes = [] for name in eye_base_names: eyes += ["ORG-"+name] - + # Duplicate the eyes to make deformation bones def_eyes = [] # def/org pairs for eye in eyes: def_eyes += [(copy_bone_simple(obj.data, eye, "DEF-"+base_names[eye], parent=True).name, eye)] - - + + bpy.ops.object.mode_set(mode='OBJECT') - + # Constraints for eye in def_eyes: con = pb[eye[0]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = eye[1] - + return (None,) @@ -113,32 +112,32 @@ def deform(obj, definitions, base_names, options): def control(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + head = definitions[0] eye_target = definitions[1] - + # Get list of eyes if "eyes" in options: eye_base_names = options["eyes"].replace(" ", "").split(",") else: eye_base_names = [] - + # Get their ORG- names eyes = [] for name in eye_base_names: eyes += ["ORG-"+name] - + # Get the average position of the eyes center = Vector(0,0,0) for eye in eyes: center += eb[eye].head if len(eyes) != 0: center /= len(eyes) - + # Get the average length of the eyes length = 0.0 for eye in eyes: @@ -147,48 +146,48 @@ def control(obj, definitions, base_names, options): length = 1.0 else: length /= len(eyes) - - + + # Make the mind's eye minds_eye = copy_bone_simple(obj.data, eye_target, "MCH-"+base_names[eye_target]+".mind", parent=True).name eb[minds_eye].head = center eb[minds_eye].tail = eb[eye_target].head eb[minds_eye].roll = 0.0 eb[minds_eye].length = length - + # Create org/copy/control eye sets eye_sets = [] for eye in eyes: copy = copy_bone_simple(obj.data, minds_eye, "MCH-"+base_names[eye]+".cpy", parent=True).name eb[copy].translate(eb[eye].head - eb[copy].head) eb[copy].parent = eb[eye].parent - + control = copy_bone_simple(obj.data, eye, base_names[eye], parent=True).name eb[control].parent = eb[copy] - + eye_sets += [(eye, copy, control)] - + # Bones for parent/free switch for eye target target_ctrl = copy_bone_simple(obj.data, eye_target, base_names[eye_target], parent=True).name parent = copy_bone_simple(obj.data, head, "MCH-eye_target_parent", parent=False).name - + eb[target_ctrl].parent = eb[parent] - - - - + + + + bpy.ops.object.mode_set(mode='OBJECT') - + # Axis locks pb[target_ctrl].lock_scale = False, True, True - + # Add eye_spread action if it doesn't already exist action_name = "eye_spread" if action_name in bpy.data.actions: spread_action = bpy.data.actions[action_name] else: spread_action = add_action(name=action_name) - + # Add free property prop_name = "free" prop = rna_idprop_ui_prop_get(pb[target_ctrl], prop_name, create=True) @@ -197,45 +196,45 @@ def control(obj, definitions, base_names, options): prop["soft_max"] = 1.0 prop["min"] = 0.0 prop["max"] = 1.0 - + free_driver_path = pb[target_ctrl].path_to_id() + '["free"]' - + # Constraints # Mind's eye tracks eye target control con = pb[minds_eye].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = target_ctrl - + # Parent copies transforms of head con = pb[parent].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = head - + fcurve = con.driver_add("influence", 0) driver = fcurve.driver driver.type = 'AVERAGE' mod = fcurve.modifiers[0] mod.coefficients[0] = 1.0 mod.coefficients[1] = -1.0 - + var = driver.variables.new() var.name = "free" var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = free_driver_path - + # Eye set's constraints for eye in eye_sets: # Org copies transforms of control con = pb[eye[0]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = eye[2] - + # Copy copies rotation of mind's eye con = pb[eye[1]].constraints.new('COPY_ROTATION') con.target = obj con.subtarget = minds_eye - + # Control gets action constraint for eye spread con = pb[eye[2]].constraints.new('ACTION') con.target = obj @@ -247,9 +246,9 @@ def control(obj, definitions, base_names, options): con.minimum = 0.0 con.maximum = 2.0 con.target_space = 'LOCAL' - - - + + + # Set layers #layer = list(bb[definitions[2]].layer) #bb[lid1].layer = layer @@ -260,8 +259,8 @@ def control(obj, definitions, base_names, options): #bb[lid6].layer = layer #bb[lid7].layer = layer #bb[lid8].layer = layer - - + + return (None,) diff --git a/release/scripts/modules/rigify/eye_lid.py b/release/scripts/modules/rigify/eye_lid.py index 1955b3e459b..ac6a12e842c 100644 --- a/release/scripts/modules/rigify/eye_lid.py +++ b/release/scripts/modules/rigify/eye_lid.py @@ -22,8 +22,8 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "eye_lid" @@ -37,7 +37,7 @@ def get_unmarked_action(): if action.tag != True: return action return None - + def add_action(name=None): mark_actions() bpy.ops.action.new() @@ -67,35 +67,35 @@ def metarig_definition(obj, orig_bone_name): bb = obj.data.bones bone = bb[orig_bone_name] chain = [] - + try: chain += [bone.parent.parent.name, bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, orig_bone_name)) + chain += [child.name for child in bone.children_recursive_basename] - + if len(chain) < 10: - raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) + chain = chain[:10] - + try: chain += [bb[chain[9]].children[0].name] chain += [bb[chain[10]].children[0].name] except IndexError: - raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a chain of 10 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) + return chain def deform(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones pb = obj.pose.bones - - + + # Upper lid MCH lid1 = make_lid_stretch_bone(obj, "MCH-lid", definitions[2], definitions[3], 1.0) lid2 = make_lid_stretch_bone(obj, "MCH-lid", definitions[3], definitions[4], 1.0) @@ -103,19 +103,19 @@ def deform(obj, definitions, base_names, options): lid33 = make_lid_stretch_bone(obj, "MCH-lid", definitions[4], definitions[3], 1.0) lid3 = make_lid_stretch_bone(obj, "MCH-lid", definitions[5], definitions[4], 1.0) lid4 = make_lid_stretch_bone(obj, "MCH-lid", definitions[6], definitions[5], 1.0) - + dlid22 = copy_bone_simple(obj.data, lid22, "MCH-lid", parent=True).name dlid33 = copy_bone_simple(obj.data, lid33, "MCH-lid", parent=True).name eb[dlid22].bbone_segments = 8 eb[dlid33].bbone_segments = 8 - + eb[lid1].parent = eb[definitions[2]] eb[lid2].parent = eb[definitions[3]] eb[lid22].parent = eb[definitions[4]] eb[lid33].parent = eb[definitions[4]] eb[lid3].parent = eb[definitions[5]] eb[lid4].parent = eb[definitions[6]] - + # Lower lid MCH lid5 = make_lid_stretch_bone(obj, "MCH-lid", definitions[6], definitions[7], 1.0) lid6 = make_lid_stretch_bone(obj, "MCH-lid", definitions[7], definitions[8], 1.0) @@ -123,115 +123,115 @@ def deform(obj, definitions, base_names, options): lid77 = make_lid_stretch_bone(obj, "MCH-lid", definitions[8], definitions[7], 1.0) lid7 = make_lid_stretch_bone(obj, "MCH-lid", definitions[9], definitions[8], 1.0) lid8 = make_lid_stretch_bone(obj, "MCH-lid", definitions[2], definitions[9], 1.0) - + dlid66 = copy_bone_simple(obj.data, lid66, "MCH-lid", parent=True).name dlid77 = copy_bone_simple(obj.data, lid77, "MCH-lid", parent=True).name eb[dlid66].bbone_segments = 8 eb[dlid77].bbone_segments = 8 - + eb[lid5].parent = eb[definitions[6]] eb[lid6].parent = eb[definitions[7]] eb[lid66].parent = eb[definitions[8]] eb[lid77].parent = eb[definitions[8]] eb[lid7].parent = eb[definitions[9]] eb[lid8].parent = eb[definitions[2]] - + # Upper lid DEF dlid1 = copy_bone_simple(obj.data, lid1, "DEF-" + base_names[definitions[2]], parent=True).name dlid2 = copy_bone_simple(obj.data, lid2, "DEF-" + base_names[definitions[3]], parent=True).name dlid3 = copy_bone_simple(obj.data, lid3, "DEF-" + base_names[definitions[4]], parent=True).name dlid4 = copy_bone_simple(obj.data, lid4, "DEF-" + base_names[definitions[5]], parent=True).name - + eb[dlid2].parent = eb[dlid1] eb[dlid22].parent = eb[dlid2] - + eb[dlid3].parent = eb[dlid4] eb[dlid33].parent = eb[dlid3] - + eb[dlid2].connected = True eb[dlid22].connected = True eb[dlid3].connected = True eb[dlid33].connected = True - + eb[dlid1].bbone_segments = 8 eb[dlid2].bbone_segments = 8 eb[dlid3].bbone_segments = 8 eb[dlid4].bbone_segments = 8 - + # Lower lid DEF dlid5 = copy_bone_simple(obj.data, lid5, "DEF-" + base_names[definitions[6]], parent=True).name dlid6 = copy_bone_simple(obj.data, lid6, "DEF-" + base_names[definitions[7]], parent=True).name dlid7 = copy_bone_simple(obj.data, lid7, "DEF-" + base_names[definitions[8]], parent=True).name dlid8 = copy_bone_simple(obj.data, lid8, "DEF-" + base_names[definitions[9]], parent=True).name - + eb[dlid6].parent = eb[dlid5] eb[dlid66].parent = eb[dlid6] - + eb[dlid7].parent = eb[dlid8] eb[dlid77].parent = eb[dlid7] - + eb[dlid6].connected = True eb[dlid66].connected = True eb[dlid7].connected = True eb[dlid77].connected = True - + eb[dlid5].bbone_segments = 8 eb[dlid6].bbone_segments = 8 eb[dlid7].bbone_segments = 8 eb[dlid8].bbone_segments = 8 - - + + bpy.ops.object.mode_set(mode='OBJECT') - + # Constraints con = pb[dlid1].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid1 - + con = pb[dlid22].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid22 - + con = pb[dlid33].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid33 - + con = pb[dlid2].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid2 - + con = pb[dlid3].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid3 - + con = pb[dlid4].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid4 - + con = pb[dlid5].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid5 - + con = pb[dlid6].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid6 - + con = pb[dlid66].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid66 - + con = pb[dlid77].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid77 - + con = pb[dlid7].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid7 - + con = pb[dlid8].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lid8 - + return (None,) @@ -239,15 +239,15 @@ def deform(obj, definitions, base_names, options): def control(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + head_e = eb[definitions[0]] eye_e = eb[definitions[1]] - - + + # Make eye "flower" flo1 = copy_bone_simple(obj.data, definitions[1], "MCH-"+base_names[definitions[2]]+".flower", parent=True).name flo2 = copy_bone_simple(obj.data, definitions[1], "MCH-"+base_names[definitions[3]]+".flower", parent=True).name @@ -257,7 +257,7 @@ def control(obj, definitions, base_names, options): flo6 = copy_bone_simple(obj.data, definitions[1], "MCH-"+base_names[definitions[7]]+".flower", parent=True).name flo7 = copy_bone_simple(obj.data, definitions[1], "MCH-"+base_names[definitions[8]]+".flower", parent=True).name flo8 = copy_bone_simple(obj.data, definitions[1], "MCH-"+base_names[definitions[9]]+".flower", parent=True).name - + eb[flo1].tail = eb[definitions[2]].head eb[flo2].tail = eb[definitions[3]].head eb[flo3].tail = eb[definitions[4]].head @@ -266,8 +266,8 @@ def control(obj, definitions, base_names, options): eb[flo6].tail = eb[definitions[7]].head eb[flo7].tail = eb[definitions[8]].head eb[flo8].tail = eb[definitions[9]].head - - + + # Make eye lids on tips of flowers flid1 = copy_bone_simple(obj.data, definitions[2], "MCH-"+base_names[definitions[2]]).name flid2 = copy_bone_simple(obj.data, definitions[3], "MCH-"+base_names[definitions[3]]).name @@ -277,7 +277,7 @@ def control(obj, definitions, base_names, options): flid6 = copy_bone_simple(obj.data, definitions[7], "MCH-"+base_names[definitions[7]]).name flid7 = copy_bone_simple(obj.data, definitions[8], "MCH-"+base_names[definitions[8]]).name flid8 = copy_bone_simple(obj.data, definitions[9], "MCH-"+base_names[definitions[9]]).name - + eb[flid1].parent = eb[flo1] eb[flid2].parent = eb[flo2] eb[flid3].parent = eb[flo3] @@ -286,8 +286,8 @@ def control(obj, definitions, base_names, options): eb[flid6].parent = eb[flo6] eb[flid7].parent = eb[flo7] eb[flid8].parent = eb[flo8] - - + + # Make eye lid controls lid1 = copy_bone_simple(obj.data, definitions[2], base_names[definitions[2]]).name lid2 = copy_bone_simple(obj.data, definitions[3], base_names[definitions[3]]).name @@ -297,7 +297,7 @@ def control(obj, definitions, base_names, options): lid6 = copy_bone_simple(obj.data, definitions[7], base_names[definitions[7]]).name lid7 = copy_bone_simple(obj.data, definitions[8], base_names[definitions[8]]).name lid8 = copy_bone_simple(obj.data, definitions[9], base_names[definitions[9]]).name - + size = eb[lid1].length eb[lid1].tail = eb[lid1].head + Vector(0,size,0) eb[lid2].tail = eb[lid2].head + Vector(0,size,0) @@ -307,7 +307,7 @@ def control(obj, definitions, base_names, options): eb[lid6].tail = eb[lid6].head + Vector(0,size,0) eb[lid7].tail = eb[lid7].head + Vector(0,size,0) eb[lid8].tail = eb[lid8].head + Vector(0,size,0) - + eb[lid1].roll = 0 eb[lid2].roll = 0 eb[lid3].roll = 0 @@ -316,7 +316,7 @@ def control(obj, definitions, base_names, options): eb[lid6].roll = 0 eb[lid7].roll = 0 eb[lid8].roll = 0 - + eb[lid1].parent = head_e eb[lid2].parent = head_e eb[lid3].parent = head_e @@ -325,27 +325,27 @@ def control(obj, definitions, base_names, options): eb[lid6].parent = head_e eb[lid7].parent = head_e eb[lid8].parent = head_e - + lower_lid_ctrl = copy_bone_simple(obj.data, definitions[10], base_names[definitions[10]]).name upper_lid_ctrl = copy_bone_simple(obj.data, definitions[11], base_names[definitions[11]]).name eb[lower_lid_ctrl].parent = head_e eb[upper_lid_ctrl].parent = head_e distance = (eb[lower_lid_ctrl].head - eb[upper_lid_ctrl].head).length - - + + bpy.ops.object.mode_set(mode='OBJECT') - + # Axis locks pb[lower_lid_ctrl].lock_location = True, False, True pb[upper_lid_ctrl].lock_location = True, False, True - + # Add eye close action if it doesn't already exist action_name = "eye_close" if action_name in bpy.data.actions: close_action = bpy.data.actions[action_name] else: close_action = add_action(name=action_name) - + # Add close property (useful when making the animation in the action) prop_name = "close_action" prop = rna_idprop_ui_prop_get(pb[upper_lid_ctrl], prop_name, create=True) @@ -354,79 +354,79 @@ def control(obj, definitions, base_names, options): prop["soft_max"] = 1.0 prop["min"] = 0.0 prop["max"] = 1.0 - + close_driver_path = pb[upper_lid_ctrl].path_to_id() + '["close_action"]' - + # Constraints - + # Flowers track lid controls con = pb[flo1].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid1 - + con = pb[flo2].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid2 - + con = pb[flo3].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid3 - + con = pb[flo4].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid4 - + con = pb[flo5].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid5 - + con = pb[flo6].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid6 - + con = pb[flo7].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid7 - + con = pb[flo8].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = lid8 - - + + # ORG bones to flower lids con = pb[definitions[2]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid1 - + con = pb[definitions[3]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid2 - + con = pb[definitions[4]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid3 - + con = pb[definitions[5]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid4 - + con = pb[definitions[6]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid5 - + con = pb[definitions[7]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid6 - + con = pb[definitions[8]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid7 - + con = pb[definitions[9]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = flid8 - - + + # Action constraints, upper lid con = pb[lid1].constraints.new('ACTION') con.target = obj @@ -445,8 +445,8 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - - + + con = pb[lid2].constraints.new('ACTION') con.target = obj con.subtarget = upper_lid_ctrl @@ -464,7 +464,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid3].constraints.new('ACTION') con.target = obj con.subtarget = upper_lid_ctrl @@ -482,7 +482,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid4].constraints.new('ACTION') con.target = obj con.subtarget = upper_lid_ctrl @@ -500,7 +500,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid5].constraints.new('ACTION') con.target = obj con.subtarget = upper_lid_ctrl @@ -518,7 +518,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + # Action constraints, lower lid con = pb[lid5].constraints.new('ACTION') con.target = obj @@ -537,7 +537,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid6].constraints.new('ACTION') con.target = obj con.subtarget = lower_lid_ctrl @@ -555,7 +555,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid7].constraints.new('ACTION') con.target = obj con.subtarget = lower_lid_ctrl @@ -573,7 +573,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid8].constraints.new('ACTION') con.target = obj con.subtarget = lower_lid_ctrl @@ -591,7 +591,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - + con = pb[lid1].constraints.new('ACTION') con.target = obj con.subtarget = lower_lid_ctrl @@ -609,10 +609,10 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = close_driver_path - - - - + + + + # Set layers layer = list(bb[definitions[2]].layer) bb[lid1].layer = layer @@ -623,8 +623,8 @@ def control(obj, definitions, base_names, options): bb[lid6].layer = layer bb[lid7].layer = layer bb[lid8].layer = layer - - + + return (None,) @@ -644,34 +644,34 @@ def main(obj, bone_definition, base_names, options): def make_lid_stretch_bone(obj, name, bone1, bone2, roll_alpha): eb = obj.data.edit_bones pb = obj.pose.bones - + # Create the bone, pointing from bone1 to bone2 bone_e = copy_bone_simple(obj.data, bone1, name, parent=True) bone_e.connected = False bone_e.tail = eb[bone2].head bone = bone_e.name - + # Align the bone roll with the average direction of bone1 and bone2 vec = bone_e.y_axis.cross(((1.0-roll_alpha)*eb[bone1].y_axis) + (roll_alpha*eb[bone2].y_axis)).normalize() - + ang = acos(vec * bone_e.x_axis) - + bone_e.roll += ang c1 = vec * bone_e.x_axis bone_e.roll -= (ang*2) c2 = vec * bone_e.x_axis - + if c1 > c2: bone_e.roll += (ang*2) - + bpy.ops.object.mode_set(mode='OBJECT') bone_p = pb[bone] - + # Constrains con = bone_p.constraints.new('COPY_LOCATION') con.target = obj con.subtarget = bone1 - + con = bone_p.constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = bone2 diff --git a/release/scripts/modules/rigify/finger_curl.py b/release/scripts/modules/rigify/finger_curl.py index 997ed889bb2..da2cf8dc279 100644 --- a/release/scripts/modules/rigify/finger_curl.py +++ b/release/scripts/modules/rigify/finger_curl.py @@ -19,10 +19,9 @@ # <pep8 compliant> import bpy -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import copy_bone_simple, get_side_name from rna_prop_ui import rna_idprop_ui_prop_get -from functools import reduce METARIG_NAMES = "finger_01", "finger_02", "finger_03" @@ -100,48 +99,48 @@ def deform(obj, definitions, base_names, options): center = f1a.center f1a.tail = center f1b.head = center - + # Create the other deform bones. f2 = copy_bone_simple(obj.data, definitions[1], "DEF-%s" % base_names[definitions[1]], parent=True) f3 = copy_bone_simple(obj.data, definitions[2], "DEF-%s" % base_names[definitions[2]], parent=True) - + # Store names before leaving edit mode f1a_name = f1a.name f1b_name = f1b.name f2_name = f2.name f3_name = f3.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bones f1a = obj.pose.bones[f1a_name] f1b = obj.pose.bones[f1b_name] f2 = obj.pose.bones[f2_name] f3 = obj.pose.bones[f3_name] - + # Constrain the base digit's bones con = f1a.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[1] - + con = f1a.constraints.new('COPY_SCALE') con.name = "copy_scale" con.target = obj con.subtarget = definitions[0] - + con = f1b.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[0] - + # Constrain the other digit's bones con = f2.constraints.new('COPY_TRANSFORMS') con.name = "copy_transforms" con.target = obj con.subtarget = definitions[1] - + con = f3.constraints.new('COPY_TRANSFORMS') con.name = "copy_transforms" con.target = obj @@ -151,32 +150,32 @@ def deform(obj, definitions, base_names, options): def main(obj, bone_definition, base_names, options): # *** EDITMODE bpy.ops.object.mode_set(mode='EDIT') - + # get assosiated data arm = obj.data bb = obj.data.bones eb = obj.data.edit_bones pb = obj.pose.bones - + org_f1 = bone_definition[0] # Original finger bone 01 org_f2 = bone_definition[1] # Original finger bone 02 org_f3 = bone_definition[2] # Original finger bone 03 - + # Check options if "bend_ratio" in options: bend_ratio = options["bend_ratio"] else: bend_ratio = 0.4 - + yes = [1, 1.0, True, "True", "true", "Yes", "yes"] make_hinge = False if ("hinge" in options) and (eb[org_f1].parent is not None): if options["hinge"] in yes: make_hinge = True - + # Needed if its a new armature with no keys - obj.animation_data_create() + obj.animation_data_create() # Create the control bone base_name = base_names[bone_definition[0]].split(".", 1)[0] @@ -185,12 +184,12 @@ def main(obj, bone_definition, base_names, options): eb[control].connected = eb[org_f1].connected eb[control].parent = eb[org_f1].parent eb[control].length = tot_len - + # Create secondary control bones f1 = copy_bone_simple(arm, bone_definition[0], base_names[bone_definition[0]]).name f2 = copy_bone_simple(arm, bone_definition[1], base_names[bone_definition[1]]).name f3 = copy_bone_simple(arm, bone_definition[2], base_names[bone_definition[2]]).name - + # Create driver bones df1 = copy_bone_simple(arm, bone_definition[0], "MCH-" + base_names[bone_definition[0]]).name eb[df1].length /= 2 @@ -198,7 +197,7 @@ def main(obj, bone_definition, base_names, options): eb[df2].length /= 2 df3 = copy_bone_simple(arm, bone_definition[2], "MCH-" + base_names[bone_definition[2]]).name eb[df3].length /= 2 - + # Set parents of the bones, interleaving the driver bones with the secondary control bones eb[f3].connected = False eb[df3].connected = False @@ -206,29 +205,29 @@ def main(obj, bone_definition, base_names, options): eb[df2].connected = False eb[f1].connected = False eb[df1].connected = eb[org_f1].connected - + eb[f3].parent = eb[df3] eb[df3].parent = eb[f2] eb[f2].parent = eb[df2] eb[df2].parent = eb[f1] eb[f1].parent = eb[df1] eb[df1].parent = eb[org_f1].parent - + # Set up bones for hinge if make_hinge: socket = copy_bone_simple(arm, org_f1, "MCH-socket_"+control, parent=True).name hinge = copy_bone_simple(arm, eb[org_f1].parent.name, "MCH-hinge_"+control).name - + eb[control].connected = False eb[control].parent = eb[hinge] - + # Create the deform rig while we're still in edit mode deform(obj, bone_definition, base_names, options) - - + + # *** POSEMODE bpy.ops.object.mode_set(mode='OBJECT') - + # Set rotation modes and axis locks pb[control].rotation_mode = obj.pose.bones[bone_definition[0]].rotation_mode pb[control].lock_location = True, True, True @@ -241,20 +240,20 @@ def main(obj, bone_definition, base_names, options): pb[f3].lock_location = True, True, True pb[df2].rotation_mode = 'YZX' pb[df3].rotation_mode = 'YZX' - + # Add the bend_ratio property to the control bone pb[control]["bend_ratio"] = bend_ratio prop = rna_idprop_ui_prop_get(pb[control], "bend_ratio", create=True) prop["soft_min"] = 0.0 prop["soft_max"] = 1.0 - + # Add hinge property to the control bone if make_hinge: pb[control]["hinge"] = 0.0 prop = rna_idprop_ui_prop_get(pb[control], "hinge", create=True) prop["soft_min"] = 0.0 prop["soft_max"] = 1.0 - + # Constraints con = pb[df1].constraints.new('COPY_LOCATION') con.target = obj @@ -263,24 +262,24 @@ def main(obj, bone_definition, base_names, options): con = pb[df1].constraints.new('COPY_ROTATION') con.target = obj con.subtarget = control - + con = pb[org_f1].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = f1 - + con = pb[org_f2].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = f2 - + con = pb[org_f3].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = f3 - + if make_hinge: con = pb[hinge].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = bb[org_f1].parent.name - + hinge_driver_path = pb[control].path_to_id() + '["hinge"]' fcurve = con.driver_add("influence", 0) @@ -296,11 +295,11 @@ def main(obj, bone_definition, base_names, options): mod.poly_order = 1 mod.coefficients[0] = 1.0 mod.coefficients[1] = -1.0 - + con = pb[control].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = socket - + # Create the drivers for the driver bones (control bone scale rotates driver bones) controller_path = pb[control].path_to_id() # 'pose.bones["%s"]' % control_bone_name @@ -349,7 +348,7 @@ def main(obj, bone_definition, base_names, options): layer = list(arm.bones[bone_definition[0]].layer) for bone_name in [f1, f2, f3]: arm.bones[bone_name].layer = layer - + layer = list(arm.bones[bone_definition[0]].layer) bb[control].layer = layer diff --git a/release/scripts/modules/rigify/leg_biped.py b/release/scripts/modules/rigify/leg_biped.py index 5c243727516..6cfb1b92dc2 100644 --- a/release/scripts/modules/rigify/leg_biped.py +++ b/release/scripts/modules/rigify/leg_biped.py @@ -20,7 +20,7 @@ import bpy from math import pi -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple, blend_bone_list, get_side_name, get_base_name from rna_prop_ui import rna_idprop_ui_prop_get @@ -306,7 +306,7 @@ def fk(obj, bone_definition, base_names, options): fk_chain = mt_chain.copy(base_names=base_names) # fk has no prefix! fk_chain.foot_e.name = "MCH-" + fk_chain.foot fk_chain.foot = fk_chain.foot_e.name - + # Set up fk foot control foot_e = copy_bone_simple(arm, mt.heel, base_names[mt_chain.foot]) foot = foot_e.name @@ -396,7 +396,7 @@ def deform(obj, definitions, base_names, options): center = uleg1.center uleg1.tail = center uleg2.head = center - + # Create lower leg bones: two bones, each half of the lower leg. lleg1 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.01" % base_names[definitions[2]], parent=True) lleg2 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.02" % base_names[definitions[2]], parent=True) @@ -406,19 +406,19 @@ def deform(obj, definitions, base_names, options): center = lleg1.center lleg1.tail = center lleg2.head = center - + # Create a bone for the second lower leg deform bone to twist with twist = copy_bone_simple(obj.data, lleg2.name, "MCH-leg_twist") twist.length /= 4 twist.connected = False twist.parent = obj.data.edit_bones[definitions[3]] - + # Create foot bone foot = copy_bone_simple(obj.data, definitions[3], "DEF-%s" % base_names[definitions[3]], parent=True) - + # Create toe bone toe = copy_bone_simple(obj.data, definitions[4], "DEF-%s" % base_names[definitions[4]], parent=True) - + # Store names before leaving edit mode uleg1_name = uleg1.name uleg2_name = uleg2.name @@ -427,10 +427,10 @@ def deform(obj, definitions, base_names, options): twist_name = twist.name foot_name = foot.name toe_name = toe.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bones uleg1 = obj.pose.bones[uleg1_name] uleg2 = obj.pose.bones[uleg2_name] @@ -438,56 +438,56 @@ def deform(obj, definitions, base_names, options): lleg2 = obj.pose.bones[lleg2_name] foot = obj.pose.bones[foot_name] toe = obj.pose.bones[toe_name] - + # Upper leg constraints con = uleg1.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[2] - + con = uleg1.constraints.new('COPY_SCALE') con.name = "scale" con.target = obj con.subtarget = definitions[1] - + con = uleg2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[1] - + # Lower leg constraints con = lleg1.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[2] - + con = lleg1.constraints.new('COPY_SCALE') con.name = "copy_rot" con.target = obj con.subtarget = definitions[2] - + con = lleg2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = twist_name - + con = lleg2.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[3] - + # Foot constraint con = foot.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[3] - + # Toe constraint con = toe.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[4] - + bpy.ops.object.mode_set(mode='EDIT') return (uleg1_name, uleg2_name, lleg1_name, lleg2_name, foot_name, toe_name, None) @@ -499,4 +499,4 @@ def main(obj, bone_definition, base_names, options): bpy.ops.object.mode_set(mode='OBJECT') blend_bone_list(obj, bone_definition + [None], bones_fk, bones_ik, target_bone=bones_ik[6], target_prop="ik", blend_default=1.0) - + diff --git a/release/scripts/modules/rigify/leg_quadruped.py b/release/scripts/modules/rigify/leg_quadruped.py index 524450d0d24..43c54e9f321 100644 --- a/release/scripts/modules/rigify/leg_quadruped.py +++ b/release/scripts/modules/rigify/leg_quadruped.py @@ -22,7 +22,7 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import pi from rigify import RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple, add_pole_target_bone, get_side_name, get_base_name +from rigify_utils import bone_class_instance, copy_bone_simple, get_side_name, get_base_name from Mathutils import Vector METARIG_NAMES = "hips", "thigh", "shin", "foot", "toe" @@ -144,7 +144,7 @@ def ik(obj, bone_definition, base_names, options): eb[knee_rotator].tail = eb[knee_rotator].head + eb[mt_chain.toe].vector eb[knee_rotator].length = eb[ik_chain.thigh].length / 2 eb[knee_rotator].roll += pi/2 - + # parent ik leg to the knee rotator eb[ik_chain.thigh].parent = eb[knee_rotator] @@ -186,7 +186,7 @@ def ik(obj, bone_definition, base_names, options): mt_chain.update() ik.update() ik_chain.update() - + # Set rotation modes and axis locks #pb[knee_rotator].rotation_mode = 'YXZ' #pb[knee_rotator].lock_rotation = False, True, False @@ -195,7 +195,7 @@ def ik(obj, bone_definition, base_names, options): pb[ik.foot_roll].lock_rotation = False, True, True pb[ik_chain.toe].rotation_mode = 'XYZ' pb[ik_chain.toe].lock_rotation = False, True, True - + # IK switch property prop = rna_idprop_ui_prop_get(pb[ik_chain.foot], "ik", create=True) pb[ik_chain.foot]["ik"] = 1.0 @@ -203,7 +203,7 @@ def ik(obj, bone_definition, base_names, options): prop["soft_max"] = 1.0 prop["min"] = 0.0 prop["max"] = 1.0 - + ik_driver_path = pb[ik_chain.foot].path_to_id() + '["ik"]' # simple constraining of orig bones @@ -290,9 +290,9 @@ def ik(obj, bone_definition, base_names, options): for attr in ik.attr_names: obj.data.bones[getattr(ik, attr)].layer = layer obj.data.bones[knee_rotator].layer = layer - + return None, ik_chain.thigh, ik_chain.shin, ik_chain.foot, ik_chain.toe - + def fk(obj, bone_definition, base_names, options): @@ -307,34 +307,34 @@ def fk(obj, bone_definition, base_names, options): mt.attr_initialize(METARIG_NAMES, bone_definition) mt_chain.attr_initialize(METARIG_NAMES, bone_definition) - + fk_chain = mt_chain.copy(to_fmt="%s", base_names=base_names) - + # Create the socket socket = copy_bone_simple(arm, mt_chain.thigh, "MCH-leg_socket").name eb[socket].parent = eb[mt.hips] eb[socket].length = eb[mt_chain.thigh].length / 4 - + # Create the hinge hinge = copy_bone_simple(arm, mt.hips, "MCH-leg_hinge").name eb[hinge].length = eb[mt.hips].length / 2 - + # Make leg child of hinge eb[fk_chain.thigh].connected = False eb[fk_chain.thigh].parent = eb[hinge] - - + + bpy.ops.object.mode_set(mode='OBJECT') - + # Set rotation modes and axis locks pb[fk_chain.shin].rotation_mode = 'XYZ' pb[fk_chain.shin].lock_rotation = False, True, True - + # Constrain original bones to control bones con = mt_chain.thigh_p.constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = fk_chain.thigh - + con = mt_chain.shin_p.constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = fk_chain.shin @@ -346,24 +346,24 @@ def fk(obj, bone_definition, base_names, options): con = mt_chain.toe_p.constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = fk_chain.toe - + # Socket constraint con = pb[fk_chain.thigh].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = socket - + # Hinge constraint con = pb[hinge].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = mt.hips - + prop = rna_idprop_ui_prop_get(pb[fk_chain.thigh], "hinge", create=True) pb[fk_chain.thigh]["hinge"] = 0.0 prop["soft_min"] = 0.0 prop["soft_max"] = 1.0 prop["min"] = 0.0 prop["max"] = 1.0 - + hinge_driver_path = pb[fk_chain.thigh].path_to_id() + '["hinge"]' fcurve = con.driver_add("influence", 0) @@ -379,7 +379,7 @@ def fk(obj, bone_definition, base_names, options): mod.poly_order = 1 mod.coefficients[0] = 1.0 mod.coefficients[1] = -1.0 - + return None, fk_chain.thigh, fk_chain.shin, fk_chain.foot, fk_chain.toe @@ -397,7 +397,7 @@ def deform(obj, definitions, base_names, options): center = uleg1.center uleg1.tail = center uleg2.head = center - + # Create lower leg bones: two bones, each half of the lower leg. lleg1 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.01" % base_names[definitions[2]], parent=True) lleg2 = copy_bone_simple(obj.data, definitions[2], "DEF-%s.02" % base_names[definitions[2]], parent=True) @@ -407,19 +407,19 @@ def deform(obj, definitions, base_names, options): center = lleg1.center lleg1.tail = center lleg2.head = center - + # Create a bone for the second lower leg deform bone to twist with twist = copy_bone_simple(obj.data, lleg2.name, "MCH-leg_twist") twist.length /= 4 twist.connected = False twist.parent = obj.data.edit_bones[definitions[3]] - + # Create foot bone foot = copy_bone_simple(obj.data, definitions[3], "DEF-%s" % base_names[definitions[3]], parent=True) - + # Create toe bone toe = copy_bone_simple(obj.data, definitions[4], "DEF-%s" % base_names[definitions[4]], parent=True) - + # Store names before leaving edit mode uleg1_name = uleg1.name uleg2_name = uleg2.name @@ -428,10 +428,10 @@ def deform(obj, definitions, base_names, options): twist_name = twist.name foot_name = foot.name toe_name = toe.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bones uleg1 = obj.pose.bones[uleg1_name] uleg2 = obj.pose.bones[uleg2_name] @@ -439,49 +439,49 @@ def deform(obj, definitions, base_names, options): lleg2 = obj.pose.bones[lleg2_name] foot = obj.pose.bones[foot_name] toe = obj.pose.bones[toe_name] - + # Upper leg constraints con = uleg1.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[2] - + con = uleg2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[1] - + # Lower leg constraints con = lleg1.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[2] - + con = lleg2.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = twist_name - + con = lleg2.constraints.new('DAMPED_TRACK') con.name = "trackto" con.target = obj con.subtarget = definitions[3] - + # Foot constraint con = foot.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[3] - + # Toe constraint con = toe.constraints.new('COPY_ROTATION') con.name = "copy_rot" con.target = obj con.subtarget = definitions[4] - + bpy.ops.object.mode_set(mode='EDIT') return (uleg1_name, uleg2_name, lleg1_name, lleg2_name, foot_name, toe_name, None) - + diff --git a/release/scripts/modules/rigify/mouth.py b/release/scripts/modules/rigify/mouth.py index dbda25d399b..4a01a272af7 100644 --- a/release/scripts/modules/rigify/mouth.py +++ b/release/scripts/modules/rigify/mouth.py @@ -22,8 +22,8 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos, pi from Mathutils import Vector -from rigify import get_layer_dict, RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple #METARIG_NAMES = ("cpy",) RIG_TYPE = "mouth" @@ -38,7 +38,7 @@ def get_unmarked_action(): if action.tag != True: return action return None - + def add_action(name=None): mark_actions() bpy.ops.action.new() @@ -46,7 +46,7 @@ def add_action(name=None): if name is not None: action.name = name return action - + def addget_shape_key(obj, name="Key"): """ Fetches a shape key, or creates it if it doesn't exist """ @@ -54,16 +54,16 @@ def addget_shape_key(obj, name="Key"): if obj.data.shape_keys is None: shape = obj.add_shape_key(name="Basis", from_mix=False) obj.active_shape_key_index = 0 - + # Get the shapekey, or create it if it doesn't already exist if name in obj.data.shape_keys.keys: shape_key = obj.data.shape_keys.keys[name] else: shape_key = obj.add_shape_key(name=name, from_mix=False) - + return shape_key - - + + def addget_shape_key_driver(obj, name="Key"): """ Fetches the driver for the shape key, or creates it if it doesn't already exist. @@ -78,9 +78,9 @@ def addget_shape_key_driver(obj, name="Key"): if fcurve == None: fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0) fcurve.driver.type = 'AVERAGE' - + return fcurve - + def metarig_template(): # generated by rigify.write_meta_rig @@ -101,37 +101,37 @@ def metarig_template(): def metarig_definition(obj, orig_bone_name): bone = obj.data.bones[orig_bone_name] chain = [] - + try: chain += [bone.parent.parent.name, bone.parent.name, bone.name] except AttributeError: - raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a chain of two parents (bone: %s)" % (RIG_TYPE, orig_bone_name)) + chain += [child.name for child in bone.children_recursive_basename] - + if len(chain) < 10: - raise RigifyError("'%s' rig type requires a chain of 8 bones (bone: %s)" % (RIG_TYPE, base_names[0])) - + raise RigifyError("'%s' rig type requires a chain of 8 bones (bone: %s)" % (RIG_TYPE, orig_bone_name)) + return chain[:10] def deform(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + jaw = definitions[1] - + # Options req_options = ["mesh"] for option in req_options: if option not in options: raise RigifyError("'%s' rig type requires a '%s' option (bone: %s)" % (RIG_TYPE, option, base_names[definitions[0]])) - + meshes = options["mesh"].replace(" ", "").split(",") - + # Upper lip MCH lip1 = make_lip_stretch_bone(obj, "MCH-lip", definitions[3], definitions[2], 0.0) lip2 = make_lip_stretch_bone(obj, "MCH-lip", definitions[4], definitions[3], 0.0) @@ -139,17 +139,17 @@ def deform(obj, definitions, base_names, options): lip33 = make_lip_stretch_bone(obj, "MCH-lip", definitions[3], definitions[4], 0.0) lip3 = make_lip_stretch_bone(obj, "MCH-lip", definitions[4], definitions[5], 0.0) lip4 = make_lip_stretch_bone(obj, "MCH-lip", definitions[5], definitions[6], 0.0) - + eb[lip1].parent = eb[definitions[3]] eb[lip2].parent = eb[definitions[4]] eb[lip22].parent = eb[definitions[5]] eb[lip33].parent = eb[definitions[3]] eb[lip3].parent = eb[definitions[4]] eb[lip4].parent = eb[definitions[5]] - + eb[lip22].bbone_segments = 8 eb[lip33].bbone_segments = 8 - + # Lower lip MCH lip5 = make_lip_stretch_bone(obj, "MCH-lip", definitions[7], definitions[6], 0.0) lip6 = make_lip_stretch_bone(obj, "MCH-lip", definitions[8], definitions[7], 0.0) @@ -157,129 +157,129 @@ def deform(obj, definitions, base_names, options): lip77 = make_lip_stretch_bone(obj, "MCH-lip", definitions[7], definitions[8], 0.0) lip7 = make_lip_stretch_bone(obj, "MCH-lip", definitions[8], definitions[9], 0.0) lip8 = make_lip_stretch_bone(obj, "MCH-lip", definitions[9], definitions[2], 0.0) - + eb[lip5].parent = eb[definitions[7]] eb[lip6].parent = eb[definitions[8]] eb[lip66].parent = eb[definitions[9]] eb[lip77].parent = eb[definitions[7]] eb[lip7].parent = eb[definitions[8]] eb[lip8].parent = eb[definitions[9]] - + eb[lip66].bbone_segments = 8 eb[lip77].bbone_segments = 8 - + # Upper lip DEF dlip1 = copy_bone_simple(obj.data, lip1, "DEF-" + base_names[definitions[4]] + ".01.R", parent=True).name dlip2 = copy_bone_simple(obj.data, lip2, "DEF-" + base_names[definitions[4]] + ".02.R", parent=True).name dlip3 = copy_bone_simple(obj.data, lip3, "DEF-" + base_names[definitions[4]] + ".02.L", parent=True).name dlip4 = copy_bone_simple(obj.data, lip4, "DEF-" + base_names[definitions[4]] + ".01.L", parent=True).name - + eb[dlip1].parent = eb[dlip2] eb[dlip2].parent = eb[lip22] - + eb[dlip4].parent = eb[dlip3] eb[dlip3].parent = eb[lip33] - + eb[dlip1].connected = True eb[dlip2].connected = True eb[dlip4].connected = True eb[dlip3].connected = True - + eb[dlip1].bbone_segments = 8 eb[dlip2].bbone_segments = 8 eb[dlip3].bbone_segments = 8 eb[dlip4].bbone_segments = 8 - + # Lower lip DEF dlip8 = copy_bone_simple(obj.data, lip8, "DEF-" + base_names[definitions[8]] + ".01.R", parent=True).name dlip7 = copy_bone_simple(obj.data, lip7, "DEF-" + base_names[definitions[8]] + ".02.R", parent=True).name dlip6 = copy_bone_simple(obj.data, lip6, "DEF-" + base_names[definitions[8]] + ".02.L", parent=True).name dlip5 = copy_bone_simple(obj.data, lip5, "DEF-" + base_names[definitions[8]] + ".01.L", parent=True).name - - + + eb[dlip5].parent = eb[dlip6] eb[dlip6].parent = eb[lip66] - + eb[dlip8].parent = eb[dlip7] eb[dlip7].parent = eb[lip77] - + eb[dlip5].connected = True eb[dlip6].connected = True eb[dlip8].connected = True eb[dlip7].connected = True - + eb[dlip5].bbone_segments = 8 eb[dlip6].bbone_segments = 8 eb[dlip7].bbone_segments = 8 eb[dlip8].bbone_segments = 8 - + # Jaw open bones jopen1 = copy_bone_simple(obj.data, jaw, "MCH-"+base_names[jaw]+".track1", parent=True).name eb[jopen1].connected = False eb[jopen1].head = eb[jaw].tail eb[jopen1].tail = eb[jopen1].head + Vector(0, 0, eb[jaw].length/4) - + jopen2 = copy_bone_simple(obj.data, jopen1, "MCH-"+base_names[jaw]+".track2").name eb[jopen2].parent = eb[jaw] - - + + bpy.ops.object.mode_set(mode='OBJECT') - + # Constraints con = pb[dlip1].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip1 - + con = pb[dlip2].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip2 - + con = pb[dlip3].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip3 - + con = pb[dlip4].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip4 - + con = pb[dlip5].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip5 - + con = pb[dlip6].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip6 - + con = pb[dlip7].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip7 - + con = pb[dlip8].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = lip8 - + # Corrective shape keys for the corners of the mouth. bpy.ops.object.mode_set(mode='EDIT') - + # Calculate the rotation difference between the bones rotdiff_r = acos(eb[lip1].matrix.to_quat() * eb[lip8].matrix.to_quat()) * 2 rotdiff_l = acos(eb[lip4].matrix.to_quat() * eb[lip5].matrix.to_quat()) * 2 - + bpy.ops.object.mode_set(mode='OBJECT') - - + + # Left side shape key for mesh_name in meshes: mesh_obj = bpy.data.objects[mesh_name] shape_key_name = "COR-" + base_names[definitions[4]] + ".L.spread" - + # Add/get the shape key shape_key = addget_shape_key(mesh_obj, name=shape_key_name) - + # Add/get the shape key driver fcurve = addget_shape_key_driver(mesh_obj, name=shape_key_name) driver = fcurve.driver - + # Get the variable, or create it if it doesn't already exist var_name = base_names[definitions[6]] if var_name in driver.variables: @@ -287,32 +287,32 @@ def deform(obj, definitions, base_names, options): else: var = driver.variables.new() var.name = var_name - + # Set up the variable var.type = "ROTATION_DIFF" var.targets[0].id = obj var.targets[0].bone_target = lip4 var.targets[1].id = obj var.targets[1].bone_target = lip5 - + # Set fcurve offset mod = fcurve.modifiers[0] if rotdiff_l != pi: mod.coefficients[0] = -rotdiff_l / (pi-rotdiff_l) mod.coefficients[1] = 1 / (pi-rotdiff_l) - + # Right side shape key for mesh_name in meshes: mesh_obj = bpy.data.objects[mesh_name] shape_key_name = "COR-" + base_names[definitions[4]] + ".R.spread" - + # Add/get the shape key shape_key = addget_shape_key(mesh_obj, name=shape_key_name) - + # Add/get the shape key driver fcurve = addget_shape_key_driver(mesh_obj, name=shape_key_name) driver = fcurve.driver - + # Get the variable, or create it if it doesn't already exist var_name = base_names[definitions[2]] if var_name in driver.variables: @@ -320,32 +320,32 @@ def deform(obj, definitions, base_names, options): else: var = driver.variables.new() var.name = var_name - + # Set up the variable var.type = "ROTATION_DIFF" var.targets[0].id = obj var.targets[0].bone_target = lip1 var.targets[1].id = obj var.targets[1].bone_target = lip8 - + # Set fcurve offset mod = fcurve.modifiers[0] if rotdiff_r != pi: mod.coefficients[0] = -rotdiff_r / (pi-rotdiff_r) mod.coefficients[1] = 1 / (pi-rotdiff_r) - + # Jaw open corrective shape key for mesh_name in meshes: mesh_obj = bpy.data.objects[mesh_name] shape_key_name = "COR-" + base_names[definitions[4]] + ".jaw_open" - + # Add/get the shape key shape_key = addget_shape_key(mesh_obj, name=shape_key_name) - + # Add/get the shape key driver fcurve = addget_shape_key_driver(mesh_obj, name=shape_key_name) driver = fcurve.driver - + # Get the variable, or create it if it doesn't already exist var_name = base_names[definitions[4]] if var_name in driver.variables: @@ -353,19 +353,19 @@ def deform(obj, definitions, base_names, options): else: var = driver.variables.new() var.name = var_name - + # Set up the variable var.type = "LOC_DIFF" var.targets[0].id = obj var.targets[0].bone_target = jopen1 var.targets[1].id = obj var.targets[1].bone_target = jopen2 - + # Set fcurve offset mod = fcurve.modifiers[0] mod.coefficients[0] = 0.0 mod.coefficients[1] = 1.0 / bb[jaw].length - + return (None,) @@ -373,15 +373,15 @@ def deform(obj, definitions, base_names, options): def control(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + head_e = eb[definitions[0]] jaw_e = eb[definitions[1]] jaw = definitions[1] - + # Head lips hlip1 = copy_bone_simple(obj.data, definitions[2], "MCH-"+base_names[definitions[2]]+".head").name hlip2 = copy_bone_simple(obj.data, definitions[3], "MCH-"+base_names[definitions[3]]+".head").name @@ -391,7 +391,7 @@ def control(obj, definitions, base_names, options): hlip6 = copy_bone_simple(obj.data, definitions[7], "MCH-"+base_names[definitions[7]]+".head").name hlip7 = copy_bone_simple(obj.data, definitions[8], "MCH-"+base_names[definitions[8]]+".head").name hlip8 = copy_bone_simple(obj.data, definitions[9], "MCH-"+base_names[definitions[9]]+".head").name - + eb[hlip1].parent = head_e eb[hlip2].parent = head_e eb[hlip3].parent = head_e @@ -400,7 +400,7 @@ def control(obj, definitions, base_names, options): eb[hlip6].parent = head_e eb[hlip7].parent = head_e eb[hlip8].parent = head_e - + # Jaw lips jlip1 = copy_bone_simple(obj.data, definitions[2], "MCH-"+base_names[definitions[2]]+".jaw").name jlip2 = copy_bone_simple(obj.data, definitions[3], "MCH-"+base_names[definitions[3]]+".jaw").name @@ -410,7 +410,7 @@ def control(obj, definitions, base_names, options): jlip6 = copy_bone_simple(obj.data, definitions[7], "MCH-"+base_names[definitions[7]]+".jaw").name jlip7 = copy_bone_simple(obj.data, definitions[8], "MCH-"+base_names[definitions[8]]+".jaw").name jlip8 = copy_bone_simple(obj.data, definitions[9], "MCH-"+base_names[definitions[9]]+".jaw").name - + eb[jlip1].parent = jaw_e eb[jlip2].parent = jaw_e eb[jlip3].parent = jaw_e @@ -419,7 +419,7 @@ def control(obj, definitions, base_names, options): eb[jlip6].parent = jaw_e eb[jlip7].parent = jaw_e eb[jlip8].parent = jaw_e - + # Control lips lip1 = copy_bone_simple(obj.data, definitions[2], base_names[definitions[2]]).name lip2 = copy_bone_simple(obj.data, definitions[3], base_names[definitions[3]]).name @@ -429,7 +429,7 @@ def control(obj, definitions, base_names, options): lip6 = copy_bone_simple(obj.data, definitions[7], base_names[definitions[7]]).name lip7 = copy_bone_simple(obj.data, definitions[8], base_names[definitions[8]]).name lip8 = copy_bone_simple(obj.data, definitions[9], base_names[definitions[9]]).name - + size = eb[lip1].length eb[lip1].tail = eb[lip1].head + Vector(0,size,0) eb[lip2].tail = eb[lip2].head + Vector(0,size,0) @@ -439,7 +439,7 @@ def control(obj, definitions, base_names, options): eb[lip6].tail = eb[lip6].head + Vector(0,size,0) eb[lip7].tail = eb[lip7].head + Vector(0,size,0) eb[lip8].tail = eb[lip8].head + Vector(0,size,0) - + eb[lip1].roll = 0 eb[lip2].roll = 0 eb[lip3].roll = 0 @@ -448,7 +448,7 @@ def control(obj, definitions, base_names, options): eb[lip6].roll = 0 eb[lip7].roll = 0 eb[lip8].roll = 0 - + eb[lip1].parent = eb[hlip1] eb[lip2].parent = eb[hlip2] eb[lip3].parent = eb[hlip3] @@ -457,7 +457,7 @@ def control(obj, definitions, base_names, options): eb[lip6].parent = eb[hlip6] eb[lip7].parent = eb[hlip7] eb[lip8].parent = eb[hlip8] - + # Link lips llip1 = copy_bone_simple(obj.data, definitions[2], "MCH-"+base_names[definitions[2]]+".link").name llip2 = copy_bone_simple(obj.data, definitions[3], "MCH-"+base_names[definitions[3]]+".link").name @@ -467,7 +467,7 @@ def control(obj, definitions, base_names, options): llip6 = copy_bone_simple(obj.data, definitions[7], "MCH-"+base_names[definitions[7]]+".link").name llip7 = copy_bone_simple(obj.data, definitions[8], "MCH-"+base_names[definitions[8]]+".link").name llip8 = copy_bone_simple(obj.data, definitions[9], "MCH-"+base_names[definitions[9]]+".link").name - + eb[llip1].parent = eb[lip1] eb[llip2].parent = eb[lip2] eb[llip3].parent = eb[lip3] @@ -476,22 +476,22 @@ def control(obj, definitions, base_names, options): eb[llip6].parent = eb[lip6] eb[llip7].parent = eb[lip7] eb[llip8].parent = eb[lip8] - + # Jaw open tracker jopent = copy_bone_simple(obj.data, jaw_e.name, "MCH-"+base_names[jaw_e.name]+".track", parent=True).name eb[jopent].connected = False eb[jopent].tail = jaw_e.tail + Vector(0,0,jaw_e.length) eb[jopent].head = jaw_e.tail - + bpy.ops.object.mode_set(mode='OBJECT') - + # Add mouth open action if it doesn't already exist action_name = "mouth_open" if action_name in bpy.data.actions: open_action = bpy.data.actions[action_name] else: open_action = add_action(name=action_name) - + # Add close property (useful when making the animation in the action) prop_name = "open_action" prop = rna_idprop_ui_prop_get(pb[lip1], prop_name, create=True) @@ -500,12 +500,12 @@ def control(obj, definitions, base_names, options): prop["soft_max"] = 1.0 prop["min"] = 0.0 prop["max"] = 1.0 - + open_driver_path = pb[lip1].path_to_id() + '["open_action"]' - - + + # Constraints - + # Jaw open tracker stretches to jaw tip con = pb[jopent].constraints.new('STRETCH_TO') con.target = obj @@ -513,83 +513,83 @@ def control(obj, definitions, base_names, options): con.head_tail = 1.0 con.original_length = bb[jopent].length con.volume = 'NO_VOLUME' - + # Head lips to jaw lips influence = [0.02, 0.15, 0.5, 0.25, 0.0] - + con = pb[hlip1].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip1 con.influence = influence[2] - + con = pb[hlip2].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip2 con.influence = influence[1] - + con = pb[hlip3].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip3 con.influence = influence[0] - + con = pb[hlip4].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip4 con.influence = influence[1] - + con = pb[hlip5].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip5 con.influence = influence[2] - + con = pb[hlip6].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip6 con.influence = 1.0 - influence[3] - + con = pb[hlip7].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip7 con.influence = 1.0 - influence[4] - + con = pb[hlip8].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = jlip8 con.influence = 1.0 - influence[3] - + # ORG bones to link lips con = pb[definitions[2]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip1 - + con = pb[definitions[3]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip2 - + con = pb[definitions[4]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip3 - + con = pb[definitions[5]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip4 - + con = pb[definitions[6]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip5 - + con = pb[definitions[7]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip6 - + con = pb[definitions[8]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip7 - + con = pb[definitions[9]].constraints.new('COPY_TRANSFORMS') con.target = obj con.subtarget = llip8 - + # Action constraints for open mouth con = pb[lip1].constraints.new('ACTION') con.target = obj @@ -608,7 +608,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip2].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -626,7 +626,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip3].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -644,7 +644,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip4].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -662,7 +662,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip5].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -680,7 +680,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip6].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -698,7 +698,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip7].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -716,7 +716,7 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - + con = pb[lip8].constraints.new('ACTION') con.target = obj con.subtarget = jopent @@ -734,8 +734,8 @@ def control(obj, definitions, base_names, options): var.targets[0].id_type = 'OBJECT' var.targets[0].id = obj var.targets[0].data_path = open_driver_path - - + + # Set layers layer = list(bb[definitions[2]].layer) bb[lip1].layer = layer @@ -746,8 +746,8 @@ def control(obj, definitions, base_names, options): bb[lip6].layer = layer bb[lip7].layer = layer bb[lip8].layer = layer - - + + return (None,) @@ -767,34 +767,34 @@ def main(obj, bone_definition, base_names, options): def make_lip_stretch_bone(obj, name, bone1, bone2, roll_alpha): eb = obj.data.edit_bones pb = obj.pose.bones - + # Create the bone, pointing from bone1 to bone2 bone_e = copy_bone_simple(obj.data, bone1, name, parent=True) bone_e.connected = False bone_e.tail = eb[bone2].head bone = bone_e.name - + # Align the bone roll with the average direction of bone1 and bone2 vec = bone_e.y_axis.cross(((1.0-roll_alpha)*eb[bone1].y_axis) + (roll_alpha*eb[bone2].y_axis)).normalize() - + ang = acos(vec * bone_e.x_axis) - + bone_e.roll += ang c1 = vec * bone_e.x_axis bone_e.roll -= (ang*2) c2 = vec * bone_e.x_axis - + if c1 > c2: bone_e.roll += (ang*2) - + bpy.ops.object.mode_set(mode='OBJECT') bone_p = pb[bone] - + # Constrains con = bone_p.constraints.new('COPY_LOCATION') con.target = obj con.subtarget = bone1 - + con = bone_p.constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = bone2 diff --git a/release/scripts/modules/rigify/neck_flex.py b/release/scripts/modules/rigify/neck_flex.py index d26510f49b2..b749ab6ad89 100644 --- a/release/scripts/modules/rigify/neck_flex.py +++ b/release/scripts/modules/rigify/neck_flex.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from rigify import RigifyError, get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple from rna_prop_ui import rna_idprop_ui_prop_get @@ -106,16 +106,16 @@ def deform(obj, definitions, base_names, options): # Create deform bone. bone = copy_bone_simple(obj.data, org_bone_name, "DEF-%s" % base_names[org_bone_name], parent=True) - + # Store name before leaving edit mode bone_name = bone.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bone bone = obj.pose.bones[bone_name] - + # Constrain to the original bone # XXX. Todo, is this needed if the bone is connected to its parent? con = bone.constraints.new('COPY_TRANSFORMS') @@ -323,8 +323,8 @@ def main(obj, bone_definition, base_names, options): con = orig_neck_p.constraints.new('COPY_ROTATION') con.target = obj con.subtarget = neck_p.name - - + + # Set the head control's custom shape to use the last # org neck bone for its transform ex.head_ctrl_p.custom_shape_transform = obj.pose.bones[bone_definition[len(bone_definition)-1]] @@ -339,11 +339,11 @@ def main(obj, bone_definition, base_names, options): getattr(ex_chain, attr + "_b").layer = layer for attr in ex.attr_names: getattr(ex, attr + "_b").layer = layer - + layer = list(arm.bones[bone_definition[1]].layer) ex.head_ctrl_b.layer = layer # no blending the result of this return None - + diff --git a/release/scripts/modules/rigify/palm_curl.py b/release/scripts/modules/rigify/palm_curl.py index 82010552ea7..73a1597dfbe 100644 --- a/release/scripts/modules/rigify/palm_curl.py +++ b/release/scripts/modules/rigify/palm_curl.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict from rigify_utils import copy_bone_simple, get_side_name from rna_prop_ui import rna_idprop_ui_prop_get @@ -104,16 +103,16 @@ def deform(obj, definitions, base_names, options): # Create deform bone. bone = copy_bone_simple(obj.data, org_bone_name, "DEF-%s" % base_names[org_bone_name], parent=True) - + # Store name before leaving edit mode bone_name = bone.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bone bone = obj.pose.bones[bone_name] - + # Constrain to the original bone # XXX. Todo, is this needed if the bone is connected to its parent? con = bone.constraints.new('COPY_TRANSFORMS') @@ -141,7 +140,7 @@ def main(obj, bone_definition, base_names, options): offset = (pinky_ebone.head - ring_ebone.head) control_ebone.translate(offset) - + deform(obj, bone_definition, base_names, options) bpy.ops.object.mode_set(mode='OBJECT') diff --git a/release/scripts/modules/rigify/shape_key_distance.py b/release/scripts/modules/rigify/shape_key_distance.py index 7701e725ea9..c15a27f497d 100644 --- a/release/scripts/modules/rigify/shape_key_distance.py +++ b/release/scripts/modules/rigify/shape_key_distance.py @@ -19,11 +19,7 @@ # <pep8 compliant> import bpy -from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos -from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError #METARIG_NAMES = ("cpy",) RIG_TYPE = "shape_key_distance" @@ -36,16 +32,16 @@ def addget_shape_key(obj, name="Key"): if obj.data.shape_keys is None: shape = obj.add_shape_key(name="Basis", from_mix=False) obj.active_shape_key_index = 0 - + # Get the shapekey, or create it if it doesn't already exist if name in obj.data.shape_keys.keys: shape_key = obj.data.shape_keys.keys[name] else: shape_key = obj.add_shape_key(name=name, from_mix=False) - + return shape_key - - + + def addget_shape_key_driver(obj, name="Key"): """ Fetches the driver for the shape key, or creates it if it doesn't already exist. @@ -60,7 +56,7 @@ def addget_shape_key_driver(obj, name="Key"): if fcurve == None: fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0) fcurve.driver.type = 'AVERAGE' - + return fcurve @@ -90,42 +86,42 @@ def metarig_definition(obj, orig_bone_name): def deform(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') eb = obj.data.edit_bones - + bone_from = definitions[0] - - + + # Options req_options = ["to", "mesh", "shape_key"] for option in req_options: if option not in options: raise RigifyError("'%s' rig type requires a '%s' option (bone: %s)" % (RIG_TYPE, option, base_names[definitions[0]])) - + bone_to = "ORG-" + options["to"] meshes = options["mesh"].replace(" ", "").split(",") shape_key_name = options["shape_key"] - + if "dmul" in options: shape_blend_fac = options["dmul"] else: shape_blend_fac = 1.0 - - + + # Calculate the distance between the bones distance = (eb[bone_from].head - eb[bone_to].head).length - + bpy.ops.object.mode_set(mode='OBJECT') - + # For every listed mesh object for mesh_name in meshes: mesh_obj = bpy.data.objects[mesh_name] - + # Add/get the shape key shape_key = addget_shape_key(mesh_obj, name=shape_key_name) - + # Add/get the shape key driver fcurve = addget_shape_key_driver(mesh_obj, name=shape_key_name) driver = fcurve.driver - + # Get the variable, or create it if it doesn't already exist var_name = base_names[bone_from] if var_name in driver.variables: @@ -133,7 +129,7 @@ def deform(obj, definitions, base_names, options): else: var = driver.variables.new() var.name = var_name - + # Set up the variable var.type = "LOC_DIFF" var.targets[0].id_type = 'OBJECT' @@ -142,14 +138,14 @@ def deform(obj, definitions, base_names, options): var.targets[1].id_type = 'OBJECT' var.targets[1].id = obj var.targets[1].bone_target = bone_to - + # Set fcurve offset, so zero is at the rest distance - + mod = fcurve.modifiers[0] if distance > 0.00001: mod.coefficients[0] = -shape_blend_fac mod.coefficients[1] = shape_blend_fac / distance - + return (None,) diff --git a/release/scripts/modules/rigify/shape_key_rotdiff.py b/release/scripts/modules/rigify/shape_key_rotdiff.py index 265a2fe368a..6d6f6cbc615 100644 --- a/release/scripts/modules/rigify/shape_key_rotdiff.py +++ b/release/scripts/modules/rigify/shape_key_rotdiff.py @@ -19,11 +19,7 @@ # <pep8 compliant> import bpy -from rna_prop_ui import rna_idprop_ui_prop_get -from math import acos -from Mathutils import Vector -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError #METARIG_NAMES = ("cpy",) RIG_TYPE = "shape_key_rotdiff" @@ -36,16 +32,16 @@ def addget_shape_key(obj, name="Key"): if obj.data.shape_keys is None: shape = obj.add_shape_key(name="Basis", from_mix=False) obj.active_shape_key_index = 0 - + # Get the shapekey, or create it if it doesn't already exist if name in obj.data.shape_keys.keys: shape_key = obj.data.shape_keys.keys[name] else: shape_key = obj.add_shape_key(name=name, from_mix=False) - + return shape_key - - + + def addget_shape_key_driver(obj, name="Key"): """ Fetches the driver for the shape key, or creates it if it doesn't already exist. @@ -60,7 +56,7 @@ def addget_shape_key_driver(obj, name="Key"): if fcurve == None: fcurve = obj.data.shape_keys.keys[name].driver_add("value", 0) fcurve.driver.type = 'AVERAGE' - + return fcurve @@ -90,42 +86,42 @@ def metarig_definition(obj, orig_bone_name): def deform(obj, definitions, base_names, options): bpy.ops.object.mode_set(mode='EDIT') eb = obj.data.edit_bones - + bone_from = definitions[0] - - + + # Options req_options = ["to", "mesh", "shape_key"] for option in req_options: if option not in options: raise RigifyError("'%s' rig type requires a '%s' option (bone: %s)" % (RIG_TYPE, option, base_names[definitions[0]])) - + bone_to = "ORG-" + options["to"] meshes = options["mesh"].replace(" ", "").split(",") shape_key_name = options["shape_key"] - + if "dmul" in options: shape_blend_fac = options["dmul"] else: shape_blend_fac = 1.0 - - + + # Calculate the rotation difference between the bones rotdiff = (eb[bone_from].matrix.to_quat() * eb[bone_to].matrix.to_quat()) * 2 - + bpy.ops.object.mode_set(mode='OBJECT') - + # For every listed mesh object for mesh_name in meshes: mesh_obj = bpy.data.objects[mesh_name] - + # Add/get the shape key shape_key = addget_shape_key(mesh_obj, name=shape_key_name) - + # Add/get the shape key driver fcurve = addget_shape_key_driver(mesh_obj, name=shape_key_name) driver = fcurve.driver - + # Get the variable, or create it if it doesn't already exist var_name = base_names[bone_from] if var_name in driver.variables: @@ -133,7 +129,7 @@ def deform(obj, definitions, base_names, options): else: var = driver.variables.new() var.name = var_name - + # Set up the variable var.type = "ROTATION_DIFF" var.targets[0].id_type = 'OBJECT' @@ -142,14 +138,14 @@ def deform(obj, definitions, base_names, options): var.targets[1].id_type = 'OBJECT' var.targets[1].id = obj var.targets[1].bone_target = bone_to - + # Set fcurve offset, so zero is at the rest distance - + mod = fcurve.modifiers[0] if rotdiff > 0.00001: mod.coefficients[0] = -shape_blend_fac mod.coefficients[1] = shape_blend_fac / rotdiff - + return (None,) diff --git a/release/scripts/modules/rigify/spine_pivot_flex.py b/release/scripts/modules/rigify/spine_pivot_flex.py index 5bf5b3bf484..b1552b2395b 100644 --- a/release/scripts/modules/rigify/spine_pivot_flex.py +++ b/release/scripts/modules/rigify/spine_pivot_flex.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict +from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple from rna_prop_ui import rna_idprop_ui_prop_get @@ -128,16 +128,16 @@ def deform(obj, definitions, base_names, options): # Create deform bone. bone = copy_bone_simple(obj.data, org_bone_name, "DEF-%s" % base_names[org_bone_name], parent=True) - + # Store name before leaving edit mode bone_name = bone.name - + # Leave edit mode bpy.ops.object.mode_set(mode='OBJECT') - + # Get the pose bone bone = obj.pose.bones[bone_name] - + # Constrain to the original bone # XXX. Todo, is this needed if the bone is connected to its parent? con = bone.constraints.new('COPY_TRANSFORMS') @@ -284,7 +284,7 @@ def main(obj, bone_definition, base_names, options): mt_chain.update() ex_chain.update() rv_chain.update() - + # Axis locks ex.ribcage_copy_p.lock_location = True, True, True @@ -453,8 +453,8 @@ def main(obj, bone_definition, base_names, options): mod.poly_order = 1 mod.coefficients[0] = - (i - 1) mod.coefficients[1] = spine_chain_len - - + + # Set pelvis and ribcage controls to use the first and last bone in the # spine respectively for their custom shape transform ex.ribcage_copy_p.custom_shape_transform = obj.pose.bones[bone_definition[len(bone_definition)-1]] @@ -472,7 +472,7 @@ def main(obj, bone_definition, base_names, options): getattr(ex_chain, attr + "_b").layer = layer for attr in rv_chain.attr_names: getattr(rv_chain, attr + "_b").layer = layer - + layer = list(arm.bones[bone_definition[1]].layer) arm.bones[ex.pelvis_copy].layer = layer arm.bones[ex.ribcage_copy].layer = layer diff --git a/release/scripts/modules/rigify/stretch.py b/release/scripts/modules/rigify/stretch.py index 373a934ac74..634232bc6e4 100644 --- a/release/scripts/modules/rigify/stretch.py +++ b/release/scripts/modules/rigify/stretch.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict, RigifyError -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "stretch" @@ -65,7 +65,7 @@ def main(obj, bone_definition, base_names, options): raise RigifyError("'%s' rig type 'to' parameter must be a string (bone: %s)" % (RIG_TYPE, base_names[bone_definition[0]])) if ("ORG-" + options["to"]) not in obj.data.bones: raise RigifyError("'%s' rig type 'to' parameter must name a bone in the metarig (bone: %s)" % (RIG_TYPE, base_names[bone_definition[0]])) - + preserve_volume = None # Check optional parameter if "preserve_volume" in options: @@ -73,14 +73,14 @@ def main(obj, bone_definition, base_names, options): preserve_volume = bool_map[options["preserve_volume"]] except KeyError: preserve_volume = False - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + bpy.ops.object.mode_set(mode='EDIT') arm = obj.data - + mbone1 = bone_definition[0] mbone2 = "ORG-" + options["to"] @@ -90,14 +90,14 @@ def main(obj, bone_definition, base_names, options): bone_e.tail = eb[mbone2].head bone = bone_e.name - + bpy.ops.object.mode_set(mode='OBJECT') # Constraints con = pb[bone].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = mbone2 - + con = pb[bone].constraints.new('STRETCH_TO') con.target = obj con.subtarget = mbone2 diff --git a/release/scripts/modules/rigify/stretch_twist.py b/release/scripts/modules/rigify/stretch_twist.py index 6e5891b5e0a..60ffaa26210 100644 --- a/release/scripts/modules/rigify/stretch_twist.py +++ b/release/scripts/modules/rigify/stretch_twist.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "stretch_twist" @@ -66,7 +66,7 @@ def main(obj, bone_definition, base_names, options): raise RigifyError("'%s' rig type 'to' parameter must be a string (bone: %s)" % (RIG_TYPE, base_names[0])) if ("ORG-" + options["to"]) not in obj.data.bones: raise RigifyError("'%s' rig type 'to' parameter must name a bone in the metarig (bone: %s)" % (RIG_TYPE, base_names[0])) - + preserve_volume = None # Check optional parameter if "preserve_volume" in options: @@ -74,30 +74,30 @@ def main(obj, bone_definition, base_names, options): preserve_volume = bool_map[options["preserve_volume"]] except KeyError: preserve_volume = False - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + bpy.ops.object.mode_set(mode='EDIT') arm = obj.data - + mbone1 = bone_definition[0] mbone2 = "ORG-" + options["to"] - + bone_e = copy_bone_simple(obj.data, mbone1, "MCH-%s" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = None bone_e.head = (eb[mbone1].head + eb[mbone2].head) / 2 bone_e.tail = (bone_e.head[0], bone_e.head[1], bone_e.head[2]+0.1) mid_bone = bone_e.name - + bone_e = copy_bone_simple(obj.data, mbone1, "DEF-%s.01" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = eb[mbone1] bone_e.tail = eb[mid_bone].head bone1 = bone_e.name - + bone_e = copy_bone_simple(obj.data, mbone2, "DEF-%s.02" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = eb[mbone2] @@ -105,26 +105,26 @@ def main(obj, bone_definition, base_names, options): bone2 = bone_e.name - + bpy.ops.object.mode_set(mode='OBJECT') # Constraints - + # Mid bone con = pb[mid_bone].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = mbone1 - + con = pb[mid_bone].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = mbone2 con.influence = 0.5 - + # Bone 1 con = pb[bone1].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = mid_bone - + con = pb[bone1].constraints.new('STRETCH_TO') con.target = obj con.subtarget = mid_bone @@ -133,12 +133,12 @@ def main(obj, bone_definition, base_names, options): con.volume = 'VOLUME_XZX' else: con.volume = 'NO_VOLUME' - + # Bone 2 con = pb[bone2].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = mid_bone - + con = pb[bone2].constraints.new('STRETCH_TO') con.target = obj con.subtarget = mid_bone diff --git a/release/scripts/modules/rigify/track_dual.py b/release/scripts/modules/rigify/track_dual.py index 3a1197b95bf..1dcd105730b 100644 --- a/release/scripts/modules/rigify/track_dual.py +++ b/release/scripts/modules/rigify/track_dual.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "track_dual" @@ -48,12 +48,11 @@ bool_map = {0:False, 1:True, "no":False, "yes":True, "No":False, "Yes":True} + def metarig_definition(obj, orig_bone_name): return (orig_bone_name,) - - def main(obj, bone_definition, base_names, options): """ A dual-bone track setup. Deformation only (no controls). @@ -65,23 +64,23 @@ def main(obj, bone_definition, base_names, options): raise RigifyError("'%s' rig type 'to' parameter must be a string (bone: %s)" % (RIG_TYPE, base_names[0])) if ("ORG-" + options["to"]) not in obj.data.bones: raise RigifyError("'%s' rig type 'to' parameter must name a bone in the metarig (bone: %s)" % (RIG_TYPE, base_names[0])) - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + bpy.ops.object.mode_set(mode='EDIT') arm = obj.data - + mbone1 = bone_definition[0] mbone2 = "ORG-" + options["to"] - + bone_e = copy_bone_simple(obj.data, mbone1, "DEF-%s.01" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = eb[mbone1] bone_e.tail = (eb[mbone1].head + eb[mbone2].head) / 2 bone1 = bone_e.name - + bone_e = copy_bone_simple(obj.data, mbone2, "DEF-%s.02" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = eb[mbone1] @@ -89,7 +88,6 @@ def main(obj, bone_definition, base_names, options): bone2 = bone_e.name - bpy.ops.object.mode_set(mode='OBJECT') # Constraints @@ -98,16 +96,15 @@ def main(obj, bone_definition, base_names, options): con.target = obj con.subtarget = mbone2 - + # Bone 2 con = pb[bone2].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = mbone2 - + con = pb[bone2].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = mbone1 return tuple() - diff --git a/release/scripts/modules/rigify/track_reverse.py b/release/scripts/modules/rigify/track_reverse.py index 38f7b6182f9..ec6107709e4 100644 --- a/release/scripts/modules/rigify/track_reverse.py +++ b/release/scripts/modules/rigify/track_reverse.py @@ -19,8 +19,8 @@ # <pep8 compliant> import bpy -from rigify import get_layer_dict -from rigify_utils import bone_class_instance, copy_bone_simple +from rigify import RigifyError +from rigify_utils import copy_bone_simple METARIG_NAMES = tuple() RIG_TYPE = "track_reverse" @@ -66,17 +66,17 @@ def main(obj, bone_definition, base_names, options): raise RigifyError("'%s' rig type 'to' parameter must be a string (bone: %s)" % (RIG_TYPE, base_names[0])) if ("ORG-" + options["to"]) not in obj.data.bones: raise RigifyError("'%s' rig type 'to' parameter must name a bone in the metarig (bone: %s)" % (RIG_TYPE, base_names[0])) - + eb = obj.data.edit_bones bb = obj.data.bones pb = obj.pose.bones - + bpy.ops.object.mode_set(mode='EDIT') arm = obj.data - + mbone1 = bone_definition[0] mbone2 = "ORG-" + options["to"] - + bone_e = copy_bone_simple(obj.data, mbone2, "DEF-%s.02" % base_names[bone_definition[0]]) bone_e.connected = False bone_e.parent = eb[mbone1] @@ -84,14 +84,14 @@ def main(obj, bone_definition, base_names, options): bone = bone_e.name - + bpy.ops.object.mode_set(mode='OBJECT') # Constraints con = pb[bone].constraints.new('COPY_LOCATION') con.target = obj con.subtarget = mbone2 - + con = pb[bone].constraints.new('DAMPED_TRACK') con.target = obj con.subtarget = mbone1 diff --git a/release/scripts/modules/rigify_utils.py b/release/scripts/modules/rigify_utils.py index 289489686ec..8ade0ede8b2 100644 --- a/release/scripts/modules/rigify_utils.py +++ b/release/scripts/modules/rigify_utils.py @@ -174,7 +174,6 @@ def blend_bone_list(obj, apply_bones, from_bones, to_bones, target_bone=None, ta blend_transforms(new_pbone, from_bone_name, to_bone_name) - def add_pole_target_bone(obj, base_bone_name, name, mode='CROSS'): ''' Does not actually create a poll target, just the bone to use as a poll target @@ -320,10 +319,11 @@ def bone_class_instance(obj, slots, name="BoneContainer"): there are also utility functions for manipulating all members. ''' + attr_names = tuple(slots) # dont modify the original + if len(slots) != len(set(slots)): raise Exception("duplicate entries found %s" % attr_names) - attr_names = tuple(slots) # dont modify the original slots = list(slots) # dont modify the original for i in range(len(slots)): member = slots[i] diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index f5b9e518c8f..a9e50592059 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -126,7 +126,7 @@ def draw(layout, context, context_member, use_edit=True): class PropertyPanel(bpy.types.Panel): """ - The subclass should have its own poll function + The subclass should have its own poll function and the variable '_context_path' MUST be set. """ bl_label = "Custom Properties" @@ -269,4 +269,3 @@ class WM_OT_properties_remove(bpy.types.Operator): item = eval("context.%s" % self.properties.path) del item[self.properties.property] return {'FINISHED'} - diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py index 4a31a275a4d..59e40fbd628 100644 --- a/release/scripts/op/add_mesh_torus.py +++ b/release/scripts/op/add_mesh_torus.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8-80 compliant> +# <pep8 compliant> import bpy import Mathutils from math import cos, sin, pi @@ -82,7 +82,7 @@ class AddTorus(bpy.types.Operator): bl_undo = True major_radius = FloatProperty(name="Major Radius", - description="Radius from center of torus to center of it's cross section", + description="Radius from the origin to the center of the cross sections", default=1.0, min=0.01, max=100.0) minor_radius = FloatProperty(name="Minor Radius", description="Radius of the torus' cross section", @@ -94,7 +94,8 @@ class AddTorus(bpy.types.Operator): description="Number of segments for the minor ring of the torus", default=16, min=3, max=256) use_abso = BoolProperty(name="Use Int+Ext Controls", - description="Use the Int / Ext controls for torus dimensions", default=False) + description="Use the Int / Ext controls for torus dimensions", + default=False) abso_major_rad = FloatProperty(name="Exterior Radius", description="Total Exterior Radius of the torus", default=1.0, min=0.01, max=100.0) @@ -103,16 +104,17 @@ class AddTorus(bpy.types.Operator): default=0.5, min=0.01, max=100.0) def execute(self, context): + props = self.properties - if self.properties.use_abso == True: - extra_helper = (self.properties.abso_major_rad - self.properties.abso_minor_rad) * 0.5 - self.properties.major_radius = self.properties.abso_minor_rad + extra_helper - self.properties.minor_radius = extra_helper + if props.use_abso == True: + extra_helper = (props.abso_major_rad - props.abso_minor_rad) * 0.5 + props.major_radius = props.abso_minor_rad + extra_helper + props.minor_radius = extra_helper - verts_loc, faces = add_torus(self.properties.major_radius, - self.properties.minor_radius, - self.properties.major_segments, - self.properties.minor_segments) + verts_loc, faces = add_torus(props.major_radius, + props.minor_radius, + props.major_segments, + props.minor_segments) mesh = bpy.data.meshes.new("Torus") @@ -133,12 +135,12 @@ class AddTorus(bpy.types.Operator): ob_new.selected = True ob_new.location = scene.cursor_location - + obj_act = scene.objects.active - + if obj_act and obj_act.mode == 'EDIT': bpy.ops.object.mode_set(mode='OBJECT') - + obj_act.selected = True scene.update() # apply location #scene.objects.active = ob_new diff --git a/release/scripts/op/mesh.py b/release/scripts/op/mesh.py index 88b70509dee..78ac463248d 100644 --- a/release/scripts/op/mesh.py +++ b/release/scripts/op/mesh.py @@ -16,10 +16,11 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8-80 compliant> +# <pep8 compliant> import bpy + class MeshSelectInteriorFaces(bpy.types.Operator): '''Select faces where all edges have more then 2 face users.''' @@ -69,23 +70,23 @@ class MeshMirrorUV(bpy.types.Operator): bl_label = "Copy Mirrored UV coords" bl_register = True bl_undo = True - + def poll(self, context): ob = context.active_object return (ob and ob.type == 'MESH') - + def execute(self, context): DIR = 1 # TODO, make an option - + from Mathutils import Vector - + ob = context.active_object is_editmode = (ob.mode == 'EDIT') if is_editmode: bpy.ops.object.mode_set(mode='OBJECT', toggle=False) mesh = ob.data - + # mirror lookups mirror_gt = {} mirror_lt = {} @@ -109,7 +110,7 @@ class MeshMirrorUV(bpy.types.Operator): j = mirror_b.get(nco) if j is not None: vmap[i] = j - + active_uv_layer = None for lay in mesh.uv_textures: @@ -119,13 +120,13 @@ class MeshMirrorUV(bpy.types.Operator): fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer] fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs] - + # as a list faces = mesh.faces[:] - + fuvsel = [(False not in uv.uv_selected) for uv in active_uv_layer] fcents = [f.center for f in faces] - + # find mirror faces mirror_fm = {} for i, f in enumerate(faces): @@ -133,7 +134,7 @@ class MeshMirrorUV(bpy.types.Operator): verts.sort() verts = tuple(verts) mirror_fm[verts] = i - + fmap = {} for i, f in enumerate(faces): verts = [vmap.get(j) for j in f.verts] @@ -142,10 +143,10 @@ class MeshMirrorUV(bpy.types.Operator): j = mirror_fm.get(tuple(verts)) if j is not None: fmap[i] = j - + done = [False] * len(faces) for i, j in fmap.items(): - + if not fuvsel[i] or not fuvsel[j]: continue elif DIR == 0 and fcents[i][0] < 0.0: @@ -154,19 +155,19 @@ class MeshMirrorUV(bpy.types.Operator): continue # copy UVs - uv1= fuvs[i] - uv2= fuvs_cpy[j] - + uv1 = fuvs[i] + uv2 = fuvs_cpy[j] + # get the correct rotation v1 = faces[j].verts[:] v2 = [vmap[k] for k in faces[i].verts[:]] - + for k in range(len(uv1)): k_map = v1.index(v2[k]) - uv1[k].x = -(uv2[k_map].x-0.5) + 0.5 + uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5 uv1[k].y = uv2[k_map].y - + if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False) diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index c3961093c1f..f6c60e0da53 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -109,17 +109,17 @@ class SubdivisionSet(bpy.types.Operator): mod.sculpt_levels = level elif obj.mode == 'OBJECT': if mod.levels != level: - mod.levels = level + mod.levels = level return else: if obj.mode == 'SCULPT': - if mod.sculpt_levels+level <= mod.total_levels: + if mod.sculpt_levels + level <= mod.total_levels: mod.sculpt_levels += level elif obj.mode == 'OBJECT': - if mod.levels+level <= mod.total_levels: + if mod.levels + level <= mod.total_levels: mod.levels += level return - + elif mod.type == 'SUBSURF': if relative: mod.levels += level @@ -160,6 +160,7 @@ class ShapeTransfer(bpy.types.Operator): default=False) def _main(self, ob_act, objects, mode='OFFSET', use_clamp=False): + def me_nos(verts): return [v.normal.copy() for v in verts] @@ -170,6 +171,7 @@ class ShapeTransfer(bpy.types.Operator): me = ob.data key = ob.add_shape_key(from_mix=False) if len(me.shape_keys.keys) == 1: + key.name = "Basis" key = ob.add_shape_key(from_mix=False) # we need a rest key.name = name ob.active_shape_key_index = len(me.shape_keys.keys) - 1 @@ -187,7 +189,8 @@ class ShapeTransfer(bpy.types.Operator): orig_shape_coords = me_cos(ob_act.active_shape_key.data) orig_normals = me_nos(me.verts) - orig_coords = me_cos(me.verts) + # orig_coords = me_cos(me.verts) # the actual mverts location isnt as relyable as the base shape :S + orig_coords = me_cos(me.shape_keys.keys[0].data) for ob_other in objects: me_other = ob_other.data @@ -328,12 +331,12 @@ class JoinUVs(bpy.types.Operator): bpy.ops.object.mode_set(mode='OBJECT', toggle=False) len_faces = len(mesh.faces) - + uv_array = array.array('f', [0.0] * 8) * len_faces # seems to be the fastest way to create an array mesh.active_uv_texture.data.foreach_get("uv_raw", uv_array) objects = context.selected_editable_objects[:] - + for obj_other in objects: if obj_other.type == 'MESH': obj_other.data.tag = False @@ -344,7 +347,7 @@ class JoinUVs(bpy.types.Operator): if mesh_other != mesh: if mesh_other.tag == False: mesh_other.tag = True - + if len(mesh_other.faces) != len_faces: self.report({'WARNING'}, "Object: %s, Mesh: '%s' has %d faces, expected %d\n" % (obj_other.name, mesh_other.name, len(mesh_other.faces), len_faces)) else: @@ -352,7 +355,7 @@ class JoinUVs(bpy.types.Operator): if not uv_other: mesh_other.uv_texture_add() # should return the texture it adds uv_other = mesh_other.active_uv_texture - + # finally do the copy uv_other.data.foreach_set("uv_raw", uv_array) diff --git a/release/scripts/op/screen_play_rendered_anim.py b/release/scripts/op/screen_play_rendered_anim.py index b52bdf46ebd..c76afef06c3 100644 --- a/release/scripts/op/screen_play_rendered_anim.py +++ b/release/scripts/op/screen_play_rendered_anim.py @@ -29,6 +29,7 @@ import subprocess import os import platform + def guess_player_path(preset): if preset == 'BLENDER24': player_path = 'blender' diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py index dd2d6d4a00f..c02b14c8e55 100644 --- a/release/scripts/op/uv.py +++ b/release/scripts/op/uv.py @@ -16,11 +16,12 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8-80 compliant> +# <pep8 compliant> import bpy from bpy.props import * + class ExportUVLayout(bpy.types.Operator): '''Export the Mesh as SVG.''' @@ -28,15 +29,15 @@ class ExportUVLayout(bpy.types.Operator): bl_label = "Export UV Layout" bl_register = True bl_undo = True - + path = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, hidden=True) only_selected = BoolProperty(name="Only Selected", description="Export Only the selected UVs", default=False) - + def poll(self, context): obj = context.active_object return (obj and obj.type == 'MESH') - + def _image_size(self, context, default_width=1024, default_height=1024): # fallback if not in image context. image_width, image_height = default_width, default_height @@ -49,14 +50,14 @@ class ExportUVLayout(bpy.types.Operator): # incase no data is found. if width and height: image_width, image_height = width, height - + return image_width, image_height def execute(self, context): # for making an XML compatible string from xml.sax.saxutils import escape from os.path import basename - + obj = context.active_object is_editmode = (obj.mode == 'EDIT') if is_editmode: @@ -65,7 +66,7 @@ class ExportUVLayout(bpy.types.Operator): image_width, image_height = self._image_size(context) mesh = obj.data - + active_uv_layer = None for lay in mesh.uv_textures: if lay.active: @@ -74,21 +75,21 @@ class ExportUVLayout(bpy.types.Operator): fuvs = [(uv.uv1, uv.uv2, uv.uv3, uv.uv4) for uv in active_uv_layer] fuvs_cpy = [(uv[0].copy(), uv[1].copy(), uv[2].copy(), uv[3].copy()) for uv in fuvs] - + # as a list faces = mesh.faces[:] - + fuvsel = [(False not in uv.uv_selected) for uv in active_uv_layer] - + file = open(self.properties.path, "w") fw = file.write - + fw('<?xml version="1.0" standalone="no"?>\n') fw('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" \n') fw(' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n') fw('<svg width="%dpx" height="%dpx" viewBox="0px 0px %dpx %dpx"\n' % (image_width, image_height, image_width, image_height)) fw(' xmlns="http://www.w3.org/2000/svg" version="1.1">\n') - + desc = "%s, %s, %s (Blender %s)" % (basename(bpy.data.filename), obj.name, mesh.name, bpy.app.version_string) fw('<desc>%s</desc>\n' % escape(desc)) @@ -97,14 +98,14 @@ class ExportUVLayout(bpy.types.Operator): fill_default = 'fill="grey"' for mat in mesh.materials if mesh.materials else [None]: if mat: - fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c*255) for c in mat.diffuse_color)) + fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c * 255) for c in mat.diffuse_color)) else: fill_settings.append(fill_default) - + only_selected = self.properties.only_selected - + for i, uv in enumerate(active_uv_layer): - + if only_selected and False in uv.uv_selected: continue @@ -112,7 +113,7 @@ class ExportUVLayout(bpy.types.Operator): uvs = uv.uv1, uv.uv2, uv.uv3 else: uvs = uv.uv1, uv.uv2, uv.uv3, uv.uv4 - + try: # rare cases material index is invalid. fill = fill_settings[faces[i].material_index] except IndexError: @@ -120,14 +121,14 @@ class ExportUVLayout(bpy.types.Operator): fw('<polygon %s fill-opacity="0.5" stroke="black" stroke-width="1px" \n' % fill) fw(' points="') - + for j, uv in enumerate(uvs): x, y = uv.x, 1.0 - uv.y fw('%.3f,%.3f ' % (x * image_width, y * image_height)) fw('" />\n') fw('\n') fw('</svg>\n') - + if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False) @@ -141,6 +142,7 @@ class ExportUVLayout(bpy.types.Operator): # Register the operator bpy.types.register(ExportUVLayout) + def menu_func(self, context): default_path = bpy.data.filename.replace(".blend", ".svg") self.layout.operator(ExportUVLayout.bl_idname).path = default_path diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 95b4cb27288..86e7f2e7bde 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -43,7 +43,9 @@ rna_reverse_prop = BoolProperty(name="Reverse", description="Cycle backwards", default=False) rna_relative_prop = BoolProperty(name="Relative", - description="Apply relative to the current value (delta)", default=False) + description="Apply relative to the current value (delta)", + default=False) + def context_path_validate(context, path): import sys @@ -105,7 +107,8 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum bl_undo = True path = rna_path_prop - value = FloatProperty(name="Value", description="Assignment value", default=0.0) + value = FloatProperty(name="Value", + description="Assignment value", default=0.0) relative = rna_relative_prop execute = execute_context_assign diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py index 92fbdaee989..23d75607ba3 100644 --- a/release/scripts/templates/operator.py +++ b/release/scripts/templates/operator.py @@ -63,4 +63,4 @@ menu_func = lambda self, context: self.layout.operator("export.some_data", text= bpy.types.INFO_MT_file_export.append(menu_func) if __name__ == "__main__": - bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply")
\ No newline at end of file + bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply") diff --git a/release/scripts/templates/operator_uv.py b/release/scripts/templates/operator_uv.py index 15ae9d261a0..36d8333d49d 100644 --- a/release/scripts/templates/operator_uv.py +++ b/release/scripts/templates/operator_uv.py @@ -17,7 +17,7 @@ def main(context): for j, v_idx in enumerate(mesh.faces[i].verts): if uv.uv_selected[j]: # apply the location of the vertex as a UV - uvs[j][:] = mesh.verts[v_idx].co.xy + uvs[j][:] = mesh.verts[v_idx].co.xy if is_editmode: diff --git a/release/scripts/templates/panel_simple.py b/release/scripts/templates/panel_simple.py index fd05e5031f7..aac4b6e715e 100644 --- a/release/scripts/templates/panel_simple.py +++ b/release/scripts/templates/panel_simple.py @@ -5,10 +5,10 @@ class OBJECT_PT_hello(bpy.types.Panel): bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - + def draw(self, context): layout = self.layout - + obj = context.object row = layout.row() diff --git a/release/scripts/ui/properties_animviz.py b/release/scripts/ui/properties_animviz.py index 2085030a29c..89d526ab8dc 100644 --- a/release/scripts/ui/properties_animviz.py +++ b/release/scripts/ui/properties_animviz.py @@ -24,6 +24,7 @@ narrowui = 180 ################################################ # Generic Panels (Independent of DataType) + class MotionPathButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -31,9 +32,9 @@ class MotionPathButtonsPanel(bpy.types.Panel): def draw_settings(self, context, avs, wide_ui, bones=False): layout = self.layout - + mps = avs.motion_paths - + if wide_ui: layout.prop(mps, "type", expand=True) else: @@ -61,6 +62,7 @@ class MotionPathButtonsPanel(bpy.types.Panel): col.prop(mps, "highlight_keyframes", text="Keyframes") col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers") + # FIXME: this panel still needs to be ported so that it will work correctly with animviz class OnionSkinButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' @@ -99,21 +101,22 @@ class OnionSkinButtonsPanel(bpy.types.Panel): ################################################ # Specific Panels for DataTypes + class OBJECT_PT_motion_paths(MotionPathButtonsPanel): #bl_label = "Object Motion Paths" bl_context = "object" def poll(self, context): return (context.object) - + def draw(self, context): layout = self.layout - - ob = context.object + + ob = context.object wide_ui = context.region.width > narrowui - + self.draw_settings(context, ob.animation_visualisation, wide_ui) - + layout.separator() split = layout.split() @@ -124,7 +127,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel): if wide_ui: col = split.column() col.operator("object.paths_clear", text="Clear Paths") - + + class DATA_PT_motion_paths(MotionPathButtonsPanel): #bl_label = "Bone Motion Paths" bl_context = "data" @@ -132,15 +136,15 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel): def poll(self, context): # XXX: include posemode check? return (context.object) and (context.armature) - + def draw(self, context): layout = self.layout - - ob = context.object + + ob = context.object wide_ui = context.region.width > narrowui - + self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True) - + layout.separator() split = layout.split() diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 2a14ee74c4e..06452bb39c1 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -162,7 +162,10 @@ class DATA_PT_bone_groups(DataButtonsPanel): #row.operator("object.bone_group_select", text="Select") #row.operator("object.bone_group_deselect", text="Deselect") + # TODO: this panel will soon be depreceated too + + class DATA_PT_ghost(DataButtonsPanel): bl_label = "Ghost" diff --git a/release/scripts/ui/properties_data_camera.py b/release/scripts/ui/properties_data_camera.py index 44fa3013bd2..2d182506a92 100644 --- a/release/scripts/ui/properties_data_camera.py +++ b/release/scripts/ui/properties_data_camera.py @@ -121,7 +121,6 @@ class DATA_PT_camera(DataButtonsPanel): if cam.dof_object != None: col.enabled = False col.prop(cam, "dof_distance", text="Distance") - class DATA_PT_camera_display(DataButtonsPanel): diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py index 4071c7b0412..f5d66526d2c 100644 --- a/release/scripts/ui/properties_data_curve.py +++ b/release/scripts/ui/properties_data_curve.py @@ -180,11 +180,9 @@ class DATA_PT_pathanim(DataButtonsPanelCurve): layout.active = curve.use_path - row = layout.row() + col = layout.column() layout.prop(curve, "path_length", text="Frames") - - if wide_ui: - row.label() + layout.prop(curve, "eval_time") split = layout.split() @@ -283,7 +281,7 @@ class DATA_PT_font(DataButtonsPanel): wide_ui = context.region.width > narrowui layout.template_ID(text, "font", open="font.open", unlink="font.unlink") - + #if wide_ui: # layout.prop(text, "font") #else: diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index 2748c5e4c31..fb540eade9c 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -155,12 +155,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): ob = context.object key = ob.data.shape_keys - if key and len(key.keys): - # this is so that we get the active shapekey from the - # shapekeys block, not from object data - kb = key.keys[ob.active_shape_key.name] - else: - kb = None + kb = ob.active_shape_key wide_ui = context.region.width > narrowui enable_edit = ob.mode != 'EDIT' @@ -299,4 +294,3 @@ bpy.types.register(DATA_PT_uv_texture) bpy.types.register(DATA_PT_vertex_colors) bpy.types.register(DATA_PT_custom_props_mesh) - diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py index 8951693aaac..60b9bd3432e 100644 --- a/release/scripts/ui/properties_data_metaball.py +++ b/release/scripts/ui/properties_data_metaball.py @@ -140,5 +140,3 @@ bpy.types.register(DATA_PT_metaball) bpy.types.register(DATA_PT_metaball_element) bpy.types.register(DATA_PT_custom_props_metaball) - - diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py index 2d97ef10506..dfd44529048 100644 --- a/release/scripts/ui/properties_data_modifier.py +++ b/release/scripts/ui/properties_data_modifier.py @@ -22,6 +22,7 @@ import bpy narrowui = 180 narrowmod = 260 + class DataButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -37,7 +38,7 @@ class DATA_PT_modifiers(DataButtonsPanel): ob = context.object wide_ui = context.region.width > narrowui compact_mod = context.region.width < narrowmod - + layout.operator_menu_enum("object.modifier_add", "type") for md in ob.modifiers: @@ -602,22 +603,22 @@ class DATA_PT_modifiers(DataButtonsPanel): def SOLIDIFY(self, layout, ob, md, wide_ui): layout.prop(md, "offset") - + split = layout.split() - + col = split.column() col.label(text="Crease:") - col.prop(md, "edge_crease_inner",text="Inner") + col.prop(md, "edge_crease_inner", text="Inner") col.prop(md, "edge_crease_outer", text="Outer") col.prop(md, "edge_crease_rim", text="Rim") - + if wide_ui: col = split.column() col.label() col.prop(md, "use_rim") col.prop(md, "use_even_offset") col.prop(md, "use_quality_normals") - + # col = layout.column() # col.label(text="Vertex Group:") # col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") @@ -728,4 +729,4 @@ class DATA_PT_modifiers(DataButtonsPanel): col.prop(md, "width", slider=True) col.prop(md, "narrowness", slider=True) -bpy.types.register(DATA_PT_modifiers)
\ No newline at end of file +bpy.types.register(DATA_PT_modifiers) diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index 863e596d701..bd3b6f86e7e 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -103,7 +103,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): col = row.column(align=True) col.operator("object.material_slot_add", icon='ZOOMIN', text="") col.operator("object.material_slot_remove", icon='ZOOMOUT', text="") - + col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="") if ob.mode == 'EDIT': @@ -653,6 +653,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): sub.prop(rayt, "gloss_threshold", text="Threshold") sub.prop(rayt, "gloss_samples", text="Samples") + class MATERIAL_PT_transp_game(MaterialButtonsPanel): bl_label = "Transparency" bl_default_closed = True @@ -686,7 +687,7 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel): col = split.column() col.prop(mat, "alpha") - + class MATERIAL_PT_halo(MaterialButtonsPanel): bl_label = "Halo" @@ -788,6 +789,7 @@ bpy.types.register(MATERIAL_PT_options) bpy.types.register(MATERIAL_PT_shadow) bpy.types.register(MATERIAL_PT_transp_game) + class VolumeButtonsPanel(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py index 3b539506552..181560751ea 100644 --- a/release/scripts/ui/properties_object.py +++ b/release/scripts/ui/properties_object.py @@ -179,7 +179,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel): if wide_ui: col = split.column() col.prop(group, "dupli_offset", text="") - + prop = col.operator("wm.context_set_value", text="From Cursor") prop.path = "object.group_users[%d].dupli_offset" % index prop.value = value diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py index 21afadfa425..fcd342cf377 100644 --- a/release/scripts/ui/properties_object_constraint.py +++ b/release/scripts/ui/properties_object_constraint.py @@ -460,12 +460,12 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.prop(con, "use_offset") self.space_template(layout, con, wide_ui) - + def COPY_TRANSFORMS(self, context, layout, con, wide_ui): self.target_template(layout, con, wide_ui) self.space_template(layout, con, wide_ui) - + #def SCRIPT(self, context, layout, con): @@ -566,7 +566,7 @@ class ConstraintButtonsPanel(bpy.types.Panel): if wide_ui: row.label(text="Min/Max:") row.prop(con, "floor_location", expand=True) - + self.space_template(layout, con, wide_ui) def RIGID_BODY_JOINT(self, context, layout, con, wide_ui): @@ -744,18 +744,14 @@ class BONE_PT_constraints(ConstraintButtonsPanel): bl_context = "bone_constraint" def poll(self, context): - ob = context.object - return (ob and ob.type == 'ARMATURE' and context.bone) + return (context.pose_bone) def draw(self, context): layout = self.layout - ob = context.object - pchan = ob.pose.bones[context.bone.name] - layout.operator_menu_enum("pose.constraint_add", "type") - for con in pchan.constraints: + for con in context.pose_bone.constraints: self.draw_constraint(context, con) bpy.types.register(OBJECT_PT_constraints) diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 0ce8d1dca3e..7a936168961 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -74,7 +74,7 @@ class SCENE_PT_unit(SceneButtonsPanel): if wide_ui: col = split.column() col.prop(unit, "use_separate") - + layout.column().prop(unit, "rotation_units") @@ -102,6 +102,11 @@ class SCENE_PT_keying_sets(SceneButtonsPanel): col = row.column() col.prop(ks, "name") col.prop(ks, "absolute") + + subcol = col.column() + subcol.operator_context = 'INVOKE_DEFAULT' + op = subcol.operator("anim.keying_set_export", text="Export to File") + op.path = "keyingset.py" if wide_ui: col = row.column() @@ -180,6 +185,7 @@ class SCENE_PT_physics(SceneButtonsPanel): else: layout.column().prop(scene, "gravity", text="") + class SCENE_PT_simplify(SceneButtonsPanel): bl_label = "Simplify" COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -188,7 +194,7 @@ class SCENE_PT_simplify(SceneButtonsPanel): scene = context.scene rd = scene.render_data self.layout.prop(rd, "use_simplify", text="") - + def draw(self, context): layout = self.layout scene = context.scene @@ -217,3 +223,117 @@ bpy.types.register(SCENE_PT_simplify) bpy.types.register(SCENE_PT_custom_props) +################################ + +from bpy.props import * + +class ANIM_OT_keying_set_export(bpy.types.Operator): + "Export Keying Set to a python script." + bl_idname = "anim.keying_set_export" + bl_label = "Export Keying Set..." + + path = bpy.props.StringProperty(name="File Path", description="File path to write file to.") + filename = bpy.props.StringProperty(name="File Name", description="Name of the file.") + directory = bpy.props.StringProperty(name="Directory", description="Directory of the file.") + filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True, hidden=True) + filter_text = bpy.props.BoolProperty(name="Filter text", description="", default=True, hidden=True) + filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, hidden=True) + + def execute(self, context): + if not self.properties.path: + raise Exception("File path not set.") + + f = open(self.properties.path, "w") + if not f: + raise Exception("Could not open file.") + + scene = context.scene + ks = scene.active_keying_set + + + f.write("# Keying Set: %s\n" % ks.name) + + f.write("import bpy\n\n") + f.write("scene= bpy.data.scenes[0]\n\n") + + # Add KeyingSet and set general settings + f.write("# Keying Set Level declarations\n") + f.write("ks= scene.add_keying_set(name=\"%s\")\n" % ks.name) + + if ks.absolute is False: + f.write("ks.absolute = False\n") + f.write("\n") + + f.write("ks.insertkey_needed = %s\n" % ks.insertkey_needed) + f.write("ks.insertkey_visual = %s\n" % ks.insertkey_visual) + f.write("ks.insertkey_xyz_to_rgb = %s\n" % ks.insertkey_xyz_to_rgb) + f.write("\n") + + + # generate and write set of lookups for id's used in paths + id_to_paths_cache = {} # cache for syncing ID-blocks to bpy paths + shorthands + + for ksp in ks.paths: + if ksp.id is None: + continue; + if ksp.id in id_to_paths_cache: + continue; + + # - idtype_list is used to get the list of id-datablocks from bpy.data.* + # since this info isn't available elsewhere + # - id.bl_rna.name gives a name suitable for UI, + # with a capitalised first letter, but we need + # the plural form that's all lower case + idtype_list = ksp.id.bl_rna.name.lower() + "s" + id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name) + + # shorthand ID for the ID-block (as used in the script) + short_id = "id_%d" % len(id_to_paths_cache) + + # store this in the cache now + id_to_paths_cache[ksp.id] = [short_id, id_bpy_path] + + f.write("# ID's that are commonly used\n") + for id_pair in id_to_paths_cache.values(): + f.write("%s = %s\n" % (id_pair[0], id_pair[1])) + f.write("\n") + + + # write paths + f.write("# Path Definitions\n") + for ksp in ks.paths: + f.write("ksp = ks.add_destination(") + + # id-block + RNA-path + if ksp.id: + # find the relevant shorthand from the cache + id_bpy_path = id_to_paths_cache[ksp.id][0] + else: + id_bpy_path = "None" # XXX... + f.write("%s, '%s'" % (id_bpy_path, ksp.data_path)) + + # array index settings (if applicable) + if ksp.entire_array is False: + f.write(", entire_array=False, array_index=%d" % ksp.array_index) + + # grouping settings (if applicable) + # NOTE: the current default is KEYINGSET, but if this changes, change this code too + if ksp.grouping == 'NAMED': + f.write(", grouping_method='%s', group_name=\"%s\"" % (ksp.grouping, ksp.group)) + elif ksp.grouping != 'KEYINGSET': + f.write(", grouping_method='%s'" % ksp.grouping) + + # finish off + f.write(")\n") + + f.write("\n") + f.close() + + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.manager + wm.add_fileselect(self) + return {'RUNNING_MODAL'} + +bpy.types.register(ANIM_OT_keying_set_export) diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index 5f742ddcfb9..7de0df2dfe4 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -103,23 +103,23 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): col = row.column(align=True) col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP' col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN' - + if wide_ui: split = layout.split(percentage=0.65) col = split.column() else: col = layout.column() - + if tex_collection: col.template_ID(idblock, "active_texture", new="texture.new") elif node: col.template_ID(node, "texture", new="texture.new") elif idblock: col.template_ID(idblock, "texture", new="texture.new") - + if space.pin_id: col.template_ID(space, "pin_id") - + if wide_ui: col = split.column() @@ -281,7 +281,7 @@ class TEXTURE_PT_influence(TextureSlotPanel): idblock = context_tex_datablock(context) if type(idblock) == bpy.types.Brush: return False - + return context.texture_slot def draw(self, context): @@ -848,7 +848,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel): layout.prop(vd, "domain_object") layout.prop(vd, "smoke_data_type") elif vd.file_format == 'IMAGE_SEQUENCE': - layout.template_image(tex, "image", tex.image_user) + layout.template_image(tex, "image", tex.image_user) layout.prop(vd, "still") row = layout.row() diff --git a/release/scripts/ui/properties_world.py b/release/scripts/ui/properties_world.py index 2633aeb6cc9..a30dacb6eb3 100644 --- a/release/scripts/ui/properties_world.py +++ b/release/scripts/ui/properties_world.py @@ -181,6 +181,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): split.prop(light, "ao_factor", text="Factor") split.prop(light, "ao_blend_mode", text="") + class WORLD_PT_environment_lighting(WorldButtonsPanel): bl_label = "Environment Lighting" COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -199,6 +200,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel): split.prop(light, "environment_energy", text="Energy") split.prop(light, "environment_color", text="") + class WORLD_PT_indirect_lighting(WorldButtonsPanel): bl_label = "Indirect Lighting" COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -217,6 +219,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel): split.prop(light, "indirect_factor", text="Factor") split.prop(light, "indirect_bounces", text="Bounces") + class WORLD_PT_gather(WorldButtonsPanel): bl_label = "Gather" COMPAT_ENGINES = {'BLENDER_RENDER'} diff --git a/release/scripts/ui/space_graph.py b/release/scripts/ui/space_graph.py index c1d3b87a9de..e4752877c2f 100644 --- a/release/scripts/ui/space_graph.py +++ b/release/scripts/ui/space_graph.py @@ -70,7 +70,7 @@ class GRAPH_MT_view(bpy.types.Menu): layout.operator("graph.properties", icon='MENU_PANEL') layout.separator() - + layout.prop(st, "realtime_updates") layout.prop(st, "show_cframe_indicator") layout.prop(st, "show_cursor") diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py index e21b1c3d1da..da9151906ba 100644 --- a/release/scripts/ui/space_image.py +++ b/release/scripts/ui/space_image.py @@ -387,22 +387,24 @@ class IMAGE_PT_game_properties(bpy.types.Panel): col.separator() col.prop(ima, "mapping", expand=True) + class IMAGE_PT_view_histogram(bpy.types.Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'PREVIEW' bl_label = "Histogram" - + def poll(self, context): sima = context.space_data return (sima and sima.image) - + def draw(self, context): layout = self.layout sima = context.space_data - + layout.template_histogram(sima, "histogram") + class IMAGE_PT_view_properties(bpy.types.Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index d027700ccd4..c23d93ae77b 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -90,7 +90,7 @@ class INFO_MT_file(bpy.types.Menu): layout.separator() layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES') - + layout.operator_context = 'EXEC_AREA' layout.operator("wm.read_homefile", text="Load Factory Settings").factory = True @@ -129,6 +129,7 @@ class INFO_MT_file_open_recent(bpy.types.Menu): layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line file.close() + class INFO_MT_file_import(bpy.types.Menu): bl_idname = "INFO_MT_file_import" bl_label = "Import" diff --git a/release/scripts/ui/space_node.py b/release/scripts/ui/space_node.py index 3dc26f49a6f..68372d8957f 100644 --- a/release/scripts/ui/space_node.py +++ b/release/scripts/ui/space_node.py @@ -120,7 +120,7 @@ class NODE_MT_node(bpy.types.Menu): layout.separator() layout.operator("node.link_make") - layout.operator("node.link_make", text="Make and Replace Links").replace=True + layout.operator("node.link_make", text="Make and Replace Links").replace = True layout.separator() layout.operator("node.group_edit") diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 42b6b1d1a54..5a98b4d0fcf 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -18,10 +18,14 @@ # <pep8 compliant> import bpy -import os, re, shutil +import os +import re +import shutil + -# General UI Theme Settings (User Interface) def ui_items_general(col, context): + """ General UI Theme Settings (User Interface) + """ row = col.row() sub = row.column() sub.prop(context, "outline") @@ -38,9 +42,10 @@ def ui_items_general(col, context): subsub.active = context.shaded subsub.prop(context, "shadetop") subsub.prop(context, "shadedown") - + col.separator() - + + def opengl_lamp_buttons(column, lamp): split = column.split(percentage=0.1) @@ -244,6 +249,13 @@ class USERPREF_PT_interface(bpy.types.Panel): col.prop(view, "view2d_grid_minimum_spacing", text="Minimum Grid Spacing") col.prop(view, "timecode_style") + col.separator() + col.separator() + + col.label(text="2D Viewports:") + col.prop(view, "view2d_grid_minimum_spacing", text="Minimum Grid Spacing") + col.prop(view, "timecode_style") + row.separator() row.separator() @@ -427,10 +439,10 @@ class USERPREF_PT_system(bpy.types.Panel): col.separator() col.separator() col.separator() - + col.label(text="Screencast:") col.prop(system, "screencast_fps") - col.prop(system, "screencast_wait_time") + col.prop(system, "screencast_wait_time") col.separator() col.separator() col.separator() @@ -448,7 +460,7 @@ class USERPREF_PT_system(bpy.types.Panel): #col.separator() #col.prop(system, "use_textured_fonts") - + # 2. Column column = split.column() @@ -462,7 +474,7 @@ class USERPREF_PT_system(bpy.types.Panel): #Anti-aliasing is disabled as it breaks broder/lasso select #col.prop(system, "use_antialiasing") col.label(text="Window Draw Method:") - col.row().prop(system, "window_draw_method", expand=True) + col.prop(system, "window_draw_method", text="") col.label(text="Textures:") col.prop(system, "gl_texture_limit", text="Limit Size") col.prop(system, "texture_time_out", text="Time Out") @@ -475,7 +487,7 @@ class USERPREF_PT_system(bpy.types.Panel): col.label(text="Sequencer:") col.prop(system, "prefetch_frames") col.prop(system, "memory_cache_limit") - + # 3. Column column = split.column() @@ -486,27 +498,27 @@ class USERPREF_PT_system(bpy.types.Panel): split.label() split.label(text="Colors:") split.label(text="Direction:") - + lamp = system.solid_lights[0] opengl_lamp_buttons(column, lamp) - + lamp = system.solid_lights[1] opengl_lamp_buttons(column, lamp) - + lamp = system.solid_lights[2] opengl_lamp_buttons(column, lamp) column.separator() column.separator() column.separator() - + column.label(text="Color Picker Type:") column.row().prop(system, "color_picker_type", text="") - + column.separator() column.separator() column.separator() - + column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range") sub = column.column() sub.active = system.use_weight_color_range @@ -532,7 +544,7 @@ class USERPREF_PT_theme(bpy.types.Panel): split_themes.prop(theme, "theme_area", expand=True) split = split_themes.split() - + if theme.theme_area == 'USER_INTERFACE': col = split.column() @@ -939,19 +951,18 @@ class USERPREF_PT_theme(bpy.types.Panel): col = split.column() col.prop(prefs, "header_text") - + elif theme.theme_area == 'CONSOLE': prefs = theme.console - + col = split.column() col.prop(prefs, "header") - + col = split.column() col.prop(prefs, "line_output") col.prop(prefs, "line_input") col.prop(prefs, "line_info") col.prop(prefs, "line_error") - class USERPREF_PT_file(bpy.types.Panel): @@ -1062,7 +1073,7 @@ class USERPREF_PT_input(bpy.types.Panel): row = col.row() row.prop(km, "children_expanded", text="", no_bg=True) row.label(text=km.name) - + row.label() row.label() @@ -1156,7 +1167,7 @@ class USERPREF_PT_input(bpy.types.Panel): # Expanded, additional event settings if kmi.expanded: box = col.box() - + box.enabled = km.user_defined if map_type not in ('TEXTINPUT', 'TIMER'): @@ -1186,8 +1197,8 @@ class USERPREF_PT_input(bpy.types.Panel): subrow.prop(kmi, "alt") subrow.prop(kmi, "oskey", text="Cmd") subrow.prop(kmi, "key_modifier", text="", event=True) - - def display_properties(properties, title = None): + + def display_properties(properties, title=None): box.separator() if title: box.label(text=title) @@ -1196,7 +1207,7 @@ class USERPREF_PT_input(bpy.types.Panel): if not properties.is_property_hidden(pname): value = eval("properties." + pname) if isinstance(value, bpy.types.OperatorProperties): - display_properties(value, title = pname) + display_properties(value, title=pname) else: flow.prop(properties, pname) @@ -1268,6 +1279,7 @@ class USERPREF_PT_input(bpy.types.Panel): for km in kc.keymaps: km = km.active() + layout.set_context_pointer("keymap", km) filtered_items = [kmi for kmi in km.items if filter in kmi.name.lower()] @@ -1282,10 +1294,8 @@ class USERPREF_PT_input(bpy.types.Panel): if km.user_defined: op = row.operator("wm.keymap_restore", text="Restore") - op.keymap = km else: op = row.operator("wm.keymap_edit", text="Edit") - op.keymap = km for kmi in filtered_items: self.draw_kmi(kc, km, kmi, col, 1) @@ -1295,7 +1305,6 @@ class USERPREF_PT_input(bpy.types.Panel): subcol = col.split(percentage=0.2).column() subcol.active = km.user_defined op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN') - op.keymap = km def draw_hierarchy(self, defkc, layout): for entry in KM_HIERARCHY: @@ -1303,9 +1312,9 @@ class USERPREF_PT_input(bpy.types.Panel): def draw(self, context): layout = self.layout - + #import time - + #start = time.time() userpref = context.user_preferences @@ -1330,7 +1339,7 @@ class USERPREF_PT_input(bpy.types.Panel): row = subcol.row() row.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="Configuration:") - layout.set_context_pointer("keyconfig", wm.active_keyconfig) + layout.set_context_pointer("keyconfig", wm.active_keyconfig) row.operator("wm.keyconfig_remove", text="", icon='X') row.prop(kc, "filter", icon="VIEWZOOM") @@ -1341,7 +1350,7 @@ class USERPREF_PT_input(bpy.types.Panel): self.draw_filtered(kc, col) else: self.draw_hierarchy(kc, col) - + #print("runtime", time.time() - start) bpy.types.register(USERPREF_HT_header) @@ -1385,7 +1394,7 @@ class WM_OT_keyconfig_test(bpy.types.Operator): s.append(", key_modifier=\'%s\'" % kmi.key_modifier) s.append(")\n") - + def export_properties(prefix, properties): for pname in dir(properties): if not properties.is_property_hidden(pname): @@ -1491,6 +1500,7 @@ def _string_value(value): return result + class WM_OT_keyconfig_import(bpy.types.Operator): "Import key configuration from a python script." bl_idname = "wm.keyconfig_import" @@ -1517,28 +1527,28 @@ class WM_OT_keyconfig_import(bpy.types.Operator): for line in f.readlines(): match = name_pattern.match(line) - + if match: config_name = match.groups()[0] - + f.close() - + path = os.path.split(os.path.split(__file__)[0])[0] # remove ui/space_userpref.py path = os.path.join(path, "cfg") - + # create config folder if needed if not os.path.exists(path): - os.mkdir(path) - + os.mkdir(path) + path = os.path.join(path, config_name + ".py") - + if self.properties.keep_original: shutil.copy(self.properties.path, path) else: shutil.move(self.properties.path, path) - - __import__(config_name) - + + __import__(config_name) + wm = bpy.data.window_managers[0] wm.active_keyconfig = wm.keyconfigs[config_name] @@ -1548,7 +1558,8 @@ class WM_OT_keyconfig_import(bpy.types.Operator): wm = context.manager wm.add_fileselect(self) return {'RUNNING_MODAL'} - + + class WM_OT_keyconfig_export(bpy.types.Operator): "Export key configuration to a python script." bl_idname = "wm.keyconfig_export" @@ -1617,9 +1628,9 @@ class WM_OT_keyconfig_export(bpy.types.Operator): value = _string_value(value) if value != "": f.write(prefix + ".%s = %s\n" % (pname, value)) - + props = kmi.properties - + if props is not None: export_properties("kmi.properties", props) @@ -1672,7 +1683,7 @@ class WM_OT_keyitem_restore(bpy.types.Operator): bl_idname = "wm.keyitem_restore" bl_label = "Restore Key Map Item" - item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") + item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") def execute(self, context): wm = context.manager @@ -1713,8 +1724,8 @@ class WM_OT_keyitem_remove(bpy.types.Operator): bl_idname = "wm.keyitem_remove" bl_label = "Remove Key Map Item" - item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") - + item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove") + def execute(self, context): wm = context.manager km = context.keymap @@ -1722,6 +1733,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator): km.remove_item(kmi) return {'FINISHED'} + class WM_OT_keyconfig_remove(bpy.types.Operator): "Remove key config." bl_idname = "wm.keyconfig_remove" @@ -1733,18 +1745,18 @@ class WM_OT_keyconfig_remove(bpy.types.Operator): def execute(self, context): wm = context.manager - + keyconfig = wm.active_keyconfig - + module = __import__(keyconfig.name) - + os.remove(module.__file__) compiled_path = module.__file__ + "c" # for .pyc - + if os.path.exists(compiled_path): os.remove(compiled_path) - + wm.remove_keyconfig(keyconfig) return {'FINISHED'} diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 225f7c5c5bb..2cc056ac04a 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -854,6 +854,7 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu): # ********** Weight paint menu ********** + class VIEW3D_MT_paint_weight(bpy.types.Menu): bl_label = "Weights" @@ -1012,7 +1013,7 @@ class VIEW3D_MT_pose(bpy.types.Menu): layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS' layout.operator("pose.flip_names") - + layout.operator("pose.quaternions_flip") layout.separator() @@ -1130,7 +1131,7 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu): layout.separator() - layout.operator("mesh.extrude_move") + layout.operator("wm.call_menu", text="Extrude").name = "VIEW3D_MT_edit_mesh_extrude" layout.operator("mesh.duplicate_move") layout.operator("mesh.delete", text="Delete...") @@ -1197,6 +1198,19 @@ class VIEW3D_MT_edit_mesh_selection_mode(bpy.types.Menu): prop.value = "(False, False, True)" prop.path = "tool_settings.mesh_selection_mode" +class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): + bl_label = "Extrude" + + def draw(self, context): + layout = self.layout + + layout.operator_context = 'INVOKE_REGION_WIN' + + layout.operator("mesh.extrude_region_move", text="Region") + layout.operator("mesh.extrude_faces_move", text="Individual Faces") + layout.operator("mesh.extrude_edges_move", text="Edges Only") + layout.operator("mesh.extrude_vertices_move", text="Vertices Only") + class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu): bl_label = "Vertices" @@ -1756,6 +1770,7 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): row.enabled = region.lock_rotation and region.box_preview row.prop(region, "box_clip") + class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' @@ -1834,7 +1849,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel): layout = self.layout view = context.space_data - + col = layout.column() col.operator("view3d.add_background_image", text="Add Image") @@ -1845,9 +1860,9 @@ class VIEW3D_PT_background_image(bpy.types.Panel): row.prop(bg, "show_expanded", text="", no_bg=True) row.label(text=getattr(bg.image, "name", "Not Set")) row.operator("view3d.remove_background_image", text="", icon='X').index = i - + box.prop(bg, "view_axis", text="Axis") - + if bg.show_expanded: row = box.row() row.template_ID(bg, "image", open="image.open") @@ -1859,7 +1874,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel): row = box.row(align=True) row.prop(bg, "offset_x", text="X") row.prop(bg, "offset_y", text="Y") - + class VIEW3D_PT_transform_orientations(bpy.types.Panel): bl_space_type = 'VIEW_3D' @@ -2030,6 +2045,7 @@ bpy.types.register(VIEW3D_MT_edit_mesh_edges) bpy.types.register(VIEW3D_MT_edit_mesh_faces) bpy.types.register(VIEW3D_MT_edit_mesh_normals) bpy.types.register(VIEW3D_MT_edit_mesh_showhide) +bpy.types.register(VIEW3D_MT_edit_mesh_extrude) bpy.types.register(VIEW3D_MT_edit_curve) bpy.types.register(VIEW3D_MT_edit_curve_ctrlpoints) diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index ece0bfd7947..e8e892f682f 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -99,7 +99,7 @@ class VIEW3D_PT_tools_meshedit(View3DPanel): col = layout.column(align=True) col.label(text="Add:") - col.operator("mesh.extrude_move") + col.operator("wm.call_menu", text="Extrude").name = "VIEW3D_MT_edit_mesh_extrude" col.operator("mesh.subdivide") col.operator("mesh.loopcut_slide") col.operator("mesh.duplicate_move", text="Duplicate") @@ -644,13 +644,14 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel): settings = self.paint_settings(context) brush = settings.brush tex_slot = brush.texture_slot - + col = layout.column() - + col.template_ID_preview(brush, "texture", new="texture.new", rows=2, cols=4) - + col.row().prop(tex_slot, "map_mode", expand=True) - + + class VIEW3D_PT_tools_brush_tool(PaintPanel): bl_label = "Tool" bl_default_closed = True @@ -658,7 +659,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel): def poll(self, context): settings = self.paint_settings(context) return (settings and settings.brush and - (context.sculpt_object or context.texture_paint_object or + (context.sculpt_object or context.texture_paint_object or context.vertex_paint_object or context.weight_paint_object)) def draw(self, context): diff --git a/source/SConscript b/source/SConscript index e4e89671653..3944a3c6df5 100644 --- a/source/SConscript +++ b/source/SConscript @@ -10,5 +10,5 @@ if env['WITH_BF_GAMEENGINE']: if env['WITH_BF_PLAYER']: SConscript (['blenderplayer/bad_level_call_stubs/SConscript']) -if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw'): +if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw', 'linuxcross'): SConscript (['icons/SConscript']) diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index 91edc46ba8b..34ffaa71c76 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -11,7 +11,7 @@ incs += ' ' + env['BF_GETTEXT_INC'] defs = [] -if sys.platform == 'win32': +if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross': defs.append('_WIN32') defs.append('USE_GETTEXT_DLL') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 45df0913079..666ecf7d65d 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -43,7 +43,7 @@ struct bContext; struct ReportList; #define BLENDER_VERSION 250 -#define BLENDER_SUBVERSION 15 +#define BLENDER_SUBVERSION 16 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 9684aa1c602..20a7ea77e1b 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -60,7 +60,7 @@ typedef struct Global { /* strings of recent opend files */ struct ListBase recent_files; - short afbreek, moving; + short afbreek, moving, file_loaded; short background; short winpos, displaymode; /* used to be in Render */ short rendering; /* to indicate render is busy, prevent renderwindow events etc */ diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 8722485b97d..82ef525ba91 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -41,7 +41,8 @@ void sound_init(); void sound_exit(); -void sound_disable(); +void sound_force_device(int device); +int sound_define_from_str(char *str); struct bSound* sound_new_file(struct Main *main, char* filename); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 2084dc7ede7..ee84b8e010c 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1010,7 +1010,8 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) Object *ob= (Object *)dtar->id; bPoseChannel *pchan; float mat[4][4]; - short rotOrder = 0; + float eul[3] = {0.0f,0.0f,0.0f}; + short useEulers=0, rotOrder=ROT_MODE_EUL; /* check if this target has valid data */ if ((ob == NULL) || (GS(dtar->id->name) != ID_OB)) { @@ -1025,7 +1026,11 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) /* check if object or bone, and get transform matrix accordingly */ if (pchan) { /* bone */ - rotOrder= (pchan->rotmode > 0) ? pchan->rotmode : ROT_MODE_EUL; + if (pchan->rotmode > 0) { + VECCOPY(eul, pchan->eul); + rotOrder= pchan->rotmode; + useEulers = 1; + } if (dtar->flag & DTAR_FLAG_LOCALSPACE) copy_m4_m4(mat, pchan->chan_mat); @@ -1034,7 +1039,11 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) } else { /* object */ - rotOrder= (ob->rotmode > 0) ? ob->rotmode : ROT_MODE_EUL; + if (ob->rotmode > 0) { + VECCOPY(eul, ob->rot); + rotOrder= ob->rotmode; + useEulers = 1; + } if (dtar->flag & DTAR_FLAG_LOCALSPACE) object_to_mat4(ob, mat); @@ -1055,10 +1064,10 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) return scale[dtar->transChan - DTAR_TRANSCHAN_SCALEX]; } else if (dtar->transChan >= DTAR_TRANSCHAN_ROTX) { - /* extract euler rotation, and choose the right axis */ - float eul[3]; + /* extract euler rotation (if needed), and choose the right axis */ + if ((dtar->flag & DTAR_FLAG_LOCALSPACE)==0 || (useEulers == 0)) + mat4_to_eulO(eul, rotOrder, mat); - mat4_to_eulO(eul, rotOrder, mat); return eul[dtar->transChan - DTAR_TRANSCHAN_ROTX]; } else { diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index ac4d0fe730a..dad38962743 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -432,7 +432,7 @@ DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifie } BLI_convertstringcode(targetDir, G.sce); - BLI_convertstringframe(targetDir, curFrame); // fixed #frame-no + BLI_convertstringframe(targetDir, curFrame, 0); // fixed #frame-no strcpy(targetFile,targetDir); strcat(targetFile, ".bobj.gz"); diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index cca3d561ed4..a05e8516260 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -392,7 +392,6 @@ Image *BKE_add_image_file(const char *name, int frame) BLI_strncpy(str, name, sizeof(str)); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, frame); /* exists? */ file= open(str, O_BINARY|O_RDONLY); @@ -404,7 +403,6 @@ Image *BKE_add_image_file(const char *name, int frame) if(ima->source!=IMA_SRC_VIEWER && ima->source!=IMA_SRC_GENERATED) { BLI_strncpy(strtest, ima->name, sizeof(ima->name)); BLI_convertstringcode(strtest, G.sce); - BLI_convertstringframe(strtest, frame); if( strcmp(strtest, str)==0 ) { if(ima->anim==NULL || ima->id.us==0) { @@ -1412,15 +1410,9 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ext) { if (string==NULL) return; - BLI_strncpy(string, base, FILE_MAX - 10); /* weak assumption */ - - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - BLI_convertstringcode(string, G.sce); - BLI_convertstringframe(string, frame); + BLI_convertstringframe(string, frame, 4); if(use_ext) BKE_add_image_extension(string, imtype); @@ -1675,8 +1667,6 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) else BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, frame); /* TODO - should this be here? */ - /* read ibuf */ ibuf = IMB_loadiffname(name, IB_rect|IB_multilayer); if(G.f & G_DEBUG) printf("loaded %s\n", name); @@ -1838,7 +1828,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) else BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, cfra); + BLI_convertstringframe(str, cfra, 0); /* read ibuf */ ibuf = IMB_loadiffname(str, IB_rect|IB_multilayer|IB_imginfo); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c43b1791035..d216cefe8f8 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1069,7 +1069,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver) /* Add F-Curve to the correct list * - grpname is needed to be used as group name where relevant, and is usually derived from actname */ -static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, char *grpname) +static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, char *grpname, int muteipo) { /* If we're adding to an action, we will have groups to write to... */ if (groups && grpname) { @@ -1096,6 +1096,8 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c agrp= MEM_callocN(sizeof(bActionGroup), "bActionGroup"); agrp->flag = AGRP_SELECTED; + if(muteipo) agrp->flag |= AGRP_MUTED; + BLI_snprintf(agrp->name, 64, grpname); BLI_addtail(&tmp_act.groups, agrp); @@ -1107,6 +1109,9 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c /* WARNING: this func should only need to look at the stuff we initialised, if not, things may crash */ action_groups_add_channel(&tmp_act, agrp, fcu); + if(agrp->flag & AGRP_MUTED) /* flush down */ + fcu->flag |= FCURVE_MUTED; + /* set the output lists based on the ones in the temp action */ groups->first= tmp_act.groups.first; groups->last= tmp_act.groups.last; @@ -1124,7 +1129,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c * actname: name of Action-Channel (if applicable) that IPO-Curve's IPO-block belonged to * constname: name of Constraint-Channel (if applicable) that IPO-Curve's IPO-block belonged to */ -static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname) +static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, char *actname, char *constname, int muteipo) { AdrBit2Path *abp; FCurve *fcu; @@ -1240,7 +1245,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha } /* add new F-Curve to list */ - fcurve_add_to_list(groups, list, fcurve, actname); + fcurve_add_to_list(groups, list, fcurve, actname, muteipo); } } else { @@ -1314,7 +1319,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha } /* add new F-Curve to list */ - fcurve_add_to_list(groups, list, fcu, actname); + fcurve_add_to_list(groups, list, fcu, actname, muteipo); } } @@ -1355,7 +1360,7 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase if (icu->driver) { /* Blender 2.4x allowed empty drivers, but we don't now, since they cause more trouble than they're worth */ if ((icu->driver->ob) || (icu->driver->type == IPO_DRIVER_TYPE_PYTHON)) { - icu_to_fcurves(NULL, drivers, icu, actname, constname); + icu_to_fcurves(NULL, drivers, icu, actname, constname, ipo->muteipo); } else { MEM_freeN(icu->driver); @@ -1363,7 +1368,7 @@ static void ipo_to_animato (Ipo *ipo, char actname[], char constname[], ListBase } } else - icu_to_fcurves(animgroups, anim, icu, actname, constname); + icu_to_fcurves(animgroups, anim, icu, actname, constname, ipo->muteipo); } /* if this IPO block doesn't have any users after this one, free... */ diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 1f5e0ca1624..1e1c945d386 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -52,6 +52,7 @@ #include "BKE_action.h" #include "BKE_blender.h" #include "BKE_curve.h" +#include "BKE_customdata.h" #include "BKE_global.h" #include "BKE_key.h" #include "BKE_lattice.h" @@ -999,6 +1000,8 @@ static float *get_weights_array(Object *ob, char *vgroup) { bDeformGroup *curdef; MDeformVert *dvert= NULL; + EditMesh *em= NULL; + EditVert *eve; int totvert= 0, index= 0; /* no vgroup string set? */ @@ -1009,6 +1012,9 @@ static float *get_weights_array(Object *ob, char *vgroup) Mesh *me= ob->data; dvert= me->dvert; totvert= me->totvert; + + if(me->edit_mesh && me->edit_mesh->totvert == totvert) + em= me->edit_mesh; } else if(ob->type==OB_LATTICE) { Lattice *lt= ob->data; @@ -1028,15 +1034,32 @@ static float *get_weights_array(Object *ob, char *vgroup) int i, j; weights= MEM_callocN(totvert*sizeof(float), "weights"); - - for (i=0; i < totvert; i++, dvert++) { - for(j=0; j<dvert->totweight; j++) { - if (dvert->dw[j].def_nr == index) { - weights[i]= dvert->dw[j].weight; - break; + + if(em) { + for(i=0, eve=em->verts.first; eve; eve=eve->next, i++) { + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if(dvert) { + for(j=0; j<dvert->totweight; j++) { + if(dvert->dw[j].def_nr == index) { + weights[i]= dvert->dw[j].weight; + break; + } + } } } } + else { + for(i=0; i < totvert; i++, dvert++) { + for(j=0; j<dvert->totweight; j++) { + if(dvert->dw[j].def_nr == index) { + weights[i]= dvert->dw[j].weight; + break; + } + } + } + } + return weights; } return NULL; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 6dba1a2e9ba..8dca00e2e85 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3565,7 +3565,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int cfra) strcpy(filename, fss->surfdataPath); strcat(filename, suffix); BLI_convertstringcode(filename, G.sce); - BLI_convertstringframe(filename, curFrame); // fixed #frame-no + BLI_convertstringframe(filename, curFrame, 0); // fixed #frame-no strcat(filename, suffix2); gzf = gzopen(filename, "rb"); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index ad32f578a10..9fde0730011 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -583,8 +583,6 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) seq->type != SEQ_IMAGE) { BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, scene->r.cfra); - } if (seq->type == SEQ_IMAGE) { @@ -1190,7 +1188,6 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, dir, seq->strip->proxy->file); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, cfra); return TRUE; } @@ -1220,8 +1217,8 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na } BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, frameno); - + BLI_convertstringframe(name, frameno, 0); + strcat(name, ".jpg"); @@ -1988,7 +1985,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int StripElem * s_elem = give_stripelem(seq, cfra); BLI_join_dirfile(name, seq->strip->dir, s_elem->name); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, scene->r.cfra); if (!build_proxy_run) { se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); } @@ -2023,7 +2019,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int if(seq->anim==0) { BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, scene->r.cfra); seq->anim = openanim( name, IB_rect | diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3232e2677b5..1be59529cc7 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -31,11 +31,25 @@ #include <config.h> #endif -static int sound_disabled = 0; +static int force_device = -1; -void sound_disable() +int sound_define_from_str(char *str) { - sound_disabled = 1; + if (BLI_strcaseeq(str, "NULL")) + return AUD_NULL_DEVICE; + if (BLI_strcaseeq(str, "SDL")) + return AUD_SDL_DEVICE; + if (BLI_strcaseeq(str, "OPENAL")) + return AUD_OPENAL_DEVICE; + if (BLI_strcaseeq(str, "JACK")) + return AUD_JACK_DEVICE; + + return -1; +} + +void sound_force_device(int device) +{ + force_device = device; } void sound_init() @@ -49,8 +63,8 @@ void sound_init() specs.format = U.audioformat; specs.rate = U.audiorate; - if (sound_disabled) - device = 0; + if(force_device >= 0) + device = force_device; if(buffersize < 128) buffersize = AUD_DEFAULT_BUFFER_SIZE; diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 0d057525f38..a6092790706 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -129,11 +129,7 @@ static void filepath_avi (char *string, RenderData *rd) BLI_make_existing_file(string); if (!BLI_testextensie(string, ".avi")) { - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - - BLI_convertstringframe_range(string, rd->sfra, rd->efra); + BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); strcat(string, ".avi"); } } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 56924cb0dfa..9c38f84aa26 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -781,7 +781,6 @@ void filepath_ffmpeg(char* string, RenderData* rd) { strcpy(string, rd->pic); BLI_convertstringcode(string, G.sce); - BLI_convertstringframe(string, rd->cfra); BLI_make_existing_file(string); @@ -802,11 +801,7 @@ void filepath_ffmpeg(char* string, RenderData* rd) { if (!*fe) { strcat(string, autosplit); - /* if we dont have any #'s to insert numbers into, use 4 numbers by default */ - if (strchr(string, '#')==NULL) - strcat(string, "####"); /* 4 numbers */ - - BLI_convertstringframe_range(string, rd->sfra, rd->efra); + BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); strcat(string, *exts); } else { *(string + strlen(string) - strlen(*fe)) = 0; diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h new file mode 100644 index 00000000000..c953774dd40 --- /dev/null +++ b/source/blender/blenlib/BLI_args.h @@ -0,0 +1,53 @@ +/** + * A general argument parsing module + * + * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BLI_ARGS_H +#define BLI_ARGS_H + +struct bArgs; +typedef struct bArgs bArgs; + +/* returns the number of extra arguments consumed by the function. 0 is normal value, -1 stops parsing arguments, other negative indicates skip */ +typedef int (*BA_ArgCallback)(int argc, char **argv, void *data); + +struct bArgs *BLI_argsInit(int argc, char **argv); +void BLI_argsFree(struct bArgs *ba); + +/* pass starts at 1, -1 means valid all the time */ +void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data); +void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data); /* not case specific */ + +void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data); + +void BLI_argsPrint(struct bArgs *ba); +char **BLI_argsArgv(struct bArgs *ba); + +#endif diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index f9ef3d8c828..8e97511f4c5 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -97,8 +97,8 @@ int BLI_has_parent(char *path); * @retval Returns true if the path was relative (started with "//"). */ int BLI_convertstringcode(char *path, const char *basepath); -int BLI_convertstringframe(char *path, int frame); -int BLI_convertstringframe_range(char *path, int sta, int end); +int BLI_convertstringframe(char *path, int frame, int digits); +int BLI_convertstringframe_range(char *path, int sta, int end, int digits); int BLI_convertstringcwd(char *path); void BLI_makestringcode(const char *relfile, char *file); diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index bca9399bc27..df1a096cb99 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -16,4 +16,8 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] +if env['OURPLATFORM'] == 'linuxcross': + if env['WITH_BF_OPENMP']: + incs += ' ' + env['BF_OPENMP_INC'] + env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [363,170], compileflags =cflags ) diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c new file mode 100644 index 00000000000..9d67556a599 --- /dev/null +++ b/source/blender/blenlib/intern/BLI_args.c @@ -0,0 +1,201 @@ +/** + * A general argument parsing module + * + * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <ctype.h> /* for tolower */ + +#include "MEM_guardedalloc.h" + +#include "BLI_string.h" +#include "BLI_args.h" +#include "BLI_ghash.h" + +typedef struct bAKey { + char *arg; + uintptr_t pass; /* cast easier */ + int case_str; /* case specific or not */ +} bAKey; + +typedef struct bArgument { + BA_ArgCallback func; + void *data; +} bArgument; + +struct bArgs { + GHash *items; + int argc; + char **argv; + int *passes; +}; + +unsigned int case_strhash(void *ptr) { + char *s= ptr; + unsigned int i= 0; + unsigned char c; + + while ( (c= tolower(*s++)) ) + i= i*37 + c; + + return i; +} + +static unsigned int keyhash(void *ptr) +{ + bAKey *k = ptr; + return case_strhash(k->arg) ^ BLI_ghashutil_inthash((void*)k->pass); +} + +static int keycmp(void *a, void *b) +{ + bAKey *ka = a; + bAKey *kb = b; + if (ka->pass == kb->pass || ka->pass == -1 || kb->pass == -1) { /* -1 is wildcard for pass */ + if (ka->case_str == 1 || kb->case_str == 1) + return BLI_strcasecmp(ka->arg, kb->arg); + else + return strcmp(ka->arg, kb->arg); + } else { + return BLI_ghashutil_intcmp((void*)ka->pass, (void*)kb->pass); + } +} + +bArgs *BLI_argsInit(int argc, char **argv) +{ + bArgs *ba = MEM_callocN(sizeof(bArgs), "bArgs"); + ba->passes = MEM_callocN(sizeof(int) * argc, "bArgs passes"); + ba->items = BLI_ghash_new(keyhash, keycmp); + ba->argc = argc; + ba->argv = argv; + + return ba; +} + +static void freeItem(void *val) +{ + MEM_freeN(val); +} + +void BLI_argsFree(struct bArgs *ba) +{ + BLI_ghash_free(ba->items, freeItem, freeItem); + MEM_freeN(ba->passes); + MEM_freeN(ba); +} + +void BLI_argsPrint(struct bArgs *ba) +{ + int i; + for (i = 0; i < ba->argc; i++) { + printf("argv[%d] = %s\n", i, ba->argv[i]); + } +} + +char **BLI_argsArgv(struct bArgs *ba) +{ + return ba->argv; +} + +void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data) +{ + bArgument *a = MEM_callocN(sizeof(bArgument), "bArgument"); + bAKey *key = MEM_callocN(sizeof(bAKey), "bAKey"); + + key->arg = arg; + key->pass = pass; + key->case_str = 1; + + a->func = cb; + a->data = data; + + BLI_ghash_insert(ba->items, key, a); +} + +void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data) +{ + bArgument *a = MEM_callocN(sizeof(bArgument), "bArgument"); + bAKey *key = MEM_callocN(sizeof(bAKey), "bAKey"); + + key->arg = arg; + key->pass = pass; + key->case_str = 0; + + a->func = cb; + a->data = data; + + BLI_ghash_insert(ba->items, key, a); +} + + +void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data) +{ + bAKey key; + int i = 0; + + key.case_str = -1; /* signal what side of the comparison it is */ + key.pass = pass; + + for( i = 1; i < ba->argc; i++) { /* skip argv[0] */ + key.arg = ba->argv[i]; + if (ba->passes[i] == 0) { + bArgument *a = BLI_ghash_lookup(ba->items, &key); + BA_ArgCallback func = NULL; + void *data = NULL; + + if (a) { + func = a->func; + data = a->data; + } else { + func = default_cb; + data = default_data; + + if (func) { + printf("calling default on %s\n", ba->argv[i]); + } + } + + if (func) { + int retval = func(ba->argc - i, ba->argv + i, data); + + if (retval >= 0) { + int j; + + /* use extra arguments */ + for (j = 0; j <= retval; j++) { + ba->passes[i + j] = pass; + } + i += retval; + } else if (retval == -1){ + ba->passes[i] = pass; + break; + } + } + } + } +} diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 895f2d1ee56..c3ce73df6c6 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -557,9 +557,30 @@ static int stringframe_chars(char *path, int *char_start, int *char_end) } } -int BLI_convertstringframe(char *path, int frame) +static void ensure_digits(char *path, int digits) +{ + char *file= BLI_last_slash(path); + + if(file==NULL) + file= path; + + if(strrchr(file, '#') == NULL) { + int len= strlen(file); + + while(digits--) { + file[len++]= '#'; + } + file[len]= '\0'; + } +} + +int BLI_convertstringframe(char *path, int frame, int digits) { int ch_sta, ch_end; + + if(digits) + ensure_digits(path, digits); + if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */ char tmp[FILE_MAX], format[64]; sprintf(format, "%%.%ds%%.%dd%%s", ch_sta, ch_end-ch_sta); /* example result: "%.12s%.5d%s" */ @@ -570,9 +591,13 @@ int BLI_convertstringframe(char *path, int frame) return 0; } -int BLI_convertstringframe_range(char *path, int sta, int end) +int BLI_convertstringframe_range(char *path, int sta, int end, int digits) { int ch_sta, ch_end; + + if(digits) + ensure_digits(path, digits); + if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */ char tmp[FILE_MAX], format[64]; sprintf(format, "%%.%ds%%.%dd_%%.%dd%%s", ch_sta, ch_end-ch_sta, ch_end-ch_sta); /* example result: "%.12s%.5d-%.5d%s" */ diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 0133017eb4d..9bc04201419 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -346,6 +346,8 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node) GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(iter)); } + BLI_ghashIterator_free(iter); + for(i = 0; i < totface*4; ++i) if(node->face_vert_indices[i] < 0) node->face_vert_indices[i]= -node->face_vert_indices[i] + node->uniq_verts - 1; @@ -1006,6 +1008,8 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot BLI_ghashIterator_step(hiter), ++i) faces[i]= BLI_ghashIterator_getKey(hiter); + BLI_ghashIterator_free(hiter); + BLI_ghash_free(map, NULL, NULL); *totface= tot; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ec7a64ac73e..7db395c6148 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6078,6 +6078,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->alignment= RGN_ALIGN_LEFT; ar->v2d.scroll= V2D_SCROLL_BOTTOM; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; + + // for some reason, some files still don't get this auto + ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); + BLI_addtail(lb, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_RIGHT; + ar->v2d.scroll= V2D_SCROLL_RIGHT; + ar->v2d.flag = RGN_FLAG_HIDDEN; break; case SPACE_NODE: @@ -9679,7 +9687,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) char str[FILE_MAX]; BLI_join_dirfile(str, seq->strip->dir, seq->strip->stripdata->name); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, scene->r.cfra); seq->sound = sound_new_file(main, str); } } diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index f0dd24a735f..8a815418369 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -669,7 +669,7 @@ class TransformWriter : protected TransformBase protected: void add_node_transform(COLLADASW::Node& node, float mat[][4], float parent_mat[][4]) { - float loc[3], rot[3], size[3]; + float loc[3], rot[3], scale[3]; float local[4][4]; if (parent_mat) { @@ -681,27 +681,61 @@ protected: copy_m4_m4(local, mat); } - TransformBase::decompose(local, loc, rot, NULL, size); + TransformBase::decompose(local, loc, rot, NULL, scale); - /* - // this code used to create a single <rotate> representing object rotation - float quat[4]; - float axis[3]; - float angle; - double angle_deg; - eul_to_quat( quat,rot); - normalize_qt(quat); - quat_to_axis_angle( axis, &angle,quat); - angle_deg = angle * 180.0f / M_PI; - node.addRotate(axis[0], axis[1], axis[2], angle_deg); - */ - node.addTranslate("location", loc[0], loc[1], loc[2]); + add_transform(node, loc, rot, scale); + } + + void add_node_transform_ob(COLLADASW::Node& node, Object *ob) + { + float rot[3], loc[3], scale[3]; + + if (ob->parent) { + float C[4][4], D[4][4], tmat[4][4], imat[4][4], mat[4][4]; + + // factor out scale from obmat + + copy_v3_v3(scale, ob->size); + + ob->size[0] = ob->size[1] = ob->size[2] = 1.0f; + object_to_mat4(ob, C); + copy_v3_v3(ob->size, scale); + + mul_serie_m4(tmat, ob->parent->obmat, ob->parentinv, C, NULL, NULL, NULL, NULL, NULL); + + // calculate local mat + + invert_m4_m4(imat, ob->parent->obmat); + mul_m4_m4m4(mat, tmat, imat); + + // done + + mat4_to_eul(rot, mat); + copy_v3_v3(loc, mat[3]); + } + else { + copy_v3_v3(loc, ob->loc); + copy_v3_v3(rot, ob->rot); + copy_v3_v3(scale, ob->size); + } + + add_transform(node, loc, rot, scale); + } + + void add_node_transform_identity(COLLADASW::Node& node) + { + float loc[] = {0.0f, 0.0f, 0.0f}, scale[] = {1.0f, 1.0f, 1.0f}, rot[] = {0.0f, 0.0f, 0.0f}; + add_transform(node, loc, rot, scale); + } +private: + void add_transform(COLLADASW::Node& node, float loc[3], float rot[3], float scale[3]) + { + node.addTranslate("location", loc[0], loc[1], loc[2]); node.addRotateZ("rotationZ", COLLADABU::Math::Utils::radToDegF(rot[2])); node.addRotateY("rotationY", COLLADABU::Math::Utils::radToDegF(rot[1])); node.addRotateX("rotationX", COLLADABU::Math::Utils::radToDegF(rot[0])); - - node.addScale("scale", size[0], size[1], size[2]); + node.addScale("scale", scale[0], scale[1], scale[2]); } }; @@ -1238,15 +1272,11 @@ public: bool is_skinned_mesh = arm_exporter->is_skinned_mesh(ob); - float mat[4][4]; - if (ob->type == OB_MESH && is_skinned_mesh) // for skinned mesh we write obmat in <bind_shape_matrix> - unit_m4(mat); + TransformWriter::add_node_transform_identity(node); else - copy_m4_m4(mat, ob->obmat); - - TransformWriter::add_node_transform(node, mat, ob->parent ? ob->parent->obmat : NULL); + TransformWriter::add_node_transform_ob(node, ob); // <instance_geometry> if (ob->type == OB_MESH) { diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 39424797df6..8078ee2e6e0 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -1564,15 +1564,13 @@ public: return NULL; } - MTex *assign_textures_to_uvlayer(COLLADAFW::InstanceGeometry::TextureCoordinateBinding &ctexture, + MTex *assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture, Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map, MTex *color_texture) { - - COLLADAFW::TextureMapId texture_index = ctexture.textureMapId; - - char *uvname = CustomData_get_layer_name(&me->fdata, CD_MTFACE, ctexture.setIndex); - + COLLADAFW::TextureMapId texture_index = ctexture.getTextureMapId(); + char *uvname = CustomData_get_layer_name(&me->fdata, CD_MTFACE, ctexture.getSetIndex()); + if (texindex_texarray_map.find(texture_index) == texindex_texarray_map.end()) { fprintf(stderr, "Cannot find texture array by texture index.\n"); @@ -1595,7 +1593,7 @@ public: return color_texture; } - MTFace *assign_material_to_geom(COLLADAFW::InstanceGeometry::MaterialBinding cmaterial, + MTFace *assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial, std::map<COLLADAFW::UniqueId, Material*>& uid_material_map, Object *ob, const COLLADAFW::UniqueId *geom_uid, MTex **color_texture, char *layername, MTFace *texture_face, @@ -1614,7 +1612,7 @@ public: Material *ma = uid_material_map[ma_uid]; assign_material(ob, ma, ob->totcol + 1); - COLLADAFW::InstanceGeometry::TextureCoordinateBindingArray& tex_array = + COLLADAFW::TextureCoordinateBindingArray& tex_array = cmaterial.getTextureCoordinateBindingArray(); TexIndexTextureArrayMap texindex_texarray_map = material_texture_mapping_map[ma]; unsigned int i; @@ -1714,7 +1712,7 @@ public: MTFace *texture_face = NULL; MTex *color_texture = NULL; - COLLADAFW::InstanceGeometry::MaterialBindingArray& mat_array = + COLLADAFW::MaterialBindingArray& mat_array = geom->getMaterialBindings(); // loop through geom's materials @@ -3130,7 +3128,7 @@ public: ob = create_lamp_object(lamp[0], ob, sce); } else if (controller.getCount() != 0) { - COLLADAFW::InstanceController *geom = (COLLADAFW::InstanceController*)controller[0]; + COLLADAFW::InstanceGeometry *geom = (COLLADAFW::InstanceGeometry*)controller[0]; ob = mesh_importer.create_mesh_object(node, geom, true, uid_material_map, material_texture_mapping_map); } // XXX instance_node is not supported yet @@ -3284,7 +3282,6 @@ public: int i = 0; COLLADAFW::Color col; - COLLADAFW::Texture ctex; MTex *mtex = NULL; TexIndexTextureArrayMap texindex_texarray_map; @@ -3298,7 +3295,7 @@ public: } // texture else if (ef->getDiffuse().isTexture()) { - ctex = ef->getDiffuse().getTexture(); + COLLADAFW::Texture ctex = ef->getDiffuse().getTexture(); mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map); if (mtex != NULL) { mtex->mapto = MAP_COL; @@ -3316,7 +3313,7 @@ public: } // texture else if (ef->getAmbient().isTexture()) { - ctex = ef->getAmbient().getTexture(); + COLLADAFW::Texture ctex = ef->getAmbient().getTexture(); mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map); if (mtex != NULL) { mtex->mapto = MAP_AMB; @@ -3333,7 +3330,7 @@ public: } // texture else if (ef->getSpecular().isTexture()) { - ctex = ef->getSpecular().getTexture(); + COLLADAFW::Texture ctex = ef->getSpecular().getTexture(); mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map); if (mtex != NULL) { mtex->mapto = MAP_SPEC; @@ -3350,7 +3347,7 @@ public: } // texture else if (ef->getReflective().isTexture()) { - ctex = ef->getReflective().getTexture(); + COLLADAFW::Texture ctex = ef->getReflective().getTexture(); mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map); if (mtex != NULL) { mtex->mapto = MAP_REF; @@ -3365,7 +3362,7 @@ public: } // texture else if (ef->getEmission().isTexture()) { - ctex = ef->getEmission().getTexture(); + COLLADAFW::Texture ctex = ef->getEmission().getTexture(); mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map); if (mtex != NULL) { mtex->mapto = MAP_EMIT; diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index fe78a058d24..81845598162 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -753,8 +753,8 @@ BeztEditFunc ANIM_editkeyframes_mirror(short type) static short set_bezier_auto(BeztEditData *bed, BezTriple *bezt) { if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { - if (bezt->f1 & SELECT) bezt->h1= 1; /* the secret code for auto */ - if (bezt->f3 & SELECT) bezt->h2= 1; + if (bezt->f1 & SELECT) bezt->h1= HD_AUTO; /* the secret code for auto */ + if (bezt->f3 & SELECT) bezt->h2= HD_AUTO; /* if the handles are not of the same type, set them * to type free @@ -809,7 +809,7 @@ static short set_bezier_free(BeztEditData *bed, BezTriple *bezt) return 0; } -/* Set all Bezier Handles to a single type */ +/* Set all selected Bezier Handles to a single type */ // calchandles_fcurve BeztEditFunc ANIM_editkeyframes_handles(short code) { diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 2ebee2ad274..8336732a704 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -420,7 +420,7 @@ void FONT_OT_file_paste(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE); } /******************* paste buffer operator ********************/ @@ -1642,7 +1642,7 @@ void FONT_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE); } /******************* delete operator *********************/ diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index e394de613e4..53c725b811c 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -203,7 +203,6 @@ void bglVertex3f(float x, float y, float z); void bglVertex2fv(float *vec); /* intel gfx cards frontbuffer problem */ void bglFlush(void); -int is_a_really_crappy_intel_card(void); void set_inverted_drawing(int enable); void setlinestyle(int nr); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a4a7a7c5bb5..7d9d78f5b20 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -344,8 +344,8 @@ static void ui_centered_bounds_block(const bContext *C, uiBlock *block) static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_calc) { wmWindow *window= CTX_wm_window(C); - int startx, starty, endx, endy, width, height; - int oldbounds, mx, my, xmax, ymax; + int startx, starty, endx, endy, width, height, oldwidth, oldheight; + int oldbounds, xmax, ymax; oldbounds= block->bounds; @@ -354,9 +354,9 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_ wm_window_get_size(window, &xmax, &ymax); - mx= window->eventstate->x + block->minx + block->mx; - my= window->eventstate->y + block->miny + block->my; - + oldwidth= block->maxx - block->minx; + oldheight= block->maxy - block->miny; + /* first we ensure wide enough text bounds */ if(bounds_calc==UI_BLOCK_BOUNDS_POPUP_MENU) { if(block->flag & UI_BLOCK_LOOP) { @@ -373,8 +373,10 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_ width= block->maxx - block->minx; height= block->maxy - block->miny; - startx= mx-(0.8*(width)); - starty= my; + /* offset block based on mouse position, user offset is scaled + along in case we resized the block in ui_text_bounds_block */ + startx= window->eventstate->x + block->minx + (block->mx*width)/oldwidth; + starty= window->eventstate->y + block->miny + (block->my*height)/oldheight; if(startx<10) startx= 10; @@ -744,8 +746,11 @@ void uiDrawBlock(const bContext *C, uiBlock *block) ui_but_to_pixelrect(&rect, ar, block, NULL); /* pixel space for AA widgets */ - wmPushMatrix(); - wmLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); wmOrtho2(-0.01f, ar->winx-0.01f, -0.01f, ar->winy-0.01f); @@ -763,7 +768,10 @@ void uiDrawBlock(const bContext *C, uiBlock *block) } /* restore matrix */ - wmPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); ui_draw_links(block); } diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 330209ef6f5..2ba7d8bb457 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -731,7 +731,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti * glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1)); for (rgb=0; rgb<3; rgb++) { - float *data; + float *data = NULL; if (rgb==0) data = hist->data_r; else if (rgb==1) data = hist->data_g; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 019aa10e902..a751c7b7aa2 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4204,7 +4204,6 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y) { uiBlock *block; - /* check if the mouse is in the region */ if(!BLI_in_rcti(&ar->winrct, x, y)) { for(block=ar->uiblocks.first; block; block=block->next) @@ -4234,13 +4233,13 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y) mask_rct.ymin= v2d->mask.ymin; mask_rct.ymax= v2d->mask.ymax; - if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) { + if (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR)) { if (v2d->scroll & V2D_SCROLL_LEFT) mask_rct.xmin= v2d->vert.xmin; else if (v2d->scroll & V2D_SCROLL_RIGHT) mask_rct.xmax= v2d->vert.xmax; } - if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) { + if (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR)) { if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) mask_rct.ymin= v2d->hor.ymin; else if (v2d->scroll & V2D_SCROLL_TOP) @@ -4698,6 +4697,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) if(data->state == BUTTON_STATE_HIGHLIGHT) { switch(event->type) { case WINDEACTIVATE: + case EVT_BUT_CANCEL: data->cancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); retval= WM_UI_HANDLER_CONTINUE; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index b3a3da5e916..b332db09086 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1875,6 +1875,19 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu /************************ Popup Menu Memory ****************************/ +static int ui_popup_string_hash(char *str) +{ + /* sometimes button contains hotkey, sometimes not, strip for proper compare */ + int hash; + char *delimit= strchr(str, '|'); + + if(delimit) *delimit= 0; + hash= BLI_ghashutil_strhash(str); + if(delimit) *delimit= '|'; + + return hash; +} + static int ui_popup_menu_hash(char *str) { return BLI_ghashutil_strhash(str); @@ -1883,7 +1896,7 @@ static int ui_popup_menu_hash(char *str) /* but == NULL read, otherwise set */ uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but) { - static char mem[256], first=1; + static int mem[256], first=1; int hash= block->puphash; if(first) { @@ -1894,12 +1907,16 @@ uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but) if(but) { /* set */ - mem[hash & 255 ]= BLI_findindex(&block->buttons, but); + mem[hash & 255 ]= ui_popup_string_hash(but->str); return NULL; } else { /* get */ - return BLI_findlink(&block->buttons, mem[hash & 255]); + for(but=block->buttons.first; but; but=but->next) + if(ui_popup_string_hash(but->str) == mem[hash & 255]) + return but; + + return NULL; } } @@ -1924,7 +1941,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi ScrArea *sa; ARegion *ar; uiPopupMenu *pup= arg_pup; - int offset, direction, minwidth, flip; + int offset[2], direction, minwidth, width, height, flip; if(pup->menu_func) { pup->block->handle= handle; @@ -1960,7 +1977,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi block->direction= direction; - uiBlockLayoutResolve(block, NULL, NULL); + uiBlockLayoutResolve(block, &width, &height); uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); @@ -1969,17 +1986,27 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi uiBlockSetDirection(block, direction); /* offset the mouse position, possibly based on earlier selection */ - offset= 1.5*MENU_BUTTON_HEIGHT; - - if(block->flag & UI_BLOCK_POPUP_MEMORY) { - bt= ui_popup_menu_memory(block, NULL); + if((block->flag & UI_BLOCK_POPUP_MEMORY) && + (bt= ui_popup_menu_memory(block, NULL))) { + /* position mouse on last clicked item, at 0.8*width of the + button, so it doesn't overlap the text too much, also note + the offset is negative because we are inverse moving the + block to be under the mouse */ + offset[0]= -(bt->x1 + 0.8f*(bt->x2 - bt->x1)); + offset[1]= -(bt->y1 + 0.5f*MENU_BUTTON_HEIGHT); + } + else { + /* position mouse at 0.8*width of the button and below the tile + on the first item */ + offset[0]= 0; + for(bt=block->buttons.first; bt; bt=bt->next) + offset[0]= MIN2(offset[0], -(bt->x1 + 0.8f*(bt->x2 - bt->x1))); - if(bt) - offset= -bt->y1 - 0.5f*MENU_BUTTON_HEIGHT; + offset[1]= 1.5*MENU_BUTTON_HEIGHT; } block->minbounds= minwidth; - uiMenuPopupBoundsBlock(block, 1, 20, offset); + uiMenuPopupBoundsBlock(block, 1, offset[0], offset[1]); } else { /* for a header menu we set the direction automatic */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 9468eb7a0c6..313b03fdec3 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1355,6 +1355,11 @@ void init_userdef_do_versions(void) strcpy(km->idname, "Property Editor"); } } + if (G.main->versionfile < 250 || (G.main->versionfile == 250 && G.main->subversionfile < 16)) { + if(U.wmdrawmethod == USER_DRAW_TRIPLE) + U.wmdrawmethod = USER_DRAW_AUTOMATIC; + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 7aabc147139..4a648e6051b 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -62,7 +62,12 @@ /* *********************************************************************** */ -/* helper to allow scrollbars to dynamically hide */ +/* helper to allow scrollbars to dynamically hide + * - returns a copy of the scrollbar settings with the flags to display + * horizontal/vertical scrollbars removed + * - input scroll value is the v2d->scroll var + * - hide flags are set per region at drawtime + */ static int view2d_scroll_mapped(int scroll) { if(scroll & V2D_SCROLL_HORIZONTAL_HIDE) @@ -990,7 +995,7 @@ void UI_view2d_view_ortho(const bContext *C, View2D *v2d) wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); /* XXX is this necessary? */ - wmLoadIdentity(); + glLoadIdentity(); } /* Set view matrices to only use one axis of 'cur' only @@ -1019,7 +1024,7 @@ void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis) wmOrtho2(-xofs, ar->winx-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); /* XXX is this necessary? */ - wmLoadIdentity(); + glLoadIdentity(); } @@ -1031,7 +1036,7 @@ void UI_view2d_view_restore(const bContext *C) int height= ar->winrct.ymax-ar->winrct.ymin+1; wmOrtho2(0.0f, (float)width, 0.0f, (float)height); - wmLoadIdentity(); + glLoadIdentity(); // ED_region_pixelspace(CTX_wm_region(C)); } @@ -1411,10 +1416,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short CLAMP(scrollers->hor_min, hor.xmin, hor.xmax-V2D_SCROLLER_HANDLE_SIZE); } - /* check whether sliders can disappear */ + /* check whether sliders can disappear due to the full-range being used */ if(v2d->keeptot) { - if(fac1 <= 0.0f && fac2 >= 1.0f) + if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) { + v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR; scrollers->horfull= 1; + } + else + v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR; } } @@ -1448,10 +1457,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short CLAMP(scrollers->vert_min, vert.ymin, vert.ymax-V2D_SCROLLER_HANDLE_SIZE); } - /* check whether sliders can disappear */ + /* check whether sliders can disappear due to the full-range being used */ if(v2d->keeptot) { - if(fac1 <= 0.0f && fac2 >= 1.0f) + if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) { + v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR; scrollers->vertfull= 1; + } + else + v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR; } } @@ -2027,7 +2040,10 @@ void UI_view2d_text_cache_draw(ARegion *ar) { View2DString *v2s; - // wmPushMatrix(); + // glMatrixMode(GL_PROJECTION); + // glPushMatrix(); + // glMatrixMode(GL_MODELVIEW); + // glPushMatrix(); ED_region_pixelspace(ar); for(v2s= strings.first; v2s; v2s= v2s->next) { @@ -2049,7 +2065,10 @@ void UI_view2d_text_cache_draw(ARegion *ar) } } - // wmPopMatrix(); + // glMatrixMode(GL_PROJECTION); + // glPopMatrix(); + // glMatrixMode(GL_MODELVIEW); + // glPopMatrix(); if(strings.first) BLI_freelistN(&strings); diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index b25922cab5a..e84c9196e8b 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1414,6 +1414,18 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) scroller_activate_init(C, op, event, in_scroller); vsm= (v2dScrollerMove *)op->customdata; + /* check if zoom zones are inappropriate (i.e. zoom widgets not shown), so cannot continue + * NOTE: see view2d.c for latest conditions, and keep this in sync with that + */ + if (ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) { + if ( ((vsm->scroller=='h') && (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL)==0) || + ((vsm->scroller=='v') && (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL)==0) ) + { + /* switch to bar (i.e. no scaling gets handled) */ + vsm->zone= SCROLLHANDLE_BAR; + } + } + /* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */ if (vsm->zone == SCROLLHANDLE_BAR) { if ( ((vsm->scroller=='h') && (v2d->keepofs & V2D_LOCKOFS_X)) || @@ -1426,15 +1438,21 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_PASS_THROUGH; } } + /* zone is also inappropriate if scroller is not visible... */ - if ( ((vsm->scroller=='h') && (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE)) || - ((vsm->scroller=='v') && (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE)) ) + if ( ((vsm->scroller=='h') && (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR))) || + ((vsm->scroller=='v') && (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR))) ) { + /* free customdata initialised */ + scroller_activate_exit(C, op); + /* can't catch this event for ourselves, so let it go to someone else? */ + // FIXME: still this doesn't fall through to the item_activate callback for the outliner... return OPERATOR_PASS_THROUGH; } - if(vsm->scroller=='h') + /* activate the scroller */ + if (vsm->scroller=='h') v2d->scroll_ui |= V2D_SCROLL_H_ACTIVE; else v2d->scroll_ui |= V2D_SCROLL_V_ACTIVE; diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index d5794bfd4b3..3e56a8ea471 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1466,6 +1466,11 @@ static int mesh_separate_loose(Scene *scene, Base *editbase) selectconnected_mesh_all(em); + /* don't separate the very last part */ + for(eve=em->verts.first; eve; eve= eve->next) + if((eve->f & SELECT)==0) break; + if(eve==NULL) break; + /* and now separate */ doit= mesh_separate_selected(scene, editbase); } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 3539079591d..f601dcb06cf 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -623,46 +623,16 @@ void hashvert_flag(EditMesh *em, int flag) } /* generic extern called extruder */ -void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) +void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, short type) { float nor[3]= {0.0, 0.0, 0.0}; - short nr, transmode= 0; + short transmode= 0; - /* extrude depends on totvertsel etc */ - EM_stats_update(em); - - if(em->selectmode & SCE_SELECT_VERTEX) { - if(em->totvertsel==0) nr= 0; - else if(em->totvertsel==1) nr= 4; - else if(em->totedgesel==0) nr= 4; - else if(em->totfacesel==0) - nr= 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4"); - else if(em->totfacesel==1) - nr= 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4"); - else - nr= 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4"); - } - else if(em->selectmode & SCE_SELECT_EDGE) { - if (em->totedgesel==0) nr = 0; - else if (em->totedgesel==1) nr = 3; - else if(em->totfacesel==0) nr = 3; - else if(em->totfacesel==1) - nr= 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3"); - else - nr= 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3"); - } - else { - if (em->totfacesel == 0) nr = 0; - else if (em->totfacesel == 1) nr = 1; - else - nr= 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2"); - } - - if(nr<1) return; + if(type<1) return; - if(nr==1) transmode= extrudeflag(obedit, em, SELECT, nor, 0); - else if(nr==4) transmode= extrudeflag_verts_indiv(em, SELECT, nor); - else if(nr==3) transmode= extrudeflag_edges_indiv(em, SELECT, nor); + if(type==1) transmode= extrudeflag(obedit, em, SELECT, nor, 0); + else if(type==4) transmode= extrudeflag_verts_indiv(em, SELECT, nor); + else if(type==3) transmode= extrudeflag_edges_indiv(em, SELECT, nor); else transmode= extrudeflag_face_indiv(em, SELECT, nor); if(transmode==0) { @@ -682,7 +652,7 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) /* individual faces? */ // BIF_TransformSetUndo("Extrude"); - if(nr==2) { + if(type==2) { // initTransform(TFM_SHRINKFATTEN, CTX_NO_PET|CTX_NO_MIRROR); // Transform(); } @@ -706,7 +676,7 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - extrude_mesh(scene, obedit, em, op); + extrude_mesh(scene, obedit, em, op, RNA_int_get(op->ptr, "type")); BKE_mesh_end_editmesh(obedit->data, em); @@ -723,7 +693,7 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - extrude_mesh(scene, obedit, em, op); + extrude_mesh(scene, obedit, em, op, RNA_int_get(op->ptr, "type")); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -732,9 +702,86 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +EnumPropertyItem extrude_items[] = { + {1, "REGION", 0, "Region", ""}, + {2, "FACES", 0, "Individual Faces", ""}, + {3, "EDGES", 0, "Only Edges", ""}, + {4, "VERTS", 0, "Only Vertices", ""}, + {0, NULL, 0, NULL, NULL}}; + + +static EnumPropertyItem *extrude_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + EnumPropertyItem *item= NULL; + Object *obedit= CTX_data_edit_object(C); + EditMesh *em; + + int totitem= 0; + + if(!obedit) + return extrude_items; + + em = BKE_mesh_get_editmesh(obedit->data); + + EM_stats_update(em); + + if(em->selectmode & SCE_SELECT_VERTEX) { + if(em->totvertsel==0) {} + else if(em->totvertsel==1) { RNA_enum_item_add(&item, &totitem, &extrude_items[3]); } + else if(em->totedgesel==0) { RNA_enum_item_add(&item, &totitem, &extrude_items[3]); } + else if(em->totfacesel==0) { + RNA_enum_item_add(&item, &totitem, &extrude_items[2]); + RNA_enum_item_add(&item, &totitem, &extrude_items[3]); + } + else if(em->totfacesel==1) { + RNA_enum_item_add(&item, &totitem, &extrude_items[0]); + RNA_enum_item_add(&item, &totitem, &extrude_items[2]); + RNA_enum_item_add(&item, &totitem, &extrude_items[3]); + } + else { + RNA_enum_item_add(&item, &totitem, &extrude_items[0]); + RNA_enum_item_add(&item, &totitem, &extrude_items[1]); + RNA_enum_item_add(&item, &totitem, &extrude_items[2]); + RNA_enum_item_add(&item, &totitem, &extrude_items[3]); + } + } + else if(em->selectmode & SCE_SELECT_EDGE) { + if (em->totedgesel==0) {} + else if (em->totedgesel==1) { RNA_enum_item_add(&item, &totitem, &extrude_items[2]); } + else if(em->totfacesel==0) { RNA_enum_item_add(&item, &totitem, &extrude_items[2]); } + else if(em->totfacesel==1) { + RNA_enum_item_add(&item, &totitem, &extrude_items[0]); + RNA_enum_item_add(&item, &totitem, &extrude_items[2]); + } + else { + RNA_enum_item_add(&item, &totitem, &extrude_items[0]); + RNA_enum_item_add(&item, &totitem, &extrude_items[1]); + RNA_enum_item_add(&item, &totitem, &extrude_items[2]); + } + } + else { + if (em->totfacesel == 0) {} + else if (em->totfacesel == 1) { RNA_enum_item_add(&item, &totitem, &extrude_items[0]); } + else { + RNA_enum_item_add(&item, &totitem, &extrude_items[0]); + RNA_enum_item_add(&item, &totitem, &extrude_items[1]); + } + } + + if(item) { + RNA_enum_item_end(&item, &totitem); + *free= 1; + return item; + } + else { + return NULL; + } +} void MESH_OT_extrude(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name= "Extrude"; ot->description= "Extrude selected vertices, edges or faces."; @@ -747,6 +794,11 @@ void MESH_OT_extrude(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + prop= RNA_def_enum(ot->srna, "type", extrude_items, 0, "Type", ""); + RNA_def_enum_funcs(prop, extrude_itemf); + ot->prop= prop; } static int split_mesh(bContext *C, wmOperator *op) diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index c3bb8dd061d..5dd940be785 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -188,16 +188,29 @@ void ED_operatormacros_mesh(void) otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); - ot= WM_operatortype_append_macro("MESH_OT_extrude_move_along_normals", "Extrude Along Normals", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->poll = ED_operator_editmesh_face_select; /* restrict extrude along normals to face select */ - WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + ot= WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + RNA_enum_set(otmacro->ptr, "type", 1); otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_enum_set(otmacro->ptr, "constraint_orientation", V3D_MANIP_NORMAL); RNA_boolean_set_array(otmacro->ptr, "constraint_axis", constraint_axis); - ot= WM_operatortype_append_macro("MESH_OT_extrude_move", "Extrude and Move", OPTYPE_UNDO|OPTYPE_REGISTER); - WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + ot= WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + RNA_enum_set(otmacro->ptr, "type", 2); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + + ot= WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + RNA_enum_set(otmacro->ptr, "type", 3); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + + ot= WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude"); + RNA_enum_set(otmacro->ptr, "type", 4); otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); } @@ -251,8 +264,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1); - WM_keymap_add_item(keymap, "MESH_OT_extrude_move_along_normals", EKEY, KM_PRESS, 0, 0); /* this first so it's selected if possible */ - WM_keymap_add_item(keymap, "MESH_OT_extrude_move", EKEY, KM_PRESS, 0, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0); @@ -278,7 +290,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_split", YKEY, KM_PRESS, 0, 0); /* use KM_CLICK because same key is used for tweaks */ - WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", LEFTMOUSE, KM_CLICK, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 93f6542f9cb..f83af1d5167 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -106,7 +106,7 @@ void ED_region_pixelspace(ARegion *ar) int height= ar->winrct.ymax-ar->winrct.ymin+1; wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); - wmLoadIdentity(); + glLoadIdentity(); } /* only exported for WM */ @@ -932,9 +932,8 @@ void ED_region_init(bContext *C, ARegion *ar) ar->winy= ar->winrct.ymax - ar->winrct.ymin + 1; /* UI convention */ - wmLoadIdentity(); wmOrtho2(-0.01f, ar->winx-0.01f, -0.01f, ar->winy-0.01f); - + glLoadIdentity(); } void ED_region_toggle_hidden(bContext *C, ARegion *ar) diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 752c6feb9af..1ea0c2ccdbd 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -851,22 +851,11 @@ void bglPolygonOffset(float viewdist, float dist) } } -int is_a_really_crappy_intel_card(void) -{ - static int well_is_it= -1; - - /* Do you understand the implication? Do you? */ - if (well_is_it==-1) - well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "Intel Inc.") == 0); - - return well_is_it; -} - void bglFlush(void) { glFlush(); #ifdef __APPLE__ -// if(is_a_really_crappy_intel_card()) +// if(GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) // XXX myswapbuffers(); //hack to get mac intel graphics to show frontbuffer #endif } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4394893ff69..c6755e70492 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3329,8 +3329,8 @@ static void screen_opengl_render_apply(OGLRender *oglrender) /* read in pixels & stamp */ rr= RE_AcquireResultRead(oglrender->re); glReadPixels(0, 0, sizex, sizey, GL_RGBA, GL_FLOAT, rr->rectf); - if((scene->r.scemode & R_STAMP_INFO) && (scene->r.stamp & R_STAMP_DRAW)) - BKE_stamp_buf(scene, (unsigned char *)rr->rect32, rr->rectf, rr->rectx, rr->recty, 3); + if((scene->r.stamp & R_STAMP_ALL) && (scene->r.stamp & R_STAMP_DRAW)) + BKE_stamp_buf(scene, NULL, rr->rectf, rr->rectx, rr->recty, 4); RE_ReleaseResult(oglrender->re); /* update byte from float buffer */ diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index b818de56aa3..7ad65a1cbfc 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1474,9 +1474,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P view3d_operator_needs_opengl(C); /* load projection matrix */ - wmMultMatrix(ob->obmat); - wmGetSingleMatrix(mat); - wmLoadMatrix(vc->rv3d->viewmat); + mul_m4_m4m4(mat, ob->obmat, vc->rv3d->persmat); flip = RNA_boolean_get(itemptr, "flip"); pressure = RNA_float_get(itemptr, "pressure"); @@ -1904,9 +1902,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P view3d_operator_needs_opengl(C); /* load projection matrix */ - wmMultMatrix(ob->obmat); - wmGetSingleMatrix(mat); - wmLoadMatrix(vc->rv3d->viewmat); + mul_m4_m4m4(mat, ob->obmat, vc->rv3d->persmat); mval[0]-= vc->ar->winrct.xmin; mval[1]-= vc->ar->winrct.ymin; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index e91765936ed..1914c40f817 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -152,8 +152,6 @@ typedef struct StrokeCache { float (*face_norms)[3]; /* Copy of the mesh faces' normals */ float rotation; /* Texture rotation (radians) for anchored and rake modes */ int pixel_radius, previous_pixel_radius; - PBVHNode **grab_active_nodes[8]; /* The same list of nodes is used throught grab stroke */ - int grab_active_totnode[8]; float grab_active_location[8][3]; float grab_delta[3], grab_delta_symmetry[3]; float old_grab_location[3], orig_grab_location[3]; @@ -689,8 +687,7 @@ typedef struct { Sculpt *sd; SculptSession *ss; float radius_squared; - ListBase *active_verts; - float area_normal[3]; + int original; } SculptSearchSphereData; /* Test AABB against sphere */ @@ -701,7 +698,10 @@ static int sculpt_search_sphere_cb(PBVHNode *node, void *data_v) float t[3], bb_min[3], bb_max[3]; int i; - BLI_pbvh_node_get_BB(node, bb_min, bb_max); + if(data->original) + BLI_pbvh_node_get_original_BB(node, bb_min, bb_max); + else + BLI_pbvh_node_get_BB(node, bb_min, bb_max); for(i = 0; i < 3; ++i) { if(bb_min[i] > center[i]) @@ -1351,21 +1351,14 @@ static void do_brush_action(Sculpt *sd, SculptSession *ss, StrokeCache *cache) /* Build a list of all nodes that are potentially within the brush's area of influence */ if(brush->sculpt_tool == SCULPT_TOOL_GRAB) { - if(cache->first_time) { - /* For the grab tool we store these nodes once in the beginning - and then reuse them. */ - BLI_pbvh_search_gather(ss->tree, sculpt_search_sphere_cb, &data, + data.original= 1; + BLI_pbvh_search_gather(ss->tree, sculpt_search_sphere_cb, &data, &nodes, &totnode); - - ss->cache->grab_active_nodes[ss->cache->symmetry]= nodes; - ss->cache->grab_active_totnode[ss->cache->symmetry]= totnode; + + if(cache->first_time) copy_v3_v3(ss->cache->grab_active_location[ss->cache->symmetry], ss->cache->location); - } - else { - nodes= ss->cache->grab_active_nodes[ss->cache->symmetry]; - totnode= ss->cache->grab_active_totnode[ss->cache->symmetry]; + else copy_v3_v3(ss->cache->location, ss->cache->grab_active_location[ss->cache->symmetry]); - } } else { BLI_pbvh_search_gather(ss->tree, sculpt_search_sphere_cb, &data, @@ -1405,7 +1398,7 @@ static void do_brush_action(Sculpt *sd, SculptSession *ss, StrokeCache *cache) /* copy the modified vertices from mesh to the active key */ if(ss->kb) mesh_to_key(ss->ob->data, ss->kb); - if((brush->sculpt_tool != SCULPT_TOOL_GRAB) && nodes) + if(nodes) MEM_freeN(nodes); } } @@ -1651,15 +1644,10 @@ static float unproject_brush_radius(Object *ob, ViewContext *vc, float center[3] static void sculpt_cache_free(StrokeCache *cache) { - int i; if(cache->face_norms) MEM_freeN(cache->face_norms); if(cache->mats) MEM_freeN(cache->mats); - for(i = 0; i < 8; ++i) { - if(cache->grab_active_nodes[i]) - MEM_freeN(cache->grab_active_nodes[i]); - } MEM_freeN(cache); } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index d5de3f8101b..064baafbd95 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -114,7 +114,7 @@ void SOUND_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 72ec45845c2..bb77ad40671 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -949,6 +949,18 @@ void ACTION_OT_interpolation_type (wmOperatorType *ot) /* ******************** Set Handle-Type Operator *********************** */ +EnumPropertyItem actkeys_handle_type_items[] = { + {0, "", 0, "For Selected Handles", ""}, + {HD_FREE, "FREE", 0, "Free", ""}, + {HD_AUTO, "AUTO", 0, "Auto", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {0, "", 0, "For Selected F-Curves", ""}, + {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Handles stay horizontal"}, + {0, NULL, 0, NULL, NULL}}; + +/* ------------------- */ + /* this function is responsible for setting handle-type of selected keyframes */ static void sethandles_action_keys(bAnimContext *ac, short mode) { @@ -964,25 +976,36 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) /* loop through setting flags for handles * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... */ + for (ale= anim_data.first; ale; ale= ale->next) + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); + + /* cleanup */ + BLI_freelistN(&anim_data); +} + +/* this function is responsible for toggling clamped-handles */ +static void sethandles_clamped_action_keys(bAnimContext *ac) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* toggle auto-handles on the F-Curves, which forces handles to stay horizontal */ for (ale= anim_data.first; ale; ale= ale->next) { - if (mode == -1) { - BeztEditFunc toggle_cb; + FCurve *fcu= ale->data; + + /* only enable if curve is selected */ + if (SEL_FCU(fcu)) + fcu->flag |= FCURVE_AUTO_HANDLES; + else + fcu->flag &= ~FCURVE_AUTO_HANDLES; - /* check which type of handle to set (free or aligned) - * - check here checks for handles with free alignment already - */ - if (ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL)) - toggle_cb= ANIM_editkeyframes_handles(HD_FREE); - else - toggle_cb= ANIM_editkeyframes_handles(HD_ALIGN); - - /* set handle-type */ - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, toggle_cb, calchandles_fcurve); - } - else { - /* directly set handle-type */ - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); - } + /* force handles to be recalculated */ + calchandles_fcurve(fcu); } /* cleanup */ @@ -1006,7 +1029,10 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op) mode= RNA_enum_get(op->ptr, "type"); /* set handle type */ - sethandles_action_keys(&ac, mode); + if (mode == HD_AUTO_ANIM) + sethandles_clamped_action_keys(&ac); + else + sethandles_action_keys(&ac, mode); /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); @@ -1033,7 +1059,7 @@ void ACTION_OT_handle_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - ot->prop= RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", actkeys_handle_type_items, 0, "Type", ""); } /* ******************** Set Keyframe-Type Operator *********************** */ diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index fcfd8b907eb..ba73182d129 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -48,6 +48,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_action.h" #include "BKE_material.h" #include "BKE_modifier.h" #include "BKE_paint.h" @@ -274,6 +275,40 @@ static int buttons_context_path_bone(ButsContextPath *path) return 0; } +static int buttons_context_path_pose_bone(ButsContextPath *path) +{ + PointerRNA *ptr= &path->ptr[path->len-1]; + + /* if we already have a (pinned) PoseBone, we're done */ + if(RNA_struct_is_a(ptr->type, &RNA_PoseBone)) { + return 1; + } + + /* if we have an armature, get the active bone */ + if(buttons_context_path_object(path)) { + Object *ob= path->ptr[path->len-1].data; + bArmature *arm= ob->data; /* path->ptr[path->len-1].data - works too */ + + if(ob->type != OB_ARMATURE || arm->edbo) { + return 0; + } + else { + if(arm->act_bone) { + bPoseChannel *pchan= get_pose_channel(ob->pose, arm->act_bone->name); + if(pchan) { + RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &path->ptr[path->len]); + path->len++; + return 1; + } + } + } + } + + /* no path to a bone possible */ + return 0; +} + + static int buttons_context_path_particle(ButsContextPath *path) { Object *ob; @@ -461,11 +496,13 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma found= buttons_context_path_texture(C, path); break; case BCONTEXT_BONE: - case BCONTEXT_BONE_CONSTRAINT: found= buttons_context_path_bone(path); if(!found) found= buttons_context_path_data(path, OB_ARMATURE); break; + case BCONTEXT_BONE_CONSTRAINT: + found= buttons_context_path_pose_bone(path); + break; default: found= 0; break; @@ -586,7 +623,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r static const char *dir[] = { "world", "object", "mesh", "armature", "lattice", "curve", "meta_ball", "lamp", "camera", "material", "material_slot", - "texture", "texture_slot", "bone", "edit_bone", "particle_system", "particle_system_editable", + "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL}; CTX_data_dir_set(result, dir); @@ -704,6 +741,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_EditBone); return 1; } + else if(CTX_data_equals(member, "pose_bone")) { + set_pointer_type(path, result, &RNA_PoseBone); + return 1; + } else if(CTX_data_equals(member, "particle_system")) { set_pointer_type(path, result, &RNA_ParticleSystem); return 1; diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 406ecd77136..a5e708e90e3 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -148,6 +148,6 @@ void BUTTONS_OT_file_browse(wmOperatorType *ot) ot->cancel= file_browse_cancel; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); } diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index 9e8e3b7b058..5f0b75d068a 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -106,7 +106,6 @@ static void save_rendered_image_cb_real(char *name, int confirm) strcpy(str, name); BLI_convertstringcode(str, G.sce); - BLI_convertstringframe(str, scene->r.cfra); /* TODO - is this even used? */ if (confirm) overwrite = saveover(str); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 753aeb78dde..8f0cfea5d64 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -337,15 +337,18 @@ static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) { - /* don't draw handle lines if handles are not shown */ - if ( (sipo->flag & SIPO_NOHANDLES) || - (fcu->flag & FCURVE_PROTECTED) || - (fcu->flag & FCURVE_INT_VALUES) || - ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) - /* || (fcu->totvert <= 1) */ - ) { + /* don't draw handle lines if handles are not to be shown */ + if ( (sipo->flag & SIPO_NOHANDLES) || /* handles shouldn't be shown anywhere */ + (fcu->flag & FCURVE_PROTECTED) || /* keyframes aren't editable */ + (fcu->flag & FCURVE_INT_VALUES) || /* editing the handles here will cause weird/incorrect interpolation issues */ + ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || /* group that curve belongs to is not editable */ + (fcu->totvert <= 1) /* do not show handles if there is only 1 keyframe, otherwise they all clump together in an ugly ball */ + ) + { return 0; - } else { + } + else + { return 1; } } @@ -427,7 +430,7 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, } } - glEnd(); // GL_LINES + glEnd(); // GL_LINES } /* Samples ---------------- */ @@ -922,14 +925,14 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if (fcu->bezt) { int do_handles = draw_fcurve_handles_check(sipo, fcu); - - if(do_handles) { + + if (do_handles) { /* only draw handles/vertices on keyframes */ glEnable(GL_BLEND); draw_fcurve_handles(ac, sipo, ar, fcu); glDisable(GL_BLEND); } - + draw_fcurve_vertices(ac, sipo, ar, fcu, do_handles); } else { diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 3c7ce2778b6..5e2e56abcc5 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1138,7 +1138,7 @@ void GRAPH_OT_sound_bake (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1); @@ -1361,6 +1361,18 @@ void GRAPH_OT_interpolation_type (wmOperatorType *ot) /* ******************** Set Handle-Type Operator *********************** */ +EnumPropertyItem graphkeys_handle_type_items[] = { + {0, "", 0, "For Selected Handles", ""}, + {HD_FREE, "FREE", 0, "Free", ""}, + {HD_AUTO, "AUTO", 0, "Auto", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {0, "", 0, "For Selected F-Curves", ""}, + {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Handles stay horizontal"}, + {0, NULL, 0, NULL, NULL}}; + +/* ------------------- */ + /* this function is responsible for setting handle-type of selected keyframes */ static void sethandles_graph_keys(bAnimContext *ac, short mode) { @@ -1370,32 +1382,42 @@ static void sethandles_graph_keys(bAnimContext *ac, short mode) BeztEditFunc set_cb= ANIM_editkeyframes_handles(mode); /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through setting flags for handles * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... */ - // XXX we might need to supply BeztEditData to get it to only affect selected handles + for (ale= anim_data.first; ale; ale= ale->next) + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); + + /* cleanup */ + BLI_freelistN(&anim_data); +} + +/* this function is responsible for toggling clamped-handles */ +static void sethandles_clamped_graph_keys(bAnimContext *ac) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* toggle auto-handles on the F-Curves, which forces handles to stay horizontal */ for (ale= anim_data.first; ale; ale= ale->next) { - if (mode == -1) { - BeztEditFunc toggle_cb; + FCurve *fcu= ale->data; + + /* only enable if curve is selected */ + if (SEL_FCU(fcu)) + fcu->flag |= FCURVE_AUTO_HANDLES; + else + fcu->flag &= ~FCURVE_AUTO_HANDLES; - /* check which type of handle to set (free or aligned) - * - check here checks for handles with free alignment already - */ - if (ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL)) - toggle_cb= ANIM_editkeyframes_handles(HD_FREE); - else - toggle_cb= ANIM_editkeyframes_handles(HD_ALIGN); - - /* set handle-type */ - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, toggle_cb, calchandles_fcurve); - } - else { - /* directly set handle-type */ - ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); - } + /* force handles to be recalculated */ + calchandles_fcurve(fcu); } /* cleanup */ @@ -1417,18 +1439,21 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op) mode= RNA_enum_get(op->ptr, "type"); /* set handle type */ - sethandles_graph_keys(&ac, mode); + if (mode == HD_AUTO_ANIM) + sethandles_clamped_graph_keys(&ac); + else + sethandles_graph_keys(&ac, mode); /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ + /* set notifier that keyframe properties have changed */ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } -void GRAPH_OT_handle_type (wmOperatorType *ot) + void GRAPH_OT_handle_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Handle Type"; @@ -1444,7 +1469,7 @@ void GRAPH_OT_handle_type (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - ot->prop= RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", graphkeys_handle_type_items, 0, "Type", ""); } /* ************************************************************************** */ diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index f642b284491..ca5af4d4794 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -115,12 +115,24 @@ bAnimListElem *get_active_fcurve_channel (bAnimContext *ac) /* check if any FModifiers to draw controls for - fcm is 'active' modifier * used for the polling callbacks + also for drawing */ +// TODO: restructure these tests +// TODO: maybe for now, just allow editing always for now... short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) { /* don't draw if there aren't any modifiers at all */ if (fcu->modifiers.first == NULL) return 0; + /* if only one modifier + * - don't draw if it is muted or disabled + * - set it as the active one if no active one is present + */ + if (fcu->modifiers.first == fcu->modifiers.last) { + fcm= fcu->modifiers.first; + if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) + return 0; + } + /* if there's an active modifier - don't draw if it doesn't drastically * alter the curve... */ @@ -136,13 +148,6 @@ short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) } } - /* if only one modifier - don't draw if it is muted or disabled */ - if (fcu->modifiers.first == fcu->modifiers.last) { - fcm= fcu->modifiers.first; - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - /* if only active modifier - don't draw if it is muted or disabled */ if (fcm) { if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7dd26c31658..2011649fda6 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -741,7 +741,7 @@ void IMAGE_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); } /******************** replace image operator ********************/ @@ -794,7 +794,7 @@ void IMAGE_OT_replace(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); } /******************** save image as operator ********************/ @@ -810,7 +810,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera if (ibuf) { BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, scene->r.cfra); + BLI_convertstringframe(name, scene->r.cfra, 0); if(scene->r.scemode & R_EXTENSION) { BKE_add_image_extension(name, sima->imtypenr); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 5a584782237..3cb00baf427 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -602,7 +602,7 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) } break; case NC_IMAGE: - if (wmn->reference == sima->image) { + if (wmn->reference == sima->image || !wmn->reference) { image_histogram_tag_refresh(sa); ED_area_tag_refresh(sa); ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 5d8ff3849e6..be4c060bdec 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -306,5 +306,5 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 7e2aa6b5709..c60f73112f2 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -247,6 +247,7 @@ void NLA_OT_tweakmode_exit (wmOperatorType *ot) /* Add a new Action-Clip strip to the active track (or the active block if no space in the track) */ /* pop up menu allowing user to choose the action to use */ +// TODO: at some point, we may have to migrate to a search menu to manage the case where there are many actions static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent *evt) { Main *m= CTX_data_main(C); @@ -259,7 +260,7 @@ static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent * /* loop through Actions in Main database, adding as items in the menu */ for (act= m->action.first; act; act= act->id.next) - uiItemStringO(layout, act->id.name+2, 0, "NLA_OT_actionclip_add", "action", act->id.name); + uiItemStringO(layout, act->id.name+2, 0, "NLA_OT_actionclip_add", "action", act->id.name+2); uiItemS(layout); uiPupMenuEnd(C, pup); @@ -278,7 +279,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) int filter, items; bAction *act = NULL; - char actname[22]; + char actname[20]; float cfra; /* get editor data */ @@ -290,7 +291,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) /* get action to use */ RNA_string_get(op->ptr, "action", actname); - act= (bAction *)find_id("AC", actname+2); + act= (bAction *)find_id("AC", actname); if (act == NULL) { BKE_report(op->reports, RPT_ERROR, "No valid Action to add."); @@ -364,7 +365,7 @@ void NLA_OT_actionclip_add (wmOperatorType *ot) /* props */ // TODO: this would be nicer as an ID-pointer... - RNA_def_string(ot->srna, "action", "", 21, "Action", "Name of Action to add as a new Action-Clip Strip."); + ot->prop = RNA_def_string(ot->srna, "action", "", 19, "Action", "Name of Action to add as a new Action-Clip Strip."); } /* ******************** Add Transition Operator ***************************** */ @@ -1672,7 +1673,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* id-props */ - RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", ""); RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip."); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index fe5c7bca3a6..b914411aeeb 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1271,8 +1271,11 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) if(ibuf) { float x, y; - wmPushMatrix(); - + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + /* somehow the offset has to be calculated inverse */ glaDefine2DArea(&ar->winrct); @@ -1293,7 +1296,10 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) if(ibuf->rect) glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - wmPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); } BKE_image_release_ibuf(ima, lock); diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 03bc8340810..27719f124a1 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -605,14 +605,12 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv) } } -#ifdef __APPLE__ -// if(is_a_really_crappy_nvidia_card()) { XXX +// if(GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) { XXX // float zoomx= curarea->winx/(float)(G.v2d->cur.xmax-G.v2d->cur.xmin); // float zoomy= curarea->winy/(float)(G.v2d->cur.ymax-G.v2d->cur.ymin); // glPixelZoom(zoomx*xscale, zoomy*yscale); // } // else -#endif glPixelZoom(xscale, yscale); glEnable(GL_BLEND); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 13bf50b1c19..359082c470a 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -342,7 +342,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie"); } @@ -379,7 +379,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } @@ -465,7 +465,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES); } @@ -608,7 +608,7 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME); RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type"); RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index bc103466c49..58d8e6b3363 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -287,7 +287,7 @@ void TEXT_OT_open(wmOperatorType *ot) ot->poll= text_new_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE); } /******************* reload operator *********************/ diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index e7eff234b6e..64cb4c901f9 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1581,7 +1581,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* precalc inverse matrix for drawing screen aligned */ if (arm->drawtype==ARM_ENVELOPE) { /* precalc inverse matrix for drawing screen aligned */ - wmGetMatrix(smat); + copy_m4_m4(smat, rv3d->viewmatob); mul_mat3_m4_fl(smat, 1.0f/len_v3(ob->obmat[0])); invert_m4_m4(imat, smat); @@ -1941,7 +1941,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt) /* envelope (deform distance) */ if(arm->drawtype==ARM_ENVELOPE) { /* precalc inverse matrix for drawing screen aligned */ - wmGetMatrix(smat); + copy_m4_m4(smat, rv3d->viewmatob); mul_mat3_m4_fl(smat, 1.0f/len_v3(ob->obmat[0])); invert_m4_m4(imat, smat); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cca8dc134e9..5c5f0dbc897 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -554,7 +554,10 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa for(a=0; a<6; a++) glDisable(GL_CLIP_PLANE0+a); - wmPushMatrix(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); ED_region_pixelspace(ar); if(depth_write) { @@ -574,7 +577,10 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa } else glDepthMask(1); - wmPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); if(rv3d->rflag & RV3D_CLIPPING) for(a=0; a<6; a++) @@ -851,7 +857,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* we first draw only the screen aligned & fixed scale stuff */ glPushMatrix(); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); /* lets calculate the scale: */ pixsize= rv3d->persmat[0][3]*ob->obmat[3][0]+ rv3d->persmat[1][3]*ob->obmat[3][1]+ rv3d->persmat[2][3]*ob->obmat[3][2]+ rv3d->persmat[3][3]; @@ -1065,7 +1071,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, } /* and back to viewspace */ - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); VECCOPY(vec, ob->obmat[3]); setlinestyle(0); @@ -1136,7 +1142,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob /* a standing up pyramid with (0,0,0) as top */ Camera *cam; World *wrld; - float vec[8][4], tmat[4][4], fac, facx, facy, depth; + float nobmat[4][4], vec[8][4], fac, facx, facy, depth; int i; if(G.f & G_RENDER_SHADOW) @@ -1216,13 +1222,13 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if(flag==0) { if(cam->flag & (CAM_SHOWLIMITS+CAM_SHOWMIST)) { - wmLoadMatrix(rv3d->viewmat); - copy_m4_m4(vec, ob->obmat); - normalize_m4(vec); - wmMultMatrix(vec); + /* draw in normalized object matrix space */ + copy_m4_m4(nobmat, ob->obmat); + normalize_m4(nobmat); - swap_m4m4(rv3d->persmat, tmat); - wmGetSingleMatrix(rv3d->persmat); + glPushMatrix(); + glLoadMatrixf(rv3d->viewmat); + glMultMatrixf(nobmat); if(cam->flag & CAM_SHOWLIMITS) { draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF); @@ -1234,7 +1240,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if(cam->flag & CAM_SHOWMIST) if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF); - swap_m4m4(rv3d->persmat, tmat); + glPopMatrix(); } } } @@ -3355,7 +3361,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { float mat[4][4]; mul_m4_m4m4(mat, psys->imat, ob->obmat); - wmMultMatrix(mat); + glMultMatrixf(mat); } totpart=psys->totpart; @@ -3856,7 +3862,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); } static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit) @@ -4692,7 +4698,7 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Object *ob= base->object; MetaBall *mb; MetaElem *ml; - float imat[4][4], tmat[4][4]; + float imat[4][4]; int code= 1; mb= ob->data; @@ -4717,8 +4723,7 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, } else UI_ThemeColor(TH_WIRE); - wmGetMatrix(tmat); - invert_m4_m4(imat, tmat); + invert_m4_m4(imat, rv3d->viewmatob); normalize_v3(imat[0]); normalize_v3(imat[1]); @@ -4753,7 +4758,7 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, return 0; } -static void draw_forcefield(Scene *scene, Object *ob) +static void draw_forcefield(Scene *scene, Object *ob, RegionView3D *rv3d) { PartDeflect *pd= ob->pd; float imat[4][4], tmat[4][4]; @@ -4776,8 +4781,7 @@ static void draw_forcefield(Scene *scene, Object *ob) else size = 1.0; /* calculus here, is reused in PFIELD_FORCE */ - wmGetMatrix(tmat); - invert_m4_m4(imat, tmat); + invert_m4_m4(imat, rv3d->viewmatob); // normalize_v3(imat[0]); // we don't do this because field doesnt scale either... apart from wind! // normalize_v3(imat[1]); @@ -5586,7 +5590,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) break; case OB_LAMP: drawlamp(scene, v3d, rv3d, base, dt, flag); - if(dtx || (base->flag & SELECT)) wmMultMatrix(ob->obmat); + if(dtx || (base->flag & SELECT)) glMultMatrixf(ob->obmat); break; case OB_CAMERA: drawcamera(scene, v3d, rv3d, ob, flag); @@ -5609,17 +5613,17 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if ((sb= ob->soft)){ if(sb->solverflags & SBSO_ESTIMATEIPO){ - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); copy_m3_m3(msc,sb->lscale); copy_m3_m3(mrt,sb->lrot); mul_m3_m3m3(mtr,mrt,msc); ob_draw_RE_motion(sb->lcom,mtr,tipw,tiph,drawsize); - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); } } } - if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob); + if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob, rv3d); /* code for new particle system */ if( (warning_recursive==0) && @@ -5633,7 +5637,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */ //glDepthMask(GL_FALSE); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); view3d_cached_text_draw_begin(); @@ -5648,7 +5652,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) view3d_cached_text_draw_end(v3d, ar, 0, NULL); - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); //glDepthMask(GL_TRUE); if(col) cpack(col); @@ -5663,9 +5667,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) { PTCacheEdit *edit = PE_get_current(scene, ob); if(edit) { - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt); - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); } } } @@ -5683,7 +5687,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) { size_t i; - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); glDepthMask(GL_FALSE); @@ -5701,7 +5705,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) bglEnd(); glPointSize(1.0); - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); glDisable(GL_BLEND); glDepthMask(GL_TRUE); if(col) cpack(col); @@ -5725,8 +5729,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) int x, y, z; float *density = smoke_get_density(smd->domain->fluid); - wmLoadMatrix(rv3d->viewmat); - // wmMultMatrix(ob->obmat); + glLoadMatrixf(rv3d->viewmat); + // glMultMatrixf(ob->obmat); if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); glDepthMask(GL_FALSE); @@ -5759,7 +5763,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) bglEnd(); glPointSize(1.0); - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); glDisable(GL_BLEND); glDepthMask(GL_TRUE); if(col) cpack(col); @@ -5809,11 +5813,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(dt<OB_SHADED) { if((ob->gameflag & OB_DYNAMIC) || ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) { - float tmat[4][4], imat[4][4], vec[3]; + float imat[4][4], vec[3]; vec[0]= vec[1]= vec[2]= 0.0; - wmGetMatrix(tmat); - invert_m4_m4(imat, tmat); + invert_m4_m4(imat, rv3d->viewmatob); setlinestyle(2); drawcircball(GL_LINE_LOOP, vec, ob->inertia, imat); @@ -5824,7 +5827,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* return warning, this is cached text draw */ view3d_cached_text_draw_end(v3d, ar, 1, NULL); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(zbufoff) glDisable(GL_DEPTH_TEST); @@ -6043,7 +6046,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec { ToolSettings *ts= scene->toolsettings; - wmMultMatrix(ob->obmat); + glMultMatrixf(ob->obmat); glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); @@ -6092,7 +6095,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec break; } - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); } diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 168e1f8592d..3e4748d4807 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -346,8 +346,8 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture glGetBooleanv(GL_BLEND, (GLboolean *)&gl_blend); glGetBooleanv(GL_DEPTH_TEST, (GLboolean *)&gl_depth); - wmLoadMatrix(rv3d->viewmat); - // wmMultMatrix(ob->obmat); + glLoadMatrixf(rv3d->viewmat); + // glMultMatrixf(ob->obmat); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index a65521cd0fb..6b653ccba89 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -172,10 +172,11 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) */ void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d) { - wmMultMatrix(ob->obmat); /* local viewmat and persmat, to calculate projections */ - wmGetMatrix(rv3d->viewmatob); - wmGetSingleMatrix(rv3d->persmatob); + mul_m4_m4m4(rv3d->viewmatob, ob->obmat, rv3d->viewmat); + mul_m4_m4m4(rv3d->persmatob, ob->obmat, rv3d->persmat); + + glLoadMatrixf(rv3d->viewmatob); /* initializes object space clipping, speeds up clip tests */ ED_view3d_local_clipping(rv3d, ob->obmat); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fa155489b59..525842b2a8f 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1395,15 +1395,15 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) if(v3d->zbuf) glDisable(GL_DEPTH_TEST); glDepthMask(0); + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - /* need to use wm push/pop matrix because ED_region_pixelspace - uses the wm functions too, otherwise gets out of sync */ - wmPushMatrix(); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); ED_region_pixelspace(ar); - glEnable(GL_BLEND); - glPixelZoom(zoomx, zoomy); glColor4f(1.0, 1.0, 1.0, 1.0-bgpic->blend); glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect); @@ -1411,7 +1411,10 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) glPixelZoom(1.0, 1.0); glPixelTransferf(GL_ALPHA_SCALE, 1.0f); - wmPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); glDisable(GL_BLEND); @@ -1556,10 +1559,10 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas } } if(use_displist) { - wmMultMatrix(dob->mat); + glMultMatrixf(dob->mat); if(boundbox_clip(rv3d, dob->mat, &bb)) glCallList(displist); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); } else { copy_m4_m4(dob->ob->obmat, dob->mat); @@ -1638,7 +1641,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d) glClear(GL_DEPTH_BUFFER_BIT); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); v3d->zbuf= TRUE; glEnable(GL_DEPTH_TEST); @@ -1674,7 +1677,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)) glClear(GL_DEPTH_BUFFER_BIT); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); // persp(PERSP_STORE); // store correct view for persp(PERSP_VIEW) calls if(rv3d->rflag & RV3D_CLIPPING) { @@ -1910,10 +1913,9 @@ static void view3d_main_area_setup_view(Scene *scene, View3D *v3d, ARegion *ar, /* set for opengl */ glMatrixMode(GL_PROJECTION); - wmLoadMatrix(rv3d->winmat); - + glLoadMatrixf(rv3d->winmat); glMatrixMode(GL_MODELVIEW); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); } void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[][4], float winmat[][4]) @@ -2048,8 +2050,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) v3d->zbuf= FALSE; /* enables anti-aliasing for 3D view drawing */ - if (!(U.gameflags & USER_DISABLE_AA)) - glEnable(GL_MULTISAMPLE_ARB); + /*if (!(U.gameflags & USER_DISABLE_AA)) + glEnable(GL_MULTISAMPLE_ARB);*/ // needs to be done always, gridview is adjusted in drawgrid() now rv3d->gridview= v3d->grid; @@ -2071,9 +2073,9 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) drawgrid(&scene->unit, ar, v3d, &grid_unit); /* XXX make function? replaces persp(1) */ glMatrixMode(GL_PROJECTION); - wmLoadMatrix(rv3d->winmat); + glLoadMatrixf(rv3d->winmat); glMatrixMode(GL_MODELVIEW); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(v3d->flag & V3D_DISPBGPICS) { draw_bgpic(scene, ar, v3d); @@ -2158,8 +2160,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) BIF_draw_manipulator(C); /* Disable back anti-aliasing */ - if (!(U.gameflags & USER_DISABLE_AA)) - glDisable(GL_MULTISAMPLE_ARB); + /*if (!(U.gameflags & USER_DISABLE_AA)) + glDisable(GL_MULTISAMPLE_ARB);*/ if(v3d->zbuf) { v3d->zbuf= FALSE; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a83d226ae79..f74978fd317 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -104,9 +104,9 @@ void view3d_operator_needs_opengl(const bContext *C) wmSubWindowSet(CTX_wm_window(C), ar->swinid); glMatrixMode(GL_PROJECTION); - wmLoadMatrix(rv3d->winmat); + glLoadMatrixf(rv3d->winmat); glMatrixMode(GL_MODELVIEW); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); } } @@ -282,9 +282,12 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo sms.orig_lens= v3d->lens; } /* grid draw as floor */ - sms.orig_view= rv3d->view; - rv3d->view= 0; - + if((rv3d->viewlock & RV3D_LOCKED)==0) { + /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */ + sms.orig_view= rv3d->sms ? rv3d->sms->orig_view : rv3d->view; + rv3d->view= 0; + } + /* ensure it shows correct */ if(sms.to_camera) rv3d->persp= RV3D_PERSP; @@ -344,8 +347,11 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event) rv3d->dist = sms->new_dist; v3d->lens = sms->new_lens; } - rv3d->view= sms->orig_view; + if((rv3d->viewlock & RV3D_LOCKED)==0) { + rv3d->view= sms->orig_view; + } + MEM_freeN(rv3d->sms); rv3d->sms= NULL; @@ -1068,13 +1074,10 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick else wmFrustum(x1, x2, y1, y2, clipsta, clipend); } - /* not sure what this was for? (ton) */ - glMatrixMode(GL_PROJECTION); - wmGetMatrix(rv3d->winmat); - glMatrixMode(GL_MODELVIEW); + /* update matrix in 3d view region */ + glGetFloatv(GL_PROJECTION_MATRIX, (float*)rv3d->winmat); } - static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short smooth) { float bmat[4][4]; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 205d6f3479f..a75b64f5e43 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -767,7 +767,7 @@ static void preOrthoFront(int ortho, float twmat[][4], int axis) copy_m4_m4(omat, twmat); orthogonalize_m4(omat, axis); glPushMatrix(); - wmMultMatrix(omat); + glMultMatrixf(omat); glFrontFace( is_mat4_flipped(omat)?GL_CW:GL_CCW); } } @@ -864,14 +864,14 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3] // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); if (ortho) { - wmMultMatrix(matt); + glMultMatrixf(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } } else { if (ortho) { glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); - wmMultMatrix(rv3d->twmat); + glMultMatrixf(rv3d->twmat); } } @@ -1028,7 +1028,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, } /* restore */ - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); gluDeleteQuadric(qobj); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -1130,11 +1130,11 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3] // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); - wmMultMatrix(matt); + glMultMatrixf(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } else { - wmMultMatrix(rv3d->twmat); + glMultMatrixf(rv3d->twmat); glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); } @@ -1179,7 +1179,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, } /* restore */ - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); glFrontFace(GL_CCW); @@ -1240,7 +1240,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi glPopMatrix(); /* and now apply matrix, we move to local matrix drawing */ - wmMultMatrix(rv3d->twmat); + glMultMatrixf(rv3d->twmat); /* axis */ glLoadName(-1); @@ -1281,7 +1281,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi } gluDeleteQuadric(qobj); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); @@ -1336,10 +1336,10 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov // XXX if (t->flag & T_USES_MANIPULATOR) { // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); // XXX } - wmMultMatrix(matt); + glMultMatrixf(matt); } else { - wmMultMatrix(rv3d->twmat); + glMultMatrixf(rv3d->twmat); } glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); @@ -1383,7 +1383,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov /* restore */ gluDeleteQuadric(qobj); - wmLoadMatrix(rv3d->viewmat); + glLoadMatrixf(rv3d->viewmat); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index bae3c790684..c80a0929e18 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -379,7 +379,7 @@ void initSnappingMode(TransInfo *t) if (t->tsnap.applySnap != NULL && // A snapping function actually exist (obedit != NULL && ELEM3(obedit->type, OB_MESH, OB_ARMATURE, OB_CURVE)) ) // Temporary limited to edit mode meshes, armature, curves { - if (t->flag & T_PROP_EDIT) + if ((t->flag & T_PROP_EDIT) || t->tsnap.project) /* also exclude edit for project, for now */ { t->tsnap.modeSelect = SNAP_NOT_OBEDIT; } diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index c2af4e8fcb1..998c13d2a64 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -37,8 +37,6 @@ extern "C" { #endif -/* GPU extensions support */ - struct Image; struct ImageUser; @@ -54,6 +52,8 @@ typedef struct GPUOffScreen GPUOffScreen; struct GPUShader; typedef struct GPUShader GPUShader; +/* GPU extensions support */ + void GPU_extensions_disable(void); void GPU_extensions_init(void); /* call this before running any of the functions below */ void GPU_extensions_exit(void); @@ -61,6 +61,33 @@ int GPU_glsl_support(void); int GPU_non_power_of_two_support(void); int GPU_print_error(char *str); +/* GPU Types */ + +typedef enum GPUDeviceType { + GPU_DEVICE_NVIDIA = (1<<0), + GPU_DEVICE_ATI = (1<<1), + GPU_DEVICE_INTEL = (1<<2), + GPU_DEVICE_SOFTWARE = (1<<3), + GPU_DEVICE_UNKNOWN = (1<<4), + GPU_DEVICE_ANY = (0xff) +} GPUDeviceType; + +typedef enum GPUOSType { + GPU_OS_WIN = (1<<16), + GPU_OS_MAC = (1<<17), + GPU_OS_UNIX = (1<<18), + GPU_OS_ANY = (0xff00) +} GPUOSType; + +typedef enum GPUDriverType { + GPU_DRIVER_OFFICIAL = (1<<24), + GPU_DRIVER_OPENSOURCE = (1<<25), + GPU_DRIVER_SOFTWARE = (1<<26), + GPU_DRIVER_UNKNOWN = (0xff0000) +} GPUDriverType; + +int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver); + /* GPU Texture - always returns unsigned char RGBA textures - if texture with non square dimensions is created, depending on the diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 6590d838b90..ac79322dd20 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -672,6 +672,9 @@ void GPU_draw_buffers(void *buffers_v) glDrawElements(GL_TRIANGLES, buffers->tot_tri * 3, buffers->index_type, 0); } + glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); } diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 74b9f362939..fdc0eb7148c 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1314,7 +1314,9 @@ void GPU_state_init(void) glCullFace(GL_BACK); glDisable(GL_CULL_FACE); - glDisable(GL_MULTISAMPLE_ARB); + /* calling this makes drawing very slow when AA is not set up in ghost + on Linux/NVIDIA. + glDisable(GL_MULTISAMPLE); */ } /* debugging aid */ diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index a5a8c626cbd..3a36cc01d3e 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -71,8 +71,20 @@ static struct GPUGlobal { GLuint currentfb; int glslsupport; int extdisabled; + GPUDeviceType device; + GPUOSType os; + GPUDriverType driver; } GG = {1, 0, 0, 0}; +/* GPU Types */ + +int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver) +{ + return (GG.device & device) && (GG.os & os) && (GG.driver & driver); +} + +/* GPU Extensions */ + void GPU_extensions_disable() { GG.extdisabled = 1; @@ -80,6 +92,8 @@ void GPU_extensions_disable() void GPU_extensions_init() { + const char *vendor, *renderer; + glewInit(); /* glewIsSupported("GL_VERSION_2_0") */ @@ -91,6 +105,54 @@ void GPU_extensions_init() if (!GLEW_ARB_multitexture) GG.glslsupport = 0; if (!GLEW_ARB_vertex_shader) GG.glslsupport = 0; if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0; + + vendor = (const char*)glGetString(GL_VENDOR); + renderer = (const char*)glGetString(GL_RENDERER); + + if(strstr(vendor, "ATI")) { + GG.device = GPU_DEVICE_ATI; + GG.driver = GPU_DRIVER_OFFICIAL; + } + else if(strstr(vendor, "NVIDIA")) { + GG.device = GPU_DEVICE_NVIDIA; + GG.driver = GPU_DRIVER_OFFICIAL; + } + else if(strstr(vendor, "Intel") || strstr(renderer, "Mesa DRI Intel")) { + GG.device = GPU_DEVICE_INTEL; + GG.driver = GPU_DRIVER_OFFICIAL; + } + else if(strstr(renderer, "Mesa DRI R")) { + GG.device = GPU_DEVICE_ATI; + GG.driver = GPU_DRIVER_OPENSOURCE; + } + else if(strstr(renderer, "Nouveau")) { + GG.device = GPU_DEVICE_NVIDIA; + GG.driver = GPU_DRIVER_OPENSOURCE; + } + else if(strstr(vendor, "Mesa")) { + GG.device = GPU_DEVICE_SOFTWARE; + GG.driver = GPU_DRIVER_SOFTWARE; + } + else if(strstr(vendor, "Microsoft")) { + GG.device = GPU_DEVICE_SOFTWARE; + GG.driver = GPU_DRIVER_SOFTWARE; + } + else if(strstr(renderer, "Apple Software Renderer")) { + GG.device = GPU_DEVICE_SOFTWARE; + GG.driver = GPU_DRIVER_SOFTWARE; + } + else { + GG.device = GPU_DEVICE_UNKNOWN; + GG.driver = GPU_DRIVER_UNKNOWN; + } + + GG.os = GPU_OS_UNIX; +#ifdef _WIN32 + GG.os = GPU_OS_WIN; +#endif +#ifdef __APPLE__ + GG.os = GPU_OS_MAC; +#endif } int GPU_glsl_support() @@ -102,10 +164,8 @@ int GPU_non_power_of_two_support() { /* Exception for buggy ATI/Apple driver in Mac OS X 10.5/10.6, * they claim to support this but can cause system freeze */ -#ifdef __APPLE__ - if(strcmp((char*)glGetString(GL_VENDOR), "ATI Technologies Inc.") == 0) + if(GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) return 0; -#endif return GLEW_ARB_texture_non_power_of_two; } diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index f988511b146..c08c32490c1 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -297,7 +297,7 @@ typedef enum eBezTriple_Handle { HD_AUTO, HD_VECT, HD_ALIGN, - HD_AUTO_ANIM + HD_AUTO_ANIM, /* not real handle type, but is just used as dummy item for anim code */ } eBezTriple_Handle; /* interpolation modes (used only for BezTriple->ipo) */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index f7b7584a731..db31e4cd220 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -650,7 +650,7 @@ enum FileSortTypeE { #define FILE_MAIN 2 #define FILE_LOADFONT 3 /* filesel op property -> action */ -#define FILE_OPEN 0 +#define FILE_OPENFILE 0 #define FILE_SAVE 1 /* sfile->flag and simasel->flag */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 40de15ac012..24d54bae1fa 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -485,6 +485,8 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_DRAW_TRIPLE 0 #define USER_DRAW_OVERLAP 1 #define USER_DRAW_FULL 2 +#define USER_DRAW_AUTOMATIC 3 +#define USER_DRAW_OVERLAP_FLIP 4 /* tw_flag (transform widget) */ diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h index bc019ef8121..daffeb48447 100644 --- a/source/blender/makesdna/DNA_view2d_types.h +++ b/source/blender/makesdna/DNA_view2d_types.h @@ -124,9 +124,12 @@ typedef struct View2D { #define V2D_SCROLL_SCALE_VERTICAL (1<<5) /* scale markings - horizontal */ #define V2D_SCROLL_SCALE_HORIZONTAL (1<<6) - /* disable draw temporary */ + /* induce hiding of scrollbars - set by region drawing in response to size of region */ #define V2D_SCROLL_VERTICAL_HIDE (1<<7) #define V2D_SCROLL_HORIZONTAL_HIDE (1<<8) + /* scrollbar extends beyond its available window - set when calculating scrollbars for drawing */ +#define V2D_SCROLL_VERTICAL_FULLR (1<<9) +#define V2D_SCROLL_HORIZONTAL_FULLR (1<<10) /* scroll_ui, activate flag for drawing */ #define V2D_SCROLL_H_ACTIVE (1<<0) diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 6546ec5747a..6a7f41c891e 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -77,13 +77,13 @@ typedef struct BGpic { typedef struct RegionView3D { - float winmat[4][4]; - float viewmat[4][4]; - float viewinv[4][4]; - float persmat[4][4]; - float persinv[4][4]; + float winmat[4][4]; /* GL_PROJECTION matrix */ + float viewmat[4][4]; /* GL_MODELVIEW matrix */ + float viewinv[4][4]; /* inverse of viewmat */ + float persmat[4][4]; /* viewmat*winmat */ + float persinv[4][4]; /* inverse of persmat */ - /* local viewmat/persmat, multiplied with object matrix, while drawing */ + /* viewmat/persmat multiplied with object matrix, while drawing and selection */ float viewmatob[4][4]; float persmatob[4][4]; diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 8a0e738080c..38819ccdf96 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -55,15 +55,17 @@ makesdna = makesdna_tool.Program (target = targetdir, source = source_files, LIB dna_dict = dna.Dictionary() dna.Depends ('dna.c', makesdna) dna.Depends ('dna.c', header_files) + if env['OURPLATFORM'] != 'linuxcross': + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'): + dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET") + else: + dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") +else: if USE_WINE: dna.Command ('dna.c', '', 'wine ' + root_build_dir+os.sep+"makesdna $TARGET") else: - if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'): - dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET") - else: - dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET") -else: - dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET") + dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET") + obj = ['intern/dna.c', 'intern/dna_genfile.c'] Return ('obj') diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 22b16c13630..3ee49be3c9a 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -191,6 +191,7 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) } } +// XXX depreceated.... old armature only animviz static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value) { bArmature *data= (bArmature*)ptr->data; @@ -204,20 +205,7 @@ static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) CLAMP(value, data->ghostsf, (int)(MAXFRAMEF/2)); data->ghostef= value; } - -static void rna_Armature_path_start_frame_set(PointerRNA *ptr, int value) -{ - bArmature *data= (bArmature*)ptr->data; - CLAMP(value, 1, data->pathef); - data->pathsf= value; -} - -static void rna_Armature_path_end_frame_set(PointerRNA *ptr, int value) -{ - bArmature *data= (bArmature*)ptr->data; - CLAMP(value, data->pathsf, (int)(MAXFRAMEF/2)); - data->pathef= value; -} +// XXX depreceated... old armature only animviz static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) { @@ -744,14 +732,6 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range."}, {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes."}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_paths_type_items[]= { - {ARM_PATH_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame."}, - {0, "RANGE", 0, "In Range", "Display Paths of poses within specified range."}, - {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_paths_location_items[]= { - {ARM_PATH_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"}, - {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"}, - {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_pose_position_items[]= { {0, "POSE", 0, "Pose Position", "Show armature in posed state."}, {ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state. No posing possible."}, @@ -797,18 +777,6 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - prop= RNA_def_property(srna, "paths_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag"); - RNA_def_property_enum_items(prop, prop_paths_type_items); - RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Bone Paths"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - prop= RNA_def_property(srna, "paths_location", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "pathflag"); - RNA_def_property_enum_items(prop, prop_paths_location_items); - RNA_def_property_ui_text(prop, "Paths Location", "When calculating Bone Paths, use Head or Tips"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - /* Boolean values */ /* layer */ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_LAYER_MEMBER); @@ -827,8 +795,6 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* flag */ - - prop= RNA_def_property(srna, "draw_axes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES); RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes."); @@ -864,10 +830,12 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors."); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); +// XXX depreceated ....... old animviz for armatures only prop= RNA_def_property(srna, "ghost_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL); RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Bones Only", ""); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); +// XXX depreceated ....... old animviz for armatures only /* deformflag */ prop= RNA_def_property(srna, "deform_vertexgroups", PROP_BOOLEAN, PROP_NONE); @@ -895,24 +863,8 @@ static void rna_def_armature(BlenderRNA *brna) //RNA_def_property_ui_text(prop, "Invert Vertex Group Influence", "Invert Vertex Group influence (only for Modifiers)"); //RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - /* pathflag */ - prop= RNA_def_property(srna, "paths_show_frame_numbers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_FNUMS); - RNA_def_property_ui_text(prop, "Paths Show Frame Numbers", "When drawing Armature in Pose Mode, show frame numbers on Bone Paths"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - prop= RNA_def_property(srna, "paths_highlight_keyframes", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFRAS); - RNA_def_property_ui_text(prop, "Paths Highlight Keyframes", "When drawing Armature in Pose Mode, emphasize position of keyframes on Bone Paths"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - prop= RNA_def_property(srna, "paths_show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "pathflag", ARM_PATH_KFNOS); - RNA_def_property_ui_text(prop, "Paths Show Keyframe Numbers", "When drawing Armature in Pose Mode, show frame numbers of Keyframes on Bone Paths"); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - /* Number fields */ +// XXX depreceated ....... old animviz for armatures only /* ghost/onionskining settings */ prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostep"); @@ -937,37 +889,7 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL); RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)."); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - /* bone path settings */ - prop= RNA_def_property(srna, "path_size", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pathsize"); - RNA_def_property_range(prop, 1, 100); - RNA_def_property_ui_text(prop, "Paths Frame Step", "Number of frames between 'dots' on Bone Paths (when drawing)."); - RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - - prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME); - RNA_def_property_int_sdna(prop, NULL, "pathsf"); - RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_start_frame_set", NULL); - RNA_def_property_ui_text(prop, "Paths Calculation Start Frame", "Starting frame of range of frames to use for Bone Path calculations."); - RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - - prop= RNA_def_property(srna, "path_end_frame", PROP_INT, PROP_TIME); - RNA_def_property_int_sdna(prop, NULL, "pathef"); - RNA_def_property_int_funcs(prop, NULL, "rna_Armature_path_end_frame_set", NULL); - RNA_def_property_ui_text(prop, "Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations."); - RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - - prop= RNA_def_property(srna, "path_before_current", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pathbc"); - RNA_def_property_range(prop, 1, MAXFRAMEF/2); - RNA_def_property_ui_text(prop, "Paths Frames Before Current", "Number of frames before current frame to show on Bone Paths (only for 'Around Current' option)."); - RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - - prop= RNA_def_property(srna, "path_after_current", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pathac"); - RNA_def_property_range(prop, 1, MAXFRAMEF/2); - RNA_def_property_ui_text(prop, "Paths Frames After Current", "Number of frames after current frame to show on Bone Paths (only for 'Around Current' option)."); - RNA_def_property_update(prop, 0, "rna_Armature_update_data"); +// XXX depreceated ....... old animviz for armatures only } void RNA_def_armature(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 91c296fd862..e276ef354f4 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -42,7 +42,6 @@ EnumPropertyItem beztriple_handle_type_items[] = { {HD_AUTO, "AUTO", 0, "Auto", ""}, {HD_VECT, "VECTOR", 0, "Vector", ""}, {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, - {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem beztriple_interpolation_mode_items[] = { @@ -831,7 +830,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering. Zero skips this property."); - prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ctime"); RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at."); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 34e2fc06ad7..0612520caec 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -98,7 +98,7 @@ char *rna_Image_get_abs_filename(Image *image, bContext *C) BLI_strncpy(filename, image->name, FILE_MAXDIR + FILE_MAXFILE); BLI_convertstringcode(filename, CTX_data_main(C)->name); - BLI_convertstringframe(filename, CTX_data_scene(C)->r.cfra); + BLI_convertstringframe(filename, CTX_data_scene(C)->r.cfra, 0); return filename; } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d14dfd08d48..a83ff71378f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2167,8 +2167,10 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem draw_method_items[] = { + {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver."}, {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory."}, {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."}, + {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", "Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)."}, {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt index 48392a5f509..77b666e269b 100644 --- a/source/blender/python/CMakeLists.txt +++ b/source/blender/python/CMakeLists.txt @@ -19,33 +19,31 @@ # # The Original Code is: all of this file. # -# Contributor(s): Jacques Beaurain. +# Contributor(s): Jacques Beaurainm, Campbell Barton # # ***** END GPL LICENSE BLOCK ***** +ADD_SUBDIRECTORY(generic) + FILE(GLOB SRC intern/*.c) -FILE(GLOB GENSRC generic/*.c) SET(INC - . ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna - ../blenkernel ../editors/include ../windowmanager ${PYTHON_INC} - ../../../extern/glew/include ../freestyle/intern/python + . + ../blenlib + ../makesdna + ../makesrna + ../blenkernel + ../windowmanager + ../editors/include + ../freestyle/intern/python + ../../../intern/guardedalloc + ${PYTHON_INC} ) -IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) -ENDIF(WITH_OPENEXR) - -IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) -ENDIF(WITH_QUICKTIME) - -IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) -ENDIF(WITH_FFMPEG) +# only to check if buildinfo is available +IF(WITH_BUILDINFO) + ADD_DEFINITIONS(-DBUILD_DATE) +ENDIF(WITH_BUILDINFO) BLENDERLIB(bf_python "${SRC}" "${INC}") -BLENDERLIB(bf_gen_python "${GENSRC}" "${INC}") diff --git a/source/blender/python/doc/epy/Mathutils.py b/source/blender/python/doc/epy/Mathutils.py index eff3ab87dd3..b1bb039debe 100644 --- a/source/blender/python/doc/epy/Mathutils.py +++ b/source/blender/python/doc/epy/Mathutils.py @@ -1,60 +1,9 @@ # Blender.Mathutils module and its subtypes -""" -The Blender.Mathutils submodule. -Mathutils -========= -(when accessing it from the Game Engine use Mathutils instead of Blender.Mathutils) - -This module provides access to matrices, eulers, quaternions and vectors. - -Example:: - import Blender - from Blender import Mathutils - from Blender.Mathutils import * - - vec = Vector([1,2,3]) - mat = RotationMatrix(90, 4, 'x') - matT = TranslationMatrix(vec) - - matTotal = mat * matT - matTotal.invert() - - mat3 = matTotal.rotationPart - quat1 = mat.to_quat() - quat2 = mat3.to_quat() - - angle = DifferenceQuats(quat1, quat2) - print angle -""" class Vector: """ - The Vector object - ================= - @note: Comparison operators can be done on Vector classes: - - >, >=, <, <= test the vector magnitude - - ==, != test vector values e.g. 1,2,3 != 1,2,4 even if they are the same length - @note: Math can be performed on Vector classes - - vec + vec - - vec - vec - - vec * float/int - - vec * matrix - - vec * vec - - vec * quat - - -vec - @note: You can access a vector object like a sequence - - x = vector[0] - - vec_a[:] vec_b - - vec2d[:] vec3d[:2] - @note: Vectors support 'swizzle' operations - - vec.xyz = vec.zyx - - vec.xy = vec.zw - - vec.xxy = vec.wzz - - vec.yzyz = vec.yxyx - - See U{http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)} @attention: Vector data can be wrapped or non-wrapped. When a object is wrapped it means that the object will give you direct access to the data inside of blender. Modification @@ -62,15 +11,6 @@ class Vector: you need to use the object's constructor. If you copy and object by assignment you will not get a second copy but a second reference to the same data. Only certain functions will return wrapped data. This will be indicated in the method description. - Example:: - wrappedObject = Object.getAttribute() #this is wrapped data - print wrappedObject.wrapped #prints 'True' - copyOfObject = wrappedObject.copy() #creates a copy of the object - secondPointer = wrappedObject #creates a second pointer to the same data - print wrappedObject.attribute #prints '5' - secondPointer.attribute = 10 - print wrappedObject.attribute #prints '10' - print copyOfObject.attribute #prints '5' """ def __init__(list = None): @@ -107,15 +47,6 @@ class Euler: you need to use the object's constructor. If you copy and object by assignment you will not get a second copy but a second reference to the same data. Only certain functions will return wrapped data. This will be indicated in the method description. - Example:: - wrappedObject = Object.getAttribute() #this is wrapped data - print wrappedObject.wrapped #prints 'True' - copyOfObject = wrappedObject.copy() #creates a copy of the object - secondPointer = wrappedObject #creates a second pointer to the same data - print wrappedObject.attribute #prints '5' - secondPointer.attribute = 10 - print wrappedObject.attribute #prints '10' - print copyOfObject.attribute #prints '5' """ def __init__(list = None): @@ -154,15 +85,6 @@ class Quaternion: you need to use the object's constructor. If you copy and object by assignment you will not get a second copy but a second reference to the same data. Only certain functions will return wrapped data. This will be indicated in the method description. - Example:: - wrappedObject = Object.getAttribute() #this is wrapped data - print wrappedObject.wrapped #prints 'True' - copyOfObject = wrappedObject.copy() #creates a copy of the object - secondPointer = wrappedObject #creates a second pointer to the same data - print wrappedObject.attribute #prints '5' - secondPointer.attribute = 10 - print wrappedObject.attribute #prints '10' - print copyOfObject.attribute #prints '5' """ def __init__(list, angle = None): @@ -208,15 +130,6 @@ class Matrix: you need to use the object's constructor. If you copy and object by assignment you will not get a second copy but a second reference to the same data. Only certain functions will return wrapped data. This will be indicated in the method description. - Example:: - wrappedObject = Object.getAttribute() #this is wrapped data - print wrappedObject.wrapped #prints 'True' - copyOfObject = wrappedObject.copy() #creates a copy of the object - secondPointer = wrappedObject #creates a second pointer to the same data - print wrappedObject.attribute #prints '5' - secondPointer.attribute = 10 - print wrappedObject.attribute #prints '10' - print copyOfObject.attribute #prints '5' """ def __init__(list1 = None, list2 = None, list3 = None, list4 = None): diff --git a/source/blender/python/doc/examples/mathutils.py b/source/blender/python/doc/examples/mathutils.py new file mode 100644 index 00000000000..a00ca3dd1c8 --- /dev/null +++ b/source/blender/python/doc/examples/mathutils.py @@ -0,0 +1,17 @@ +import Mathutils + +vec = Mathutils.Vector(1.0, 2.0, 3.0) + +mat_rot = Mathutils.RotationMatrix(90, 4, 'X') +mat_trans = Mathutils.TranslationMatrix(vec) + +mat = mat_trans * mat_rot +mat.invert() + +mat3 = mat.rotation_part() +quat1 = mat.to_quat() +quat2 = mat3.to_quat() + +angle = quat1.difference(quat2) + +print(angle)
\ No newline at end of file diff --git a/source/blender/python/doc/examples/mathutils_euler.py b/source/blender/python/doc/examples/mathutils_euler.py new file mode 100644 index 00000000000..0e7a62162d9 --- /dev/null +++ b/source/blender/python/doc/examples/mathutils_euler.py @@ -0,0 +1,3 @@ +import Mathutils + +# todo
\ No newline at end of file diff --git a/source/blender/python/doc/examples/mathutils_matrix.py b/source/blender/python/doc/examples/mathutils_matrix.py new file mode 100644 index 00000000000..0e7a62162d9 --- /dev/null +++ b/source/blender/python/doc/examples/mathutils_matrix.py @@ -0,0 +1,3 @@ +import Mathutils + +# todo
\ No newline at end of file diff --git a/source/blender/python/doc/examples/mathutils_quat.py b/source/blender/python/doc/examples/mathutils_quat.py new file mode 100644 index 00000000000..0e7a62162d9 --- /dev/null +++ b/source/blender/python/doc/examples/mathutils_quat.py @@ -0,0 +1,3 @@ +import Mathutils + +# todo
\ No newline at end of file diff --git a/source/blender/python/doc/examples/mathutils_vector.py b/source/blender/python/doc/examples/mathutils_vector.py new file mode 100644 index 00000000000..8b3dbfa5ee8 --- /dev/null +++ b/source/blender/python/doc/examples/mathutils_vector.py @@ -0,0 +1,55 @@ +import Mathutils + +# zero length vector +vec = Mathutils.Vector(0, 0, 1) + +# unit length vector +vec_a = vec.copy().normalize() + +vec_b = Mathutils.Vector(0, 1, 2) + +vec2d = Mathutils.Vector(1, 2) +vec3d = Mathutils.Vector([1, 0, 0]) +vec4d = vec_a.copy().resize4D() + +# other mathutuls types +quat = Mathutils.Quaternion() +matrix = Mathutils.Matrix() + +# Comparison operators can be done on Vector classes: + +# greater and less then test vector length. +vec_a > vec_b +vec_a >= vec_b +vec_a < vec_b +vec_a <= vec_b + +# ==, != test vector values e.g. 1,2,3 != 3,2,1 even if they are the same length +vec_a == vec_b +vec_a != vec_b + + +# Math can be performed on Vector classes +vec_a + vec_b +vec_a - vec_b +vec_a * vec_b +vec_a * 10.0 +vec_a * matrix +vec_a * vec_b +vec_a * quat +-vec_a + + +# You can access a vector object like a sequence +x = vec_a[0] +len(vec) +vec_a[:] = vec_b +vec2d[:] = vec3d[:2] + + +# Vectors support 'swizzle' operations +# See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics) +vec.xyz = vec.zyx +vec.xy = vec4d.zw +vec.xyz = vec4d.wzz +vec4d.wxyz = vec.yxyx diff --git a/source/blender/python/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py index d7699d5d8f5..3b92ec28548 100644 --- a/source/blender/python/sphinx_doc_gen.py +++ b/source/blender/python/doc/sphinx_doc_gen.py @@ -21,7 +21,7 @@ script_help_msg = ''' Usage, run this script from blenders root path once you have compiled blender - ./blender.bin -b -P /b/source/blender/python/sphinx_doc_gen.py + ./blender.bin -b -P /b/source/blender/python/doc/sphinx_doc_gen.py This will generate python files in "./source/blender/python/doc/sphinx-in" Generate html docs by running... @@ -51,11 +51,14 @@ def range_str(val): else: return str(val) -def write_indented_lines(ident, fn, text): +def write_indented_lines(ident, fn, text, strip=True): if text is None: return for l in text.split("\n"): - fn(ident + l.strip() + "\n") + if strip: + fn(ident + l.strip() + "\n") + else: + fn(ident + l + "\n") def pymethod2sphinx(ident, fw, identifier, py_func): @@ -109,8 +112,7 @@ def py_c_func2sphinx(ident, fw, identifier, py_func, is_class=True): # dump the docstring, assume its formatted correctly if py_func.__doc__: - for l in py_func.__doc__.split("\n"): - fw(ident + l + "\n") + write_indented_lines(ident, fw, py_func.__doc__, False) fw("\n") else: fw(ident + ".. function:: %s()\n\n" % identifier) @@ -133,6 +135,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): MethodDescriptorType = type(dict.get) GetSetDescriptorType = type(int.real) + filepath = os.path.join(BASEPATH, module_name + ".rst") @@ -150,6 +153,16 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): fw(module.__doc__.strip()) fw("\n\n") + # write members of the module + # only tested with PyStructs which are not exactly modules + for attribute, descr in sorted(type(module).__dict__.items()): + if type(descr) == types.MemberDescriptorType: + if descr.__doc__: + fw(".. data:: %s\n\n" % attribute) + write_indented_lines(" ", fw, descr.__doc__, False) + fw("\n") + + classes = [] for attribute in dir(module): @@ -173,8 +186,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): # May need to be its own function fw(".. class:: %s\n\n" % attribute) if value.__doc__: - for l in value.__doc__.split("\n"): - fw(" %s\n" % l) + write_indented_lines(" ", fw, value.__doc__, False) fw("\n") for key in sorted(value.__dict__.keys()): @@ -184,8 +196,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): if type(descr) == GetSetDescriptorType: if descr.__doc__: fw(" .. attribute:: %s\n\n" % key) - for l in descr.__doc__.split("\n"): - fw(" %s\n" % l) + write_indented_lines(" ", fw, descr.__doc__, False) fw("\n") for key in sorted(value.__dict__.keys()): @@ -194,8 +205,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): descr = value.__dict__[key] if type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet if descr.__doc__: - for l in descr.__doc__.split("\n"): - fw(" %s\n" % l) + write_indented_lines(" ", fw, descr.__doc__, False) fw("\n") fw("\n\n") @@ -203,6 +213,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): file.close() + def rna2sphinx(BASEPATH): structs, funcs, ops, props = rna_info.BuildRNAInfo() @@ -217,11 +228,16 @@ def rna2sphinx(BASEPATH): file = open(filepath, "w") fw = file.write + + version_string = bpy.app.version_string.split("(")[0] + if bpy.app.build_revision != "Unknown": + version_string = version_string + " r" + bpy.app.build_revision + fw("project = 'Blender 3D'\n") # fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") - fw("version = '%s'\n" % bpy.app.version_string) - fw("release = '%s'\n" % bpy.app.version_string) + fw("version = '%s'\n" % version_string) + fw("release = '%s'\n" % version_string) fw("\n") # needed for latex, pdf gen fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n") @@ -237,7 +253,7 @@ def rna2sphinx(BASEPATH): fw(" Blender Documentation contents\n") fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") fw("\n") - fw("This document is an API reference for Blender %s.\n" % bpy.app.version_string.split()[0]) + fw("This document is an API reference for Blender %s. built %s.\n" % (version_string, bpy.app.build_date)) fw("\n") fw("An introduction to blender and python can be found at <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>\n") fw("\n") @@ -285,6 +301,8 @@ def rna2sphinx(BASEPATH): # python modules from bpy import utils as module pymodule2sphinx(BASEPATH, "bpy.utils", module, "Utilities (bpy.utils)") + + # C modules from bpy import app as module pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data (bpy.app)") @@ -473,10 +491,18 @@ if __name__ == '__main__': print("\nError, this script must run from inside blender2.5") print(script_help_msg) else: - # os.system("rm source/blender/python/doc/sphinx-in/*.rst") - # os.system("rm -rf source/blender/python/doc/sphinx-out/*") - rna2sphinx('source/blender/python/doc/sphinx-in') + import shutil + + path_in = 'source/blender/python/doc/sphinx-in' + path_out = 'source/blender/python/doc/sphinx-in' + + shutil.rmtree(path_in, True) + shutil.rmtree(path_out, True) + rna2sphinx(path_in) + + # for fast module testing # os.system("rm source/blender/python/doc/sphinx-in/bpy.types.*.rst") + # os.system("rm source/blender/python/doc/sphinx-in/bpy.ops.*.rst") import sys sys.exit() diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c index 767af8e0836..a0eb050341f 100644 --- a/source/blender/python/generic/BGL.c +++ b/source/blender/python/generic/BGL.c @@ -33,7 +33,7 @@ * allowing script writers to make OpenGL calls in their Python scripts. */ #include "BGL.h" /*This must come first */ - +#include <GL/glew.h> #include "MEM_guardedalloc.h" static int type_size( int type ); diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h index 91f88549faf..d83a48445c9 100644 --- a/source/blender/python/generic/BGL.h +++ b/source/blender/python/generic/BGL.h @@ -41,7 +41,6 @@ #endif #include <Python.h> -#include <GL/glew.h> PyObject *BGL_Init(void); diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt new file mode 100644 index 00000000000..da916ef33c7 --- /dev/null +++ b/source/blender/python/generic/CMakeLists.txt @@ -0,0 +1,34 @@ +# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Contributor(s): Campbell Barton +# +# ***** END GPL LICENSE BLOCK ***** + +FILE(GLOB SRC *.c) + +SET(INC + . + ../../blenlib + ../../makesdna + ../../blenkernel + ../../editors/include + ../../../../intern/guardedalloc + ../../../../extern/glew/include + ${PYTHON_INC} +) + +BLENDERLIB(bf_gen_python "${SRC}" "${INC}") diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c index b3679c8f4a2..4d52e184319 100644 --- a/source/blender/python/generic/IDProp.c +++ b/source/blender/python/generic/IDProp.c @@ -480,10 +480,13 @@ PyObject *BPy_Wrap_GetKeys(IDProperty *prop) IDProperty *loop; int i; - for (i=0, loop=prop->data.group.first; loop; loop=loop->next, i++) + for (i=0, loop=prop->data.group.first; loop && (i < prop->len); loop=loop->next, i++) PyList_SET_ITEM(seq, i, PyUnicode_FromString(loop->name)); - if (i != prop->len) { + /* if the id prop is corrupt, count the remaining */ + for (; loop; loop=loop->next, i++) {} + + if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */ BPy_IDGroup_CorrectListLen(prop, seq, i); Py_DECREF(seq); /*free the list*/ /*call self again*/ diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index fa2c60813ed..cc8ced2d2db 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -54,7 +54,10 @@ #include "BKE_utildefines.h" //-------------------------DOC STRINGS --------------------------- -static char M_Mathutils_doc[] = "This module provides access to matrices, eulers, quaternions and vectors."; +static char M_Mathutils_doc[] = +"This module provides access to matrices, eulers, quaternions and vectors.\n" +"\n" +".. literalinclude:: ../examples/mathutils.py\n"; //-----------------------------METHODS---------------------------- //-----------------quat_rotation (internal)----------- diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index c41107286e0..2ba3d1d7675 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -591,7 +591,10 @@ static struct PyMethodDef Euler_methods[] = { }; //------------------PY_OBECT DEFINITION-------------------------- -static char euler_doc[] = "This object gives access to Eulers in Blender."; +static char euler_doc[] = +"This object gives access to Eulers in Blender.\n" +"\n" +".. literalinclude:: ../examples/mathutils_euler.py\n"; PyTypeObject euler_Type = { PyVarObject_HEAD_INIT(NULL, 0) diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index af754e532a9..181004929ff 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -1280,7 +1280,10 @@ static struct PyMethodDef Matrix_methods[] = { }; /*------------------PY_OBECT DEFINITION--------------------------*/ -static char matrix_doc[] = "This object gives access to Matrices in Blender."; +static char matrix_doc[] = +"This object gives access to Matrices in Blender.\n" +"\n" +".. literalinclude:: ../examples/mathutils_matrix.py\n"; PyTypeObject matrix_Type = { PyVarObject_HEAD_INIT(NULL, 0) diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 33d35da5175..54172537e26 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -860,7 +860,10 @@ static PyGetSetDef Quaternion_getseters[] = { }; //------------------PY_OBECT DEFINITION-------------------------- -static char quaternion_doc[] = "This object gives access to Quaternions in Blender."; +static char quaternion_doc[] = +"This object gives access to Quaternions in Blender.\n" +"\n" +".. literalinclude:: ../examples/mathutils_quat.py\n"; PyTypeObject quaternion_Type = { PyVarObject_HEAD_INIT(NULL, 0) diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 4efd168eb87..d0b103ae15c 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -793,8 +793,7 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end) list = PyList_New(end - begin); for(count = begin; count < end; count++) { - PyList_SetItem(list, count - begin, - PyFloat_FromDouble(self->vec[count])); + PyList_SET_ITEM(list, count - begin, PyFloat_FromDouble(self->vec[count])); } return list; @@ -1510,6 +1509,11 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) while (swizzleClosure & SWIZZLE_VALID_AXIS) { axisB = swizzleClosure & SWIZZLE_AXIS; + if(axisB >= self->size) { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis."); + return NULL; + } + vec[axisA] = self->vec[axisB]; swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; axisA++; @@ -1567,11 +1571,23 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < vecVal->size) { axisA = swizzleClosure & SWIZZLE_AXIS; + + if(axisB >= vecVal->size) { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis."); + return -1; + } + vecTemp[axisA] = vecVal->vec[axisB]; swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; axisB++; } + + if(axisB != vecVal->size) { + PyErr_SetString(PyExc_AttributeError, "Error: vector size does not match swizzle.\n"); + return -1; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); /* continue with BaseMathObject_WriteCallback at the end */ } @@ -1585,9 +1601,9 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur { item = PyList_GetItem(value, axisB); scalarVal = (float)PyFloat_AsDouble(item); - + if (scalarVal==-1.0 && PyErr_Occurred()) { - PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); + PyErr_SetString(PyExc_AttributeError, "Error: list item could not be used as a float.\n"); return -1; } @@ -1598,6 +1614,12 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; axisB++; } + + if(axisB != listLen) { + PyErr_SetString(PyExc_AttributeError, "Error: list size does not match swizzle.\n"); + return -1; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); /* continue with BaseMathObject_WriteCallback at the end */ } @@ -1619,7 +1641,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur return -1; } - if(!BaseMath_WriteCallback(vecVal)) + if(!BaseMath_WriteCallback(self)) return -1; else return 0; @@ -1639,342 +1661,342 @@ static PyGetSetDef Vector_getseters[] = { {"_owner", (getter)BaseMathObject_getOwner, (setter)NULL, BaseMathObject_Owner_doc, NULL}, /* autogenerated swizzle attrs, see python script below */ - {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 36 */ - {"xxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 292 */ - {"xxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2340 */ - {"xxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2852 */ - {"xxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3364 */ - {"xxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3876 */ - {"xxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 356 */ - {"xxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2404 */ - {"xxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2916 */ - {"xxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3428 */ - {"xxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3940 */ - {"xxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 420 */ - {"xxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2468 */ - {"xxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2980 */ - {"xxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3492 */ - {"xxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4004 */ - {"xxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 484 */ - {"xxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2532 */ - {"xxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3044 */ - {"xxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3556 */ - {"xxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4068 */ - {"xy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 44 */ - {"xyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 300 */ - {"xyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2348 */ - {"xyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2860 */ - {"xyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3372 */ - {"xyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3884 */ - {"xyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 364 */ - {"xyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2412 */ - {"xyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2924 */ - {"xyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3436 */ - {"xyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3948 */ - {"xyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 428 */ - {"xyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2476 */ - {"xyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2988 */ - {"xyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3500 */ - {"xyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4012 */ - {"xyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 492 */ - {"xywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2540 */ - {"xywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3052 */ - {"xywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3564 */ - {"xyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4076 */ - {"xz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 52 */ - {"xzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 308 */ - {"xzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2356 */ - {"xzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2868 */ - {"xzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3380 */ - {"xzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3892 */ - {"xzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 372 */ - {"xzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2420 */ - {"xzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2932 */ - {"xzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3444 */ - {"xzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3956 */ - {"xzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 436 */ - {"xzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2484 */ - {"xzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2996 */ - {"xzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3508 */ - {"xzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4020 */ - {"xzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 500 */ - {"xzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2548 */ - {"xzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3060 */ - {"xzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3572 */ - {"xzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4084 */ - {"xw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 60 */ - {"xwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 316 */ - {"xwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2364 */ - {"xwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2876 */ - {"xwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3388 */ - {"xwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3900 */ - {"xwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 380 */ - {"xwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2428 */ - {"xwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2940 */ - {"xwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3452 */ - {"xwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3964 */ - {"xwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 444 */ - {"xwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2492 */ - {"xwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3004 */ - {"xwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3516 */ - {"xwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4028 */ - {"xww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 508 */ - {"xwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2556 */ - {"xwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3068 */ - {"xwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3580 */ - {"xwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4092 */ - {"yx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 37 */ - {"yxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 293 */ - {"yxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2341 */ - {"yxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2853 */ - {"yxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3365 */ - {"yxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3877 */ - {"yxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 357 */ - {"yxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2405 */ - {"yxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2917 */ - {"yxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3429 */ - {"yxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3941 */ - {"yxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 421 */ - {"yxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2469 */ - {"yxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2981 */ - {"yxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3493 */ - {"yxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4005 */ - {"yxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 485 */ - {"yxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2533 */ - {"yxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3045 */ - {"yxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3557 */ - {"yxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4069 */ - {"yy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 45 */ - {"yyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 301 */ - {"yyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2349 */ - {"yyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2861 */ - {"yyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3373 */ - {"yyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3885 */ - {"yyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 365 */ - {"yyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2413 */ - {"yyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2925 */ - {"yyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3437 */ - {"yyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3949 */ - {"yyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 429 */ - {"yyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2477 */ - {"yyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2989 */ - {"yyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3501 */ - {"yyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4013 */ - {"yyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 493 */ - {"yywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2541 */ - {"yywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3053 */ - {"yywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3565 */ - {"yyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4077 */ - {"yz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 53 */ - {"yzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 309 */ - {"yzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2357 */ - {"yzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2869 */ - {"yzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3381 */ - {"yzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3893 */ - {"yzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 373 */ - {"yzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2421 */ - {"yzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2933 */ - {"yzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3445 */ - {"yzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3957 */ - {"yzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 437 */ - {"yzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2485 */ - {"yzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2997 */ - {"yzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3509 */ - {"yzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4021 */ - {"yzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 501 */ - {"yzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2549 */ - {"yzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3061 */ - {"yzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3573 */ - {"yzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4085 */ - {"yw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 61 */ - {"ywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 317 */ - {"ywxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2365 */ - {"ywxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2877 */ - {"ywxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3389 */ - {"ywxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3901 */ - {"ywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 381 */ - {"ywyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2429 */ - {"ywyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2941 */ - {"ywyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3453 */ - {"ywyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3965 */ - {"ywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 445 */ - {"ywzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2493 */ - {"ywzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3005 */ - {"ywzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3517 */ - {"ywzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4029 */ - {"yww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 509 */ - {"ywwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2557 */ - {"ywwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3069 */ - {"ywwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3581 */ - {"ywww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4093 */ - {"zx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 38 */ - {"zxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 294 */ - {"zxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2342 */ - {"zxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2854 */ - {"zxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3366 */ - {"zxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3878 */ - {"zxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 358 */ - {"zxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2406 */ - {"zxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2918 */ - {"zxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3430 */ - {"zxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3942 */ - {"zxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 422 */ - {"zxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2470 */ - {"zxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2982 */ - {"zxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3494 */ - {"zxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4006 */ - {"zxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 486 */ - {"zxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2534 */ - {"zxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3046 */ - {"zxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3558 */ - {"zxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4070 */ - {"zy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 46 */ - {"zyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 302 */ - {"zyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2350 */ - {"zyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2862 */ - {"zyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3374 */ - {"zyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3886 */ - {"zyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 366 */ - {"zyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2414 */ - {"zyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2926 */ - {"zyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3438 */ - {"zyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3950 */ - {"zyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 430 */ - {"zyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2478 */ - {"zyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2990 */ - {"zyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3502 */ - {"zyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4014 */ - {"zyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 494 */ - {"zywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2542 */ - {"zywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3054 */ - {"zywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3566 */ - {"zyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4078 */ - {"zz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 54 */ - {"zzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 310 */ - {"zzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2358 */ - {"zzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2870 */ - {"zzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3382 */ - {"zzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3894 */ - {"zzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 374 */ - {"zzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2422 */ - {"zzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2934 */ - {"zzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3446 */ - {"zzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3958 */ - {"zzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 438 */ - {"zzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2486 */ - {"zzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2998 */ - {"zzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3510 */ - {"zzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4022 */ - {"zzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 502 */ - {"zzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2550 */ - {"zzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3062 */ - {"zzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3574 */ - {"zzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4086 */ - {"zw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 62 */ - {"zwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 318 */ - {"zwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2366 */ - {"zwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2878 */ - {"zwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3390 */ - {"zwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3902 */ - {"zwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 382 */ - {"zwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2430 */ - {"zwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2942 */ - {"zwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3454 */ - {"zwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3966 */ - {"zwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 446 */ - {"zwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2494 */ - {"zwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3006 */ - {"zwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3518 */ - {"zwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4030 */ - {"zww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 510 */ - {"zwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2558 */ - {"zwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3070 */ - {"zwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3582 */ - {"zwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4094 */ - {"wx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 39 */ - {"wxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 295 */ - {"wxxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2343 */ - {"wxxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2855 */ - {"wxxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3367 */ - {"wxxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3879 */ - {"wxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 359 */ - {"wxyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2407 */ - {"wxyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2919 */ - {"wxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3431 */ - {"wxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3943 */ - {"wxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 423 */ - {"wxzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2471 */ - {"wxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2983 */ - {"wxzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3495 */ - {"wxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4007 */ - {"wxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 487 */ - {"wxwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2535 */ - {"wxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3047 */ - {"wxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3559 */ - {"wxww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4071 */ - {"wy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 47 */ - {"wyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 303 */ - {"wyxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2351 */ - {"wyxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2863 */ - {"wyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3375 */ - {"wyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3887 */ - {"wyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 367 */ - {"wyyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2415 */ - {"wyyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2927 */ - {"wyyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3439 */ - {"wyyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3951 */ - {"wyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 431 */ - {"wyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2479 */ - {"wyzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2991 */ - {"wyzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3503 */ - {"wyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4015 */ - {"wyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 495 */ - {"wywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2543 */ - {"wywy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3055 */ - {"wywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3567 */ - {"wyww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4079 */ - {"wz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 55 */ - {"wzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 311 */ - {"wzxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2359 */ - {"wzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2871 */ - {"wzxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3383 */ - {"wzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3895 */ - {"wzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 375 */ - {"wzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2423 */ - {"wzyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2935 */ - {"wzyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3447 */ - {"wzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3959 */ - {"wzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 439 */ - {"wzzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2487 */ - {"wzzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2999 */ - {"wzzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3511 */ - {"wzzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4023 */ - {"wzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 503 */ - {"wzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2551 */ - {"wzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3063 */ - {"wzwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3575 */ - {"wzww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4087 */ - {"ww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, /* 63 */ - {"wwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 319 */ - {"wwxx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2367 */ - {"wwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2879 */ - {"wwxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3391 */ - {"wwxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3903 */ - {"wwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 383 */ - {"wwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2431 */ - {"wwyy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2943 */ - {"wwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3455 */ - {"wwyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3967 */ - {"wwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 447 */ - {"wwzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2495 */ - {"wwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3007 */ - {"wwzz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3519 */ - {"wwzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4031 */ - {"www", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, /* 511 */ - {"wwwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 2559 */ - {"wwwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3071 */ - {"wwwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 3583 */ - {"wwww", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, /* 4095 */ + {"xx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 36 + {"xxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 292 + {"xxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2340 + {"xxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2852 + {"xxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3364 + {"xxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3876 + {"xxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 356 + {"xxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2404 + {"xxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2916 + {"xxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3428 + {"xxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3940 + {"xxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 420 + {"xxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2468 + {"xxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2980 + {"xxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3492 + {"xxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4004 + {"xxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 484 + {"xxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2532 + {"xxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3044 + {"xxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3556 + {"xxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4068 + {"xy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 44 + {"xyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 300 + {"xyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2348 + {"xyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2860 + {"xyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3372 + {"xyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3884 + {"xyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 364 + {"xyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2412 + {"xyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2924 + {"xyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3436 + {"xyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3948 + {"xyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 428 + {"xyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2476 + {"xyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2988 + {"xyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3500 + {"xyzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4012 + {"xyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 492 + {"xywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2540 + {"xywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3052 + {"xywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3564 + {"xyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4076 + {"xz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 52 + {"xzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 308 + {"xzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2356 + {"xzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2868 + {"xzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3380 + {"xzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3892 + {"xzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 372 + {"xzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2420 + {"xzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2932 + {"xzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3444 + {"xzyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3956 + {"xzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 436 + {"xzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2484 + {"xzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2996 + {"xzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3508 + {"xzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4020 + {"xzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 500 + {"xzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2548 + {"xzwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3060 + {"xzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3572 + {"xzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4084 + {"xw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 60 + {"xwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 316 + {"xwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2364 + {"xwxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2876 + {"xwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3388 + {"xwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3900 + {"xwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 380 + {"xwyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2428 + {"xwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2940 + {"xwyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3452 + {"xwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3964 + {"xwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 444 + {"xwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2492 + {"xwzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3004 + {"xwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3516 + {"xwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4028 + {"xww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 508 + {"xwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2556 + {"xwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3068 + {"xwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3580 + {"xwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((0|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4092 + {"yx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 37 + {"yxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 293 + {"yxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2341 + {"yxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2853 + {"yxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3365 + {"yxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3877 + {"yxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 357 + {"yxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2405 + {"yxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2917 + {"yxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3429 + {"yxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3941 + {"yxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 421 + {"yxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2469 + {"yxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2981 + {"yxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3493 + {"yxzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4005 + {"yxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 485 + {"yxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2533 + {"yxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3045 + {"yxwz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3557 + {"yxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4069 + {"yy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 45 + {"yyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 301 + {"yyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2349 + {"yyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2861 + {"yyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3373 + {"yyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3885 + {"yyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 365 + {"yyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2413 + {"yyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2925 + {"yyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3437 + {"yyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3949 + {"yyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 429 + {"yyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2477 + {"yyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2989 + {"yyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3501 + {"yyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4013 + {"yyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 493 + {"yywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2541 + {"yywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3053 + {"yywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3565 + {"yyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4077 + {"yz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 53 + {"yzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 309 + {"yzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2357 + {"yzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2869 + {"yzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3381 + {"yzxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3893 + {"yzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 373 + {"yzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2421 + {"yzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2933 + {"yzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3445 + {"yzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3957 + {"yzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 437 + {"yzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2485 + {"yzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2997 + {"yzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3509 + {"yzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4021 + {"yzw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 501 + {"yzwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2549 + {"yzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3061 + {"yzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3573 + {"yzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4085 + {"yw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 61 + {"ywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 317 + {"ywxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2365 + {"ywxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2877 + {"ywxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3389 + {"ywxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3901 + {"ywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 381 + {"ywyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2429 + {"ywyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2941 + {"ywyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3453 + {"ywyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3965 + {"ywz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 445 + {"ywzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2493 + {"ywzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3005 + {"ywzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3517 + {"ywzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4029 + {"yww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 509 + {"ywwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2557 + {"ywwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3069 + {"ywwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3581 + {"ywww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((1|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4093 + {"zx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 38 + {"zxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 294 + {"zxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2342 + {"zxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2854 + {"zxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3366 + {"zxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3878 + {"zxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 358 + {"zxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2406 + {"zxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2918 + {"zxyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3430 + {"zxyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3942 + {"zxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 422 + {"zxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2470 + {"zxzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2982 + {"zxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3494 + {"zxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4006 + {"zxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 486 + {"zxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2534 + {"zxwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3046 + {"zxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3558 + {"zxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4070 + {"zy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 46 + {"zyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 302 + {"zyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2350 + {"zyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2862 + {"zyxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3374 + {"zyxw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3886 + {"zyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 366 + {"zyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2414 + {"zyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2926 + {"zyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3438 + {"zyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3950 + {"zyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 430 + {"zyzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2478 + {"zyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2990 + {"zyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3502 + {"zyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4014 + {"zyw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 494 + {"zywx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2542 + {"zywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3054 + {"zywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3566 + {"zyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4078 + {"zz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 54 + {"zzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 310 + {"zzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2358 + {"zzxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2870 + {"zzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3382 + {"zzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3894 + {"zzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 374 + {"zzyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2422 + {"zzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2934 + {"zzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3446 + {"zzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3958 + {"zzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 438 + {"zzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2486 + {"zzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2998 + {"zzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3510 + {"zzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4022 + {"zzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 502 + {"zzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2550 + {"zzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3062 + {"zzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3574 + {"zzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4086 + {"zw", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 62 + {"zwx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 318 + {"zwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2366 + {"zwxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2878 + {"zwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3390 + {"zwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3902 + {"zwy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 382 + {"zwyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2430 + {"zwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2942 + {"zwyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3454 + {"zwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3966 + {"zwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 446 + {"zwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2494 + {"zwzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3006 + {"zwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3518 + {"zwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4030 + {"zww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 510 + {"zwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2558 + {"zwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3070 + {"zwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3582 + {"zwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((2|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4094 + {"wx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 39 + {"wxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 295 + {"wxxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2343 + {"wxxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2855 + {"wxxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3367 + {"wxxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3879 + {"wxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 359 + {"wxyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2407 + {"wxyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2919 + {"wxyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3431 + {"wxyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3943 + {"wxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 423 + {"wxzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2471 + {"wxzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2983 + {"wxzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3495 + {"wxzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4007 + {"wxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 487 + {"wxwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2535 + {"wxwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3047 + {"wxwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3559 + {"wxww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4071 + {"wy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 47 + {"wyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 303 + {"wyxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2351 + {"wyxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2863 + {"wyxz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3375 + {"wyxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3887 + {"wyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 367 + {"wyyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2415 + {"wyyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2927 + {"wyyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3439 + {"wyyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3951 + {"wyz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 431 + {"wyzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2479 + {"wyzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2991 + {"wyzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3503 + {"wyzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4015 + {"wyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 495 + {"wywx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2543 + {"wywy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3055 + {"wywz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3567 + {"wyww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4079 + {"wz", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 55 + {"wzx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 311 + {"wzxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2359 + {"wzxy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2871 + {"wzxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3383 + {"wzxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3895 + {"wzy", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 375 + {"wzyx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2423 + {"wzyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2935 + {"wzyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3447 + {"wzyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3959 + {"wzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 439 + {"wzzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2487 + {"wzzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2999 + {"wzzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3511 + {"wzzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4023 + {"wzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 503 + {"wzwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2551 + {"wzwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3063 + {"wzwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3575 + {"wzww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4087 + {"ww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS)))}, // 63 + {"wwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 319 + {"wwxx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2367 + {"wwxy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2879 + {"wwxz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3391 + {"wwxw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3903 + {"wwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 383 + {"wwyx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2431 + {"wwyy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2943 + {"wwyz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3455 + {"wwyw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3967 + {"wwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 447 + {"wwzx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2495 + {"wwzy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3007 + {"wwzz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3519 + {"wwzw", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4031 + {"www", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2))))}, // 511 + {"wwwx", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((0|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 2559 + {"wwwy", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((1|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3071 + {"wwwz", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((2|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 3583 + {"wwww", (getter)Vector_getSwizzle, (setter)NULL, NULL, SET_INT_IN_POINTER(((3|SWIZZLE_VALID_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<SWIZZLE_BITS_PER_AXIS) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*2)) | ((3|SWIZZLE_VALID_AXIS)<<(SWIZZLE_BITS_PER_AXIS*3))) )}, // 4095 {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -2011,12 +2033,12 @@ items.sort(key = lambda a: a[0].replace('x', '0').replace('y', '1').replace('z', unique = set() for key, val in items: num = eval(val) - print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)Vector_setSwizzle, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), axis_dict[key], num) + set_str = 'Vector_setSwizzle' if (len(set(key)) == len(key)) else 'NULL' + print '\t{"%s", %s(getter)Vector_getSwizzle, (setter)%s, NULL, SET_INT_IN_POINTER(%s)}, // %s' % (key, (' '*(4-len(key))), set_str, axis_dict[key], num) unique.add(num) if len(unique) != len(items): print "ERROR" - */ //-----------------row_vector_multiplication (internal)----------- @@ -2110,7 +2132,10 @@ static struct PyMethodDef Vector_methods[] = { vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order */ -static char vector_doc[] = "This object gives access to Vectors in Blender."; +static char vector_doc[] = +"This object gives access to Vectors in Blender.\n" +"\n" +".. literalinclude:: ../examples/mathutils_vector.py\n"; PyTypeObject vector_Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -2203,11 +2228,12 @@ PyObject *newVectorObject(float *vec, int size, int type, PyTypeObject *base_typ int i; VectorObject *self; - if(base_type) self = (VectorObject *)base_type->tp_alloc(base_type, 0); - else self = PyObject_NEW(VectorObject, &vector_Type); - if(size > 4 || size < 2) return NULL; + + if(base_type) self = (VectorObject *)base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(VectorObject, &vector_Type); + self->size = size; /* init callbacks as NULL */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c new file mode 100644 index 00000000000..440db76aafe --- /dev/null +++ b/source/blender/python/intern/bpy_app.c @@ -0,0 +1,129 @@ +/** + * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "bpy_app.h" +#include "bpy_util.h" + +#include "BLI_path_util.h" + +#include "BKE_blender.h" +#include "BKE_global.h" +#include "structseq.h" + +#ifdef BUILD_DATE +extern char * build_date; +extern char * build_time; +extern char * build_rev; +extern char * build_platform; +extern char * build_type; +#else +static char * build_date = "Unknown"; +static char * build_time = "Unknown"; +static char * build_rev = "Unknown"; +static char * build_platform = "Unknown"; +static char * build_type = "Unknown"; +#endif + +static PyTypeObject BlenderAppType; + +static PyStructSequence_Field app_info_fields[] = { + {"version", "The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)"}, + {"version_string", "The Blender version formatted as a string."}, + {"home", "The blender home directory, normally matching $HOME"}, + {"binary_path", "The location of blenders executable, useful for utilities that spawn new instances."}, + {"debug", "Boolean, set when blender is running in debug mode (started with -d)."}, + + /* buildinfo */ + {"build_date", "The date this blender instance was built.."}, + {"build_time", "The time this blender instance was built."}, + {"build_revision", "The subversion revision this blender instance was built with."}, + {"build_platform", "The platform this blender instance was built for."}, + {"build_type", "The type of build (Release, Debug)"}, + {0} +}; + +static PyStructSequence_Desc app_info_desc = { + "bpy.app", /* name */ + "This module contains application values that remain unchanged during runtime.", /* doc */ + app_info_fields, /* fields */ + 10 +}; + +static PyObject *make_app_info(void) +{ + extern char bprogname[]; /* argv[0] from creator.c */ + + PyObject *app_info; + int pos = 0; + + app_info = PyStructSequence_New(&BlenderAppType); + if (app_info == NULL) { + return NULL; + } + +#define SetIntItem(flag) \ + PyStructSequence_SET_ITEM(app_info, pos++, PyLong_FromLong(flag)) +#define SetStrItem(flag) \ + PyStructSequence_SET_ITEM(app_info, pos++, PyUnicode_FromString(flag)) +#define SetObjItem(obj) \ + PyStructSequence_SET_ITEM(app_info, pos++, obj) + + SetObjItem(Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION)); + SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION)); + SetStrItem(BLI_gethome()); + SetStrItem(bprogname); + SetObjItem(PyBool_FromLong(G.f & G_DEBUG)); + + /* build info */ + SetStrItem(build_date); + SetStrItem(build_time); + SetStrItem(build_rev); + SetStrItem(build_platform); + SetStrItem(build_type); + +#undef SetIntItem +#undef SetStrItem +#undef SetObjItem + + if (PyErr_Occurred()) { + Py_CLEAR(app_info); + return NULL; + } + return app_info; +} + +PyObject *BPY_app_struct(void) +{ + PyObject *ret; + + PyStructSequence_InitType(&BlenderAppType, &app_info_desc); + + ret= make_app_info(); + + /* prevent user from creating new instances */ + BlenderAppType.tp_init = NULL; + BlenderAppType.tp_new = NULL; + + return ret; +} diff --git a/source/blender/python/intern/bpy_ui.h b/source/blender/python/intern/bpy_app.h index 4182a32d3f0..1628f26b3c9 100644 --- a/source/blender/python/intern/bpy_ui.h +++ b/source/blender/python/intern/bpy_app.h @@ -21,11 +21,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BPY_UI_H__ -#define BPY_UI_H__ +#ifndef BPY_APP_H__ +#define BPY_APP_H__ #include <Python.h> -PyObject *BPY_ui_module( void ); +PyObject *BPY_app_struct( void ); #endif diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 142b5f0788a..8437f4d376e 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -38,10 +38,10 @@ #include "compile.h" /* for the PyCodeObject */ #include "eval.h" /* for PyEval_EvalCode */ +#include "bpy_app.h" #include "bpy_rna.h" #include "bpy_props.h" #include "bpy_operator.h" -#include "bpy_ui.h" #include "bpy_util.h" #ifndef WIN32 @@ -60,11 +60,9 @@ #include "BLI_fileops.h" #include "BLI_string.h" -#include "BKE_blender.h" #include "BKE_context.h" #include "BKE_text.h" #include "BKE_context.h" -#include "BKE_global.h" #include "BKE_main.h" #include "BPY_extern.h" @@ -213,9 +211,7 @@ static void bpy_init_modules( void ) /* PyModule_AddObject( mod, "doc", BPY_rna_doc() ); */ PyModule_AddObject( mod, "props", BPY_rna_props() ); PyModule_AddObject( mod, "ops", BPY_operator_module() ); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ - PyModule_AddObject( mod, "ui", BPY_ui_module() ); // XXX very experimental, consider this a test, especially PyCObject is not meant to be permanent - - + PyModule_AddObject( mod, "app", BPY_app_struct() ); /* bpy context */ { @@ -227,20 +223,6 @@ static void bpy_init_modules( void ) PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module); } - /* blender info that wont change at runtime, add into _bpy */ - { - extern char bprogname[]; /* argv[0] from creator.c */ - - PyObject *mod_dict= PyModule_GetDict(mod); - char tmpstr[256]; - PyModule_AddStringConstant(mod, "_HOME", BLI_gethome()); - PyDict_SetItemString(mod_dict, "_VERSION", Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION)); - sprintf(tmpstr, "%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - PyModule_AddStringConstant(mod, "_VERSION_STR", tmpstr); - PyModule_AddStringConstant(mod, "_BINPATH", bprogname); - PyModule_AddIntConstant(mod, "_DEBUG", G.f & G_DEBUG ? 1:0); - } - /* add our own modules dir, this is a python package */ bpy_import_test("bpy"); } @@ -797,10 +779,9 @@ int BPY_context_get(bContext *C, const char *member, bContextDataResult *result) if (item) printf("Context '%s' not a valid type\n", member); else printf("Context '%s' not found\n", member); } - else if (G.f & G_DEBUG) { + else { printf("Context '%s' found\n", member); } return done; } - diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 946e94c7064..5948507de33 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -24,6 +24,7 @@ #include "bpy_props.h" #include "bpy_rna.h" +#include "bpy_util.h" #include "RNA_access.h" #include "RNA_define.h" /* for defining our own rna */ @@ -55,7 +56,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -83,6 +84,52 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) } } +static char BPy_BoolVectorProperty_doc[] = +".. function:: BoolVectorProperty(name=\"\", description=\"\", default=(False, False, False), hidden=False, size=3)\n" +"\n" +" Returns a new vector boolean property definition."; +PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw) +{ + StructRNA *srna; + + if (PyTuple_GET_SIZE(args) > 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + srna= srna_from_self(self); + if(srna==NULL && PyErr_Occurred()) { + return NULL; /* self's type was compatible but error getting the srna */ + } + else if(srna) { + static char *kwlist[] = {"attr", "name", "description", "default", "hidden", "size", NULL}; + char *id=NULL, *name="", *description=""; + int def[PYRNA_STACK_ARRAY]={0}; + int hidden=0, size=3; + PropertyRNA *prop; + PyObject *pydef= NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOii:BoolVectorProperty", kwlist, &id, &name, &description, &pydef, &hidden, &size)) + return NULL; + + if(size < 1 || size > PYRNA_STACK_ARRAY) { + PyErr_Format(PyExc_TypeError, "BoolVectorProperty(size=%d): size must be between 0 and %d.", size, PYRNA_STACK_ARRAY); + return NULL; + } + + if(pydef && BPyAsPrimitiveArray(def, pydef, size, &PyBool_Type, "BoolVectorProperty(default=sequence)") < 0) + return NULL; + + prop= RNA_def_boolean_array(srna, id, size, pydef ? def:NULL, name, description); + if(hidden) RNA_def_property_flag(prop, PROP_HIDDEN); + RNA_def_property_duplicate_pointers(prop); + Py_RETURN_NONE; + } + else { /* operators defer running this function */ + return bpy_prop_deferred_return((void *)BPy_BoolVectorProperty, kw); + } +} + static char BPy_IntProperty_doc[] = ".. function:: IntProperty(name=\"\", description=\"\", default=0, min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, step=1, hidden=False)\n" "\n" @@ -91,7 +138,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -121,6 +168,54 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) } } +static char BPy_IntVectorProperty_doc[] = +".. function:: IntVectorProperty(name=\"\", description=\"\", default=(0, 0, 0), min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, hidden=False, size=3)\n" +"\n" +" Returns a new vector int property definition."; +PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw) +{ + StructRNA *srna; + + if (PyTuple_GET_SIZE(args) > 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + srna= srna_from_self(self); + if(srna==NULL && PyErr_Occurred()) { + return NULL; /* self's type was compatible but error getting the srna */ + } + else if(srna) { + static char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "hidden", "size", NULL}; + char *id=NULL, *name="", *description=""; + int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0}; + int hidden=0, size=3; + PropertyRNA *prop; + PyObject *pydef= NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOiiiiii:IntVectorProperty", kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &hidden, &size)) + return NULL; + + if(size < 1 || size > PYRNA_STACK_ARRAY) { + PyErr_Format(PyExc_TypeError, "IntVectorProperty(size=%d): size must be between 0 and %d.", size, PYRNA_STACK_ARRAY); + return NULL; + } + + if(pydef && BPyAsPrimitiveArray(def, pydef, size, &PyLong_Type, "IntVectorProperty(default=sequence)") < 0) + return NULL; + + prop= RNA_def_int_array(srna, id, size, pydef ? def:NULL, min, max, name, description, soft_min, soft_max); + RNA_def_property_ui_range(prop, min, max, step, 0); + if(hidden) RNA_def_property_flag(prop, PROP_HIDDEN); + RNA_def_property_duplicate_pointers(prop); + Py_RETURN_NONE; + } + else { /* operators defer running this function */ + return bpy_prop_deferred_return((void *)BPy_IntVectorProperty, kw); + } +} + + static char BPy_FloatProperty_doc[] = ".. function:: FloatProperty(name=\"\", description=\"\", default=0.0, min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, hidden=False)\n" "\n" @@ -129,7 +224,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -167,7 +262,7 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -187,38 +282,15 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw) if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssOfffffiii:FloatVectorProperty", kwlist, &id, &name, &description, &pydef, &min, &max, &soft_min, &soft_max, &step, &precision, &hidden, &size)) return NULL; - if(size < 0 || size > PYRNA_STACK_ARRAY) { - PyErr_Format(PyExc_TypeError, "FloatVectorProperty(): size must be between 0 and %d, given %d.", PYRNA_STACK_ARRAY, size); + if(size < 1 || size > PYRNA_STACK_ARRAY) { + PyErr_Format(PyExc_TypeError, "FloatVectorProperty(size=%d): size must be between 0 and %d.", size, PYRNA_STACK_ARRAY); return NULL; } - if(pydef) { - int i; - - if(!PySequence_Check(pydef)) { - PyErr_Format(PyExc_TypeError, "FloatVectorProperty(): default value is not a sequence of size: %d.", size); - return NULL; - } - - if(size != PySequence_Size(pydef)) { - PyErr_Format(PyExc_TypeError, "FloatVectorProperty(): size: %d, does not default: %d.", size, PySequence_Size(pydef)); - return NULL; - } - - for(i=0; i<size; i++) { - PyObject *item= PySequence_GetItem(pydef, i); - if(item) { - def[i]= PyFloat_AsDouble(item); - Py_DECREF(item); - } - } - - if(PyErr_Occurred()) { /* error set above */ - return NULL; - } - } + if(pydef && BPyAsPrimitiveArray(def, pydef, size, &PyFloat_Type, "FloatVectorProperty(default=sequence)") < 0) + return NULL; - prop= RNA_def_float_vector(srna, id, size, pydef ? def:NULL, min, max, name, description, soft_min, soft_max); + prop= RNA_def_float_array(srna, id, size, pydef ? def:NULL, min, max, name, description, soft_min, soft_max); RNA_def_property_ui_range(prop, min, max, step, precision); if(hidden) RNA_def_property_flag(prop, PROP_HIDDEN); RNA_def_property_duplicate_pointers(prop); @@ -237,7 +309,7 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -322,7 +394,7 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -387,7 +459,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -433,7 +505,7 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_Size(args) > 0) { + if (PyTuple_GET_SIZE(args) > 0) { PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. return NULL; } @@ -470,7 +542,9 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) static struct PyMethodDef props_methods[] = { {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolProperty_doc}, + {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolVectorProperty_doc}, {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntProperty_doc}, + {"IntVectorProperty", (PyCFunction)BPy_IntVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntVectorProperty_doc}, {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatProperty_doc}, {"FloatVectorProperty", (PyCFunction)BPy_FloatVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatVectorProperty_doc}, {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, BPy_StringProperty_doc}, diff --git a/source/blender/python/intern/bpy_props.h b/source/blender/python/intern/bpy_props.h index 23ed142d7b8..2ff938476c5 100644 --- a/source/blender/python/intern/bpy_props.h +++ b/source/blender/python/intern/bpy_props.h @@ -31,7 +31,9 @@ PyObject *BPY_rna_props( void ); /* functions for setting up new props - experemental */ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 4cda17902cb..afaf0c4e055 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3184,7 +3184,9 @@ PyTypeObject pyrna_prop_Type = { static struct PyMethodDef pyrna_struct_subtype_methods[] = { {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"IntVectorProperty", (PyCFunction)BPy_IntVectorProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"FloatVectorProperty", (PyCFunction)BPy_FloatVectorProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""}, diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c deleted file mode 100644 index ab50ebd8bd5..00000000000 --- a/source/blender/python/intern/bpy_ui.c +++ /dev/null @@ -1,69 +0,0 @@ -/** - * $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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Campbell Barton - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "bpy_ui.h" -#include "bpy_util.h" -#include "bpy_rna.h" /* for rna buttons */ -#include "bpy_operator.h" /* for setting button operator properties */ - -#include "WM_types.h" /* for WM_OP_INVOKE_DEFAULT & friends */ - -#include "BLI_dynstr.h" - -#include "MEM_guardedalloc.h" -#include "BKE_global.h" /* evil G.* */ -#include "BKE_context.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" /* only for SpaceLink */ -#include "UI_interface.h" -#include "WM_api.h" - -/* Dummy Module, may want to include non RNA UI functions here, else it can be removed */ - -static struct PyMethodDef ui_methods[] = { - {NULL, NULL, 0, NULL} -}; - -static struct PyModuleDef ui_module = { - PyModuleDef_HEAD_INIT, - "_bpy.ui", - "", - -1,/* multiple "initialization" just copies the module dict. */ - ui_methods, - NULL, NULL, NULL, NULL -}; - -PyObject *BPY_ui_module( void ) -{ - PyObject *submodule; - submodule= PyModule_Create(&ui_module); - - /* INCREF since its its assumed that all these functions return the - * module with a new ref like PyDict_New, since they are passed to - * PyModule_AddObject which steals a ref */ - Py_INCREF(submodule); - - return submodule; -} diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 2cd1337fba7..8b5987d6c94 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -373,3 +373,56 @@ int BPy_errors_to_report(ReportList *reports) return 1; } +/* array utility function */ +int BPyAsPrimitiveArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix) +{ + PyObject *value_fast; + int value_len; + int i; + + if(!(value_fast=PySequence_Fast(value, error_prefix))) { + return -1; + } + + value_len= PySequence_Fast_GET_SIZE(value_fast); + + if(value_len != length) { + Py_DECREF(value); + PyErr_Format(PyExc_TypeError, "%s: invalid sequence length. expected %d, got %d.", error_prefix, length, value_len); + return -1; + } + + /* for each type */ + if(type == &PyFloat_Type) { + float *array_float= array; + for(i=0; i<length; i++) { + array_float[i] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value_fast, i)); + } + } + else if(type == &PyLong_Type) { + int *array_int= array; + for(i=0; i<length; i++) { + array_int[i] = PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i)); + } + } + else if(type == &PyBool_Type) { + int *array_bool= array; + for(i=0; i<length; i++) { + array_bool[i] = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value_fast, i)) != 0); + } + } + else { + Py_DECREF(value_fast); + PyErr_Format(PyExc_TypeError, "%s: internal error %s is invalid.", error_prefix, type->tp_name); + return -1; + } + + Py_DECREF(value_fast); + + if(PyErr_Occurred()) { + PyErr_Format(PyExc_TypeError, "%s: one or more items could not be used as a %s.", error_prefix, type->tp_name); + return -1; + } + + return 0; +} diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h index dcf957969e8..3a363096fd2 100644 --- a/source/blender/python/intern/bpy_util.h +++ b/source/blender/python/intern/bpy_util.h @@ -78,5 +78,5 @@ void BPy_SetContext(struct bContext *C); extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate); extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate); - +int BPyAsPrimitiveArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix); #endif diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 6e9e4885def..412214aa428 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -154,8 +154,6 @@ void makeqtstring (RenderData *rd, char *string) { } void filepath_qt(char *string, RenderData *rd) { - char txt[64]; - if (string==NULL) return; strcpy(string, rd->pic); @@ -168,7 +166,7 @@ void filepath_qt(char *string, RenderData *rd) { if (strchr(string, '#')==NULL) strcat(string, "####"); /* 4 numbers */ - BLI_convertstringframe_range(string, rd->sfra, rd->efra); + BLI_convertstringframe_range(string, rd->sfra, rd->efra, 4); strcat(string, ".mov"); } } diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index 40d57552fb6..109ed1870fc 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -186,7 +186,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace + colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:0 bytesPerRow:4*width bitsPerPixel:32/*RGB format padded to 32bits*/]; @@ -208,7 +208,7 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height) pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace + colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:0 bytesPerRow:4*width bitsPerPixel:32/* RGBA */]; diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 66f0a327e81..699367e9c5a 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -54,6 +54,10 @@ IF(APPLE) ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") ENDIF(APPLE) +IF(WITH_RAYOPTIMIZATION) + ADD_DEFINITIONS(-D__SSE__) +ENDIF(WITH_RAYOPTIMIZATION) + #TODO #if env['OURPLATFORM']=='linux2': # cflags='-pthread' diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index f3a997aa5bf..7f80731e26d 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -34,6 +34,11 @@ if env['OURPLATFORM'] == 'linux2': cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] incs += ' ../../../extern/binreloc/include' +if env['OURPLATFORM'] == 'linuxcross': + if env['WITH_BF_RAYOPTIMIZATION']: + cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + cxxflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS'] + if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] @@ -44,6 +49,12 @@ if env['WITH_BF_OPENEXR']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] +# +# HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h +# +if env['OURPLATFORM'] == 'linuxcross': + defs.append('__MMX__') + if env['WITH_BF_RAYOPTIMIZATION']: defs.append('__SSE__') diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index da0be4d55d5..671811f0b7a 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2092,7 +2092,7 @@ static void load_backbuffer(Render *re) strcpy(name, re->r.backbuf); BLI_convertstringcode(name, G.sce); - BLI_convertstringframe(name, re->r.cfra); + BLI_convertstringframe(name, re->r.cfra, 0); if(re->backbuf) { re->backbuf->id.us--; @@ -2844,9 +2844,18 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R /* float factor for random dither, imbuf takes care of it */ ibuf->dither= scene->r.dither_intensity; + /* prepare to gamma correct to sRGB color space */ - if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) - ibuf->profile = IB_PROFILE_LINEAR_RGB; + if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) { + /* sequence editor can generate 8bpc render buffers */ + if (ibuf->rect) { + ibuf->profile = IB_PROFILE_SRGB; + if (ELEM(scene->r.imtype, R_OPENEXR, R_RADHDR)) + IMB_float_from_rect(ibuf); + } else { + ibuf->profile = IB_PROFILE_LINEAR_RGB; + } + } ok= BKE_write_ibuf(scene, ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality); diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 38241878300..d1fa8a5ed51 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1416,6 +1416,10 @@ int shade_samples(ShadeSample *ssamp, PixStr *ps, int x, int y) shade_input_do_shade(shi, shr); } } + else if(shi->passflag & SCE_PASS_Z) { + for(samp=0; samp<ssamp->tot; samp++, shi++, shr++) + shr->z= -shi->co[2]; + } return 1; } diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 484dbdd37a3..6d67c068bdd 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3828,6 +3828,11 @@ static int shade_tra_samples(ShadeSample *ssamp, StrandShadeCache *cache, int x, renderspothalo(shi, shr->combined, shr->combined[3]); } } + else if(shi->passflag & SCE_PASS_Z) { + for(samp=0; samp<ssamp->tot; samp++, shi++, shr++) + shr->z= -shi->co[2]; + } + return 1; } return 0; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index e7521db462d..2e598cfdd61 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -217,7 +217,7 @@ int WM_operator_name_call (struct bContext *C, const char *opstring, int int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports); void WM_operator_properties_alloc(struct PointerRNA **ptr, struct IDProperty **properties, const char *opstring); /* used for keymap and macro items */ -void WM_operator_properties_sanitize(struct PointerRNA *ptr); /* make props not context sensitive */ +void WM_operator_properties_sanitize(struct PointerRNA *ptr, int val); /* make props context sensitive or not */ void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring); void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot); void WM_operator_properties_free(struct PointerRNA *ptr); @@ -278,23 +278,14 @@ struct wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(s void (*copy)(struct wmDrag *, struct wmDropBox *)); ListBase *WM_dropboxmap_find(char *idname, int spaceid, int regionid); - /* OpenGL wrappers, mimicking opengl syntax */ + /* Set a subwindow active in pixelspace view, with optional scissor subset */ void wmSubWindowSet (struct wmWindow *win, int swinid); void wmSubWindowScissorSet (struct wmWindow *win, int swinid, struct rcti *srct); -void wmLoadMatrix (float mat[][4]); -void wmGetMatrix (float mat[][4]); -void wmMultMatrix (float mat[][4]); -void wmGetSingleMatrix (float mat[][4]); -void wmScale (float x, float y, float z); -void wmLoadIdentity (void); /* note: old name clear_view_mat */ -void wmPushMatrix (void); /* one level only */ -void wmPopMatrix (void); /* one level only */ - + /* OpenGL utilities with safety check + working in modelview matrix mode */ void wmFrustum (float x1, float x2, float y1, float y2, float n, float f); void wmOrtho (float x1, float x2, float y1, float y2, float n, float f); void wmOrtho2 (float x1, float x2, float y1, float y2); -void wmOrthoPixelSpace (void); /* utilities */ void WM_set_framebuffer_index_color(int index); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 0d2f1043d0b..30a8c4c6cde 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -180,14 +180,13 @@ static void wm_flush_regions_up(bScreen *screen, rcti *dirty) } } -static void wm_method_draw_overlap_all(bContext *C, wmWindow *win) +static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange) { wmWindowManager *wm= CTX_wm_manager(C); bScreen *screen= win->screen; ScrArea *sa; ARegion *ar; static rcti rect= {0, 0, 0, 0}; - int exchange= (G.f & G_SWAP_EXCHANGE); /* flush overlapping regions */ if(screen->regionbase.first) { @@ -400,7 +399,7 @@ static void wm_draw_triple_fail(bContext *C, wmWindow *win) wm_draw_window_clear(win); win->drawfail= 1; - wm_method_draw_overlap_all(C, win); + wm_method_draw_overlap_all(C, win, 0); } static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple) @@ -666,10 +665,27 @@ static int wm_draw_update_test_window(wmWindow *win) return 0; } +static int wm_automatic_draw_method(wmWindow *win) +{ + if(win->drawmethod == USER_DRAW_AUTOMATIC) { + /* ATI opensource driver is known to be very slow at this */ + if(GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) + return USER_DRAW_OVERLAP; + /* Windows software driver darkens color on each redraw */ + else if(GPU_type_matches(GPU_DEVICE_SOFTWARE, GPU_OS_WIN, GPU_DRIVER_SOFTWARE)) + return USER_DRAW_OVERLAP_FLIP; + else + return USER_DRAW_TRIPLE; + } + else + return win->drawmethod; +} + void wm_draw_update(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); wmWindow *win; + int drawmethod; for(win= wm->windows.first; win; win= win->next) { if(win->drawmethod != U.wmdrawmethod) { @@ -687,15 +703,17 @@ void wm_draw_update(bContext *C) if(win->screen->do_refresh) ED_screen_refresh(wm, win); + drawmethod= wm_automatic_draw_method(win); + if(win->drawfail) - wm_method_draw_overlap_all(C, win); - else if(win->drawmethod == USER_DRAW_FULL) + wm_method_draw_overlap_all(C, win, 0); + else if(drawmethod == USER_DRAW_FULL) wm_method_draw_full(C, win); - else if(win->drawmethod == USER_DRAW_OVERLAP) - wm_method_draw_overlap_all(C, win); - /*else if(win->drawmethod == USER_DRAW_DAMAGE) - wm_method_draw_damage(C, win);*/ - else // if(win->drawmethod == USER_DRAW_TRIPLE) + else if(drawmethod == USER_DRAW_OVERLAP) + wm_method_draw_overlap_all(C, win, 0); + else if(drawmethod == USER_DRAW_OVERLAP_FLIP) + wm_method_draw_overlap_all(C, win, 1); + else // if(drawmethod == USER_DRAW_TRIPLE) wm_method_draw_triple(C, win); win->screen->do_draw_gesture= 0; @@ -714,8 +732,9 @@ void wm_draw_window_clear(wmWindow *win) bScreen *screen= win->screen; ScrArea *sa; ARegion *ar; + int drawmethod= wm_automatic_draw_method(win); - if(win->drawmethod == USER_DRAW_TRIPLE) + if(drawmethod == USER_DRAW_TRIPLE) wm_draw_triple_free(win); /* clear screen swap flags */ @@ -730,7 +749,9 @@ void wm_draw_window_clear(wmWindow *win) void wm_draw_region_clear(wmWindow *win, ARegion *ar) { - if(win->drawmethod == USER_DRAW_OVERLAP) + int drawmethod= wm_automatic_draw_method(win); + + if(ELEM(drawmethod, USER_DRAW_OVERLAP, USER_DRAW_OVERLAP_FLIP)) wm_flush_regions_down(win->screen, &ar->winrct); win->screen->do_draw= 1; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 43e87e2ab60..7e7dfe7a968 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -281,6 +281,61 @@ void wm_event_do_notifiers(bContext *C) CTX_wm_window_set(C, NULL); } +/* ********************* ui handler ******************* */ + +static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *event, int always_pass) +{ + ScrArea *area= CTX_wm_area(C); + ARegion *region= CTX_wm_region(C); + ARegion *menu= CTX_wm_menu(C); + int retval; + + /* we set context to where ui handler came from */ + if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); + if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); + if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); + + retval= handler->ui_handle(C, event, handler->ui_userdata); + + /* putting back screen context */ + if((retval != WM_UI_HANDLER_BREAK) || always_pass) { + CTX_wm_area_set(C, area); + CTX_wm_region_set(C, region); + CTX_wm_menu_set(C, menu); + } + else { + /* this special cases is for areas and regions that get removed */ + CTX_wm_area_set(C, NULL); + CTX_wm_region_set(C, NULL); + CTX_wm_menu_set(C, NULL); + } + + if(retval == WM_UI_HANDLER_BREAK) + return WM_HANDLER_BREAK; + + return WM_HANDLER_CONTINUE; +} + +static void wm_handler_ui_cancel(bContext *C) +{ + wmWindow *win= CTX_wm_window(C); + ARegion *ar= CTX_wm_region(C); + wmEventHandler *handler, *nexthandler; + + if(!ar) + return; + + for(handler= ar->handlers.first; handler; handler= nexthandler) { + nexthandler= handler->next; + + if(handler->ui_handle) { + wmEvent event= *(win->eventstate); + event.type= EVT_BUT_CANCEL; + handler->ui_handle(C, &event, handler->ui_userdata); + } + } +} + /* ********************* operators ******************* */ int WM_operator_poll(bContext *C, wmOperatorType *ot) @@ -457,6 +512,8 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P motherop= NULL; } + WM_operator_properties_sanitize(op->ptr, 0); + return op; } @@ -553,6 +610,12 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P WM_cursor_grab(CTX_wm_window(C), wrap, FALSE, bounds); } + + /* cancel UI handlers, typically tooltips that can hang around + while dragging the view or worse, that stay there permanently + after the modal operator has swallowed all events and passed + none to the UI handler */ + wm_handler_ui_cancel(C); } else WM_operator_free(op); @@ -594,11 +657,12 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex case WM_OP_EXEC_REGION_WIN: case WM_OP_INVOKE_REGION_WIN: { - /* forces operator to go to the region window, for header menus */ + /* forces operator to go to the region window, for header menus + but we stay in the same region if we are already in one */ ARegion *ar= CTX_wm_region(C); ScrArea *area= CTX_wm_area(C); - if(area) { + if(!(ar && ar->regiontype == RGN_TYPE_WINDOW) && area) { ARegion *ar1= area->regionbase.first; for(; ar1; ar1= ar1->next) if(ar1->regiontype==RGN_TYPE_WINDOW) @@ -1039,42 +1103,6 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand return WM_HANDLER_BREAK; } -static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *event) -{ - ScrArea *area= CTX_wm_area(C); - ARegion *region= CTX_wm_region(C); - ARegion *menu= CTX_wm_menu(C); - int retval, always_pass; - - /* we set context to where ui handler came from */ - if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); - if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); - if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); - - /* in advance to avoid access to freed event on window close */ - always_pass= wm_event_always_pass(event); - - retval= handler->ui_handle(C, event, handler->ui_userdata); - - /* putting back screen context */ - if((retval != WM_UI_HANDLER_BREAK) || always_pass) { - CTX_wm_area_set(C, area); - CTX_wm_region_set(C, region); - CTX_wm_menu_set(C, menu); - } - else { - /* this special cases is for areas and regions that get removed */ - CTX_wm_area_set(C, NULL); - CTX_wm_region_set(C, NULL); - CTX_wm_menu_set(C, NULL); - } - - if(retval == WM_UI_HANDLER_BREAK) - return WM_HANDLER_BREAK; - - return WM_HANDLER_CONTINUE; -} - /* fileselect handlers are only in the window queue, so it's save to switch screens or area types */ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHandler *handler, wmEvent *event) { @@ -1276,7 +1304,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) } } else if(handler->ui_handle) { - action |= wm_handler_ui_call(C, handler, event); + action |= wm_handler_ui_call(C, handler, event, always_pass); } else if(handler->type==WM_HANDLER_FILESELECT) { /* screen context changes here */ diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 47d8c8d9831..e9f32f6526e 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -318,7 +318,6 @@ void wm_gesture_draw(wmWindow *win) for(; gt; gt= gt->next) { /* all in subwindow space */ wmSubWindowSet(win, gt->swinid); - wmOrthoPixelSpace(); if(gt->type==WM_GESTURE_RECT) wm_gesture_draw_rect(win, gt); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 24a66883ef7..9b0f6823522 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -60,7 +60,7 @@ static void keymap_properties_set(wmKeyMapItem *kmi) { WM_operator_properties_alloc(&(kmi->ptr), &(kmi->properties), kmi->idname); - WM_operator_properties_sanitize(kmi->ptr); + WM_operator_properties_sanitize(kmi->ptr, 1); } void WM_keymap_properties_reset(wmKeyMapItem *kmi) @@ -475,10 +475,11 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, const char *op if(found==NULL) { if(ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) { if(sa) { - ARegion *ar= sa->regionbase.first; - for(; ar; ar= ar->next) - if(ar->regiontype==RGN_TYPE_WINDOW) - break; + if(!(ar && ar->regiontype == RGN_TYPE_WINDOW)) { + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_WINDOW) + break; + } if(ar) found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, hotkey, compare_props, keymap_r); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b6d5f5c7795..5c753926537 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -391,7 +391,7 @@ wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char /* do this on first use, since operatordefinitions might have been not done yet */ WM_operator_properties_alloc(&(otmacro->ptr), &(otmacro->properties), idname); - WM_operator_properties_sanitize(otmacro->ptr); + WM_operator_properties_sanitize(otmacro->ptr, 1); BLI_addtail(&ot->macro, otmacro); @@ -593,12 +593,15 @@ void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, con } -void WM_operator_properties_sanitize(PointerRNA *ptr) +void WM_operator_properties_sanitize(PointerRNA *ptr, int val) { RNA_STRUCT_BEGIN(ptr, prop) { switch(RNA_property_type(prop)) { case PROP_ENUM: - RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); + if (val) + RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); + else + RNA_def_property_clear_flag(prop, PROP_ENUM_NO_CONTEXT); break; case PROP_POINTER: { @@ -607,7 +610,7 @@ void WM_operator_properties_sanitize(PointerRNA *ptr) /* recurse into operator properties */ if (RNA_struct_is_a(ptype, &RNA_OperatorProperties)) { PointerRNA opptr = RNA_property_pointer_get(ptr, prop); - WM_operator_properties_sanitize(&opptr); + WM_operator_properties_sanitize(&opptr, val); } break; } @@ -1361,7 +1364,7 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->exec= wm_open_mainfile_exec; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE); RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file."); } @@ -1519,7 +1522,7 @@ static void WM_OT_link_append(wmOperatorType *ot) ot->flag |= OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPEN); + WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE); RNA_def_boolean(ot->srna, "link", 1, "Link", "Link the objects or datablocks rather than appending."); RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the linked objects."); @@ -1604,7 +1607,7 @@ static void WM_OT_recover_auto_save(wmOperatorType *ot) ot->invoke= wm_recover_auto_save_invoke; ot->poll= WM_operator_winactive; - WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPEN); + WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE); } /* *************** save file as **************** */ @@ -2685,7 +2688,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op) WM_cursor_wait(0); - BKE_reportf(op->reports, RPT_INFO, "%d x %s: %.2f ms, average: %.4f", iter, infostr, time, time/iter); + BKE_reportf(op->reports, RPT_WARNING, "%d x %s: %.2f ms, average: %.4f", iter, infostr, time, time/iter); return OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index decf1f0d676..97b3d3e800c 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -66,9 +66,6 @@ typedef struct wmSubWindow { rcti winrct; int swinid; - - float viewmat[4][4], winmat[4][4]; - float viewmat1[4][4], winmat1[4][4]; } wmSubWindow; @@ -132,8 +129,17 @@ void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4]) { wmSubWindow *swin= swin_from_swinid(win, swinid); - if(swin) - mul_m4_m4m4(mat, swin->viewmat, swin->winmat); + if(swin) { + /* used by UI, should find a better way to get the matrix there */ + if(swinid == win->screen->mainwin) { + int width, height; + + wm_subwindow_getsize(win, swin->swinid, &width, &height); + orthographic_m4(mat, -0.375, (float)width-0.375, -0.375, (float)height-0.375, -100, 100); + } + else + glGetFloatv(GL_PROJECTION_MATRIX, (float*)mat); + } } /* always sets pixel-precise 2D window/view matrices */ @@ -155,16 +161,13 @@ int wm_subwindow_open(wmWindow *win, rcti *winrct) swin->swinid= freewinid; swin->winrct= *winrct; - unit_m4(swin->viewmat); - unit_m4(swin->winmat); - /* and we appy it all right away */ wmSubWindowSet(win, swin->swinid); /* extra service */ wm_subwindow_getsize(win, swin->swinid, &width, &height); wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); - wmLoadIdentity(); + glLoadIdentity(); return swin->swinid; } @@ -257,11 +260,9 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct) else glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(&_curswin->winmat[0][0]); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(&_curswin->viewmat[0][0]); - + wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); + glLoadIdentity(); + glFlush(); } @@ -272,129 +273,22 @@ void wmSubWindowSet(wmWindow *win, int swinid) wmSubWindowScissorSet(win, swinid, NULL); } -void wmLoadMatrix(float mat[][4]) -{ - if(_curswin==NULL) return; - - glLoadMatrixf(mat); - - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) - copy_m4_m4(_curswin->viewmat, mat); - else - copy_m4_m4(_curswin->winmat, mat); -} - -void wmGetMatrix(float mat[][4]) -{ - if(_curswin==NULL) return; - - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) { - copy_m4_m4(mat, _curswin->viewmat); - } else { - copy_m4_m4(mat, _curswin->winmat); - } -} - -void wmMultMatrix(float mat[][4]) -{ - if(_curswin==NULL) return; - - glMultMatrixf((float*) mat); - - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)_curswin->viewmat); - else - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)_curswin->winmat); -} - -static int debugpush= 0; - -void wmPushMatrix(void) -{ - if(_curswin==NULL) return; - - if(debugpush) - printf("wmPushMatrix error already pushed\n"); - debugpush= 1; - - copy_m4_m4(_curswin->viewmat1, _curswin->viewmat); - copy_m4_m4(_curswin->winmat1, _curswin->winmat); -} - -void wmPopMatrix(void) +void wmFrustum(float x1, float x2, float y1, float y2, float n, float f) { - if(_curswin==NULL) return; - - if(debugpush==0) - printf("wmPopMatrix error nothing popped\n"); - debugpush= 0; - - copy_m4_m4(_curswin->viewmat, _curswin->viewmat1); - copy_m4_m4(_curswin->winmat, _curswin->winmat1); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(&_curswin->winmat[0][0]); + glLoadIdentity(); + glFrustum(x1, x2, y1, y2, n, f); glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(&_curswin->viewmat[0][0]); - } -void wmGetSingleMatrix(float mat[][4]) -{ - if(_curswin) - mul_m4_m4m4(mat, _curswin->viewmat, _curswin->winmat); -} - -void wmScale(float x, float y, float z) -{ - if(_curswin==NULL) return; - - glScalef(x, y, z); - - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)_curswin->viewmat); - else - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)_curswin->winmat); - -} - -void wmLoadIdentity(void) +void wmOrtho(float x1, float x2, float y1, float y2, float n, float f) { - if(_curswin==NULL) return; - - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) - unit_m4(_curswin->viewmat); - else - unit_m4(_curswin->winmat); - + glMatrixMode(GL_PROJECTION); glLoadIdentity(); -} -void wmFrustum(float x1, float x2, float y1, float y2, float n, float f) -{ - if(_curswin) { - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(x1, x2, y1, y2, n, f); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)_curswin->winmat); - glMatrixMode(GL_MODELVIEW); - } -} + glOrtho(x1, x2, y1, y2, n, f); -void wmOrtho(float x1, float x2, float y1, float y2, float n, float f) -{ - if(_curswin) { - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - glOrtho(x1, x2, y1, y2, n, f); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)_curswin->winmat); - glMatrixMode(GL_MODELVIEW); - } + glMatrixMode(GL_MODELVIEW); } void wmOrtho2(float x1, float x2, float y1, float y2) @@ -402,18 +296,8 @@ void wmOrtho2(float x1, float x2, float y1, float y2) /* prevent opengl from generating errors */ if(x1==x2) x2+=1.0; if(y1==y2) y2+=1.0; - wmOrtho(x1, x2, y1, y2, -100, 100); -} -void wmOrthoPixelSpace(void) -{ - if(_curswin) { - int width, height; - - wm_subwindow_getsize(_curwindow, _curswin->swinid, &width, &height); - wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); - wmLoadIdentity(); - } + wmOrtho(x1, x2, y1, y2, -100, 100); } /* *************************** Framebuffer color depth, for selection codes ********************** */ @@ -533,17 +417,3 @@ int WM_framebuffer_to_index(unsigned int col) /* ********** END MY WINDOW ************** */ -#if 0 // XXX not used... -#ifdef WIN32 -static int is_a_really_crappy_nvidia_card(void) { - static int well_is_it= -1; - - /* Do you understand the implication? Do you? */ - if (well_is_it==-1) - well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0); - - return well_is_it; -} -#endif -#endif // XXX not used... - diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index ed593cb8dcd..71efdab1f59 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -34,6 +34,7 @@ #include "DNA_listBase.h" #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" +#include "RNA_access.h" #include "MEM_guardedalloc.h" @@ -714,6 +715,28 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) } break; } + + case GHOST_kEventOpenMainFile: + { + PointerRNA props_ptr; + wmWindow *oldWindow; + char *path = GHOST_GetEventData(evt); + + if (path) { + /* operator needs a valid window in context, ensures + it is correctly set */ + oldWindow = CTX_wm_window(C); + CTX_wm_window_set(C, win); + + WM_operator_properties_create(&props_ptr, "WM_OT_open_mainfile"); + RNA_string_set(&props_ptr, "path", path); + WM_operator_name_call(C, "WM_OT_open_mainfile", WM_OP_EXEC_DEFAULT, &props_ptr); + WM_operator_properties_free(&props_ptr); + + CTX_wm_window_set(C, oldWindow); + } + break; + } case GHOST_kEventDraggingDropDone: { wmEvent event= *(win->eventstate); /* copy last state, like mouse coords */ diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index be0f5abbc47..c2fe3cc8017 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -267,6 +267,7 @@ #define EVT_BUT_OPEN 0x5021 #define EVT_MODAL_MAP 0x5022 #define EVT_DROP 0x5023 +#define EVT_BUT_CANCEL 0x5024 /* NOTE: these defines are saved in keymap files, do not change values but just add new ones */ #define GESTURE_MODAL_CANCEL 1 diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index ed4332a656f..cc556f32c90 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -82,6 +82,8 @@ struct MenuType *WM_menutype_find(const char *idname, int quiet){return (struct void WM_autosave_init(struct bContext *C){} void WM_jobs_stop_all(struct wmWindowManager *wm){} +struct wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id){return (struct wmKeyMapItem *) NULL;} +int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event){return 0;} void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){} void WM_main_add_notifier(unsigned int type, void *reference){} void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep){} @@ -136,6 +138,7 @@ void ED_node_texture_default(struct Tex *tx){} void ED_node_changed_update(struct bContext *C, struct bNode *node){} void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene){} int ED_view3d_scene_layer_set(int lay, const int *values){return 0;} +void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar){} int text_file_modified(struct Text *text){return 0;} void ED_node_shader_default(struct Material *ma){} void ED_screen_animation_timer_update(struct bContext *C, int redraws){} @@ -224,6 +227,7 @@ void uiTemplateTextureImage(struct uiLayout *layout, struct bContext *C, struct void uiTemplateImage(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *userptr, int compact){} void uiTemplateDopeSheetFilter(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr){} void uiTemplateColorWheel(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider){} +void uiTemplateHistogram(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){} /* rna render */ struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;} @@ -293,7 +297,7 @@ void smoke_get_index(void) {return;} void smoke_step(void) {return;} */ -char blender_path(){return NULL;} +char blender_path(){return (char) NULL;} /* CSG */ struct CSG_BooleanOperation * CSG_NewBooleanFunction( void ){return (struct CSG_BooleanOperation *) NULL;} diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 2a7ba5b3e24..8c84976e5e2 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -89,11 +89,11 @@ IF(WIN32) ENDIF(WIN32) IF(WITH_BUILDINFO) - ADD_DEFINITIONS(-DBUILD_DATE="${BUILD_DATE}") - ADD_DEFINITIONS(-DBUILD_TIME="${BUILD_TIME}") - ADD_DEFINITIONS(-DBUILD_REV="${BUILD_REV}") - ADD_DEFINITIONS(-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}") - ADD_DEFINITIONS(-DBUILD_TYPE="${CMAKE_BUILD_TYPE}") + ADD_DEFINITIONS(-DBUILD_DATE=${BUILD_DATE}) + ADD_DEFINITIONS(-DBUILD_TIME=${BUILD_TIME}) + ADD_DEFINITIONS(-DBUILD_REV=${BUILD_REV}) + ADD_DEFINITIONS(-DBUILD_PLATFORM=${CMAKE_SYSTEM_NAME}) + ADD_DEFINITIONS(-DBUILD_TYPE=${CMAKE_BUILD_TYPE}) SET(EXESRC ${EXESRC} buildinfo.c) ENDIF(WITH_BUILDINFO) diff --git a/source/creator/creator.c b/source/creator/creator.c index 4d207319b35..ef155600059 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -44,6 +44,8 @@ #include "BLI_winstuff.h" #endif +#include "BLI_args.h" + #include "GEN_messaging.h" #include "DNA_ID.h" @@ -110,8 +112,8 @@ extern char * build_type; #endif /* Local Function prototypes */ -static void print_help(void); -static void print_version(void); +static int print_help(int argc, char **argv, void *data); +static int print_version(int argc, char **argv, void *data); /* for the callbacks: */ @@ -155,7 +157,7 @@ static void blender_esc(int sig) } } -static void print_version(void) +static int print_version(int argc, char **argv, void *data) { #ifdef BUILD_DATE printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); @@ -167,9 +169,13 @@ static void print_version(void) #else printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); #endif + + exit(0); + + return 0; } -static void print_help(void) +static int print_help(int argc, char **argv, void *data) { printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); printf ("Usage: blender [args ...] [file] [args ...]\n"); @@ -223,6 +229,8 @@ static void print_help(void) printf (" -nojoystick\tDisable joystick support\n"); printf (" -noglsl\tDisable GLSL shading\n"); printf (" -noaudio\tForce sound system to None\n"); + printf (" -setaudio\tForce sound system to a specific device\n"); + printf (" \tNULL SDL OPENAL JACK\n"); printf (" -h\t\tPrint this help text\n"); printf (" -y\t\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)\n"); printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n"); @@ -261,6 +269,10 @@ static void print_help(void) printf (" \"blender -b -o /tmp test.blend -f 1\"\n"); printf (" ...may not render to /tmp because loading the blend file overwrites the output path that was set\n"); printf (" \"blender -b test.blend -o /tmp -f 1\" works as expected.\n\n"); + + exit(0); + + return 0; } @@ -278,11 +290,589 @@ double PIL_check_seconds_timer(void); } }*/ +static int end_arguments(int argc, char **argv, void *data) +{ + return -1; +} + +static int disable_python(int argc, char **argv, void *data) +{ + G.f &= ~G_DOSCRIPTLINKS; + return 0; +} + + +static int forked_tongue(int argc, char **argv, void *data) +{ + printf ("-y was used to disable script links because,\n"); + printf ("\t-p being taken, Ton was of the opinion that Y\n"); + printf ("\tlooked like a split (disabled) snake, and also\n"); + printf ("\twas similar to a python's tongue (unproven).\n\n"); + + printf ("\tZr agreed because it gave him a reason to add a\n"); + printf ("\tcompletely useless text into Blender.\n\n"); + + printf ("\tADDENDUM! Ton, in defense, found this picture of\n"); + printf ("\tan Australian python, exhibiting her (his/its) forked\n"); + printf ("\tY tongue. It could be part of an H Zr retorted!\n\n"); + printf ("\thttp://www.users.bigpond.com/snake.man/\n"); + + exit(252); + return 0; +} + +static int background_mode(int argc, char **argv, void *data) +{ + G.background = 1; + return 0; +} + +static int debug_mode(int argc, char **argv, void *data) +{ + G.f |= G_DEBUG; /* std output printf's */ + printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); + MEM_set_memory_debug(); + +#ifdef NAN_BUILDINFO + printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type); +#endif // NAN_BUILDINFO + + BLI_argsPrint(data); + return 0; +} + +static int playback_mode(int argc, char **argv, void *data) +{ + /* not if -b was given first */ + if (G.background == 0) { + /* exception here, see below, it probably needs happens after qt init? */ + libtiff_init(); + +// XXX playanim(argc, argv); /* not the same argc and argv as before */ + exit(0); + } + + return -2; +} + +static int prefsize(int argc, char **argv, void *data) +{ + int stax, stay, sizx, sizy; + + if (argc < 5) { + printf ("-p requires four arguments\n"); + exit(1); + } + + stax= atoi(argv[1]); + stay= atoi(argv[2]); + sizx= atoi(argv[3]); + sizy= atoi(argv[4]); + + WM_setprefsize(stax, stay, sizx, sizy); + + return 4; +} + +static int with_borders(int argc, char **argv, void *data) +{ + /* with borders XXX OLD CRUFT!*/ + + return 0; +} + +static int without_borders(int argc, char **argv, void *data) +{ + /* borderless, win + linux XXX OLD CRUFT */ + /* XXX, fixme mein, borderless on OSX */ + + return 0; +} + +static int register_extension(int argc, char **argv, void *data) +{ +#ifdef WIN32 + char *path = BLI_argsArgv(data)[0]; + RegisterBlendExtension(path); +#endif + + return 0; +} + +static int no_joystick(int argc, char **argv, void *data) +{ + SYS_SystemHandle *syshandle = data; + + /** + don't initialize joysticks if user doesn't want to use joysticks + failed joystick initialization delays over 5 seconds, before game engine start + */ + SYS_WriteCommandLineInt(*syshandle, "nojoystick",1); + if (G.f & G_DEBUG) printf("disabling nojoystick\n"); + + return 0; +} + +static int no_glsl(int argc, char **argv, void *data) +{ + GPU_extensions_disable(); + return 0; +} + +static int no_audio(int argc, char **argv, void *data) +{ + sound_force_device(0); + return 0; +} + +static int set_audio(int argc, char **argv, void *data) +{ + if (argc < 1) { + printf("-setaudio require one argument\n"); + exit(1); + } + + sound_force_device(sound_define_from_str(argv[1])); + return 1; +} + +static int set_output(int argc, char **argv, void *data) +{ + bContext *C = data; + if (argc >= 1){ + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + BLI_strncpy(scene->r.pic, argv[1], FILE_MAXDIR); + } else { + printf("\nError: no blend loaded. cannot use '-o'.\n"); + } + return 1; + } else { + printf("\nError: you must specify a path after '-o '.\n"); + return 0; + } +} + +static int set_engine(int argc, char **argv, void *data) +{ + bContext *C = data; + if (argc >= 1) + { + if (!strcmp(argv[1],"help")) + { + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + printf("\t%s\n", type->idname); + } + exit(0); + } + else + { + if (CTX_data_scene(C)==NULL) + { + printf("\nError: no blend loaded. order the arguments so '-E ' is after a blend is loaded.\n"); + } + else + { + Scene *scene= CTX_data_scene(C); + RenderData *rd = &scene->r; + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + if (!strcmp(argv[1],type->idname)) + { + BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine)); + } + } + } + } + + return 1; + } + else + { + printf("\nEngine not specified.\n"); + return 0; + } +} + +static int set_image_type(int argc, char **argv, void *data) +{ + bContext *C = data; + if (argc >= 1){ + char *imtype = argv[1]; + if (CTX_data_scene(C)==NULL) { + printf("\nError: no blend loaded. order the arguments so '-F ' is after the blend is loaded.\n"); + } else { + Scene *scene= CTX_data_scene(C); + if (!strcmp(imtype,"TGA")) scene->r.imtype = R_TARGA; + else if (!strcmp(imtype,"IRIS")) scene->r.imtype = R_IRIS; + else if (!strcmp(imtype,"HAMX")) scene->r.imtype = R_HAMX; +#ifdef WITH_DDS + else if (!strcmp(imtype,"DDS")) scene->r.imtype = R_DDS; +#endif + else if (!strcmp(imtype,"JPEG")) scene->r.imtype = R_JPEG90; + else if (!strcmp(imtype,"MOVIE")) scene->r.imtype = R_MOVIE; + else if (!strcmp(imtype,"IRIZ")) scene->r.imtype = R_IRIZ; + else if (!strcmp(imtype,"RAWTGA")) scene->r.imtype = R_RAWTGA; + else if (!strcmp(imtype,"AVIRAW")) scene->r.imtype = R_AVIRAW; + else if (!strcmp(imtype,"AVIJPEG")) scene->r.imtype = R_AVIJPEG; + else if (!strcmp(imtype,"PNG")) scene->r.imtype = R_PNG; + else if (!strcmp(imtype,"AVICODEC")) scene->r.imtype = R_AVICODEC; + else if (!strcmp(imtype,"QUICKTIME")) scene->r.imtype = R_QUICKTIME; + else if (!strcmp(imtype,"BMP")) scene->r.imtype = R_BMP; + else if (!strcmp(imtype,"HDR")) scene->r.imtype = R_RADHDR; + else if (!strcmp(imtype,"TIFF")) scene->r.imtype = R_TIFF; +#ifdef WITH_OPENEXR + else if (!strcmp(imtype,"EXR")) scene->r.imtype = R_OPENEXR; + else if (!strcmp(imtype,"MULTILAYER")) scene->r.imtype = R_MULTILAYER; +#endif + else if (!strcmp(imtype,"MPEG")) scene->r.imtype = R_FFMPEG; + else if (!strcmp(imtype,"FRAMESERVER")) scene->r.imtype = R_FRAMESERVER; + else if (!strcmp(imtype,"CINEON")) scene->r.imtype = R_CINEON; + else if (!strcmp(imtype,"DPX")) scene->r.imtype = R_DPX; +#if WITH_OPENJPEG + else if (!strcmp(imtype,"JP2")) scene->r.imtype = R_JP2; +#endif + else printf("\nError: Format from '-F' not known or not compiled in this release.\n"); + + } + return 1; + } else { + printf("\nError: no blend loaded. cannot use '-x'.\n"); + return 0; + } +} + +static int set_threads(int argc, char **argv, void *data) +{ + if (argc >= 1) { + if(G.background) { + RE_set_max_threads(atoi(argv[1])); + } else { + printf("Warning: threads can only be set in background mode\n"); + } + return 1; + } else { + printf("\nError: you must specify a number of threads between 0 and 8 '-t '.\n"); + return 0; + } +} + +static int set_extension(int argc, char **argv, void *data) +{ + bContext *C = data; + if (argc >= 1) { + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + if (argv[1][0] == '0') { + scene->r.scemode &= ~R_EXTENSION; + } else if (argv[1][0] == '1') { + scene->r.scemode |= R_EXTENSION; + } else { + printf("\nError: Use '-x 1' or '-x 0' To set the extension option.\n"); + } + } else { + printf("\nError: no blend loaded. order the arguments so '-o ' is after '-x '.\n"); + } + return 1; + } else { + printf("\nError: you must specify a path after '- '.\n"); + return 0; + } +} + +static int set_ge_parameters(int argc, char **argv, void *data) +{ + SYS_SystemHandle syshandle = *(SYS_SystemHandle*)data; + int a = 0; +/** +gameengine parameters are automaticly put into system +-g [paramname = value] +-g [boolparamname] +example: +-g novertexarrays +-g maxvertexarraysize = 512 +*/ + + if(argc >= 1) + { + char* paramname = argv[a]; + /* check for single value versus assignment */ + if (a+1 < argc && (*(argv[a+1]) == '=')) + { + a++; + if (a+1 < argc) + { + a++; + /* assignment */ + SYS_WriteCommandLineString(syshandle,paramname,argv[a]); + } else + { + printf("error: argument assignment (%s) without value.\n",paramname); + return 0; + } + /* name arg eaten */ + + } else { + SYS_WriteCommandLineInt(syshandle,argv[a],1); + + /* doMipMap */ + if (!strcmp(argv[a],"nomipmap")) + { + GPU_set_mipmap(0); //doMipMap = 0; + } + /* linearMipMap */ + if (!strcmp(argv[a],"linearmipmap")) + { + GPU_set_linear_mipmap(1); //linearMipMap = 1; + } + + + } /* if (*(argv[a+1]) == '=') */ + } + + return a; +} + +static int render_frame(int argc, char **argv, void *data) +{ + bContext *C = data; + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + + if (argc > 1) { + int frame = atoi(argv[1]); + Render *re = RE_NewRender(scene->id.name); + ReportList reports; + + BKE_reports_init(&reports, RPT_PRINT); + + frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame)); + + RE_BlenderAnim(re, scene, frame, frame, scene->r.frame_step, &reports); + return 1; + } else { + printf("\nError: frame number must follow '-f'.\n"); + return 0; + } + } else { + printf("\nError: no blend loaded. cannot use '-f'.\n"); + return 0; + } +} + +static int render_animation(int argc, char **argv, void *data) +{ + bContext *C = data; + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + Render *re= RE_NewRender(scene->id.name); + ReportList reports; + BKE_reports_init(&reports, RPT_PRINT); + RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports); + } else { + printf("\nError: no blend loaded. cannot use '-a'.\n"); + } + return 0; +} + +static int set_scene(int argc, char **argv, void *data) +{ + if(argc > 1) { + set_scene_name(argv[1]); + return 1; + } else { + printf("\nError: Scene name must follow '-S'.\n"); + return 0; + } +} + +static int set_start_frame(int argc, char **argv, void *data) +{ + bContext *C = data; + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + if (argc > 1) { + int frame = atoi(argv[1]); + (scene->r.sfra) = MIN2(MAXFRAME, MAX2(1, frame)); + return 1; + } else { + printf("\nError: frame number must follow '-s'.\n"); + return 0; + } + } else { + printf("\nError: no blend loaded. cannot use '-s'.\n"); + return 0; + } +} + +static int set_end_frame(int argc, char **argv, void *data) +{ + bContext *C = data; + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + if (argc > 1) { + int frame = atoi(argv[1]); + (scene->r.efra) = MIN2(MAXFRAME, MAX2(1, frame)); + return 1; + } else { + printf("\nError: frame number must follow '-e'.\n"); + return 0; + } + } else { + printf("\nError: no blend loaded. cannot use '-e'.\n"); + return 0; + } +} + +static int set_skip_frame(int argc, char **argv, void *data) +{ + bContext *C = data; + if (CTX_data_scene(C)) { + Scene *scene= CTX_data_scene(C); + if (argc > 1) { + int frame = atoi(argv[1]); + (scene->r.frame_step) = MIN2(MAXFRAME, MAX2(1, frame)); + return 1; + } else { + printf("\nError: number of frames must follow '-j'.\n"); + return 0; + } + } else { + printf("\nError: no blend loaded. cannot use '-j'.\n"); + return 0; + } +} + +static int run_python(int argc, char **argv, void *data) +{ + bContext *C = data; +#ifndef DISABLE_PYTHON + /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */ + if (argc > 1) { + /* XXX, temp setting the WM is ugly, splash also does this :S */ + wmWindowManager *wm= CTX_wm_manager(C); + wmWindow *prevwin= CTX_wm_window(C); + + if(wm->windows.first) { + CTX_wm_window_set(C, wm->windows.first); + + BPY_run_python_script(C, argv[1], NULL, NULL); // use reports? + + CTX_wm_window_set(C, prevwin); + } + else { + fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]); + BPY_run_python_script(C, argv[1], NULL, NULL); // use reports? + } + return 1; + } else { + printf("\nError: you must specify a Python script after '-P '.\n"); + return 0; + } +#else + printf("This blender was built without python support\n"); + return 0; +#endif /* DISABLE_PYTHON */ +} + +static int load_file(int argc, char **argv, void *data) +{ + bContext *C = data; + + /* Make the path absolute because its needed for relative linked blends to be found */ + char filename[FILE_MAXDIR + FILE_MAXFILE]; + + BLI_strncpy(filename, argv[0], sizeof(filename)); + BLI_convertstringcwd(filename); + + if (G.background) { + int retval = BKE_read_file(C, argv[0], NULL, NULL); + + /*we successfully loaded a blend file, get sure that + pointcache works */ + if (retval!=0) { + CTX_wm_manager_set(C, NULL); /* remove wm to force check */ + WM_check(C); + G.relbase_valid = 1; + } + + /* happens for the UI on file reading too (huh? (ton))*/ + // XXX BKE_reset_undo(); + // BKE_write_undo("original"); /* save current state */ + } else { + /* we are not running in background mode here, but start blender in UI mode with + a file - this should do everything a 'load file' does */ + WM_read_file(C, filename, NULL); + } + + G.file_loaded = 1; + + return 0; +} + +void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) +{ + //BLI_argsAdd(ba, arg, pass, BA_ArgCallback cb, C); + + /* end argument processing after -- */ + BLI_argsAdd(ba, "--", -1, end_arguments, NULL); + + /* first pass: background mode, disable python and commands that exit after usage */ + BLI_argsAdd(ba, "--help", 1, print_help, NULL); + BLI_argsAdd(ba, "-h", 1, print_help, NULL); + BLI_argsAdd(ba, "/?", 1, print_help, NULL); + + BLI_argsAdd(ba, "--version", 1, print_version, NULL); + BLI_argsAdd(ba, "-v", 1, print_version, NULL); + + BLI_argsAdd(ba, "-Y", 1, forked_tongue, NULL); + BLI_argsAdd(ba, "-y", 1, disable_python, NULL); + + BLI_argsAdd(ba, "-B", 1, background_mode, NULL); + BLI_argsAdd(ba, "-b", 1, background_mode, NULL); + BLI_argsAdd(ba, "-a", 1, playback_mode, NULL); + + BLI_argsAdd(ba, "-d", 1, debug_mode, ba); + + /* second pass: custom window stuff */ + BLI_argsAdd(ba, "-p", 2, prefsize, NULL); + BLI_argsAdd(ba, "-w", 2, with_borders, NULL); + BLI_argsAdd(ba, "-W", 2, without_borders, NULL); + BLI_argsAdd(ba, "-R", 2, register_extension, ba); + + /* third pass: disabling things and forcing settings */ + BLI_argsAddCase(ba, "-nojoystick", 3, no_joystick, syshandle); + BLI_argsAddCase(ba, "-noglsl", 3, no_glsl, NULL); + BLI_argsAddCase(ba, "-noaudio", 3, no_audio, NULL); + BLI_argsAddCase(ba, "-setaudio", 3, set_audio, NULL); + + /* fourth pass: processing arguments */ + BLI_argsAdd(ba, "-g", 4, set_ge_parameters, syshandle); + BLI_argsAdd(ba, "-f", 4, render_frame, C); + BLI_argsAdd(ba, "-a", 4, render_animation, C); + BLI_argsAdd(ba, "-S", 4, set_scene, NULL); + BLI_argsAdd(ba, "-s", 4, set_start_frame, C); + BLI_argsAdd(ba, "-e", 4, set_end_frame, C); + BLI_argsAdd(ba, "-j", 4, set_skip_frame, C); + BLI_argsAdd(ba, "-P", 4, run_python, C); + BLI_argsAdd(ba, "-o", 4, set_output, C); + BLI_argsAdd(ba, "-E", 4, set_engine, C); + BLI_argsAdd(ba, "-F", 4, set_image_type, C); + BLI_argsAdd(ba, "-t", 4, set_threads, NULL); + BLI_argsAdd(ba, "-x", 4, set_extension, C); + +} + int main(int argc, char **argv) { SYS_SystemHandle syshandle; bContext *C= CTX_create(); - int a, i, stax, stay, sizx, sizy /*XXX, scr_init = 0*/, file_loaded= 0; + bArgs *ba; #ifdef WITH_BINRELOC br_init( NULL ); @@ -347,74 +937,10 @@ int main(int argc, char **argv) G.f |= G_DOSCRIPTLINKS; /* script links enabled by default */ - for(a=1; a<argc; a++) { - - /* Handle unix and windows style help requests */ - if ((!strcmp(argv[a], "--help")) || (!strcmp(argv[a], "/?"))){ - print_help(); - exit(0); - } - - /* end argument processing after -- */ - if (!strcmp( argv[a], "--")){ - a = argc; - break; - } - - /* Handle long version request */ - if (!strcmp(argv[a], "--version")){ - print_version(); - exit(0); - } + ba = BLI_argsInit(argc, argv); /* skip binary path */ + setupArguments(C, ba, &syshandle); - /* Handle -* switches */ - else if(argv[a][0] == '-') { - switch(argv[a][1]) { - case 'a': /* -b was not given, play an animation */ - - /* exception here, see below, it probably needs happens after qt init? */ - libtiff_init(); - -// XXX playanim(argc-1, argv+1); - exit(0); - break; - case 'b': - case 'B': - G.background = 1; - a= argc; - break; - - case 'y': - G.f &= ~G_DOSCRIPTLINKS; - break; - - case 'Y': - printf ("-y was used to disable script links because,\n"); - printf ("\t-p being taken, Ton was of the opinion that Y\n"); - printf ("\tlooked like a split (disabled) snake, and also\n"); - printf ("\twas similar to a python's tongue (unproven).\n\n"); - - printf ("\tZr agreed because it gave him a reason to add a\n"); - printf ("\tcompletely useless text into Blender.\n\n"); - - printf ("\tADDENDUM! Ton, in defense, found this picture of\n"); - printf ("\tan Australian python, exhibiting her (his/its) forked\n"); - printf ("\tY tongue. It could be part of an H Zr retorted!\n\n"); - printf ("\thttp://www.users.bigpond.com/snake.man/\n"); - - exit(252); - - case 'h': - print_help(); - exit(0); - case 'v': - print_version(); - exit(0); - default: - break; - } - } - } + BLI_argsParse(ba, 1, NULL, NULL); #ifdef __sgi setuid(getuid()); /* end superuser */ @@ -429,71 +955,8 @@ int main(int argc, char **argv) init_def_material(); if(G.background==0) { - for(a=1; a<argc; a++) { - if(argv[a][0] == '-') { - switch(argv[a][1]) { - case 'p': /* prefsize */ - if (argc-a < 5) { - printf ("-p requires four arguments\n"); - exit(1); - } - a++; - stax= atoi(argv[a]); - a++; - stay= atoi(argv[a]); - a++; - sizx= atoi(argv[a]); - a++; - sizy= atoi(argv[a]); - - WM_setprefsize(stax, stay, sizx, sizy); - break; - case 'd': - G.f |= G_DEBUG; /* std output printf's */ - printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - MEM_set_memory_debug(); -#ifdef NAN_BUILDINFO - printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type); - -#endif // NAN_BUILDINFO - for (i = 0; i < argc; i++) { - printf("argv[%d] = %s\n", i, argv[i]); - } - break; - case 'E': - G.f |= G_SWAP_EXCHANGE; - break; - case 'w': - /* with borders XXX OLD CRUFT!*/ - break; - case 'W': - /* borderless, win + linux XXX OLD CRUFT */ - /* XXX, fixme mein, borderless on OSX */ - break; - case 'R': - /* Registering filetypes only makes sense on windows... */ -#ifdef WIN32 - RegisterBlendExtension(argv[0]); -#endif - break; - case 'n': - case 'N': - if (BLI_strcasecmp(argv[a], "-nojoystick") == 0) { - /** - don't initialize joysticks if user doesn't want to use joysticks - failed joystick initialization delays over 5 seconds, before game engine start - */ - SYS_WriteCommandLineInt(syshandle,"nojoystick",1); - if (G.f & G_DEBUG) printf("disabling nojoystick\n"); - } - else if (BLI_strcasecmp(argv[a], "-noglsl") == 0) - GPU_extensions_disable(); - else if (BLI_strcasecmp(argv[a], "-noaudio") == 0) - sound_disable(); - break; - } - } - } + BLI_argsParse(ba, 2, NULL, NULL); + BLI_argsParse(ba, 3, NULL, NULL); WM_init(C, argc, argv); @@ -510,30 +973,7 @@ int main(int argc, char **argv) #endif } else { - /* background mode options */ - for(a=1; a<argc; a++) { - if(argv[a][0] == '-') { - switch(argv[a][1]) { - case 'd': - G.f |= G_DEBUG; /* std output printf's */ - printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - MEM_set_memory_debug(); -#ifdef NAN_BUILDINFO - printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type); - -#endif // NAN_BUILDINFO - for (i = 0; i < argc; i++) { - printf("argv[%d] = %s\n", i, argv[i]); - } - break; - case 'n': - case 'N': - if (BLI_strcasecmp(argv[a], "-noaudio") == 0) - sound_disable(); - break; - } - } - } + BLI_argsParse(ba, 3, NULL, NULL); WM_init(C, argc, argv); @@ -575,348 +1015,16 @@ int main(int argc, char **argv) FRS_set_context(C); /* OK we are ready for it */ + BLI_argsParse(ba, 4, load_file, C); - for(a=1; a<argc; a++) { - if (G.afbreek==1) break; - - if(argv[a][0] == '-') { - switch(argv[a][1]) { - case '-': /* -- ends argument processing */ - a = argc; - break; - - case 'p': /* prefsize */ - a+= 4; - break; - - case 'g': - { - /** - gameengine parameters are automaticly put into system - -g [paramname = value] - -g [boolparamname] - example: - -g novertexarrays - -g maxvertexarraysize = 512 - */ - - if(++a < argc) - { - char* paramname = argv[a]; - /* check for single value versus assignment */ - if (a+1 < argc && (*(argv[a+1]) == '=')) - { - a++; - if (a+1 < argc) - { - a++; - /* assignment */ - SYS_WriteCommandLineString(syshandle,paramname,argv[a]); - } else - { - printf("error: argument assignment (%s) without value.\n",paramname); - } - /* name arg eaten */ - - } else - { - SYS_WriteCommandLineInt(syshandle,argv[a],1); - - /* doMipMap */ - if (!strcmp(argv[a],"nomipmap")) - { - GPU_set_mipmap(0); //doMipMap = 0; - } - /* linearMipMap */ - if (!strcmp(argv[a],"linearmipmap")) - { - GPU_set_linear_mipmap(1); //linearMipMap = 1; - } - - - } /* if (*(argv[a+1]) == '=') */ - } /* if(++a < argc) */ - break; - } - case 'f': - a++; - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - - if (a < argc) { - int frame = atoi(argv[a]); - Render *re = RE_NewRender(scene->id.name); - ReportList reports; - - BKE_reports_init(&reports, RPT_PRINT); - - frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame)); - - RE_BlenderAnim(re, scene, frame, frame, scene->r.frame_step, &reports); - } - } else { - printf("\nError: no blend loaded. cannot use '-f'.\n"); - } - break; - case 'a': - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - Render *re= RE_NewRender(scene->id.name); - ReportList reports; - BKE_reports_init(&reports, RPT_PRINT); - RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports); - } else { - printf("\nError: no blend loaded. cannot use '-a'.\n"); - } - break; - case 'S': - if(++a < argc) { - set_scene_name(argv[a]); - } - break; - case 's': - a++; - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - if (a < argc) { - int frame = atoi(argv[a]); - (scene->r.sfra) = MIN2(MAXFRAME, MAX2(1, frame)); - } - } else { - printf("\nError: no blend loaded. cannot use '-s'.\n"); - } - break; - case 'e': - a++; - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - if (a < argc) { - int frame = atoi(argv[a]); - (scene->r.efra) = MIN2(MAXFRAME, MAX2(1, frame)); - } - } else { - printf("\nError: no blend loaded. cannot use '-e'.\n"); - } - break; - case 'j': - a++; - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - if (a < argc) { - int frame = atoi(argv[a]); - (scene->r.frame_step) = MIN2(MAXFRAME, MAX2(1, frame)); - } - } else { - printf("\nError: no blend loaded. cannot use '-j'.\n"); - } - break; - case 'P': - -#ifndef DISABLE_PYTHON - a++; - - /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */ - { - /* XXX, temp setting the WM is ugly, splash also does this :S */ - wmWindowManager *wm= CTX_wm_manager(C); - wmWindow *prevwin= CTX_wm_window(C); - - if(wm->windows.first) { - CTX_wm_window_set(C, wm->windows.first); + BLI_argsFree(ba); - BPY_run_python_script(C, argv[a], NULL, NULL); // use reports? - - CTX_wm_window_set(C, prevwin); - } - else { - fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[a]); - BPY_run_python_script(C, argv[a], NULL, NULL); // use reports? - } - } -#if 0 - a++; - if (a < argc) { - /* If we're not running in background mode, then give python a valid screen */ - if ((G.background==0) && (scr_init==0)) { - main_init_screen(); - scr_init = 1; - } - BPY_run_python_script(C, argv[a], NULL, NULL); // use reports? - } - else printf("\nError: you must specify a Python script after '-P '.\n"); -#endif -#else - printf("This blender was built without python support\n"); -#endif /* DISABLE_PYTHON */ - break; - case 'o': - a++; - if (a < argc){ - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - BLI_strncpy(scene->r.pic, argv[a], FILE_MAXDIR); - } else { - printf("\nError: no blend loaded. cannot use '-o'.\n"); - } - } else { - printf("\nError: you must specify a path after '-o '.\n"); - } - break; - case 'E': - a++; - if (a < argc) - { - if (!strcmp(argv[a],"help")) - { - RenderEngineType *type = NULL; - - for( type = R_engines.first; type; type = type->next ) - { - printf("\t%s\n", type->idname); - } - exit(0); - } - else - { - if (CTX_data_scene(C)==NULL) - { - printf("\nError: no blend loaded. order the arguments so '-E ' is after the blend is loaded.\n"); - } - else - { - Scene *scene= CTX_data_scene(C); - RenderData *rd = &scene->r; - RenderEngineType *type = NULL; - - for( type = R_engines.first; type; type = type->next ) - { - if (!strcmp(argv[a],type->idname)) - { - BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine)); - } - } - } - } - } - else - { - printf("\nEngine not specified.\n"); - } - break; - case 'F': - a++; - if (a < argc){ - if (CTX_data_scene(C)==NULL) { - printf("\nError: no blend loaded. order the arguments so '-F ' is after the blend is loaded.\n"); - } else { - Scene *scene= CTX_data_scene(C); - if (!strcmp(argv[a],"TGA")) scene->r.imtype = R_TARGA; - else if (!strcmp(argv[a],"IRIS")) scene->r.imtype = R_IRIS; - else if (!strcmp(argv[a],"HAMX")) scene->r.imtype = R_HAMX; -#ifdef WITH_DDS - else if (!strcmp(argv[a],"DDS")) scene->r.imtype = R_DDS; -#endif - else if (!strcmp(argv[a],"JPEG")) scene->r.imtype = R_JPEG90; - else if (!strcmp(argv[a],"MOVIE")) scene->r.imtype = R_MOVIE; - else if (!strcmp(argv[a],"IRIZ")) scene->r.imtype = R_IRIZ; - else if (!strcmp(argv[a],"RAWTGA")) scene->r.imtype = R_RAWTGA; - else if (!strcmp(argv[a],"AVIRAW")) scene->r.imtype = R_AVIRAW; - else if (!strcmp(argv[a],"AVIJPEG")) scene->r.imtype = R_AVIJPEG; - else if (!strcmp(argv[a],"PNG")) scene->r.imtype = R_PNG; - else if (!strcmp(argv[a],"AVICODEC")) scene->r.imtype = R_AVICODEC; - else if (!strcmp(argv[a],"QUICKTIME")) scene->r.imtype = R_QUICKTIME; - else if (!strcmp(argv[a],"BMP")) scene->r.imtype = R_BMP; - else if (!strcmp(argv[a],"HDR")) scene->r.imtype = R_RADHDR; - else if (!strcmp(argv[a],"TIFF")) scene->r.imtype = R_TIFF; -#ifdef WITH_OPENEXR - else if (!strcmp(argv[a],"EXR")) scene->r.imtype = R_OPENEXR; - else if (!strcmp(argv[a],"MULTILAYER")) scene->r.imtype = R_MULTILAYER; -#endif - else if (!strcmp(argv[a],"MPEG")) scene->r.imtype = R_FFMPEG; - else if (!strcmp(argv[a],"FRAMESERVER")) scene->r.imtype = R_FRAMESERVER; - else if (!strcmp(argv[a],"CINEON")) scene->r.imtype = R_CINEON; - else if (!strcmp(argv[a],"DPX")) scene->r.imtype = R_DPX; -#if WITH_OPENJPEG - else if (!strcmp(argv[a],"JP2")) scene->r.imtype = R_JP2; -#endif - else printf("\nError: Format from '-F' not known or not compiled in this release.\n"); - } - } else { - printf("\nError: no blend loaded. cannot use '-x'.\n"); - } - break; - - case 't': - a++; - if (a < argc) { - if(G.background) { - RE_set_max_threads(atoi(argv[a])); - } else { - printf("Warning: threads can only be set in background mode\n"); - } - } else { - printf("\nError: you must specify a number of threads between 0 and 8 '-t '.\n"); - } - break; - case 'x': /* extension */ - a++; - if (a < argc) { - if (CTX_data_scene(C)) { - Scene *scene= CTX_data_scene(C); - if (argv[a][0] == '0') { - scene->r.scemode &= ~R_EXTENSION; - } else if (argv[a][0] == '1') { - scene->r.scemode |= R_EXTENSION; - } else { - printf("\nError: Use '-x 1' or '-x 0' To set the extension option.\n"); - } - } else { - printf("\nError: no blend loaded. order the arguments so '-o ' is after '-x '.\n"); - } - } else { - printf("\nError: you must specify a path after '- '.\n"); - } - break; - } - } - else { - - /* Make the path absolute because its needed for relative linked blends to be found */ - char filename[FILE_MAXDIR + FILE_MAXFILE]; - - BLI_strncpy(filename, argv[a], sizeof(filename)); - BLI_convertstringcwd(filename); - - if (G.background) { - int retval = BKE_read_file(C, argv[a], NULL, NULL); - - /*we successfully loaded a blend file, get sure that - pointcache works */ - if (retval!=0) { - CTX_wm_manager_set(C, NULL); /* remove wm to force check */ - WM_check(C); - G.relbase_valid = 1; - } - - /* happens for the UI on file reading too (huh? (ton))*/ -// XXX BKE_reset_undo(); -// BKE_write_undo("original"); /* save current state */ - } else { - /* we are not running in background mode here, but start blender in UI mode with - a file - this should do everything a 'load file' does */ - WM_read_file(C, filename, NULL); - } - - file_loaded = 1; - } - } - if(G.background) { /* actually incorrect, but works for now (ton) */ WM_exit(C); } - if(!G.background && !file_loaded) + if(!G.background && !G.file_loaded) WM_init_splash(C); WM_main(C); diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 3191c99fb2f..9cf7e21e4ab 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -360,6 +360,7 @@ PyAttributeDef SCA_ISensor::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW_CHECK("tap",SCA_ISensor,m_tap,pyattr_check_tap), KX_PYATTRIBUTE_RO_FUNCTION("triggered", SCA_ISensor, pyattr_get_triggered), KX_PYATTRIBUTE_RO_FUNCTION("positive", SCA_ISensor, pyattr_get_positive), + KX_PYATTRIBUTE_RO_FUNCTION("status", SCA_ISensor, pyattr_get_status), //KX_PYATTRIBUTE_TODO("links"), //KX_PYATTRIBUTE_TODO("posTicks"), //KX_PYATTRIBUTE_TODO("negTicks"), @@ -382,6 +383,28 @@ PyObject* SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DE return PyLong_FromSsize_t(self->GetState()); } +PyObject* SCA_ISensor::pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); + int status = 0; + if (self->GetState()) + { + if (self->GetState() == self->GetPrevState()) + { + status = 2; + } + else + { + status = 1; + } + } + else if (self->GetState() != self->GetPrevState()) + { + status = 3; + } + return PyLong_FromSsize_t(status); +} + int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_ISensor* self= static_cast<SCA_ISensor*>(self_v); diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index e01f5775289..e92e4bfdcfb 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -160,6 +160,12 @@ public: { return m_state; } + + /** get the previous state of the sensor: positive or negative */ + bool GetPrevState() + { + return m_prev_state; + } /** Resume sensing. */ void Resume(); @@ -178,8 +184,17 @@ public: static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_status(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + + enum SensorStatus { + KX_SENSOR_INACTIVE = 0, + KX_SENSOR_JUST_ACTIVATED, + KX_SENSOR_ACTIVE, + KX_SENSOR_JUST_DEACTIVATED + + }; #endif // DISABLE_PYTHON }; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 1b9c82b432c..ba1bb7c5d7c 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1487,7 +1487,7 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("children", KX_GameObject, pyattr_get_children), KX_PYATTRIBUTE_RO_FUNCTION("childrenRecursive", KX_GameObject, pyattr_get_children_recursive), KX_PYATTRIBUTE_RO_FUNCTION("attrDict", KX_GameObject, pyattr_get_attrDict), - KX_PYATTRIBUTE_RW_FUNCTION("obcolor", KX_GameObject, pyattr_get_obcolor, pyattr_set_obcolor), + KX_PYATTRIBUTE_RW_FUNCTION("color", KX_GameObject, pyattr_get_obcolor, pyattr_set_obcolor), /* Experemental, dont rely on these yet */ KX_PYATTRIBUTE_RO_FUNCTION("sensors", KX_GameObject, pyattr_get_sensors), diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 5e109770fee..0f6b487bd60 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -333,14 +333,13 @@ static PyObject* gPyLoadGlobalDict(PyObject*) Py_RETURN_NONE; } - static char gPySendMessage_doc[] = "sendMessage(subject, [body, to, from])\n\ sends a message in same manner as a message actuator\ subject = Subject of the message\ body = Message body\ to = Name of object to send the message to\ -from = Name of object to sned the string from"; +from = Name of object to send the string from"; static PyObject* gPySendMessage(PyObject*, PyObject* args) { @@ -496,6 +495,25 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) return list; } +static char gPyAddScene_doc[] = +"addScene(name, [overlay])\n\ +adds a scene to the game engine\n\ +name = Name of the scene\n\ +overlay = Overlay or underlay"; +static PyObject* gPyAddScene(PyObject*, PyObject* args) +{ + char* name; + int overlay = 1; + KX_Scene* scene = NULL; + + if (!PyArg_ParseTuple(args, "s|i:addScene", &name , &overlay)) + return NULL; + + gp_KetsjiEngine->ConvertAndAddScene(name, (overlay != 0)); + + Py_RETURN_NONE; +} + static const char *gPyGetCurrentScene_doc = "getCurrentScene()\n" "Gets a reference to the current scene.\n"; @@ -722,15 +740,11 @@ static struct PyMethodDef game_methods[] = { {"saveGlobalDict", (PyCFunction)gPySaveGlobalDict, METH_NOARGS, (const char *)gPySaveGlobalDict_doc}, {"loadGlobalDict", (PyCFunction)gPyLoadGlobalDict, METH_NOARGS, (const char *)gPyLoadGlobalDict_doc}, {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc}, - {"getCurrentController", - (PyCFunction) SCA_PythonController::sPyGetCurrentController, - METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__}, - {"getCurrentScene", (PyCFunction) gPyGetCurrentScene, - METH_NOARGS, gPyGetCurrentScene_doc}, - {"getSceneList", (PyCFunction) gPyGetSceneList, - METH_NOARGS, (const char *)gPyGetSceneList_doc}, - {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, - METH_NOARGS, (const char *)gPyGetRandomFloat_doc}, + {"getCurrentController", (PyCFunction) SCA_PythonController::sPyGetCurrentController, METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__}, + {"getCurrentScene", (PyCFunction) gPyGetCurrentScene, METH_NOARGS, gPyGetCurrentScene_doc}, + {"getSceneList", (PyCFunction) gPyGetSceneList, METH_NOARGS, (const char *)gPyGetSceneList_doc}, + {"addScene", (PyCFunction)gPyAddScene, METH_VARARGS, (const char *)gPyAddScene_doc}, + {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, METH_NOARGS, (const char *)gPyGetRandomFloat_doc}, {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"}, {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"}, {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"}, @@ -1406,7 +1420,13 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack KX_MACRO_addTypesToDict(d, KX_STATE28, (1<<27)); KX_MACRO_addTypesToDict(d, KX_STATE29, (1<<28)); KX_MACRO_addTypesToDict(d, KX_STATE30, (1<<29)); - + + /* All Sensors */ + KX_MACRO_addTypesToDict(d, KX_SENSOR_JUST_ACTIVATED, SCA_ISensor::KX_SENSOR_JUST_ACTIVATED); + KX_MACRO_addTypesToDict(d, KX_SENSOR_ACTIVE, SCA_ISensor::KX_SENSOR_ACTIVE); + KX_MACRO_addTypesToDict(d, KX_SENSOR_JUST_DEACTIVATED, SCA_ISensor::KX_SENSOR_JUST_DEACTIVATED); + KX_MACRO_addTypesToDict(d, KX_SENSOR_INACTIVE, SCA_ISensor::KX_SENSOR_INACTIVE); + /* Radar Sensor */ KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_POS_X, KX_RadarSensor::KX_RADAR_AXIS_POS_X); KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_POS_Y, KX_RadarSensor::KX_RADAR_AXIS_POS_Y); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index c8c5b33693b..4d25b2742d7 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -33,6 +33,7 @@ #endif //WIN32 #include "KX_Scene.h" +#include "KX_PythonInit.h" #include "MT_assert.h" #include "KX_KetsjiEngine.h" #include "KX_BlenderMaterial.h" @@ -1864,6 +1865,9 @@ PyTypeObject KX_Scene::Type = { PyMethodDef KX_Scene::Methods[] = { KX_PYMETHODTABLE(KX_Scene, addObject), + KX_PYMETHODTABLE(KX_Scene, end), + KX_PYMETHODTABLE(KX_Scene, restart), + KX_PYMETHODTABLE(KX_Scene, replace), /* dict style access */ KX_PYMETHODTABLE(KX_Scene, get), @@ -2136,6 +2140,39 @@ KX_PYMETHODDEF_DOC(KX_Scene, addObject, return replica->GetProxy(); } +KX_PYMETHODDEF_DOC(KX_Scene, end, +"end()\n" +"Removes this scene from the game.\n") +{ + + KX_GetActiveEngine()->RemoveScene(m_sceneName); + + Py_RETURN_NONE; +} + +KX_PYMETHODDEF_DOC(KX_Scene, restart, + "restart()\n" + "Restarts this scene.\n") +{ + KX_GetActiveEngine()->ReplaceScene(m_sceneName, m_sceneName); + + Py_RETURN_NONE; +} + +KX_PYMETHODDEF_DOC(KX_Scene, replace, + "replace(newScene)\n" + "Replaces this scene with another one.\n") +{ + char* name; + + if (!PyArg_ParseTuple(args, "s:replace", &name)) + return NULL; + + KX_GetActiveEngine()->ReplaceScene(m_sceneName, name); + + Py_RETURN_NONE; +} + /* Matches python dict.get(key, [default]) */ KX_PYMETHODDEF_DOC(KX_Scene, get, "") { diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 602e919b58d..5a66863d3e0 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -541,6 +541,9 @@ public: /* --------------------------------------------------------------------- */ KX_PYMETHOD_DOC(KX_Scene, addObject); + KX_PYMETHOD_DOC(KX_Scene, end); + KX_PYMETHOD_DOC(KX_Scene, restart); + KX_PYMETHOD_DOC(KX_Scene, replace); KX_PYMETHOD_DOC(KX_Scene, get); /* attributes */ diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 3cf15636892..a6681bf562d 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -344,6 +344,30 @@ def addActiveActuator(actuator, activate): @type activate: boolean @param activate: whether to activate or deactivate the given actuator. """ +def loadGlobalDict(): + """ + Loads GameLogic.globalDict from a file. + """ +def saveGlobalDict(): + """ + Saves GameLogic.globalDict to a file. + """ +def addScene(name, overlay=1): + """ + Loads a scene into the game engine. + + @param name: The name of the scene + @type name: string + @param body: Overlay or underlay (optional) + @type body: int + """ +def removeScene(name): + """ + Removes a scene from the game engine. + + @param name: The name of the scene + @type name: string + """ def sendMessage(subject, body="", to="", message_from=""): """ Sends a message to sensors in any active scene. diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index e6d51e85af6..61b95e70c0b 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -142,6 +142,11 @@ class SCA_ISensor(SCA_ILogicBrick): @type triggered: boolean @ivar positive: True if this sensor brick is in a positive state. (read-only) @type positive: boolean + @ivar status: The status of the sensor. (read-only) + KX_SENSOR_INACTIVE, KX_SENSOR_JUST_ACTIVATED, + KX_SENSOR_ACTIVE, KX_SENSOR_JUST_DEACTIVATED + Note: this convenient attribute combines the values of triggered and positive attributes + @type status: int from 0-3. """ def reset(): @@ -1524,6 +1529,8 @@ class KX_GameObject(SCA_IObject): @ivar visible: visibility flag. - note: Game logic will still run for invisible objects. @type visible: boolean + @ivar color: The object color of the object + @type color: list [r, g, b, a] @ivar occlusion: occlusion capability flag. @type occlusion: boolean @ivar position: The object's position. diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index bbccb511249..67b5c89efbf 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -904,7 +904,9 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix( // if Rasterizer.setFocalLength is not called we use the camera focallength if (!m_setfocallength) - m_focallength = focallength; + // if focallength is null we use a value known to be reasonable + m_focallength = (focallength == 0.f) ? m_eyeseparation * 30.0 + : focallength; near_div_focallength = frustnear / m_focallength; offset = 0.5 * m_eyeseparation * near_div_focallength; diff --git a/source/icons/SConscript b/source/icons/SConscript index c929729f05b..5abb36aafea 100644 --- a/source/icons/SConscript +++ b/source/icons/SConscript @@ -1,6 +1,9 @@ #!/usr/bin/python Import ('env') -source = 'winblender.rcscons' +if env['OURPLATFORM'] == 'linuxcross': + source = 'linuxcrossblender.rcscons' +else: + source = 'winblender.rcscons' env.BlenderRes('winresource', source, ['core'], priority=[95]) diff --git a/tools/Blender.py b/tools/Blender.py index c51c1367f33..441d454b782 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -117,15 +117,19 @@ def setup_staticlibs(lenv): statlibs = [ #here libs for static linking ] - libincs = [ - '/usr/lib', + + libincs = [] + if lenv['OURPLATFORM'] != 'linuxcross': + libincs.append('/usr/lib') + + libincs.extend([ lenv['BF_OPENGL_LIBPATH'], lenv['BF_JPEG_LIBPATH'], lenv['BF_PNG_LIBPATH'], lenv['BF_ZLIB_LIBPATH'], lenv['BF_LIBSAMPLERATE_LIBPATH'], lenv['BF_ICONV_LIBPATH'] - ] + ]) libincs += Split(lenv['BF_FREETYPE_LIBPATH']) if lenv['WITH_BF_PYTHON']: @@ -167,6 +171,10 @@ def setup_staticlibs(lenv): libincs += Split(lenv['BF_PCRE_LIBPATH']) libincs += Split(lenv['BF_EXPAT_LIBPATH']) + if lenv['WITH_BF_OPENMP']: + if lenv['OURPLATFORM'] == 'linuxcross': + libincs += Split(lenv['BF_OPENMP_LIBPATH']) + return statlibs, libincs @@ -752,11 +760,11 @@ class BlenderEnvironment(SConsEnvironment): if lenv['OURPLATFORM']=='darwin': lenv['BINARYKIND'] = binarykind lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print)) - elif os.sep == '/': # any unix + elif os.sep == '/' and lenv['OURPLATFORM'] != 'linuxcross': # any unix (except cross-compilation) if lenv['WITH_BF_PYTHON']: if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']: lenv.AddPostAction(prog,Action(UnixPyBundle,strfunction=my_unixpybundle_print)) - elif lenv['OURPLATFORM'].startswith('win'): # windows + elif lenv['OURPLATFORM'].startswith('win') or lenv['OURPLATFORM'] == 'linuxcross': # windows or cross-compilation if lenv['WITH_BF_PYTHON']: if not lenv['WITHOUT_BF_PYTHON_INSTALL']: lenv.AddPostAction(prog,Action(WinPyBundle,strfunction=my_winpybundle_print)) diff --git a/tools/btools.py b/tools/btools.py index 7dde9a14f6c..a8e39e3d100 100644 --- a/tools/btools.py +++ b/tools/btools.py @@ -64,6 +64,9 @@ def validate_arguments(args, bc): 'WITHOUT_BF_INSTALL', 'WITHOUT_BF_PYTHON_INSTALL', 'WITH_BF_OPENMP', + 'BF_OPENMP', + 'BF_OPENMP_INC', + 'BF_OPENMP_LIBPATH', 'WITH_GHOST_COCOA', 'USE_QTKIT', 'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE', @@ -318,6 +321,9 @@ def read_opts(cfg, args): ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''), (BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)), + ('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''), + ('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''), + ('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''), (BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)), (BoolVariable('USE_QTKIT', 'Use QTKIT if true', False)), diff --git a/tools/crossmingw.py b/tools/crossmingw.py index 299bfca929d..ba6d4878593 100644 --- a/tools/crossmingw.py +++ b/tools/crossmingw.py @@ -1,7 +1,4 @@ -#coments are #JB where this file was altered by Jasen Betts -# email: 'n@tres'.join(['jase','hna.com']) - -"""tools.crossmingw +"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) @@ -12,7 +9,7 @@ selection method. """ # -# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -34,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.91.D001 2005/09/08 09:14:36 knight" +__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons" import os import os.path @@ -42,6 +39,7 @@ import string import SCons.Action import SCons.Builder +import SCons.Defaults import SCons.Tool import SCons.Util @@ -63,18 +61,20 @@ def find(env): return '' def shlib_generator(target, source, env, for_signature): - cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) + cmd = SCons.Util.CLVar(['$SHLINK']) dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') if dll: cmd.extend(['-o', dll]) - cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) + cmd.extend(['$SOURCES', '$SHLINKFLAGS', '$_LIBDIRFLAGS', '$_LIBFLAGS']) implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) + def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') + insert_def = env.subst("$WINDOWS_INSERT_DEF") + if not insert_def in ['', '0', 0] and def_target: \ + cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) return [cmd] @@ -89,7 +89,7 @@ def shlib_emitter(target, source, env): not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): # Append an import library to the list of targets. - target.append(env.ReplaceIxes(dll, + target.append(env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', 'LIBPREFIX', 'LIBSUFFIX')) @@ -97,76 +97,64 @@ def shlib_emitter(target, source, env): # or a def file source. There is no option to disable def file # target emitting, because I can't figure out why someone would ever # want to turn it off. - def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') + def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') + def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') if not def_source and not def_target: - target.append(env.ReplaceIxes(dll, + target.append(env.ReplaceIxes(dll, 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')) + 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')) return (target, source) -#JB """ I'm blindly susbstuting lines from the mingw.py -#JB file becase these lines cause python errors here. """ -#JB shlib_action = SCons.Action.Action(shlib_generator,generator=1) -shlib_action = SCons.Action.CommandGeneratorAction(shlib_generator) - -res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') -#JB """ changed for what was in mingw.py """ -#JB res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', -#JB source_scanner=SCons.Tool.SourceFileScanner) +shlib_action = SCons.Action.Action(shlib_generator, generator=1) -res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o', - source_scanner=SCons.Defaults.ObjSourceScan) +res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') -#JB SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) -SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan) -#JB """ no more changes """ +res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', + source_scanner=SCons.Tool.SourceFileScanner) +SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) def generate(env): - mingw_prefix = find(env) - - if mingw_prefix: - dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc')) - - # The mingw bin directory must be added to the path: - path = env['ENV'].get('PATH', []) - if not path: - path = [] - if SCons.Util.is_String(path): - path = string.split(path, os.pathsep) - - env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) + mingw = find(env) + if mingw: + dir = os.path.dirname(mingw) + env.PrependENVPath('PATH', dir ) + # Most of mingw is the same as gcc and friends... - gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas'] + gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4'] for tool in gnu_tools: SCons.Tool.Tool(tool)(env) #... but a few things differ: - env['CC'] = mingw_prefix + 'gcc' + env['CC'] = mingw + 'gcc' env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') - env['CXX'] = mingw_prefix + 'g++' + env['CXX'] = mingw + 'g++' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') env['SHLINKCOM'] = shlib_action - env['AR'] = mingw_prefix + 'ar' - env['RANLIB'] = mingw_prefix + 'ranlib' + env['LDMODULECOM'] = shlib_action env.Append(SHLIBEMITTER = [shlib_emitter]) - env['LINK'] = mingw_prefix + 'gcc' - env['AS'] = mingw_prefix + 'as' + env['RANLIB'] = mingw + 'ranlib' + env['LINK'] = mingw + 'gcc' + env['AS'] = mingw + 'as' + env['AR'] = mingw + 'ar' + env['WIN32DEFPREFIX'] = '' env['WIN32DEFSUFFIX'] = '.def' + env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}' + env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}' + env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - env['RC'] = mingw_prefix + 'windres' + env['RC'] = mingw + 'windres' env['RCFLAGS'] = SCons.Util.CLVar('') - env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET)} $)' + env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' env['RCINCPREFIX'] = '--include-dir ' env['RCINCSUFFIX'] = '' - env['RCCOM'] = '$RC $RCINCFLAGS $RCINCPREFIX $SOURCE.dir $RCFLAGS -i $SOURCE -o $TARGET' + env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' env['BUILDERS']['RES'] = res_builder # Some setting from the platform also have to be overridden: @@ -187,3 +175,9 @@ def generate(env): def exists(env): return find(env) + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |