diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e02ea20fb0..602fec4b759 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id$
+ # $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -70,7 +70,6 @@ OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
-OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
@@ -82,27 +81,23 @@ OPTION(WITH_BUILDINFO "Include extra build details" ON)
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
+# Unix defaults to OpenMP On
+IF (UNIX)
+ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
+ELSE(UNIX)
+ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
+ENDIF(UNIX)
+
IF (APPLE)
-OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
-OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
+ 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)
+ OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
ENDIF (APPLE)
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
-IF (WITH_OPENCOLLADA AND NOT APPLE)
-SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
-SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA})
-SET(OPENCOLLADA_LIB OpenCollada)
-SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
-SET(PCRE_LIBPATH ${PCRE}/lib)
-SET(PCRE_LIB pcre)
-SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
-SET(EXPAT_LIBPATH ${EXPAT}/lib)
-SET(EXPAT_LIB expat)
-ENDIF (WITH_OPENCOLLADA AND NOT APPLE)
-
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
# On Unix:
# cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
@@ -119,6 +114,8 @@ INCLUDE(CMake/macros.cmake)
#Platform specifics
IF(UNIX AND NOT APPLE)
+
+
IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND)
@@ -217,6 +214,20 @@ IF(UNIX AND NOT APPLE)
FIND_PACKAGE(ZLIB REQUIRED)
+ 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_INC ${OPENCOLLADA})
+ SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
+ SET(PCRE_LIBPATH ${PCRE}/lib)
+ SET(PCRE_LIB pcre)
+ SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
+ SET(EXPAT_LIBPATH ${EXPAT}/lib)
+ SET(EXPAT_LIB expat)
+ ENDIF (WITH_OPENCOLLADA)
+
+
# Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
@@ -232,7 +243,7 @@ IF(UNIX AND NOT APPLE)
ENDIF(WITH_OPENMP)
- SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
+ SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-char-subscripts")
SET(PLATFORM_LINKFLAGS "-pthread")
@@ -400,6 +411,16 @@ IF(WIN32)
SET(WINTAB_INC ${LIBDIR}/wintab/include)
+ SET(OPENCOLLADA ${LIBDIR}/opencollada)
+ SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+ SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+ SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 )
+ #pcre is bundled with openCollada
+ #SET(PCRE ${LIBDIR}/pcre)
+ #SET(PCRE_LIBPATH ${PCRE}/lib)
+ SET(PCRE_LIB pcre)
+
+
IF(CMAKE_CL_64)
SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
ELSE(CMAKE_CL_64)
@@ -510,11 +531,21 @@ IF(APPLE)
SET(LLIBS stdc++ SystemStubs)
IF (WITH_COCOA)
- SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DGHOST_COCOA")
- SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
+ SET(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
+ SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
+ IF(USE_QTKIT)
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
+ IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+ #libSDL still needs 32bit carbon quicktime
+ ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+ ELSEIF(WITH_QUICKTIME)
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+ ENDIF(USE_QTKIT)
ELSE (WITH_COCOA)
- SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
- SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
+ SET(PLATFORM_CFLAGS "-pipe -funsigned-char")
+ SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
ENDIF (WITH_COCOA)
IF(WITH_OPENMP)
@@ -532,10 +563,10 @@ IF(APPLE)
#SET(PCRE ${LIBDIR}/pcre)
#SET(PCRE_LIBPATH ${PCRE}/lib)
SET(PCRE_LIB pcre)
- #native OSX libxml2 is used
+ #libxml2 is used
#SET(EXPAT ${LIBDIR}/expat)
#SET(EXPAT_LIBPATH ${EXPAT}/lib)
- #SET(EXPAT_LIB expat)
+ SET(EXPAT_LIB)
ENDIF (WITH_OPENCOLLADA)
SET(SDL ${LIBDIR}/sdl)
@@ -556,15 +587,23 @@ IF(APPLE)
SET(EXETYPE MACOSX_BUNDLE)
-
+ SET(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
IF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
- SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
- SET(CMAKE_C_FLAGS_RELEASE "-O3 -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+ SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
ELSEIF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
- SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
- SET(CMAKE_C_FLAGS_RELEASE "-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+ SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+ ELSE(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
+ SET(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
+ # Better warnings
+ SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
+ SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
+
ENDIF(APPLE)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
diff --git a/SConstruct b/SConstruct
index e6dd85e8cff..369a1801aec 100644
--- a/SConstruct
+++ b/SConstruct
@@ -224,6 +224,11 @@ if env['WITH_GHOST_COCOA'] == True:
env.Append(CFLAGS=['-DGHOST_COCOA'])
env.Append(CXXFLAGS=['-DGHOST_COCOA'])
env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+
+if env['USE_QTKIT'] == True:
+ env.Append(CFLAGS=['-DUSE_QTKIT'])
+ env.Append(CXXFLAGS=['-DUSE_QTKIT'])
+ env.Append(CPPFLAGS=['-DUSE_QTKIT'])
#check for additional debug libnames
diff --git a/config/darwin-config.py b/config/darwin-config.py
index 03cc4eb1f8c..825d00f892d 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -13,7 +13,6 @@ USE_SDK=True
#############################################################################
################### Cocoa & architecture settings ##################
#############################################################################
-
WITH_GHOST_COCOA=True
MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
@@ -31,30 +30,36 @@ elif cmd_res[0]=='9':
elif cmd_res[0]=='10':
MAC_CUR_VER='10.6'
-if MACOSX_ARCHITECTURE == 'ppc':
- LCGDIR = '#../lib/darwin-6.1-powerpc'
-else :
- LCGDIR = '#../lib/darwin-9.x.universal'
-LIBDIR = '${LCGDIR}'
-
BF_PYTHON_VERSION = '3.1'
-if MACOSX_ARCHITECTURE == 'ppc' and BF_PYTHON_VERSION == '2.3':
+if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
+ USE_QTKIT=True # Carbon quicktime is not available for 64bit
+
+
+# Default target OSX settings per architecture
+# Can be customized
+
+if MACOSX_ARCHITECTURE == 'ppc':
MAC_MIN_VERS = '10.3'
MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
- CC = 'gcc'
- CXX = 'g++'
-elif MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'ppc':
+ LCGDIR = '#../lib/darwin-6.1-powerpc'
+ CC = 'gcc-3.3'
+ CXX = 'g++-3.3'
+elif MACOSX_ARCHITECTURE == 'i386':
MAC_MIN_VERS = '10.4'
MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+ LCGDIR = '#../lib/darwin-8.x.i386'
CC = 'gcc-4.0'
CXX = 'g++-4.0'
else :
MAC_MIN_VERS = '10.5'
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
+ LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'gcc-4.2'
CXX = 'g++-4.2'
+LIBDIR = '${LCGDIR}'
+
#############################################################################
################### Dependency settings ##################
#############################################################################
@@ -229,10 +234,7 @@ BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype'
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
-if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
- WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME ( disable for 64bit atm )
-else:
- WITH_BF_QUICKTIME = True
+WITH_BF_QUICKTIME = True
WITH_BF_ICONV = True
BF_ICONV = '/usr'
@@ -285,7 +287,10 @@ else:
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
if WITH_BF_QUICKTIME == True:
- PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
+ if USE_QTKIT == True:
+ PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
+ else:
+ PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
#note to build succesfully on 10.3.9 SDK you need to patch 10.3.9 by adding the SystemStubs.a lib from 10.4
LLIBS = ['stdc++', 'SystemStubs']
diff --git a/config/irix6-config.py b/config/irix6-config.py
index 085d1dd1e62..ab2ef02c977 100644
--- a/config/irix6-config.py
+++ b/config/irix6-config.py
@@ -161,7 +161,7 @@ CXX = 'CC'
CCFLAGS = ['-pipe','-fPIC', '-n32']
-CPPFLAGS = ['-DXP_UNIX']
+CPPFLAGS = []
CXXFLAGS = ['-pipe','-fPIC', '-n32']
REL_CFLAGS = ['-O2']
REL_CCFLAGS = ['-O2']
diff --git a/config/linux2-config.py b/config/linux2-config.py
index dffc861fca8..3e40b7af416 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -155,9 +155,9 @@ WITH_BF_COLLADA = False
BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada'
-BF_OPENCOLLADA = ''
-BF_OPENCOLLADA_LIB = 'OpenCollada'
-BF_OPENCOLLADA_LIBPATH = '/usr/lib'
+BF_OPENCOLLADA = '/usr'
+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'
BF_PCRE_LIBPATH = '/usr/lib'
@@ -165,6 +165,8 @@ BF_EXPAT = '/usr'
BF_EXPAT_LIB = 'expat'
BF_EXPAT_LIBPATH = '/usr/lib'
+WITH_BF_OPENMP = True
+
##
CC = 'gcc'
CXX = 'g++'
@@ -173,7 +175,7 @@ CXX = 'g++'
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-CPPFLAGS = ['-DXP_UNIX']
+CPPFLAGS = []
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
REL_CFLAGS = ['-O2']
REL_CCFLAGS = ['-O2']
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
index a5c83dc3503..3cfa1158700 100644
--- a/config/linuxcross-config.py
+++ b/config/linuxcross-config.py
@@ -119,7 +119,7 @@ CXX = 'i586-mingw32msvc-g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
+CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
REL_CFLAGS = [ '-O2' ]
REL_CCFLAGS = [ '-O2' ]
diff --git a/config/sunos5-config.py b/config/sunos5-config.py
index 8e4c53b5bc4..88dce927db4 100644
--- a/config/sunos5-config.py
+++ b/config/sunos5-config.py
@@ -136,7 +136,7 @@ CXX = 'g++'
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-CPPFLAGS = ['-DXP_UNIX', '-DSUN_OGL_NO_VERTEX_MACROS']
+CPPFLAGS = ['-DSUN_OGL_NO_VERTEX_MACROS']
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
REL_CFLAGS = ['-O2']
REL_CCFLAGS = ['-O2']
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index b519aa95ca7..709261ec1ca 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -136,7 +136,7 @@ CXX = 'g++'
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
+CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
REL_CFLAGS = [ '-O2' ]
REL_CCFLAGS = [ '-O2' ]
diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
index be261ec4080..a9f3223798b 100644
--- a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
+++ b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
@@ -152,6 +152,10 @@ BT_DECLARE_ALIGNED_ALLOCATOR();
{
return (proxyType == STATIC_PLANE_PROXYTYPE);
}
+ static SIMD_FORCE_INLINE bool isSoftBody(int proxyType)
+ {
+ return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);
+ }
}
;
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
index 10e880e2523..7159f552829 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
@@ -31,6 +31,7 @@ subject to the following restrictions:
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btQuickprof.h"
#include "LinearMath/btStackAlloc.h"
+#include "BulletSoftBody/btSoftBody.h"
//#define USE_BRUTEFORCE_RAYBROADPHASE 1
//RECALCULATE_AABB is slower, but benefit is that you don't need to call 'stepSimulation' or 'updateAabbs' before using a rayTest
@@ -411,6 +412,31 @@ void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTra
// restore
collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
}
+ } else {
+ if (collisionShape->isSoftBody()) {
+ btSoftBody* softBody = static_cast(collisionObject);
+ btSoftBody::sRayCast softResult;
+ if (softBody->rayTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult))
+ {
+ btCollisionWorld::LocalShapeInfo shapeInfo;
+ shapeInfo.m_shapePart = 0;
+ shapeInfo.m_triangleIndex = softResult.index;
+ // get the normal
+ btVector3 normal = softBody->m_faces[softResult.index].m_normal;
+ btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin();
+ if (normal.dot(rayDir) > 0) {
+ // normal always point toward origin of the ray
+ normal = -normal;
+ }
+ btCollisionWorld::LocalRayResult rayResult
+ (collisionObject,
+ &shapeInfo,
+ normal,
+ softResult.fraction);
+ bool normalInWorldSpace = true;
+ resultCallback.addSingleResult(rayResult,normalInWorldSpace);
+ }
+ }
}
}
}
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
index 1f4b9bec647..b6374e64153 100644
--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
+++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
@@ -72,6 +72,10 @@ public:
{
return btBroadphaseProxy::isCompound(getShapeType());
}
+ SIMD_FORCE_INLINE bool isSoftBody() const
+ {
+ return btBroadphaseProxy::isSoftBody(getShapeType());
+ }
///isInfinite is used to catch simulation error (aabb check)
SIMD_FORCE_INLINE bool isInfinite() const
diff --git a/extern/glew/CMakeLists.txt b/extern/glew/CMakeLists.txt
index 26d10a6ca9f..1c4faf04441 100644
--- a/extern/glew/CMakeLists.txt
+++ b/extern/glew/CMakeLists.txt
@@ -34,5 +34,7 @@ SET(SRC
src/glew.c
)
+ADD_DEFINITIONS(-DGLEW_STATIC)
+
BLENDERLIB(extern_glew "${SRC}" "${INC}")
diff --git a/extern/glew/SConscript b/extern/glew/SConscript
index 81a2fc67ccc..84e2ba65cc2 100644
--- a/extern/glew/SConscript
+++ b/extern/glew/SConscript
@@ -6,7 +6,7 @@ Import('env')
sources = ['src/glew.c']
-defs = ''
+defs = 'GLEW_STATIC'
incs = 'include'
env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[50,230])
diff --git a/extern/glew/include/GL/glew.h b/extern/glew/include/GL/glew.h
index 1024a88e00f..2014092e877 100644
--- a/extern/glew/include/GL/glew.h
+++ b/extern/glew/include/GL/glew.h
@@ -1,7 +1,7 @@
/*
** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2006, Milan Ikits
-** Copyright (C) 2002-2006, Marcelo E. Magallon
+** Copyright (C) 2002-2008, Milan Ikits
+** Copyright (C) 2002-2008, Marcelo E. Magallon
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
@@ -30,40 +30,52 @@
*/
/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * Mesa 3-D graphics library
+ * Version: 7.0
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
**
-** http://oss.sgi.com/projects/FreeB
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
-#define BLENDER_CHANGES
-
-#ifdef BLENDER_CHANGES
-#define GLEW_STATIC
-#endif
-
#ifndef __glew_h__
#define __glew_h__
#define __GLEW_H__
@@ -84,7 +96,7 @@
#define __GLEXT_H_
#define __gl_ATI_h_
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
+#if defined(_WIN32)
/*
* GLEW does not include to avoid name space pollution.
@@ -94,7 +106,7 @@
/* */
#ifndef APIENTRY
#define GLEW_APIENTRY_DEFINED
-# if defined(__CYGWIN__) || defined(__MINGW32__)
+# if defined(__MINGW32__)
# define APIENTRY __stdcall
# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
# define APIENTRY __stdcall
@@ -103,14 +115,14 @@
# endif
#endif
#ifndef GLAPI
-# if defined(__CYGWIN__) || defined(__MINGW32__)
+# if defined(__MINGW32__)
# define GLAPI extern
# endif
#endif
/* */
#ifndef CALLBACK
#define GLEW_CALLBACK_DEFINED
-# if defined(__CYGWIN__) || defined(__MINGW32__)
+# if defined(__MINGW32__)
# define CALLBACK __attribute__ ((__stdcall__))
# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
# define CALLBACK __stdcall
@@ -130,7 +142,7 @@ typedef unsigned short wchar_t;
#endif
/* */
#if !defined(_W64)
-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
@@ -147,7 +159,7 @@ typedef _W64 int ptrdiff_t;
#endif
#ifndef GLAPI
-# if defined(__CYGWIN__) || defined(__MINGW32__)
+# if defined(__MINGW32__)
# define GLAPI extern
# else
# define GLAPI WINGDIAPI
@@ -184,6 +196,7 @@ typedef _W64 int ptrdiff_t;
*/
#include
+#include
#define GLEW_APIENTRY_DEFINED
#define APIENTRY
@@ -208,29 +221,37 @@ extern "C" {
#ifndef GL_VERSION_1_1
#define GL_VERSION_1_1 1
-#if defined(__APPLE__) && !defined(__LP64__)
-typedef unsigned long GLenum;
-typedef unsigned long GLbitfield;
-typedef unsigned long GLuint;
-typedef long GLint;
-typedef long GLsizei;
-#else
typedef unsigned int GLenum;
typedef unsigned int GLbitfield;
typedef unsigned int GLuint;
typedef int GLint;
typedef int GLsizei;
-#endif
typedef unsigned char GLboolean;
typedef signed char GLbyte;
typedef short GLshort;
typedef unsigned char GLubyte;
typedef unsigned short GLushort;
+typedef unsigned long GLulong;
typedef float GLfloat;
typedef float GLclampf;
typedef double GLdouble;
typedef double GLclampd;
typedef void GLvoid;
+#if defined(_MSC_VER)
+# if _MSC_VER < 1400
+typedef __int64 GLint64EXT;
+typedef unsigned __int64 GLuint64EXT;
+# else
+typedef signed long long GLint64EXT;
+typedef unsigned long long GLuint64EXT;
+# endif
+#else
+# if defined(__MINGW32__)
+#include
+# endif
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
#define GL_ACCUM 0x0100
#define GL_LOAD 0x0101
@@ -1435,6 +1456,8 @@ typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first,
typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, GLint *params);
typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
@@ -1481,6 +1504,8 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p);
#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)
#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf)
#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv)
+#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri)
+#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv)
#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b)
#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv)
#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d)
@@ -1735,7 +1760,7 @@ typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname,
typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source);
typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLint programObj, const GLchar* name);
+typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name);
typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params);
typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params);
typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid*);
@@ -1808,7 +1833,6 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuin
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);
typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
-#ifndef BLENDER_CHANGES
#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)
@@ -1902,12 +1926,294 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint si
#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)
#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)
#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
-#endif
#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
#endif /* GL_VERSION_2_0 */
+/* ----------------------------- GL_VERSION_2_1 ---------------------------- */
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv)
+#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv)
+#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv)
+#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv)
+#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv)
+#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv)
+
+#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1)
+
+#endif /* GL_VERSION_2_1 */
+
+/* ----------------------------- GL_VERSION_3_0 ---------------------------- */
+
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+
+#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
+#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
+#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
+#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
+#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
+#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
+#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
+#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
+#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MINOR_VERSION 0x821C
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_DEPTH_BUFFER 0x8223
+#define GL_STENCIL_BUFFER 0x8224
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RG 0x8226
+#define GL_RGBA32F 0x8814
+#define GL_RGB32F 0x8815
+#define GL_RGBA16F 0x881A
+#define GL_RGB16F 0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_CLAMP_READ_COLOR 0x891C
+#define GL_FIXED_ONLY 0x891D
+#define GL_TEXTURE_RED_TYPE 0x8C10
+#define GL_TEXTURE_GREEN_TYPE 0x8C11
+#define GL_TEXTURE_BLUE_TYPE 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE 0x8C16
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
+#define GL_R11F_G11F_B10F 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
+#define GL_RGB9_E5 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE 0x8C3F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_PRIMITIVES_GENERATED 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS 0x8C8C
+#define GL_SEPARATE_ATTRIBS 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI 0x8D70
+#define GL_RGB32UI 0x8D71
+#define GL_RGBA16UI 0x8D76
+#define GL_RGB16UI 0x8D77
+#define GL_RGBA8UI 0x8D7C
+#define GL_RGB8UI 0x8D7D
+#define GL_RGBA32I 0x8D82
+#define GL_RGB32I 0x8D83
+#define GL_RGBA16I 0x8D88
+#define GL_RGB16I 0x8D89
+#define GL_RGBA8I 0x8D8E
+#define GL_RGB8I 0x8D8F
+#define GL_RED_INTEGER 0x8D94
+#define GL_GREEN_INTEGER 0x8D95
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_ALPHA_INTEGER 0x8D97
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
+#define GL_UNSIGNED_INT_VEC2 0x8DC6
+#define GL_UNSIGNED_INT_VEC3 0x8DC7
+#define GL_UNSIGNED_INT_VEC4 0x8DC8
+#define GL_INT_SAMPLER_1D 0x8DC9
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_QUERY_WAIT 0x8E13
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+
+typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum);
+typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*);
+typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum);
+typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint);
+typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*);
+typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*);
+typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
+typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint);
+typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint);
+typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*);
+typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*);
+typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum, GLuint, GLint*);
+typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint);
+typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*);
+typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*);
+typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLint*);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*);
+typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint);
+typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*);
+typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLint*, GLenum);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*);
+
+#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender)
+#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback)
+#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase)
+#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange)
+#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation)
+#define glClampColor GLEW_GET_FUN(__glewClampColor)
+#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi)
+#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv)
+#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv)
+#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv)
+#define glColorMaski GLEW_GET_FUN(__glewColorMaski)
+#define glDisablei GLEW_GET_FUN(__glewDisablei)
+#define glEnablei GLEW_GET_FUN(__glewEnablei)
+#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender)
+#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback)
+#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v)
+#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation)
+#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v)
+#define glGetStringi GLEW_GET_FUN(__glewGetStringi)
+#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv)
+#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv)
+#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying)
+#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv)
+#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv)
+#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv)
+#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi)
+#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv)
+#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv)
+#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings)
+#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui)
+#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv)
+#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui)
+#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv)
+#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui)
+#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv)
+#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui)
+#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv)
+#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i)
+#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv)
+#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui)
+#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv)
+#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i)
+#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv)
+#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui)
+#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv)
+#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i)
+#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv)
+#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui)
+#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv)
+#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv)
+#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i)
+#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv)
+#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv)
+#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv)
+#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui)
+#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv)
+#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv)
+#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer)
+
+#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0)
+
+#endif /* GL_VERSION_3_0 */
+
/* -------------------------- GL_3DFX_multisample -------------------------- */
#ifndef GL_3DFX_multisample
@@ -2037,6 +2343,24 @@ typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint
#endif /* GL_APPLE_float_pixels */
+/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+
+typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+
+#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE)
+#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE)
+
+#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range)
+
+#endif /* GL_APPLE_flush_buffer_range */
+
/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */
#ifndef GL_APPLE_pixel_buffer
@@ -2170,6 +2494,19 @@ typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp)
#endif /* GL_ARB_color_buffer_float */
+/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_ARB_depth_buffer_float 1
+
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+
+#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float)
+
+#endif /* GL_ARB_depth_buffer_float */
+
/* -------------------------- GL_ARB_depth_texture ------------------------- */
#ifndef GL_ARB_depth_texture
@@ -2216,6 +2553,21 @@ typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bu
#endif /* GL_ARB_draw_buffers */
+/* ------------------------- GL_ARB_draw_instanced ------------------------- */
+
+#ifndef GL_ARB_draw_instanced
+#define GL_ARB_draw_instanced 1
+
+typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
+
+#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)
+#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)
+
+#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced)
+
+#endif /* GL_ARB_draw_instanced */
+
/* ------------------------ GL_ARB_fragment_program ------------------------ */
#ifndef GL_ARB_fragment_program
@@ -2263,6 +2615,182 @@ typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bu
#endif /* GL_ARB_fragment_shader */
+/* ----------------------- GL_ARB_framebuffer_object ----------------------- */
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT 0x8218
+#define GL_FRAMEBUFFER_UNDEFINED 0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#define GL_INDEX 0x8222
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_SRGB 0x8C40
+#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
+#define GL_RENDERBUFFER_SAMPLES 0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_ATTACHMENT1 0x8CE1
+#define GL_COLOR_ATTACHMENT2 0x8CE2
+#define GL_COLOR_ATTACHMENT3 0x8CE3
+#define GL_COLOR_ATTACHMENT4 0x8CE4
+#define GL_COLOR_ATTACHMENT5 0x8CE5
+#define GL_COLOR_ATTACHMENT6 0x8CE6
+#define GL_COLOR_ATTACHMENT7 0x8CE7
+#define GL_COLOR_ATTACHMENT8 0x8CE8
+#define GL_COLOR_ATTACHMENT9 0x8CE9
+#define GL_COLOR_ATTACHMENT10 0x8CEA
+#define GL_COLOR_ATTACHMENT11 0x8CEB
+#define GL_COLOR_ATTACHMENT12 0x8CEC
+#define GL_COLOR_ATTACHMENT13 0x8CED
+#define GL_COLOR_ATTACHMENT14 0x8CEE
+#define GL_COLOR_ATTACHMENT15 0x8CEF
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_INDEX16 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES 0x8D57
+
+typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
+typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers);
+typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer)
+#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer)
+#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer)
+#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus)
+#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
+#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
+#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
+#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer)
+#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
+#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
+#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
+#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers)
+#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers)
+#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap)
+#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv)
+#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv)
+#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer)
+#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer)
+#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage)
+#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample)
+
+#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object)
+
+#endif /* GL_ARB_framebuffer_object */
+
+/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_ARB_framebuffer_sRGB 1
+
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+
+#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB)
+
+#endif /* GL_ARB_framebuffer_sRGB */
+
+/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_ARB_geometry_shader4 1
+
+#define GL_LINES_ADJACENCY_ARB 0xA
+#define GL_LINE_STRIP_ADJACENCY_ARB 0xB
+#define GL_TRIANGLES_ADJACENCY_ARB 0xC
+#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD
+#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
+#define GL_GEOMETRY_SHADER_ARB 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
+
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
+
+#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB)
+#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB)
+#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB)
+#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB)
+
+#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4)
+
+#endif /* GL_ARB_geometry_shader4 */
+
/* ------------------------ GL_ARB_half_float_pixel ------------------------ */
#ifndef GL_ARB_half_float_pixel
@@ -2274,6 +2802,17 @@ typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bu
#endif /* GL_ARB_half_float_pixel */
+/* ------------------------ GL_ARB_half_float_vertex ----------------------- */
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_ARB_half_float_vertex 1
+
+#define GL_HALF_FLOAT 0x140B
+
+#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex)
+
+#endif /* GL_ARB_half_float_vertex */
+
/* ----------------------------- GL_ARB_imaging ---------------------------- */
#ifndef GL_ARB_imaging
@@ -2427,6 +2966,43 @@ typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum in
#endif /* GL_ARB_imaging */
+/* ------------------------ GL_ARB_instanced_arrays ------------------------ */
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_ARB_instanced_arrays 1
+
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
+
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
+
+#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB)
+
+#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays)
+
+#endif /* GL_ARB_instanced_arrays */
+
+/* ------------------------ GL_ARB_map_buffer_range ------------------------ */
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+
+typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+
+#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange)
+#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange)
+
+#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range)
+
+#endif /* GL_ARB_map_buffer_range */
+
/* ------------------------- GL_ARB_matrix_palette ------------------------- */
#ifndef GL_ARB_matrix_palette
@@ -2849,6 +3425,25 @@ typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj)
#endif /* GL_ARB_texture_border_clamp */
+/* ---------------------- GL_ARB_texture_buffer_object --------------------- */
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_ARB_texture_buffer_object 1
+
+#define GL_TEXTURE_BUFFER_ARB 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
+
+typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+
+#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB)
+
+#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object)
+
+#endif /* GL_ARB_texture_buffer_object */
+
/* ----------------------- GL_ARB_texture_compression ---------------------- */
#ifndef GL_ARB_texture_compression
@@ -2886,6 +3481,20 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL
#endif /* GL_ARB_texture_compression */
+/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_ARB_texture_compression_rgtc 1
+
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+
+#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc)
+
+#endif /* GL_ARB_texture_compression_rgtc */
+
/* ------------------------ GL_ARB_texture_cube_map ------------------------ */
#ifndef GL_ARB_texture_cube_map
@@ -3036,6 +3645,39 @@ typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GL
#endif /* GL_ARB_texture_rectangle */
+/* --------------------------- GL_ARB_texture_rg --------------------------- */
+
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+
+#define GL_RED 0x1903
+#define GL_RG 0x8227
+#define GL_RG_INTEGER 0x8228
+#define GL_R8 0x8229
+#define GL_R16 0x822A
+#define GL_RG8 0x822B
+#define GL_RG16 0x822C
+#define GL_R16F 0x822D
+#define GL_R32F 0x822E
+#define GL_RG16F 0x822F
+#define GL_RG32F 0x8230
+#define GL_R8I 0x8231
+#define GL_R8UI 0x8232
+#define GL_R16I 0x8233
+#define GL_R16UI 0x8234
+#define GL_R32I 0x8235
+#define GL_R32UI 0x8236
+#define GL_RG8I 0x8237
+#define GL_RG8UI 0x8238
+#define GL_RG16I 0x8239
+#define GL_RG16UI 0x823A
+#define GL_RG32I 0x823B
+#define GL_RG32UI 0x823C
+
+#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg)
+
+#endif /* GL_ARB_texture_rg */
+
/* ------------------------ GL_ARB_transpose_matrix ------------------------ */
#ifndef GL_ARB_transpose_matrix
@@ -3060,6 +3702,27 @@ typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);
#endif /* GL_ARB_transpose_matrix */
+/* ----------------------- GL_ARB_vertex_array_object ---------------------- */
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+
+typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays);
+typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays);
+typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array);
+
+#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray)
+#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays)
+#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays)
+#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray)
+
+#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object)
+
+#endif /* GL_ARB_vertex_array_object */
+
/* -------------------------- GL_ARB_vertex_blend -------------------------- */
#ifndef GL_ARB_vertex_blend
@@ -3490,6 +4153,13 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p);
#ifndef GL_ATIX_point_sprites
#define GL_ATIX_point_sprites 1
+#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0
+#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1
+#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2
+#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3
+#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4
+#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5
+
#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites)
#endif /* GL_ATIX_point_sprites */
@@ -3765,6 +4435,15 @@ typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum s
#endif /* GL_ATI_separate_stencil */
+/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */
+
+#ifndef GL_ATI_shader_texture_lod
+#define GL_ATI_shader_texture_lod 1
+
+#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod)
+
+#endif /* GL_ATI_shader_texture_lod */
+
/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */
#ifndef GL_ATI_text_fragment_shader
@@ -3781,7 +4460,7 @@ typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum s
#ifndef GL_ATI_texture_compression_3dc
#define GL_ATI_texture_compression_3dc 1
-#define GL_COMPRESSED_RGB_3DC_ATI 0x8837
+#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc)
@@ -4040,6 +4719,30 @@ typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GL
#endif /* GL_EXT_bgra */
+/* ------------------------ GL_EXT_bindable_uniform ------------------------ */
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+
+typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+
+#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT)
+#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT)
+#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT)
+
+#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform)
+
+#endif /* GL_EXT_bindable_uniform */
+
/* --------------------------- GL_EXT_blend_color -------------------------- */
#ifndef GL_EXT_blend_color
@@ -4177,6 +4880,9 @@ typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsize
#ifndef GL_EXT_compiled_vertex_array
#define GL_EXT_compiled_vertex_array 1
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+
typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void);
@@ -4327,6 +5033,431 @@ typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zma
#endif /* GL_EXT_depth_bounds_test */
+/* ----------------------- GL_EXT_direct_state_access ---------------------- */
+
+#ifndef GL_EXT_direct_state_access
+#define GL_EXT_direct_state_access 1
+
+#define GL_PROGRAM_MATRIX_EXT 0x8E2D
+#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
+#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
+
+typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
+typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
+typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
+typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
+typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
+typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img);
+typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img);
+typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum pname, GLuint index, GLvoid** params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);
+typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
+typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
+typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
+typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode);
+typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m);
+typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
+typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode);
+typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode);
+typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer);
+typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param);
+typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage);
+typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params);
+typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string);
+typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
+typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param);
+typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
+typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
+
+#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT)
+#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT)
+#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT)
+#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT)
+#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT)
+#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT)
+#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT)
+#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT)
+#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT)
+#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT)
+#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT)
+#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT)
+#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT)
+#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT)
+#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT)
+#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT)
+#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT)
+#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT)
+#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT)
+#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT)
+#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT)
+#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT)
+#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT)
+#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT)
+#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT)
+#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT)
+#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT)
+#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT)
+#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT)
+#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT)
+#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT)
+#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT)
+#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT)
+#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT)
+#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT)
+#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT)
+#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT)
+#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT)
+#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT)
+#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT)
+#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT)
+#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT)
+#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT)
+#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT)
+#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT)
+#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT)
+#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT)
+#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT)
+#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT)
+#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT)
+#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT)
+#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT)
+#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT)
+#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT)
+#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT)
+#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT)
+#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT)
+#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT)
+#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT)
+#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT)
+#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT)
+#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT)
+#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT)
+#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT)
+#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT)
+#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT)
+#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT)
+#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT)
+#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT)
+#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT)
+#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT)
+#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT)
+#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT)
+#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT)
+#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT)
+#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT)
+#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT)
+#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT)
+#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT)
+#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT)
+#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT)
+#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT)
+#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT)
+#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT)
+#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT)
+#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT)
+#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT)
+#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT)
+#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT)
+#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT)
+#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT)
+#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT)
+#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT)
+#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT)
+#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT)
+#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT)
+#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT)
+#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT)
+#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT)
+#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT)
+#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT)
+#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT)
+#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT)
+#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT)
+#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT)
+#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT)
+#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT)
+#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT)
+#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT)
+#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT)
+#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT)
+#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT)
+#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT)
+#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT)
+#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT)
+#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT)
+#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT)
+#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT)
+#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT)
+#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT)
+#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT)
+#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT)
+#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT)
+#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT)
+#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT)
+#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT)
+#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT)
+#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT)
+#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT)
+#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT)
+#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT)
+#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT)
+#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT)
+#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT)
+#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT)
+#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT)
+#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT)
+#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT)
+#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT)
+#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT)
+#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT)
+#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT)
+#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT)
+#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT)
+#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT)
+#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT)
+#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT)
+#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT)
+#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT)
+#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT)
+#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT)
+#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT)
+#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT)
+#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT)
+#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT)
+#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT)
+#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT)
+#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT)
+#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT)
+#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT)
+#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT)
+#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT)
+#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT)
+#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT)
+#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT)
+#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT)
+#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT)
+#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT)
+#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT)
+#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT)
+#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT)
+#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT)
+#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT)
+#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT)
+#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT)
+#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT)
+#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT)
+#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT)
+#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT)
+#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT)
+#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT)
+#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT)
+#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT)
+#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT)
+#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT)
+#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT)
+
+#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access)
+
+#endif /* GL_EXT_direct_state_access */
+
+/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */
+
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+
+typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data);
+typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data);
+typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+
+#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT)
+#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT)
+#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT)
+#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT)
+#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT)
+#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT)
+
+#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2)
+
+#endif /* GL_EXT_draw_buffers2 */
+
+/* ------------------------- GL_EXT_draw_instanced ------------------------- */
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+
+typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+
+#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT)
+#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT)
+
+#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced)
+
+#endif /* GL_EXT_draw_instanced */
+
/* ----------------------- GL_EXT_draw_range_elements ---------------------- */
#ifndef GL_EXT_draw_range_elements
@@ -4459,6 +5590,8 @@ typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY
#define GL_EXT_framebuffer_multisample 1
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
@@ -4565,6 +5698,179 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLen
#endif /* GL_EXT_framebuffer_object */
+/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+
+#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB)
+
+#endif /* GL_EXT_framebuffer_sRGB */
+
+/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+
+#define GL_LINES_ADJACENCY_EXT 0xA
+#define GL_LINE_STRIP_ADJACENCY_EXT 0xB
+#define GL_TRIANGLES_ADJACENCY_EXT 0xC
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+
+#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT)
+#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)
+#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT)
+
+#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4)
+
+#endif /* GL_EXT_geometry_shader4 */
+
+/* --------------------- GL_EXT_gpu_program_parameters --------------------- */
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
+
+#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT)
+#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT)
+
+#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters)
+
+#endif /* GL_EXT_gpu_program_parameters */
+
+/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
+#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_SAMPLER_BUFFER_EXT 0x8DC2
+#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
+#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
+#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
+#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+
+typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT)
+#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT)
+#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT)
+#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT)
+#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT)
+#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT)
+#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT)
+#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT)
+#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT)
+#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT)
+#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT)
+#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT)
+#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT)
+#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT)
+#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT)
+#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT)
+#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT)
+#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT)
+#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT)
+#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT)
+#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT)
+#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT)
+#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT)
+#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT)
+#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT)
+#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT)
+#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT)
+#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT)
+#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT)
+#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT)
+#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT)
+#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT)
+#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT)
+#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT)
+
+#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4)
+
+#endif /* GL_EXT_gpu_shader4 */
+
/* ---------------------------- GL_EXT_histogram --------------------------- */
#ifndef GL_EXT_histogram
@@ -4753,6 +6059,19 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
#endif /* GL_EXT_packed_depth_stencil */
+/* -------------------------- GL_EXT_packed_float -------------------------- */
+
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+
+#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float)
+
+#endif /* GL_EXT_packed_float */
+
/* -------------------------- GL_EXT_packed_pixels ------------------------- */
#ifndef GL_EXT_packed_pixels
@@ -4909,6 +6228,8 @@ typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat b
#ifndef GL_EXT_rescale_normal
#define GL_EXT_rescale_normal 1
+#define GL_RESCALE_NORMAL_EXT 0x803A
+
#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal)
#endif /* GL_EXT_rescale_normal */
@@ -5146,6 +6467,43 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level,
#endif /* GL_EXT_texture3D */
+/* -------------------------- GL_EXT_texture_array ------------------------- */
+
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+
+#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array)
+
+#endif /* GL_EXT_texture_array */
+
+/* ---------------------- GL_EXT_texture_buffer_object --------------------- */
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+
+#define GL_TEXTURE_BUFFER_EXT 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
+
+typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+
+#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT)
+
+#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object)
+
+#endif /* GL_EXT_texture_buffer_object */
+
/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */
#ifndef GL_EXT_texture_compression_dxt1
@@ -5158,6 +6516,34 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level,
#endif /* GL_EXT_texture_compression_dxt1 */
+/* -------------------- GL_EXT_texture_compression_latc -------------------- */
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+
+#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc)
+
+#endif /* GL_EXT_texture_compression_latc */
+
+/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+
+#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc)
+
+#endif /* GL_EXT_texture_compression_rgtc */
+
/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */
#ifndef GL_EXT_texture_compression_s3tc
@@ -5290,6 +6676,77 @@ typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level,
#endif /* GL_EXT_texture_filter_anisotropic */
+/* ------------------------- GL_EXT_texture_integer ------------------------ */
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+
+typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+
+#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT)
+#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT)
+#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT)
+#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT)
+#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT)
+#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT)
+
+#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer)
+
+#endif /* GL_EXT_texture_integer */
+
/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */
#ifndef GL_EXT_texture_lod_bias
@@ -5401,6 +6858,92 @@ typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
#endif /* GL_EXT_texture_sRGB */
+/* --------------------- GL_EXT_texture_shared_exponent -------------------- */
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+
+#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent)
+
+#endif /* GL_EXT_texture_shared_exponent */
+
+/* ------------------------- GL_EXT_texture_swizzle ------------------------ */
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_EXT_texture_swizzle 1
+
+#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
+#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
+#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
+#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
+
+#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle)
+
+#endif /* GL_EXT_texture_swizzle */
+
+/* --------------------------- GL_EXT_timer_query -------------------------- */
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+
+#define GL_TIME_ELAPSED_EXT 0x88BF
+
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+
+#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT)
+#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT)
+
+#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query)
+
+#endif /* GL_EXT_timer_query */
+
+/* ----------------------- GL_EXT_transform_feedback ----------------------- */
+
+#ifndef GL_EXT_transform_feedback
+#define GL_EXT_transform_feedback 1
+
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
+#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
+#define GL_RASTERIZER_DISCARD_EXT 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
+#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
+
+typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
+typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, char *name);
+typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode);
+
+#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT)
+#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT)
+#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT)
+#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT)
+#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT)
+#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT)
+#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT)
+
+#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback)
+
+#endif /* GL_EXT_transform_feedback */
+
/* -------------------------- GL_EXT_vertex_array -------------------------- */
#ifndef GL_EXT_vertex_array
@@ -5464,6 +7007,17 @@ typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type,
#endif /* GL_EXT_vertex_array */
+/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */
+
+#ifndef GL_EXT_vertex_array_bgra
+#define GL_EXT_vertex_array_bgra 1
+
+#define GL_BGRA 0x80E1
+
+#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra)
+
+#endif /* GL_EXT_vertex_array_bgra */
+
/* -------------------------- GL_EXT_vertex_shader ------------------------- */
#ifndef GL_EXT_vertex_shader
@@ -5701,6 +7255,19 @@ typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight);
#endif /* GL_EXT_vertex_weighting */
+/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */
+
+#ifndef GL_GREMEDY_frame_terminator
+#define GL_GREMEDY_frame_terminator 1
+
+typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void);
+
+#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY)
+
+#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator)
+
+#endif /* GL_GREMEDY_frame_terminator */
+
/* ------------------------ GL_GREMEDY_string_marker ----------------------- */
#ifndef GL_GREMEDY_string_marker
@@ -6087,6 +7654,26 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);
#endif /* GL_NV_blend_square */
+/* ------------------------ GL_NV_conditional_render ----------------------- */
+
+#ifndef GL_NV_conditional_render
+#define GL_NV_conditional_render 1
+
+#define GL_QUERY_WAIT_NV 0x8E13
+#define GL_QUERY_NO_WAIT_NV 0x8E14
+#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
+
+typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
+typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void);
+
+#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV)
+#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV)
+
+#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render)
+
+#endif /* GL_NV_conditional_render */
+
/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */
#ifndef GL_NV_copy_depth_to_color
@@ -6099,6 +7686,28 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);
#endif /* GL_NV_copy_depth_to_color */
+/* ------------------------ GL_NV_depth_buffer_float ----------------------- */
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+
+typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+
+#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV)
+#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV)
+#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV)
+
+#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float)
+
+#endif /* GL_NV_depth_buffer_float */
+
/* --------------------------- GL_NV_depth_clamp --------------------------- */
#ifndef GL_NV_depth_clamp
@@ -6110,6 +7719,21 @@ typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);
#endif /* GL_NV_depth_clamp */
+/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */
+
+#ifndef GL_NV_depth_range_unclamped
+#define GL_NV_depth_range_unclamped 1
+
+#define GL_SAMPLE_COUNT_BITS_NV 0x8864
+#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865
+#define GL_QUERY_RESULT_NV 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867
+#define GL_SAMPLE_COUNT_NV 0x8914
+
+#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped)
+
+#endif /* GL_NV_depth_range_unclamped */
+
/* ---------------------------- GL_NV_evaluators --------------------------- */
#ifndef GL_NV_evaluators
@@ -6164,6 +7788,34 @@ typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pna
#endif /* GL_NV_evaluators */
+/* ----------------------- GL_NV_explicit_multisample ---------------------- */
+
+#ifndef GL_NV_explicit_multisample
+#define GL_NV_explicit_multisample 1
+
+#define GL_SAMPLE_POSITION_NV 0x8E50
+#define GL_SAMPLE_MASK_NV 0x8E51
+#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
+#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
+#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
+#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
+#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
+#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
+#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
+#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+
+typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val);
+typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
+typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
+
+#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV)
+#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV)
+#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV)
+
+#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample)
+
+#endif /* GL_NV_explicit_multisample */
+
/* ------------------------------ GL_NV_fence ------------------------------ */
#ifndef GL_NV_fence
@@ -6276,6 +7928,15 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsi
#endif /* GL_NV_fragment_program2 */
+/* ------------------------ GL_NV_fragment_program4 ------------------------ */
+
+#ifndef GL_NV_fragment_program4
+#define GL_NV_fragment_program4 1
+
+#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4)
+
+#endif /* GL_NV_fragment_program4 */
+
/* --------------------- GL_NV_fragment_program_option --------------------- */
#ifndef GL_NV_fragment_program_option
@@ -6285,6 +7946,94 @@ typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsi
#endif /* GL_NV_fragment_program_option */
+/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+
+typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+
+#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV)
+
+#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage)
+
+#endif /* GL_NV_framebuffer_multisample_coverage */
+
+/* ------------------------ GL_NV_geometry_program4 ------------------------ */
+
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+
+typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+
+#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV)
+
+#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4)
+
+#endif /* GL_NV_geometry_program4 */
+
+/* ------------------------- GL_NV_geometry_shader4 ------------------------ */
+
+#ifndef GL_NV_geometry_shader4
+#define GL_NV_geometry_shader4 1
+
+#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4)
+
+#endif /* GL_NV_geometry_shader4 */
+
+/* --------------------------- GL_NV_gpu_program4 -------------------------- */
+
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+
+#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV)
+#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV)
+#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV)
+#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV)
+#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV)
+#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV)
+#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV)
+#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV)
+#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV)
+#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV)
+#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV)
+#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV)
+
+#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4)
+
+#endif /* GL_NV_gpu_program4 */
+
/* ---------------------------- GL_NV_half_float --------------------------- */
#ifndef GL_NV_half_float
@@ -6457,6 +8206,29 @@ typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
#endif /* GL_NV_packed_depth_stencil */
+/* --------------------- GL_NV_parameter_buffer_object --------------------- */
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+
+typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+
+#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV)
+#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV)
+#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV)
+
+#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object)
+
+#endif /* GL_NV_parameter_buffer_object */
+
/* ------------------------- GL_NV_pixel_data_range ------------------------ */
#ifndef GL_NV_pixel_data_range
@@ -6498,6 +8270,38 @@ typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLi
#endif /* GL_NV_point_sprite */
+/* -------------------------- GL_NV_present_video -------------------------- */
+
+#ifndef GL_NV_present_video
+#define GL_NV_present_video 1
+
+#define GL_FRAME_NV 0x8E26
+#define GL_FIELDS_NV 0x8E27
+#define GL_CURRENT_TIME_NV 0x8E28
+#define GL_NUM_FILL_STREAMS_NV 0x8E29
+#define GL_PRESENT_TIME_NV 0x8E2A
+#define GL_PRESENT_DURATION_NV 0x8E2B
+
+typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params);
+typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params);
+typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params);
+typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);
+typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint* params);
+
+#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)
+#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)
+#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV)
+#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV)
+#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV)
+#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV)
+#define glVideoParameterivNV GLEW_GET_FUN(__glewVideoParameterivNV)
+
+#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video)
+
+#endif /* GL_NV_present_video */
+
/* ------------------------ GL_NV_primitive_restart ------------------------ */
#ifndef GL_NV_primitive_restart
@@ -6712,9 +8516,12 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage
#define GL_TEXTURE_SHADER_NV 0x86DE
#define GL_SHADER_OPERATION_NV 0x86DF
#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
#define GL_CONST_EYE_NV 0x86E5
#define GL_PASS_THROUGH_NV 0x86E6
@@ -6841,6 +8648,65 @@ typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage
#endif /* GL_NV_texture_shader3 */
+/* ------------------------ GL_NV_transform_feedback ----------------------- */
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+
+typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+
+#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV)
+#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV)
+#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV)
+#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV)
+#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV)
+#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV)
+#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV)
+#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV)
+#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV)
+#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV)
+#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV)
+
+#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback)
+
+#endif /* GL_NV_transform_feedback */
+
/* ------------------------ GL_NV_vertex_array_range ----------------------- */
#ifndef GL_NV_vertex_array_range
@@ -7137,6 +9003,81 @@ typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei
#endif /* GL_NV_vertex_program3 */
+/* ------------------------- GL_NV_vertex_program4 ------------------------- */
+
+#ifndef GL_NV_vertex_program4
+#define GL_NV_vertex_program4 1
+
+#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4)
+
+#endif /* GL_NV_vertex_program4 */
+
+/* ------------------------ GL_OES_byte_coordinates ------------------------ */
+
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+
+#define GL_BYTE 0x1400
+
+#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates)
+
+#endif /* GL_OES_byte_coordinates */
+
+/* ------------------- GL_OES_compressed_paletted_texture ------------------ */
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+
+#define GL_PALETTE4_RGB8_OES 0x8B90
+#define GL_PALETTE4_RGBA8_OES 0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
+#define GL_PALETTE4_RGBA4_OES 0x8B93
+#define GL_PALETTE4_RGB5_A1_OES 0x8B94
+#define GL_PALETTE8_RGB8_OES 0x8B95
+#define GL_PALETTE8_RGBA8_OES 0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
+#define GL_PALETTE8_RGBA4_OES 0x8B98
+#define GL_PALETTE8_RGB5_A1_OES 0x8B99
+
+#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture)
+
+#endif /* GL_OES_compressed_paletted_texture */
+
+/* --------------------------- GL_OES_read_format -------------------------- */
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+
+#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format)
+
+#endif /* GL_OES_read_format */
+
+/* ------------------------ GL_OES_single_precision ------------------------ */
+
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+
+typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth);
+typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation);
+typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
+typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation);
+typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+
+#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES)
+#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES)
+#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES)
+#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES)
+#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES)
+#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES)
+
+#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision)
+
+#endif /* GL_OES_single_precision */
+
/* ---------------------------- GL_OML_interlace --------------------------- */
#ifndef GL_OML_interlace
@@ -7370,6 +9311,24 @@ typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
#endif /* GL_SGIS_pixel_texture */
+/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+
+#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen)
+
+#endif /* GL_SGIS_point_line_texgen */
+
/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */
#ifndef GL_SGIS_sharpen_texture
@@ -7534,6 +9493,17 @@ typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp);
#endif /* GL_SGIX_clipmap */
+/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+
+#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy)
+
+#endif /* GL_SGIX_convolution_accuracy */
+
/* ------------------------- GL_SGIX_depth_texture ------------------------- */
#ifndef GL_SGIX_depth_texture
@@ -7589,7 +9559,6 @@ typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname);
#endif /* GL_SGIX_fog_texture */
-#if 0
/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */
#ifndef GL_SGIX_fragment_specular_lighting
@@ -7602,14 +9571,14 @@ typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLin
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params);
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint* params);
+typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);
typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param);
typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params);
typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param);
typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, const GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, const GLint* data);
+typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data);
+typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data);
typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data);
typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data);
@@ -7632,7 +9601,6 @@ typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLe
#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX)
#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting)
-#endif
#endif /* GL_SGIX_fragment_specular_lighting */
@@ -8333,6 +10301,8 @@ GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays;
GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri;
+GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv;
GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b;
GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv;
GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d;
@@ -8481,6 +10451,72 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv;
GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv;
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv;
+GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv;
+
+GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender;
+GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange;
+GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation;
+GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor;
+GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi;
+GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv;
+GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv;
+GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv;
+GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski;
+GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei;
+GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei;
+GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender;
+GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback;
+GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v;
+GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation;
+GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v;
+GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi;
+GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv;
+GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv;
+GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv;
+GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi;
+GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv;
+GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv;
+GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings;
+GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui;
+GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv;
+GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui;
+GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv;
+GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui;
+GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv;
+GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui;
+GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer;
+
GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX;
GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE;
@@ -8498,6 +10534,9 @@ GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE;
GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE;
GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE;
+GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE;
+GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE;
+
GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE;
GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE;
@@ -8514,6 +10553,35 @@ GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB;
GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB;
+GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;
+GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;
+
+GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;
+GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;
+GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer;
+GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
+GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
+GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;
+GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers;
+GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers;
+GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap;
+GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv;
+GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv;
+GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer;
+GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer;
+GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage;
+GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample;
+
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB;
+
GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable;
GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable;
GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv;
@@ -8547,6 +10615,11 @@ GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram;
GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax;
GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB;
+
+GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange;
+GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange;
+
GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB;
GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB;
GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB;
@@ -8642,6 +10715,8 @@ GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB;
GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB;
GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB;
+GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB;
+
GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB;
GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB;
GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB;
@@ -8655,6 +10730,11 @@ GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB;
GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB;
GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB;
+GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray;
+GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays;
+GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays;
+GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray;
+
GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB;
GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB;
GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB;
@@ -8852,6 +10932,10 @@ GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI;
GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI;
GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT;
+
GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT;
GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT;
@@ -8894,6 +10978,203 @@ GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT;
GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT;
+GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT;
+GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT;
+GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT;
+GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT;
+GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT;
+GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT;
+GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT;
+GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT;
+GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT;
+GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT;
+GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT;
+GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT;
+GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT;
+GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT;
+GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT;
+GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT;
+GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT;
+GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT;
+GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT;
+GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT;
+GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT;
+GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT;
+
+GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT;
+GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT;
+GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT;
+GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT;
+GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT;
+GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT;
+
+GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT;
+GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT;
+
GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT;
GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT;
@@ -8943,6 +11224,49 @@ GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT;
GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT;
GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT;
+GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT;
+
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT;
+
+GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT;
+GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT;
+GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT;
+GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT;
+GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT;
+GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT;
+
GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT;
GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT;
GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT;
@@ -9014,6 +11338,15 @@ GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT;
GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT;
+GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT;
+
+GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT;
+GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT;
+GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT;
+GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT;
+
GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT;
GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT;
GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT;
@@ -9023,6 +11356,17 @@ GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT;
GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT;
+GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT;
+
+GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT;
+GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT;
+GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT;
+GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT;
+GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT;
+
GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT;
GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT;
GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT;
@@ -9080,6 +11424,8 @@ GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT;
GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT;
GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT;
+GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY;
+
GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY;
GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP;
@@ -9142,6 +11488,13 @@ GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA;
GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA;
GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA;
+GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV;
+GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV;
+
+GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV;
+GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV;
+GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV;
+
GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV;
GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV;
GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV;
@@ -9152,6 +11505,10 @@ GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV;
GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV;
GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV;
+GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV;
+GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV;
+GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV;
+
GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV;
GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV;
GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV;
@@ -9167,6 +11524,23 @@ GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4
GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV;
GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV;
+GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV;
+
+GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV;
+
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV;
+
GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV;
GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV;
GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV;
@@ -9222,12 +11596,24 @@ GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV;
GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV;
GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV;
+GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV;
+
GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV;
GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV;
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV;
GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV;
+GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV;
+GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV;
+GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;
+GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;
+GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;
+GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;
+GLEW_FUN_EXPORT PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV;
+
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;
@@ -9248,6 +11634,18 @@ GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombin
GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV;
GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV;
+GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV;
+GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV;
+GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV;
+GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV;
+GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV;
+GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV;
+GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV;
+GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV;
+GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV;
+GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV;
+
GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV;
GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV;
@@ -9316,6 +11714,13 @@ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;
GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;
+GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES;
+GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES;
+GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES;
+GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES;
+GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES;
+GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES;
+
GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS;
GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS;
@@ -9345,7 +11750,6 @@ GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX;
GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX;
-#if 0
GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX;
GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX;
GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX;
@@ -9363,7 +11767,6 @@ GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX;
GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX;
GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX;
GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX;
-#endif
GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX;
@@ -9461,6 +11864,8 @@ GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3;
GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4;
GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5;
GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1;
+GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0;
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer;
GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1;
@@ -9468,6 +11873,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels;
+GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range;
@@ -9476,13 +11882,21 @@ GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range;
GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture;
@@ -9495,7 +11909,9 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine;
@@ -9505,7 +11921,9 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix;
+GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object;
GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program;
@@ -9522,6 +11940,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil;
+GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc;
GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3;
@@ -9534,6 +11953,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate;
@@ -9549,12 +11969,19 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func;
@@ -9565,6 +11992,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object;
@@ -9584,7 +12012,11 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp;
@@ -9593,15 +12025,22 @@ GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array;
+GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader;
GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting;
+GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator;
GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker;
GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes;
GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform;
@@ -9624,22 +12063,33 @@ GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers;
GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos;
GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2;
@@ -9652,6 +12102,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program;
@@ -9659,6 +12110,11 @@ GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;
GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;
+GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4;
+GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates;
+GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture;
+GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format;
+GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision;
GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace;
GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample;
GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample;
@@ -9672,6 +12128,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture;
+GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp;
@@ -9684,6 +12141,7 @@ GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap;
+GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster;
GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset;
@@ -9740,6 +12198,9 @@ GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint;
/* string codes */
#define GLEW_VERSION 1
+#define GLEW_VERSION_MAJOR 2
+#define GLEW_VERSION_MINOR 3
+#define GLEW_VERSION_MICRO 4
/* API */
#ifdef GLEW_MX
@@ -9752,11 +12213,10 @@ GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name);
#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x)
#define glewIsExtensionSupported(x) glewIsSupported(x)
+#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x))
#ifdef _WIN32
-# define GLEW_GET_VAR(x) glewGetContext()->x
# define GLEW_GET_FUN(x) glewGetContext()->x
#else
-# define GLEW_GET_VAR(x) glewGetContext()->x
# define GLEW_GET_FUN(x) x
#endif
@@ -9766,7 +12226,7 @@ GLEWAPI GLenum glewInit ();
GLEWAPI GLboolean glewIsSupported (const char* name);
#define glewIsExtensionSupported(x) glewIsSupported(x)
-#define GLEW_GET_VAR(x) x
+#define GLEW_GET_VAR(x) (*(const GLboolean*)&x)
#define GLEW_GET_FUN(x) x
#endif /* GLEW_MX */
diff --git a/extern/glew/include/GL/glxew.h b/extern/glew/include/GL/glxew.h
index d21397aeed4..a29030da3cb 100644
--- a/extern/glew/include/GL/glxew.h
+++ b/extern/glew/include/GL/glxew.h
@@ -1,7 +1,7 @@
/*
** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2006, Milan Ikits
-** Copyright (C) 2002-2006, Marcelo E. Magallon
+** Copyright (C) 2002-2008, Milan Ikits
+** Copyright (C) 2002-2008, Marcelo E. Magallon
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
@@ -30,22 +30,50 @@
*/
/*
-** The contents of this file are subject to the GLX Public License Version 1.0
-** (the "License"). You may not use this file except in compliance with the
-** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
-** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
-** or at http://www.sgi.com/software/opensource/glx/license.html.
-**
-** Software distributed under the License is distributed on an "AS IS"
-** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
-** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
-** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
-** language governing rights and limitations under the License.
-**
-** The Original Software is GLX version 1.2 source code, released February,
-** 1999. The developer of the Original Software is Silicon Graphics, Inc.
-** Those portions of the Subject Software created by Silicon Graphics, Inc.
-** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
+ * Mesa 3-D graphics library
+ * Version: 7.0
+ *
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef __glxew_h__
@@ -55,9 +83,13 @@
#ifdef __glxext_h_
#error glxext.h included before glxew.h
#endif
+#ifdef GLX_H
+#error glx.h included before glxew.h
+#endif
#define __glxext_h_
#define __GLX_glx_h__
+#define GLX_H
#include
#include
@@ -100,7 +132,13 @@ extern "C" {
typedef XID GLXDrawable;
typedef XID GLXPixmap;
+#ifdef __sun
+typedef struct __glXContextRec *GLXContext;
+#else
typedef struct __GLXcontextRec *GLXContext;
+#endif
+
+typedef unsigned int GLXVideoDeviceNV;
extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);
extern Bool glXQueryVersion (Display *dpy, int *major, int *minor);
@@ -111,7 +149,7 @@ extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
extern void glXDestroyContext (Display *dpy, GLXContext ctx);
extern Bool glXIsDirect (Display *dpy, GLXContext ctx);
-extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLuint mask);
+extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);
extern GLXContext glXGetCurrentContext (void);
extern GLXDrawable glXGetCurrentDrawable (void);
@@ -220,8 +258,24 @@ typedef XID GLXFBConfigID;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
typedef struct __GLXFBConfigRec *GLXFBConfig;
-typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent;
-typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent;
+
+typedef struct {
+ int event_type;
+ int draw_type;
+ unsigned long serial;
+ Bool send_event;
+ Display *display;
+ GLXDrawable drawable;
+ unsigned int buffer_mask;
+ unsigned int aux_buffer;
+ int x, y;
+ int width, height;
+ int count;
+} GLXPbufferClobberEvent;
+typedef union __GLXEvent {
+ GLXPbufferClobberEvent glxpbufferclobber;
+ long pad[24];
+} GLXEvent;
typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
@@ -289,6 +343,25 @@ extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
#endif /* GLX_3DFX_multisample */
+/* ------------------------- GLX_ARB_create_context ------------------------ */
+
+#ifndef GLX_ARB_create_context
+#define GLX_ARB_create_context 1
+
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+
+typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+
+#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB)
+
+#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context)
+
+#endif /* GLX_ARB_create_context */
+
/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */
#ifndef GLX_ARB_fbconfig_float
@@ -301,6 +374,17 @@ extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
#endif /* GLX_ARB_fbconfig_float */
+/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */
+
+#ifndef GLX_ARB_framebuffer_sRGB
+#define GLX_ARB_framebuffer_sRGB 1
+
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
+
+#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB)
+
+#endif /* GLX_ARB_framebuffer_sRGB */
+
/* ------------------------ GLX_ARB_get_proc_address ----------------------- */
#ifndef GLX_ARB_get_proc_address
@@ -388,6 +472,29 @@ typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, i
#endif /* GLX_ATI_render_texture */
+/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+
+#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float)
+
+#endif /* GLX_EXT_fbconfig_packed_float */
+
+/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+
+#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB)
+
+#endif /* GLX_EXT_framebuffer_sRGB */
+
/* ------------------------- GLX_EXT_import_context ------------------------ */
#ifndef GLX_EXT_import_context
@@ -422,6 +529,53 @@ typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context
#endif /* GLX_EXT_scene_marker */
+/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap 1
+
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer);
+
+#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT)
+#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT)
+
+#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap)
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
/* -------------------------- GLX_EXT_visual_info -------------------------- */
#ifndef GLX_EXT_visual_info
@@ -540,6 +694,46 @@ typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
#endif /* GLX_NV_float_buffer */
+/* -------------------------- GLX_NV_present_video ------------------------- */
+
+#ifndef GLX_NV_present_video
+#define GLX_NV_present_video 1
+
+#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
+
+typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
+typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
+
+#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV)
+#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV)
+
+#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video)
+
+#endif /* GLX_NV_present_video */
+
+/* --------------------------- GLX_NV_swap_group --------------------------- */
+
+#ifndef GLX_NV_swap_group
+#define GLX_NV_swap_group 1
+
+typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier);
+typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group);
+typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count);
+typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
+typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
+typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen);
+
+#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV)
+#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV)
+#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV)
+#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV)
+#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV)
+#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV)
+
+#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group)
+
+#endif /* GLX_NV_swap_group */
+
/* ----------------------- GLX_NV_vertex_array_range ----------------------- */
#ifndef GLX_NV_vertex_array_range
@@ -555,6 +749,40 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
#endif /* GLX_NV_vertex_array_range */
+/* -------------------------- GLX_NV_video_output -------------------------- */
+
+#ifndef GLX_NV_video_output
+#define GLX_NV_video_output 1
+
+#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
+#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
+#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
+#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
+#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
+#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
+#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
+#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
+
+typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
+typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
+typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
+typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf);
+typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
+
+#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV)
+#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV)
+#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV)
+#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV)
+#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
+#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
+
+#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
+
+#endif /* GLX_NV_video_output */
+
/* -------------------------- GLX_OML_swap_method -------------------------- */
#ifndef GLX_OML_swap_method
@@ -683,6 +911,73 @@ typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLX
#endif /* GLX_SGIX_fbconfig */
+/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin;
+ int YOrigin;
+ int maxHeight;
+ int maxWidth;
+} GLXPipeRectLimits;
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin;
+ int srcYOrigin;
+ int srcWidth;
+ int srcHeight;
+ int destXOrigin;
+ int destYOrigin;
+ int destWidth;
+ int destHeight;
+} GLXPipeRect;
+
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+
+#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX)
+#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX)
+#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX)
+#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX)
+#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX)
+#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX)
+#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX)
+#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX)
+
+#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe)
+
+#endif /* GLX_SGIX_hyperpipe */
+
/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */
#ifndef GLX_SGIX_pbuffer
@@ -911,6 +1206,8 @@ extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
extern PFNGLXSELECTEVENTPROC __glewXSelectEvent;
+extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
+
extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
@@ -920,6 +1217,9 @@ extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
+extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
+extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
+
extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
@@ -930,9 +1230,26 @@ extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
+extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
+extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
+
+extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
+extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
+extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
+extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
+extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
+extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
+
extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
+extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
+extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
+extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
+extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
+extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
+extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
+
#ifdef GLX_OML_sync_control
extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
@@ -948,6 +1265,15 @@ extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
+extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
+extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
+extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
+extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
+extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
+extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
+extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
+extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
+
extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
@@ -991,13 +1317,18 @@ GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;
GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;
GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;
+GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;
GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
+GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;
GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;
+GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
+GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;
GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;
+GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;
GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;
GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;
@@ -1006,7 +1337,10 @@ GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;
GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;
+GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
+GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
+GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
@@ -1014,6 +1348,7 @@ GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;
GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
+GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;
@@ -1041,12 +1376,12 @@ extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name);
#define glxewInit() glxewContextInit(glxewGetContext())
#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
-#define GLXEW_GET_VAR(x) glxewGetContext()->x
+#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x))
#define GLXEW_GET_FUN(x) x
#else /* GLEW_MX */
-#define GLXEW_GET_VAR(x) x
+#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
#define GLXEW_GET_FUN(x) x
extern GLboolean glxewIsSupported (const char* name);
diff --git a/extern/glew/include/GL/wglew.h b/extern/glew/include/GL/wglew.h
index febb1d07399..2eaad3651ac 100644
--- a/extern/glew/include/GL/wglew.h
+++ b/extern/glew/include/GL/wglew.h
@@ -1,7 +1,7 @@
/*
** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2006, Milan Ikits
-** Copyright (C) 2002-2006, Marcelo E. Magallon
+** Copyright (C) 2002-2008, Milan Ikits
+** Copyright (C) 2002-2008, Marcelo E. Magallon
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
@@ -29,6 +29,29 @@
** THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
#ifndef __wglew_h__
#define __wglew_h__
#define __WGLEW_H__
@@ -118,6 +141,26 @@ typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, in
#endif /* WGL_ARB_buffer_region */
+/* ------------------------- WGL_ARB_create_context ------------------------ */
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
+
+#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB)
+
+#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context)
+
+#endif /* WGL_ARB_create_context */
+
/* ----------------------- WGL_ARB_extensions_string ----------------------- */
#ifndef WGL_ARB_extensions_string
@@ -131,11 +174,25 @@ typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#endif /* WGL_ARB_extensions_string */
+/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */
+
+#ifndef WGL_ARB_framebuffer_sRGB
+#define WGL_ARB_framebuffer_sRGB 1
+
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
+
+#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB)
+
+#endif /* WGL_ARB_framebuffer_sRGB */
+
/* ----------------------- WGL_ARB_make_current_read ----------------------- */
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
@@ -386,11 +443,24 @@ typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#endif /* WGL_EXT_extensions_string */
+/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_EXT_framebuffer_sRGB 1
+
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+
+#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB)
+
+#endif /* WGL_EXT_framebuffer_sRGB */
+
/* ----------------------- WGL_EXT_make_current_read ----------------------- */
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
+
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
@@ -509,6 +579,17 @@ typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixel
#endif /* WGL_EXT_pixel_format */
+/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_EXT_pixel_format_packed_float 1
+
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+
+#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float)
+
+#endif /* WGL_EXT_pixel_format_packed_float */
+
/* -------------------------- WGL_EXT_swap_control ------------------------- */
#ifndef WGL_EXT_swap_control
@@ -690,6 +771,60 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO
#endif /* WGL_NV_float_buffer */
+/* -------------------------- WGL_NV_gpu_affinity -------------------------- */
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+
+#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+
+DECLARE_HANDLE(HGPUNV);
+typedef struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+} GPU_DEVICE, *PGPU_DEVICE;
+
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
+
+#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV)
+#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV)
+#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV)
+#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV)
+#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV)
+
+#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity)
+
+#endif /* WGL_NV_gpu_affinity */
+
+/* -------------------------- WGL_NV_present_video ------------------------- */
+
+#ifndef WGL_NV_present_video
+#define WGL_NV_present_video 1
+
+#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
+
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+
+typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);
+typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);
+typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue);
+
+#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV)
+#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV)
+#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV)
+
+#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video)
+
+#endif /* WGL_NV_present_video */
+
/* ---------------------- WGL_NV_render_depth_texture ---------------------- */
#ifndef WGL_NV_render_depth_texture
@@ -719,6 +854,29 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWO
#endif /* WGL_NV_render_texture_rectangle */
+/* --------------------------- WGL_NV_swap_group --------------------------- */
+
+#ifndef WGL_NV_swap_group
+#define WGL_NV_swap_group 1
+
+typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
+typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count);
+typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers);
+typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group);
+typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
+
+#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV)
+#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV)
+#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV)
+#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV)
+#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV)
+#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV)
+
+#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group)
+
+#endif /* WGL_NV_swap_group */
+
/* ----------------------- WGL_NV_vertex_array_range ----------------------- */
#ifndef WGL_NV_vertex_array_range
@@ -734,6 +892,45 @@ typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#endif /* WGL_NV_vertex_array_range */
+/* -------------------------- WGL_NV_video_output -------------------------- */
+
+#ifndef WGL_NV_video_output
+#define WGL_NV_video_output 1
+
+#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
+#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
+#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
+#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
+#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
+#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
+#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define WGL_VIDEO_OUT_FRAME 0x20C8
+#define WGL_VIDEO_OUT_FIELD_1 0x20C9
+#define WGL_VIDEO_OUT_FIELD_2 0x20CA
+#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
+#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
+
+DECLARE_HANDLE(HPVIDEODEV);
+
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);
+
+#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV)
+#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV)
+#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV)
+#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV)
+#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV)
+#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV)
+
+#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output)
+
+#endif /* WGL_NV_video_output */
+
/* -------------------------- WGL_OML_sync_control ------------------------- */
#ifndef WGL_OML_sync_control
@@ -777,6 +974,8 @@ WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
+WGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
+
WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
@@ -855,9 +1054,33 @@ WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
+WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
+WGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
+WGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
+WGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
+WGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
+
+WGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
+WGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
+WGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
+
+WGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
+WGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
+WGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
+WGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
+WGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
+WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
+
WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
+WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
+WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
+WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
+WGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
+WGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
+WGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
+
WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
@@ -867,7 +1090,9 @@ WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;
WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control;
WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context;
WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;
+WGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;
WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;
WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;
@@ -879,10 +1104,12 @@ WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;
WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;
WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;
WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;
WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;
WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;
+WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;
WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;
@@ -891,9 +1118,13 @@ WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;
+WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
+WGLEW_EXPORT GLboolean __WGLEW_NV_present_video;
WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
+WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group;
WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
+WGLEW_EXPORT GLboolean __WGLEW_NV_video_output;
WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
#ifdef GLEW_MX
@@ -911,12 +1142,12 @@ GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name);
#define wglewInit() wglewContextInit(wglewGetContext())
#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
-#define WGLEW_GET_VAR(x) wglewGetContext()->x
+#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x))
#define WGLEW_GET_FUN(x) wglewGetContext()->x
#else /* GLEW_MX */
-#define WGLEW_GET_VAR(x) x
+#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
#define WGLEW_GET_FUN(x) x
GLEWAPI GLboolean wglewIsSupported (const char* name);
diff --git a/extern/glew/make/msvc_9_0/glew.vcproj b/extern/glew/make/msvc_9_0/glew.vcproj
index a7186f61cbc..f8b791de218 100644
--- a/extern/glew/make/msvc_9_0/glew.vcproj
+++ b/extern/glew/make/msvc_9_0/glew.vcproj
@@ -43,7 +43,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;GLEW_STATIC"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -115,7 +115,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GLEW_STATIC"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
diff --git a/extern/glew/src/glew.c b/extern/glew/src/glew.c
index f20463630dc..24c6a726c38 100644
--- a/extern/glew/src/glew.c
+++ b/extern/glew/src/glew.c
@@ -1,7 +1,7 @@
/*
** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2006, Milan Ikits
-** Copyright (C) 2002-2006, Marcelo E. Magallon
+** Copyright (C) 2002-2008, Milan Ikits
+** Copyright (C) 2002-2008, Marcelo E. Magallon
** Copyright (C) 2002, Lev Povalahev
** All rights reserved.
**
@@ -72,15 +72,21 @@
void* NSGLGetProcAddress (const GLubyte *name)
{
+ static const struct mach_header* image = NULL;
NSSymbol symbol;
char* symbolName;
+ if (NULL == image)
+ {
+ image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ }
/* prepend a '_' for the Unix C symbol mangling convention */
symbolName = malloc(strlen((const char*)name) + 2);
strcpy(symbolName+1, (const char*)name);
symbolName[0] = '_';
symbol = NULL;
- if (NSIsSymbolNameDefined(symbolName))
- symbol = NSLookupAndBindSymbol(symbolName);
+ /* if (NSIsSymbolNameDefined(symbolName))
+ symbol = NSLookupAndBindSymbol(symbolName); */
+ symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
free(symbolName);
return symbol ? NSAddressOfSymbol(symbol) : NULL;
}
@@ -126,11 +132,15 @@ void* dlGetProcAddress (const GLubyte* name)
# endif
#endif
+/*
+ * Define GLboolean const cast.
+ */
+#define CONST_CAST(x) (*(GLboolean*)&x)
+
/*
* GLEW, just like OpenGL or GLU, does not rely on the standard C library.
* These functions implement the functionality required in this file.
*/
-
static GLuint _glewStrLen (const GLubyte* s)
{
GLuint i=0;
@@ -144,7 +154,7 @@ static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
GLuint i=0;
if (s == NULL) return 0;
while (s[i] != '\0' && s[i] != c) i++;
- return s[i] == c ? i : 0;
+ return (s[i] == '\0' || s[i] == c) ? i : 0;
}
static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
@@ -275,6 +285,8 @@ PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL;
PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL;
PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL;
PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL;
+PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL;
+PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL;
PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL;
PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL;
PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL;
@@ -423,6 +435,72 @@ PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL;
PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL;
PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL;
+PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL;
+PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL;
+PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL;
+PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL;
+PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL;
+PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL;
+
+PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL;
+PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL;
+PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL;
+PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL;
+PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL;
+PFNGLCLAMPCOLORPROC __glewClampColor = NULL;
+PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL;
+PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL;
+PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL;
+PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL;
+PFNGLCOLORMASKIPROC __glewColorMaski = NULL;
+PFNGLDISABLEIPROC __glewDisablei = NULL;
+PFNGLENABLEIPROC __glewEnablei = NULL;
+PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL;
+PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL;
+PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL;
+PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL;
+PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL;
+PFNGLGETSTRINGIPROC __glewGetStringi = NULL;
+PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL;
+PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL;
+PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL;
+PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL;
+PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL;
+PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL;
+PFNGLISENABLEDIPROC __glewIsEnabledi = NULL;
+PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL;
+PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL;
+PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL;
+PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL;
+PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL;
+PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL;
+PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL;
+PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL;
+PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL;
+PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL;
+PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL;
+PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL;
+PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL;
+PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL;
+PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL;
+PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL;
+PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL;
+PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL;
+PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL;
+PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL;
+PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL;
+PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL;
+PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL;
+PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL;
+PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL;
+PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL;
+PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL;
+PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL;
+PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL;
+PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL;
+PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL;
+PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL;
+
PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL;
PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL;
@@ -440,6 +518,9 @@ PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL;
PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL;
PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL;
+PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL;
+PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL;
+
PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL;
PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL;
@@ -456,6 +537,35 @@ PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL;
PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL;
+PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL;
+PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL;
+
+PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL;
+PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL;
+PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL;
+PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL;
+PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL;
+PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL;
+PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL;
+PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer = NULL;
+PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL;
+PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL;
+PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL;
+PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL;
+PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL;
+PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL;
+PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL;
+PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL;
+PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL;
+PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL;
+PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL;
+PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL;
+
+PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL;
+PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL;
+PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL;
+PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL;
+
PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL;
PFNGLCOLORTABLEPROC __glewColorTable = NULL;
PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL;
@@ -489,6 +599,11 @@ PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL;
PFNGLRESETMINMAXPROC __glewResetMinmax = NULL;
PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL;
+PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL;
+
+PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL;
+PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL;
+
PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL;
PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL;
PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL;
@@ -584,6 +699,8 @@ PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL;
PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL;
PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL;
+PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL;
+
PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL;
PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL;
PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL;
@@ -597,6 +714,11 @@ PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL;
PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL;
PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL;
+PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL;
+PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL;
+PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL;
+PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL;
+
PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL;
PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL;
PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL;
@@ -794,6 +916,10 @@ PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL;
PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL;
PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL;
+PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL;
+PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL;
+PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL;
+
PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL;
PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL;
@@ -836,6 +962,203 @@ PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL;
PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL;
+PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL;
+PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL;
+PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL;
+PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL;
+PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL;
+PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL;
+PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL;
+PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL;
+PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL;
+PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL;
+PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL;
+PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL;
+PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL;
+PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL;
+PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL;
+PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL;
+PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL;
+PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL;
+PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL;
+PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL;
+PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL;
+PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL;
+PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL;
+PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL;
+PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL;
+PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL;
+PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL;
+PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL;
+PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL;
+PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL;
+PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL;
+PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL;
+PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL;
+PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL;
+PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL;
+PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL;
+PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL;
+PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL;
+PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL;
+PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL;
+PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL;
+PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL;
+PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL;
+PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL;
+PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL;
+PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL;
+PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL;
+PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL;
+PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL;
+PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL;
+PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL;
+PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL;
+PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL;
+PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL;
+PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL;
+PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL;
+PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL;
+PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL;
+PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL;
+PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL;
+PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL;
+PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL;
+PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL;
+PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL;
+PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL;
+PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL;
+PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL;
+PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL;
+PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL;
+PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL;
+PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL;
+PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL;
+PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL;
+PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL;
+PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL;
+PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL;
+PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL;
+PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL;
+PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL;
+PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL;
+PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL;
+PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL;
+PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL;
+PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL;
+PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL;
+PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL;
+PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL;
+PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL;
+PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL;
+PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL;
+PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL;
+PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL;
+PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL;
+PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL;
+PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL;
+PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL;
+PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL;
+PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL;
+PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL;
+PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL;
+PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL;
+PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL;
+PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL;
+PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL;
+PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL;
+PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL;
+PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL;
+PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL;
+PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL;
+PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL;
+PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL;
+PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL;
+PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL;
+PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL;
+PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL;
+PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL;
+PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL;
+PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL;
+PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL;
+PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL;
+PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL;
+PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL;
+PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL;
+PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL;
+PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL;
+PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL;
+PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL;
+PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL;
+PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL;
+PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL;
+PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL;
+PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL;
+PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL;
+PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL;
+PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL;
+PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL;
+PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL;
+PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL;
+PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL;
+PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL;
+PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL;
+PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL;
+PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL;
+PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL;
+PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL;
+PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL;
+PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL;
+PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL;
+PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL;
+PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL;
+PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL;
+PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL;
+PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL;
+PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL;
+PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL;
+PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL;
+PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL;
+
+PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL;
+PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL;
+PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL;
+PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL;
+PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL;
+PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL;
+
+PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL;
+PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL;
+
PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL;
PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL;
@@ -885,6 +1208,49 @@ PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL;
PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL;
PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL;
+PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL;
+PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL;
+PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL;
+PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL;
+
+PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL;
+PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL;
+
+PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL;
+PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL;
+PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL;
+PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL;
+PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL;
+PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL;
+PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL;
+PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL;
+PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL;
+PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL;
+PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL;
+PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL;
+PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL;
+PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL;
+PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL;
+PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL;
+PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL;
+PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL;
+PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL;
+PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL;
+PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL;
+PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL;
+PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL;
+PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL;
+PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL;
+PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL;
+PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL;
+PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL;
+PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL;
+PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL;
+PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL;
+PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL;
+PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL;
+PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL;
+
PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL;
PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL;
PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL;
@@ -956,6 +1322,15 @@ PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL;
PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL;
+PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL;
+
+PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL;
+PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL;
+PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL;
+PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL;
+PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL;
+PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL;
+
PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL;
PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL;
PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL;
@@ -965,6 +1340,17 @@ PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL;
PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL;
+PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL;
+PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL;
+
+PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL;
+PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL;
+PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL;
+PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL;
+PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL;
+PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL;
+PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL;
+
PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL;
PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL;
PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL;
@@ -1022,6 +1408,8 @@ PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL;
PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL;
PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL;
+PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL;
+
PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL;
PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL;
@@ -1084,6 +1472,13 @@ PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL;
PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL;
PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL;
+PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL;
+PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL;
+
+PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL;
+PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL;
+PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL;
+
PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL;
PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL;
PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL;
@@ -1094,6 +1489,10 @@ PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL;
PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL;
PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL;
+PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL;
+PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL;
+PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL;
+
PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL;
PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL;
PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL;
@@ -1109,6 +1508,23 @@ PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL;
PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL;
PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL;
+PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL;
+
+PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL;
+
+PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL;
+PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL;
+PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL;
+PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL;
+PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL;
+PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL;
+PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL;
+
PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL;
PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL;
PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL;
@@ -1164,12 +1580,24 @@ PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL;
PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL;
PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL;
+PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL;
+PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL;
+PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL;
+
PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL;
PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL;
PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL;
PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL;
+PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL;
+PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL;
+PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL;
+PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL;
+PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL;
+PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL;
+PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV = NULL;
+
PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL;
PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL;
@@ -1190,6 +1618,18 @@ PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameter
PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL;
PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL;
+PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL;
+PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL;
+PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL;
+PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL;
+PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL;
+PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL;
+PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL;
+PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL;
+PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL;
+PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL;
+PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL;
+
PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL;
PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL;
@@ -1258,6 +1698,13 @@ PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL;
PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL;
PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL;
+PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL;
+PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL;
+PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL;
+PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL;
+PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL;
+PFNGLORTHOFOESPROC __glewOrthofOES = NULL;
+
PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL;
PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL;
@@ -1287,7 +1734,6 @@ PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL;
PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL;
-#if 0
PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL;
PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL;
PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL;
@@ -1305,7 +1751,6 @@ PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL;
PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL;
PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL;
PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL;
-#endif
PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL;
@@ -1402,6 +1847,8 @@ GLboolean __GLEW_VERSION_1_3 = GL_FALSE;
GLboolean __GLEW_VERSION_1_4 = GL_FALSE;
GLboolean __GLEW_VERSION_1_5 = GL_FALSE;
GLboolean __GLEW_VERSION_2_0 = GL_FALSE;
+GLboolean __GLEW_VERSION_2_1 = GL_FALSE;
+GLboolean __GLEW_VERSION_3_0 = GL_FALSE;
GLboolean __GLEW_3DFX_multisample = GL_FALSE;
GLboolean __GLEW_3DFX_tbuffer = GL_FALSE;
GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE;
@@ -1409,6 +1856,7 @@ GLboolean __GLEW_APPLE_client_storage = GL_FALSE;
GLboolean __GLEW_APPLE_element_array = GL_FALSE;
GLboolean __GLEW_APPLE_fence = GL_FALSE;
GLboolean __GLEW_APPLE_float_pixels = GL_FALSE;
+GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE;
GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE;
GLboolean __GLEW_APPLE_specular_vector = GL_FALSE;
GLboolean __GLEW_APPLE_texture_range = GL_FALSE;
@@ -1417,13 +1865,21 @@ GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE;
GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE;
GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE;
GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE;
+GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE;
GLboolean __GLEW_ARB_depth_texture = GL_FALSE;
GLboolean __GLEW_ARB_draw_buffers = GL_FALSE;
+GLboolean __GLEW_ARB_draw_instanced = GL_FALSE;
GLboolean __GLEW_ARB_fragment_program = GL_FALSE;
GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE;
GLboolean __GLEW_ARB_fragment_shader = GL_FALSE;
+GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE;
+GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE;
+GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE;
GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE;
+GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE;
GLboolean __GLEW_ARB_imaging = GL_FALSE;
+GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE;
+GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE;
GLboolean __GLEW_ARB_matrix_palette = GL_FALSE;
GLboolean __GLEW_ARB_multisample = GL_FALSE;
GLboolean __GLEW_ARB_multitexture = GL_FALSE;
@@ -1436,7 +1892,9 @@ GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE;
GLboolean __GLEW_ARB_shadow = GL_FALSE;
GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE;
GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE;
+GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE;
GLboolean __GLEW_ARB_texture_compression = GL_FALSE;
+GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE;
GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE;
GLboolean __GLEW_ARB_texture_env_add = GL_FALSE;
GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE;
@@ -1446,7 +1904,9 @@ GLboolean __GLEW_ARB_texture_float = GL_FALSE;
GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE;
GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE;
GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE;
+GLboolean __GLEW_ARB_texture_rg = GL_FALSE;
GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE;
+GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE;
GLboolean __GLEW_ARB_vertex_blend = GL_FALSE;
GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE;
GLboolean __GLEW_ARB_vertex_program = GL_FALSE;
@@ -1463,6 +1923,7 @@ GLboolean __GLEW_ATI_fragment_shader = GL_FALSE;
GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE;
GLboolean __GLEW_ATI_pn_triangles = GL_FALSE;
GLboolean __GLEW_ATI_separate_stencil = GL_FALSE;
+GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE;
GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE;
GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE;
GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE;
@@ -1475,6 +1936,7 @@ GLboolean __GLEW_EXT_422_pixels = GL_FALSE;
GLboolean __GLEW_EXT_Cg_shader = GL_FALSE;
GLboolean __GLEW_EXT_abgr = GL_FALSE;
GLboolean __GLEW_EXT_bgra = GL_FALSE;
+GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE;
GLboolean __GLEW_EXT_blend_color = GL_FALSE;
GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE;
GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE;
@@ -1490,12 +1952,19 @@ GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE;
GLboolean __GLEW_EXT_copy_texture = GL_FALSE;
GLboolean __GLEW_EXT_cull_vertex = GL_FALSE;
GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE;
+GLboolean __GLEW_EXT_direct_state_access = GL_FALSE;
+GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE;
+GLboolean __GLEW_EXT_draw_instanced = GL_FALSE;
GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE;
GLboolean __GLEW_EXT_fog_coord = GL_FALSE;
GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE;
GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE;
GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE;
GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE;
+GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE;
+GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE;
+GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE;
+GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE;
GLboolean __GLEW_EXT_histogram = GL_FALSE;
GLboolean __GLEW_EXT_index_array_formats = GL_FALSE;
GLboolean __GLEW_EXT_index_func = GL_FALSE;
@@ -1506,6 +1975,7 @@ GLboolean __GLEW_EXT_misc_attribute = GL_FALSE;
GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE;
GLboolean __GLEW_EXT_multisample = GL_FALSE;
GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE;
+GLboolean __GLEW_EXT_packed_float = GL_FALSE;
GLboolean __GLEW_EXT_packed_pixels = GL_FALSE;
GLboolean __GLEW_EXT_paletted_texture = GL_FALSE;
GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE;
@@ -1525,7 +1995,11 @@ GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE;
GLboolean __GLEW_EXT_subtexture = GL_FALSE;
GLboolean __GLEW_EXT_texture = GL_FALSE;
GLboolean __GLEW_EXT_texture3D = GL_FALSE;
+GLboolean __GLEW_EXT_texture_array = GL_FALSE;
+GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE;
GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE;
+GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE;
+GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE;
GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE;
GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE;
GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE;
@@ -1534,15 +2008,22 @@ GLboolean __GLEW_EXT_texture_env_add = GL_FALSE;
GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE;
GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE;
GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE;
+GLboolean __GLEW_EXT_texture_integer = GL_FALSE;
GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE;
GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE;
GLboolean __GLEW_EXT_texture_object = GL_FALSE;
GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE;
GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE;
GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE;
+GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE;
+GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE;
+GLboolean __GLEW_EXT_timer_query = GL_FALSE;
+GLboolean __GLEW_EXT_transform_feedback = GL_FALSE;
GLboolean __GLEW_EXT_vertex_array = GL_FALSE;
+GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE;
GLboolean __GLEW_EXT_vertex_shader = GL_FALSE;
GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE;
+GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE;
GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE;
GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE;
GLboolean __GLEW_HP_image_transform = GL_FALSE;
@@ -1565,22 +2046,33 @@ GLboolean __GLEW_MESA_resize_buffers = GL_FALSE;
GLboolean __GLEW_MESA_window_pos = GL_FALSE;
GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE;
GLboolean __GLEW_NV_blend_square = GL_FALSE;
+GLboolean __GLEW_NV_conditional_render = GL_FALSE;
GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE;
+GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE;
GLboolean __GLEW_NV_depth_clamp = GL_FALSE;
+GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE;
GLboolean __GLEW_NV_evaluators = GL_FALSE;
+GLboolean __GLEW_NV_explicit_multisample = GL_FALSE;
GLboolean __GLEW_NV_fence = GL_FALSE;
GLboolean __GLEW_NV_float_buffer = GL_FALSE;
GLboolean __GLEW_NV_fog_distance = GL_FALSE;
GLboolean __GLEW_NV_fragment_program = GL_FALSE;
GLboolean __GLEW_NV_fragment_program2 = GL_FALSE;
+GLboolean __GLEW_NV_fragment_program4 = GL_FALSE;
GLboolean __GLEW_NV_fragment_program_option = GL_FALSE;
+GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE;
+GLboolean __GLEW_NV_geometry_program4 = GL_FALSE;
+GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE;
+GLboolean __GLEW_NV_gpu_program4 = GL_FALSE;
GLboolean __GLEW_NV_half_float = GL_FALSE;
GLboolean __GLEW_NV_light_max_exponent = GL_FALSE;
GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE;
GLboolean __GLEW_NV_occlusion_query = GL_FALSE;
GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE;
+GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE;
GLboolean __GLEW_NV_pixel_data_range = GL_FALSE;
GLboolean __GLEW_NV_point_sprite = GL_FALSE;
+GLboolean __GLEW_NV_present_video = GL_FALSE;
GLboolean __GLEW_NV_primitive_restart = GL_FALSE;
GLboolean __GLEW_NV_register_combiners = GL_FALSE;
GLboolean __GLEW_NV_register_combiners2 = GL_FALSE;
@@ -1593,6 +2085,7 @@ GLboolean __GLEW_NV_texture_rectangle = GL_FALSE;
GLboolean __GLEW_NV_texture_shader = GL_FALSE;
GLboolean __GLEW_NV_texture_shader2 = GL_FALSE;
GLboolean __GLEW_NV_texture_shader3 = GL_FALSE;
+GLboolean __GLEW_NV_transform_feedback = GL_FALSE;
GLboolean __GLEW_NV_vertex_array_range = GL_FALSE;
GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE;
GLboolean __GLEW_NV_vertex_program = GL_FALSE;
@@ -1600,6 +2093,11 @@ GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE;
GLboolean __GLEW_NV_vertex_program2 = GL_FALSE;
GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE;
GLboolean __GLEW_NV_vertex_program3 = GL_FALSE;
+GLboolean __GLEW_NV_vertex_program4 = GL_FALSE;
+GLboolean __GLEW_OES_byte_coordinates = GL_FALSE;
+GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE;
+GLboolean __GLEW_OES_read_format = GL_FALSE;
+GLboolean __GLEW_OES_single_precision = GL_FALSE;
GLboolean __GLEW_OML_interlace = GL_FALSE;
GLboolean __GLEW_OML_resample = GL_FALSE;
GLboolean __GLEW_OML_subsample = GL_FALSE;
@@ -1613,6 +2111,7 @@ GLboolean __GLEW_SGIS_fog_function = GL_FALSE;
GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE;
GLboolean __GLEW_SGIS_multisample = GL_FALSE;
GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE;
+GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE;
GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE;
GLboolean __GLEW_SGIS_texture4D = GL_FALSE;
GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE;
@@ -1625,6 +2124,7 @@ GLboolean __GLEW_SGIX_async_histogram = GL_FALSE;
GLboolean __GLEW_SGIX_async_pixel = GL_FALSE;
GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE;
GLboolean __GLEW_SGIX_clipmap = GL_FALSE;
+GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE;
GLboolean __GLEW_SGIX_depth_texture = GL_FALSE;
GLboolean __GLEW_SGIX_flush_raster = GL_FALSE;
GLboolean __GLEW_SGIX_fog_offset = GL_FALSE;
@@ -1760,6 +2260,8 @@ static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT)
r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r;
r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r;
r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r;
+ r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r;
+ r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r;
r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r;
r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r;
r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r;
@@ -1836,7 +2338,6 @@ static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
{
GLboolean r = GL_FALSE;
-#ifndef BLENDER_CHANGES
r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r;
r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r;
r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r;
@@ -1930,13 +2431,100 @@ static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r;
r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r;
r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r;
-#endif
return r;
}
#endif /* GL_VERSION_2_0 */
+#ifdef GL_VERSION_2_1
+
+static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r;
+ r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r;
+ r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r;
+ r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r;
+ r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r;
+ r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_VERSION_2_1 */
+
+#ifdef GL_VERSION_3_0
+
+static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r;
+ r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r;
+ r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r;
+ r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r;
+ r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r;
+ r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r;
+ r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r;
+ r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r;
+ r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r;
+ r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r;
+ r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r;
+ r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r;
+ r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r;
+ r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r;
+ r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r;
+ r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r;
+ r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r;
+ r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r;
+ r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r;
+ r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r;
+ r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r;
+ r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r;
+ r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r;
+ r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r;
+ r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r;
+ r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r;
+ r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r;
+ r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r;
+ r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r;
+ r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r;
+ r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r;
+ r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r;
+ r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r;
+ r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r;
+ r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r;
+ r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r;
+ r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r;
+ r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r;
+ r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r;
+ r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r;
+ r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r;
+ r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r;
+ r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r;
+ r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r;
+ r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r;
+ r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r;
+ r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r;
+ r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r;
+ r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r;
+ r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r;
+ r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r;
+ r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r;
+ r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r;
+ r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r;
+ r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r;
+ r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r;
+ r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r;
+ r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_VERSION_3_0 */
+
#ifdef GL_3DFX_multisample
#endif /* GL_3DFX_multisample */
@@ -2003,6 +2591,20 @@ static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_APPLE_float_pixels */
+#ifdef GL_APPLE_flush_buffer_range
+
+static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r;
+ r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_APPLE_flush_buffer_range */
+
#ifdef GL_APPLE_pixel_buffer
#endif /* GL_APPLE_pixel_buffer */
@@ -2077,6 +2679,10 @@ static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_color_buffer_float */
+#ifdef GL_ARB_depth_buffer_float
+
+#endif /* GL_ARB_depth_buffer_float */
+
#ifdef GL_ARB_depth_texture
#endif /* GL_ARB_depth_texture */
@@ -2094,6 +2700,20 @@ static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_draw_buffers */
+#ifdef GL_ARB_draw_instanced
+
+static GLboolean _glewInit_GL_ARB_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r;
+ r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_draw_instanced */
+
#ifdef GL_ARB_fragment_program
#endif /* GL_ARB_fragment_program */
@@ -2106,10 +2726,66 @@ static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_fragment_shader */
+#ifdef GL_ARB_framebuffer_object
+
+static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r;
+ r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r;
+ r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r;
+ r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r;
+ r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r;
+ r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r;
+ r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r;
+ r = ((glFramebufferTexturLayer = (PFNGLFRAMEBUFFERTEXTURLAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexturLayer")) == NULL) || r;
+ r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r;
+ r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r;
+ r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r;
+ r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r;
+ r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r;
+ r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r;
+ r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r;
+ r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r;
+ r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r;
+ r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r;
+ r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r;
+ r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_framebuffer_object */
+
+#ifdef GL_ARB_framebuffer_sRGB
+
+#endif /* GL_ARB_framebuffer_sRGB */
+
+#ifdef GL_ARB_geometry_shader4
+
+static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r;
+ r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r;
+ r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r;
+ r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_geometry_shader4 */
+
#ifdef GL_ARB_half_float_pixel
#endif /* GL_ARB_half_float_pixel */
+#ifdef GL_ARB_half_float_vertex
+
+#endif /* GL_ARB_half_float_vertex */
+
#ifdef GL_ARB_imaging
static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -2155,6 +2831,33 @@ static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_imaging */
+#ifdef GL_ARB_instanced_arrays
+
+static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_instanced_arrays */
+
+#ifdef GL_ARB_map_buffer_range
+
+static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r;
+ r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_map_buffer_range */
+
#ifdef GL_ARB_matrix_palette
static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -2340,6 +3043,19 @@ static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_texture_border_clamp */
+#ifdef GL_ARB_texture_buffer_object
+
+static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_texture_buffer_object */
+
#ifdef GL_ARB_texture_compression
static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -2359,6 +3075,10 @@ static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT
#endif /* GL_ARB_texture_compression */
+#ifdef GL_ARB_texture_compression_rgtc
+
+#endif /* GL_ARB_texture_compression_rgtc */
+
#ifdef GL_ARB_texture_cube_map
#endif /* GL_ARB_texture_cube_map */
@@ -2395,6 +3115,10 @@ static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT
#endif /* GL_ARB_texture_rectangle */
+#ifdef GL_ARB_texture_rg
+
+#endif /* GL_ARB_texture_rg */
+
#ifdef GL_ARB_transpose_matrix
static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -2411,6 +3135,22 @@ static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ARB_transpose_matrix */
+#ifdef GL_ARB_vertex_array_object
+
+static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r;
+ r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r;
+ r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r;
+ r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_ARB_vertex_array_object */
+
#ifdef GL_ARB_vertex_blend
static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -2701,6 +3441,10 @@ static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_ATI_separate_stencil */
+#ifdef GL_ATI_shader_texture_lod
+
+#endif /* GL_ATI_shader_texture_lod */
+
#ifdef GL_ATI_text_fragment_shader
#endif /* GL_ATI_text_fragment_shader */
@@ -2825,6 +3569,21 @@ static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_bgra */
+#ifdef GL_EXT_bindable_uniform
+
+static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r;
+ r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r;
+ r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_bindable_uniform */
+
#ifdef GL_EXT_blend_color
static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3004,6 +3763,236 @@ static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_depth_bounds_test */
+#ifdef GL_EXT_direct_state_access
+
+static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r;
+ r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r;
+ r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r;
+ r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r;
+ r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r;
+ r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r;
+ r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r;
+ r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r;
+ r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r;
+ r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r;
+ r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r;
+ r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r;
+ r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r;
+ r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r;
+ r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r;
+ r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r;
+ r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r;
+ r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r;
+ r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r;
+ r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r;
+ r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r;
+ r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r;
+ r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r;
+ r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r;
+ r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r;
+ r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r;
+ r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r;
+ r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r;
+ r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r;
+ r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r;
+ r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r;
+ r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r;
+ r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r;
+ r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r;
+ r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r;
+ r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r;
+ r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r;
+ r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r;
+ r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r;
+ r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r;
+ r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r;
+ r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r;
+ r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r;
+ r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r;
+ r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r;
+ r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r;
+ r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r;
+ r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r;
+ r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r;
+ r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r;
+ r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r;
+ r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r;
+ r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r;
+ r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r;
+ r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r;
+ r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r;
+ r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r;
+ r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r;
+ r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r;
+ r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r;
+ r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r;
+ r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r;
+ r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r;
+ r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r;
+ r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r;
+ r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r;
+ r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r;
+ r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r;
+ r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r;
+ r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r;
+ r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r;
+ r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r;
+ r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r;
+ r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r;
+ r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r;
+ r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r;
+ r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r;
+ r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r;
+ r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r;
+ r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r;
+ r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r;
+ r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r;
+ r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r;
+ r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r;
+ r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r;
+ r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r;
+ r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r;
+ r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r;
+ r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r;
+ r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r;
+ r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r;
+ r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r;
+ r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r;
+ r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r;
+ r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r;
+ r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r;
+ r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r;
+ r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r;
+ r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r;
+ r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r;
+ r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r;
+ r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r;
+ r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r;
+ r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r;
+ r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r;
+ r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r;
+ r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r;
+ r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r;
+ r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r;
+ r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r;
+ r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r;
+ r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r;
+ r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r;
+ r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r;
+ r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r;
+ r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r;
+ r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r;
+ r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r;
+ r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r;
+ r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r;
+ r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r;
+ r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r;
+ r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r;
+ r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r;
+ r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r;
+ r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r;
+ r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r;
+ r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r;
+ r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r;
+ r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r;
+ r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r;
+ r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r;
+ r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r;
+ r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r;
+ r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r;
+ r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r;
+ r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r;
+ r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r;
+ r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r;
+ r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r;
+ r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r;
+ r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r;
+ r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r;
+ r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r;
+ r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r;
+ r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r;
+ r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r;
+ r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r;
+ r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r;
+ r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r;
+ r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r;
+ r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r;
+ r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r;
+ r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r;
+ r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r;
+ r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r;
+ r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r;
+ r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_direct_state_access */
+
+#ifdef GL_EXT_draw_buffers2
+
+static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r;
+ r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r;
+ r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r;
+ r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r;
+ r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r;
+ r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_draw_buffers2 */
+
+#ifdef GL_EXT_draw_instanced
+
+static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r;
+ r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_draw_instanced */
+
#ifdef GL_EXT_draw_range_elements
static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3119,6 +4108,86 @@ static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_framebuffer_object */
+#ifdef GL_EXT_framebuffer_sRGB
+
+#endif /* GL_EXT_framebuffer_sRGB */
+
+#ifdef GL_EXT_geometry_shader4
+
+static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r;
+ r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r;
+ r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r;
+ r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_geometry_shader4 */
+
+#ifdef GL_EXT_gpu_program_parameters
+
+static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r;
+ r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_gpu_program_parameters */
+
+#ifdef GL_EXT_gpu_shader4
+
+static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r;
+ r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r;
+ r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r;
+ r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r;
+ r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r;
+ r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r;
+ r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r;
+ r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r;
+ r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r;
+ r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r;
+ r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r;
+ r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r;
+ r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r;
+ r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r;
+ r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r;
+ r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r;
+ r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r;
+ r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r;
+ r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r;
+ r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r;
+ r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r;
+ r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r;
+ r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r;
+ r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r;
+ r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r;
+ r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r;
+ r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r;
+ r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r;
+ r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r;
+ r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r;
+ r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r;
+ r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r;
+ r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r;
+ r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_gpu_shader4 */
+
#ifdef GL_EXT_histogram
static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3226,6 +4295,10 @@ static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_packed_depth_stencil */
+#ifdef GL_EXT_packed_float
+
+#endif /* GL_EXT_packed_float */
+
#ifdef GL_EXT_packed_pixels
#endif /* GL_EXT_packed_pixels */
@@ -3411,10 +4484,35 @@ static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_texture3D */
+#ifdef GL_EXT_texture_array
+
+#endif /* GL_EXT_texture_array */
+
+#ifdef GL_EXT_texture_buffer_object
+
+static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_texture_buffer_object */
+
#ifdef GL_EXT_texture_compression_dxt1
#endif /* GL_EXT_texture_compression_dxt1 */
+#ifdef GL_EXT_texture_compression_latc
+
+#endif /* GL_EXT_texture_compression_latc */
+
+#ifdef GL_EXT_texture_compression_rgtc
+
+#endif /* GL_EXT_texture_compression_rgtc */
+
#ifdef GL_EXT_texture_compression_s3tc
#endif /* GL_EXT_texture_compression_s3tc */
@@ -3447,6 +4545,24 @@ static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_texture_filter_anisotropic */
+#ifdef GL_EXT_texture_integer
+
+static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r;
+ r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r;
+ r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r;
+ r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r;
+ r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r;
+ r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_texture_integer */
+
#ifdef GL_EXT_texture_lod_bias
#endif /* GL_EXT_texture_lod_bias */
@@ -3494,6 +4610,47 @@ static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_I
#endif /* GL_EXT_texture_sRGB */
+#ifdef GL_EXT_texture_shared_exponent
+
+#endif /* GL_EXT_texture_shared_exponent */
+
+#ifdef GL_EXT_texture_swizzle
+
+#endif /* GL_EXT_texture_swizzle */
+
+#ifdef GL_EXT_timer_query
+
+static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r;
+ r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_timer_query */
+
+#ifdef GL_EXT_transform_feedback
+
+static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r;
+ r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r;
+ r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r;
+ r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r;
+ r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r;
+ r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r;
+ r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_EXT_transform_feedback */
+
#ifdef GL_EXT_vertex_array
static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3515,6 +4672,10 @@ static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_vertex_array */
+#ifdef GL_EXT_vertex_array_bgra
+
+#endif /* GL_EXT_vertex_array_bgra */
+
#ifdef GL_EXT_vertex_shader
static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3584,6 +4745,19 @@ static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_EXT_vertex_weighting */
+#ifdef GL_GREMEDY_frame_terminator
+
+static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_GREMEDY_frame_terminator */
+
#ifdef GL_GREMEDY_string_marker
static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3797,14 +4971,47 @@ static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_blend_square */
+#ifdef GL_NV_conditional_render
+
+static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r;
+ r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_conditional_render */
+
#ifdef GL_NV_copy_depth_to_color
#endif /* GL_NV_copy_depth_to_color */
+#ifdef GL_NV_depth_buffer_float
+
+static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r;
+ r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r;
+ r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_depth_buffer_float */
+
#ifdef GL_NV_depth_clamp
#endif /* GL_NV_depth_clamp */
+#ifdef GL_NV_depth_range_unclamped
+
+#endif /* GL_NV_depth_range_unclamped */
+
#ifdef GL_NV_evaluators
static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3826,6 +5033,21 @@ static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_evaluators */
+#ifdef GL_NV_explicit_multisample
+
+static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r;
+ r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r;
+ r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_explicit_multisample */
+
#ifdef GL_NV_fence
static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3875,10 +5097,68 @@ static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_fragment_program2 */
+#ifdef GL_NV_fragment_program4
+
+#endif /* GL_NV_fragment_program4 */
+
#ifdef GL_NV_fragment_program_option
#endif /* GL_NV_fragment_program_option */
+#ifdef GL_NV_framebuffer_multisample_coverage
+
+static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_framebuffer_multisample_coverage */
+
+#ifdef GL_NV_geometry_program4
+
+static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_geometry_program4 */
+
+#ifdef GL_NV_geometry_shader4
+
+#endif /* GL_NV_geometry_shader4 */
+
+#ifdef GL_NV_gpu_program4
+
+static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r;
+ r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r;
+ r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r;
+ r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r;
+ r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r;
+ r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r;
+ r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r;
+ r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r;
+ r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r;
+ r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r;
+ r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r;
+ r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_gpu_program4 */
+
#ifdef GL_NV_half_float
static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3968,6 +5248,21 @@ static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_packed_depth_stencil */
+#ifdef GL_NV_parameter_buffer_object
+
+static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r;
+ r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r;
+ r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_parameter_buffer_object */
+
#ifdef GL_NV_pixel_data_range
static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -3996,6 +5291,25 @@ static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_point_sprite */
+#ifdef GL_NV_present_video
+
+static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r;
+ r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r;
+ r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r;
+ r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r;
+ r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r;
+ r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r;
+ r = ((glVideoParameterivNV = (PFNGLVIDEOPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoParameterivNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_present_video */
+
#ifdef GL_NV_primitive_restart
static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -4085,6 +5399,29 @@ static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_texture_shader3 */
+#ifdef GL_NV_transform_feedback
+
+static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r;
+ r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r;
+ r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r;
+ r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r;
+ r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r;
+ r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r;
+ r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r;
+ r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r;
+ r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r;
+ r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r;
+ r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_NV_transform_feedback */
+
#ifdef GL_NV_vertex_array_range
static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -4195,6 +5532,40 @@ static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_NV_vertex_program3 */
+#ifdef GL_NV_vertex_program4
+
+#endif /* GL_NV_vertex_program4 */
+
+#ifdef GL_OES_byte_coordinates
+
+#endif /* GL_OES_byte_coordinates */
+
+#ifdef GL_OES_compressed_paletted_texture
+
+#endif /* GL_OES_compressed_paletted_texture */
+
+#ifdef GL_OES_read_format
+
+#endif /* GL_OES_read_format */
+
+#ifdef GL_OES_single_precision
+
+static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r;
+ r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r;
+ r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r;
+ r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r;
+ r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r;
+ r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GL_OES_single_precision */
+
#ifdef GL_OML_interlace
#endif /* GL_OML_interlace */
@@ -4277,6 +5648,10 @@ static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_SGIS_pixel_texture */
+#ifdef GL_SGIS_point_line_texgen
+
+#endif /* GL_SGIS_point_line_texgen */
+
#ifdef GL_SGIS_sharpen_texture
static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -4369,6 +5744,10 @@ static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_SGIX_clipmap */
+#ifdef GL_SGIX_convolution_accuracy
+
+#endif /* GL_SGIX_convolution_accuracy */
+
#ifdef GL_SGIX_depth_texture
#endif /* GL_SGIX_depth_texture */
@@ -4409,7 +5788,6 @@ static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_
{
GLboolean r = GL_FALSE;
-#if 0
r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r;
r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r;
r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r;
@@ -4427,7 +5805,6 @@ static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_
r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r;
r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r;
r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r;
-#endif
return r;
}
@@ -4790,980 +6167,1179 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
}
else
{
+ CONST_CAST(GLEW_VERSION_1_1) = GL_TRUE;
if (s[major] >= '2')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_TRUE;
- GLEW_VERSION_1_3 = GL_TRUE;
- GLEW_VERSION_1_4 = GL_TRUE;
- GLEW_VERSION_1_5 = GL_TRUE;
- GLEW_VERSION_2_0 = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_TRUE;
+ if (s[minor] >= '1')
+ {
+ CONST_CAST(GLEW_VERSION_2_1) = GL_TRUE;
+ }
}
else
{
if (s[minor] >= '5')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_TRUE;
- GLEW_VERSION_1_3 = GL_TRUE;
- GLEW_VERSION_1_4 = GL_TRUE;
- GLEW_VERSION_1_5 = GL_TRUE;
- GLEW_VERSION_2_0 = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE;
}
if (s[minor] == '4')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_TRUE;
- GLEW_VERSION_1_3 = GL_TRUE;
- GLEW_VERSION_1_4 = GL_TRUE;
- GLEW_VERSION_1_5 = GL_FALSE;
- GLEW_VERSION_2_0 = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE;
}
if (s[minor] == '3')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_TRUE;
- GLEW_VERSION_1_3 = GL_TRUE;
- GLEW_VERSION_1_4 = GL_FALSE;
- GLEW_VERSION_1_5 = GL_FALSE;
- GLEW_VERSION_2_0 = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE;
}
if (s[minor] == '2')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_TRUE;
- GLEW_VERSION_1_3 = GL_FALSE;
- GLEW_VERSION_1_4 = GL_FALSE;
- GLEW_VERSION_1_5 = GL_FALSE;
- GLEW_VERSION_2_0 = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE;
}
if (s[minor] < '2')
{
- GLEW_VERSION_1_1 = GL_TRUE;
- GLEW_VERSION_1_2 = GL_FALSE;
- GLEW_VERSION_1_3 = GL_FALSE;
- GLEW_VERSION_1_4 = GL_FALSE;
- GLEW_VERSION_1_5 = GL_FALSE;
- GLEW_VERSION_2_0 = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_2) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_3) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_4) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_1_5) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_0) = GL_FALSE;
+ CONST_CAST(GLEW_VERSION_2_1) = GL_FALSE;
}
}
}
/* initialize extensions */
#ifdef GL_VERSION_1_2
- if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_VERSION_1_2 */
#ifdef GL_VERSION_1_3
- if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_VERSION_1_3 */
#ifdef GL_VERSION_1_4
- if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_VERSION_1_4 */
#ifdef GL_VERSION_1_5
- if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_VERSION_1_5 */
#ifdef GL_VERSION_2_0
- if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_VERSION_2_0 */
+#ifdef GL_VERSION_2_1
+ if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_2_1 */
+#ifdef GL_VERSION_3_0
+ if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_VERSION_3_0 */
#ifdef GL_3DFX_multisample
- GLEW_3DFX_multisample = glewGetExtension("GL_3DFX_multisample");
+ CONST_CAST(GLEW_3DFX_multisample) = glewGetExtension("GL_3DFX_multisample");
#endif /* GL_3DFX_multisample */
#ifdef GL_3DFX_tbuffer
- GLEW_3DFX_tbuffer = glewGetExtension("GL_3DFX_tbuffer");
- if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_3DFX_tbuffer) = glewGetExtension("GL_3DFX_tbuffer");
+ if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_3DFX_tbuffer */
#ifdef GL_3DFX_texture_compression_FXT1
- GLEW_3DFX_texture_compression_FXT1 = glewGetExtension("GL_3DFX_texture_compression_FXT1");
+ CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = glewGetExtension("GL_3DFX_texture_compression_FXT1");
#endif /* GL_3DFX_texture_compression_FXT1 */
#ifdef GL_APPLE_client_storage
- GLEW_APPLE_client_storage = glewGetExtension("GL_APPLE_client_storage");
+ CONST_CAST(GLEW_APPLE_client_storage) = glewGetExtension("GL_APPLE_client_storage");
#endif /* GL_APPLE_client_storage */
#ifdef GL_APPLE_element_array
- GLEW_APPLE_element_array = glewGetExtension("GL_APPLE_element_array");
- if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_APPLE_element_array) = glewGetExtension("GL_APPLE_element_array");
+ if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_APPLE_element_array */
#ifdef GL_APPLE_fence
- GLEW_APPLE_fence = glewGetExtension("GL_APPLE_fence");
- if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_APPLE_fence) = glewGetExtension("GL_APPLE_fence");
+ if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_APPLE_fence */
#ifdef GL_APPLE_float_pixels
- GLEW_APPLE_float_pixels = glewGetExtension("GL_APPLE_float_pixels");
+ CONST_CAST(GLEW_APPLE_float_pixels) = glewGetExtension("GL_APPLE_float_pixels");
#endif /* GL_APPLE_float_pixels */
+#ifdef GL_APPLE_flush_buffer_range
+ CONST_CAST(GLEW_APPLE_flush_buffer_range) = glewGetExtension("GL_APPLE_flush_buffer_range");
+ if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_APPLE_flush_buffer_range */
#ifdef GL_APPLE_pixel_buffer
- GLEW_APPLE_pixel_buffer = glewGetExtension("GL_APPLE_pixel_buffer");
+ CONST_CAST(GLEW_APPLE_pixel_buffer) = glewGetExtension("GL_APPLE_pixel_buffer");
#endif /* GL_APPLE_pixel_buffer */
#ifdef GL_APPLE_specular_vector
- GLEW_APPLE_specular_vector = glewGetExtension("GL_APPLE_specular_vector");
+ CONST_CAST(GLEW_APPLE_specular_vector) = glewGetExtension("GL_APPLE_specular_vector");
#endif /* GL_APPLE_specular_vector */
#ifdef GL_APPLE_texture_range
- GLEW_APPLE_texture_range = glewGetExtension("GL_APPLE_texture_range");
- if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_APPLE_texture_range) = glewGetExtension("GL_APPLE_texture_range");
+ if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_APPLE_texture_range */
#ifdef GL_APPLE_transform_hint
- GLEW_APPLE_transform_hint = glewGetExtension("GL_APPLE_transform_hint");
+ CONST_CAST(GLEW_APPLE_transform_hint) = glewGetExtension("GL_APPLE_transform_hint");
#endif /* GL_APPLE_transform_hint */
#ifdef GL_APPLE_vertex_array_object
- GLEW_APPLE_vertex_array_object = glewGetExtension("GL_APPLE_vertex_array_object");
- if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_APPLE_vertex_array_object) = glewGetExtension("GL_APPLE_vertex_array_object");
+ if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_APPLE_vertex_array_object */
#ifdef GL_APPLE_vertex_array_range
- GLEW_APPLE_vertex_array_range = glewGetExtension("GL_APPLE_vertex_array_range");
- if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_APPLE_vertex_array_range) = glewGetExtension("GL_APPLE_vertex_array_range");
+ if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_APPLE_vertex_array_range */
#ifdef GL_APPLE_ycbcr_422
- GLEW_APPLE_ycbcr_422 = glewGetExtension("GL_APPLE_ycbcr_422");
+ CONST_CAST(GLEW_APPLE_ycbcr_422) = glewGetExtension("GL_APPLE_ycbcr_422");
#endif /* GL_APPLE_ycbcr_422 */
#ifdef GL_ARB_color_buffer_float
- GLEW_ARB_color_buffer_float = glewGetExtension("GL_ARB_color_buffer_float");
- if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_color_buffer_float) = glewGetExtension("GL_ARB_color_buffer_float");
+ if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_color_buffer_float */
+#ifdef GL_ARB_depth_buffer_float
+ CONST_CAST(GLEW_ARB_depth_buffer_float) = glewGetExtension("GL_ARB_depth_buffer_float");
+#endif /* GL_ARB_depth_buffer_float */
#ifdef GL_ARB_depth_texture
- GLEW_ARB_depth_texture = glewGetExtension("GL_ARB_depth_texture");
+ CONST_CAST(GLEW_ARB_depth_texture) = glewGetExtension("GL_ARB_depth_texture");
#endif /* GL_ARB_depth_texture */
#ifdef GL_ARB_draw_buffers
- GLEW_ARB_draw_buffers = glewGetExtension("GL_ARB_draw_buffers");
- if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_draw_buffers) = glewGetExtension("GL_ARB_draw_buffers");
+ if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_draw_buffers */
+#ifdef GL_ARB_draw_instanced
+ CONST_CAST(GLEW_ARB_draw_instanced) = glewGetExtension("GL_ARB_draw_instanced");
+ if (glewExperimental || GLEW_ARB_draw_instanced) CONST_CAST(GLEW_ARB_draw_instanced) = !_glewInit_GL_ARB_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_draw_instanced */
#ifdef GL_ARB_fragment_program
- GLEW_ARB_fragment_program = glewGetExtension("GL_ARB_fragment_program");
+ CONST_CAST(GLEW_ARB_fragment_program) = glewGetExtension("GL_ARB_fragment_program");
#endif /* GL_ARB_fragment_program */
#ifdef GL_ARB_fragment_program_shadow
- GLEW_ARB_fragment_program_shadow = glewGetExtension("GL_ARB_fragment_program_shadow");
+ CONST_CAST(GLEW_ARB_fragment_program_shadow) = glewGetExtension("GL_ARB_fragment_program_shadow");
#endif /* GL_ARB_fragment_program_shadow */
#ifdef GL_ARB_fragment_shader
- GLEW_ARB_fragment_shader = glewGetExtension("GL_ARB_fragment_shader");
+ CONST_CAST(GLEW_ARB_fragment_shader) = glewGetExtension("GL_ARB_fragment_shader");
#endif /* GL_ARB_fragment_shader */
+#ifdef GL_ARB_framebuffer_object
+ CONST_CAST(GLEW_ARB_framebuffer_object) = glewGetExtension("GL_ARB_framebuffer_object");
+ if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_framebuffer_object */
+#ifdef GL_ARB_framebuffer_sRGB
+ CONST_CAST(GLEW_ARB_framebuffer_sRGB) = glewGetExtension("GL_ARB_framebuffer_sRGB");
+#endif /* GL_ARB_framebuffer_sRGB */
+#ifdef GL_ARB_geometry_shader4
+ CONST_CAST(GLEW_ARB_geometry_shader4) = glewGetExtension("GL_ARB_geometry_shader4");
+ if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_geometry_shader4 */
#ifdef GL_ARB_half_float_pixel
- GLEW_ARB_half_float_pixel = glewGetExtension("GL_ARB_half_float_pixel");
+ CONST_CAST(GLEW_ARB_half_float_pixel) = glewGetExtension("GL_ARB_half_float_pixel");
#endif /* GL_ARB_half_float_pixel */
+#ifdef GL_ARB_half_float_vertex
+ CONST_CAST(GLEW_ARB_half_float_vertex) = glewGetExtension("GL_ARB_half_float_vertex");
+#endif /* GL_ARB_half_float_vertex */
#ifdef GL_ARB_imaging
- GLEW_ARB_imaging = glewGetExtension("GL_ARB_imaging");
- if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_imaging) = glewGetExtension("GL_ARB_imaging");
+ if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_imaging */
+#ifdef GL_ARB_instanced_arrays
+ CONST_CAST(GLEW_ARB_instanced_arrays) = glewGetExtension("GL_ARB_instanced_arrays");
+ if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_instanced_arrays */
+#ifdef GL_ARB_map_buffer_range
+ CONST_CAST(GLEW_ARB_map_buffer_range) = glewGetExtension("GL_ARB_map_buffer_range");
+ if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_map_buffer_range */
#ifdef GL_ARB_matrix_palette
- GLEW_ARB_matrix_palette = glewGetExtension("GL_ARB_matrix_palette");
- if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_matrix_palette) = glewGetExtension("GL_ARB_matrix_palette");
+ if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_matrix_palette */
#ifdef GL_ARB_multisample
- GLEW_ARB_multisample = glewGetExtension("GL_ARB_multisample");
- if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_multisample) = glewGetExtension("GL_ARB_multisample");
+ if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_multisample */
#ifdef GL_ARB_multitexture
- GLEW_ARB_multitexture = glewGetExtension("GL_ARB_multitexture");
- if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_multitexture) = glewGetExtension("GL_ARB_multitexture");
+ if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_multitexture */
#ifdef GL_ARB_occlusion_query
- GLEW_ARB_occlusion_query = glewGetExtension("GL_ARB_occlusion_query");
- if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_occlusion_query) = glewGetExtension("GL_ARB_occlusion_query");
+ if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_occlusion_query */
#ifdef GL_ARB_pixel_buffer_object
- GLEW_ARB_pixel_buffer_object = glewGetExtension("GL_ARB_pixel_buffer_object");
+ CONST_CAST(GLEW_ARB_pixel_buffer_object) = glewGetExtension("GL_ARB_pixel_buffer_object");
#endif /* GL_ARB_pixel_buffer_object */
#ifdef GL_ARB_point_parameters
- GLEW_ARB_point_parameters = glewGetExtension("GL_ARB_point_parameters");
- if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_point_parameters) = glewGetExtension("GL_ARB_point_parameters");
+ if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_point_parameters */
#ifdef GL_ARB_point_sprite
- GLEW_ARB_point_sprite = glewGetExtension("GL_ARB_point_sprite");
+ CONST_CAST(GLEW_ARB_point_sprite) = glewGetExtension("GL_ARB_point_sprite");
#endif /* GL_ARB_point_sprite */
#ifdef GL_ARB_shader_objects
- GLEW_ARB_shader_objects = glewGetExtension("GL_ARB_shader_objects");
- if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_shader_objects) = glewGetExtension("GL_ARB_shader_objects");
+ if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_shader_objects */
#ifdef GL_ARB_shading_language_100
- GLEW_ARB_shading_language_100 = glewGetExtension("GL_ARB_shading_language_100");
+ CONST_CAST(GLEW_ARB_shading_language_100) = glewGetExtension("GL_ARB_shading_language_100");
#endif /* GL_ARB_shading_language_100 */
#ifdef GL_ARB_shadow
- GLEW_ARB_shadow = glewGetExtension("GL_ARB_shadow");
+ CONST_CAST(GLEW_ARB_shadow) = glewGetExtension("GL_ARB_shadow");
#endif /* GL_ARB_shadow */
#ifdef GL_ARB_shadow_ambient
- GLEW_ARB_shadow_ambient = glewGetExtension("GL_ARB_shadow_ambient");
+ CONST_CAST(GLEW_ARB_shadow_ambient) = glewGetExtension("GL_ARB_shadow_ambient");
#endif /* GL_ARB_shadow_ambient */
#ifdef GL_ARB_texture_border_clamp
- GLEW_ARB_texture_border_clamp = glewGetExtension("GL_ARB_texture_border_clamp");
+ CONST_CAST(GLEW_ARB_texture_border_clamp) = glewGetExtension("GL_ARB_texture_border_clamp");
#endif /* GL_ARB_texture_border_clamp */
+#ifdef GL_ARB_texture_buffer_object
+ CONST_CAST(GLEW_ARB_texture_buffer_object) = glewGetExtension("GL_ARB_texture_buffer_object");
+ if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_texture_buffer_object */
#ifdef GL_ARB_texture_compression
- GLEW_ARB_texture_compression = glewGetExtension("GL_ARB_texture_compression");
- if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_texture_compression) = glewGetExtension("GL_ARB_texture_compression");
+ if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_texture_compression */
+#ifdef GL_ARB_texture_compression_rgtc
+ CONST_CAST(GLEW_ARB_texture_compression_rgtc) = glewGetExtension("GL_ARB_texture_compression_rgtc");
+#endif /* GL_ARB_texture_compression_rgtc */
#ifdef GL_ARB_texture_cube_map
- GLEW_ARB_texture_cube_map = glewGetExtension("GL_ARB_texture_cube_map");
+ CONST_CAST(GLEW_ARB_texture_cube_map) = glewGetExtension("GL_ARB_texture_cube_map");
#endif /* GL_ARB_texture_cube_map */
#ifdef GL_ARB_texture_env_add
- GLEW_ARB_texture_env_add = glewGetExtension("GL_ARB_texture_env_add");
+ CONST_CAST(GLEW_ARB_texture_env_add) = glewGetExtension("GL_ARB_texture_env_add");
#endif /* GL_ARB_texture_env_add */
#ifdef GL_ARB_texture_env_combine
- GLEW_ARB_texture_env_combine = glewGetExtension("GL_ARB_texture_env_combine");
+ CONST_CAST(GLEW_ARB_texture_env_combine) = glewGetExtension("GL_ARB_texture_env_combine");
#endif /* GL_ARB_texture_env_combine */
#ifdef GL_ARB_texture_env_crossbar
- GLEW_ARB_texture_env_crossbar = glewGetExtension("GL_ARB_texture_env_crossbar");
+ CONST_CAST(GLEW_ARB_texture_env_crossbar) = glewGetExtension("GL_ARB_texture_env_crossbar");
#endif /* GL_ARB_texture_env_crossbar */
#ifdef GL_ARB_texture_env_dot3
- GLEW_ARB_texture_env_dot3 = glewGetExtension("GL_ARB_texture_env_dot3");
+ CONST_CAST(GLEW_ARB_texture_env_dot3) = glewGetExtension("GL_ARB_texture_env_dot3");
#endif /* GL_ARB_texture_env_dot3 */
#ifdef GL_ARB_texture_float
- GLEW_ARB_texture_float = glewGetExtension("GL_ARB_texture_float");
+ CONST_CAST(GLEW_ARB_texture_float) = glewGetExtension("GL_ARB_texture_float");
#endif /* GL_ARB_texture_float */
#ifdef GL_ARB_texture_mirrored_repeat
- GLEW_ARB_texture_mirrored_repeat = glewGetExtension("GL_ARB_texture_mirrored_repeat");
+ CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = glewGetExtension("GL_ARB_texture_mirrored_repeat");
#endif /* GL_ARB_texture_mirrored_repeat */
#ifdef GL_ARB_texture_non_power_of_two
- GLEW_ARB_texture_non_power_of_two = glewGetExtension("GL_ARB_texture_non_power_of_two");
+ CONST_CAST(GLEW_ARB_texture_non_power_of_two) = glewGetExtension("GL_ARB_texture_non_power_of_two");
#endif /* GL_ARB_texture_non_power_of_two */
#ifdef GL_ARB_texture_rectangle
- GLEW_ARB_texture_rectangle = glewGetExtension("GL_ARB_texture_rectangle");
+ CONST_CAST(GLEW_ARB_texture_rectangle) = glewGetExtension("GL_ARB_texture_rectangle");
#endif /* GL_ARB_texture_rectangle */
+#ifdef GL_ARB_texture_rg
+ CONST_CAST(GLEW_ARB_texture_rg) = glewGetExtension("GL_ARB_texture_rg");
+#endif /* GL_ARB_texture_rg */
#ifdef GL_ARB_transpose_matrix
- GLEW_ARB_transpose_matrix = glewGetExtension("GL_ARB_transpose_matrix");
- if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_transpose_matrix) = glewGetExtension("GL_ARB_transpose_matrix");
+ if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_transpose_matrix */
+#ifdef GL_ARB_vertex_array_object
+ CONST_CAST(GLEW_ARB_vertex_array_object) = glewGetExtension("GL_ARB_vertex_array_object");
+ if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_ARB_vertex_array_object */
#ifdef GL_ARB_vertex_blend
- GLEW_ARB_vertex_blend = glewGetExtension("GL_ARB_vertex_blend");
- if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_vertex_blend) = glewGetExtension("GL_ARB_vertex_blend");
+ if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_vertex_blend */
#ifdef GL_ARB_vertex_buffer_object
- GLEW_ARB_vertex_buffer_object = glewGetExtension("GL_ARB_vertex_buffer_object");
- if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_vertex_buffer_object) = glewGetExtension("GL_ARB_vertex_buffer_object");
+ if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_vertex_buffer_object */
#ifdef GL_ARB_vertex_program
- GLEW_ARB_vertex_program = glewGetExtension("GL_ARB_vertex_program");
- if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_vertex_program) = glewGetExtension("GL_ARB_vertex_program");
+ if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_vertex_program */
#ifdef GL_ARB_vertex_shader
- GLEW_ARB_vertex_shader = glewGetExtension("GL_ARB_vertex_shader");
- if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }
+ CONST_CAST(GLEW_ARB_vertex_shader) = glewGetExtension("GL_ARB_vertex_shader");
+ if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_vertex_shader */
#ifdef GL_ARB_window_pos
- GLEW_ARB_window_pos = glewGetExtension("GL_ARB_window_pos");
- if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ARB_window_pos) = glewGetExtension("GL_ARB_window_pos");
+ if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ARB_window_pos */
#ifdef GL_ATIX_point_sprites
- GLEW_ATIX_point_sprites = glewGetExtension("GL_ATIX_point_sprites");
+ CONST_CAST(GLEW_ATIX_point_sprites) = glewGetExtension("GL_ATIX_point_sprites");
#endif /* GL_ATIX_point_sprites */
#ifdef GL_ATIX_texture_env_combine3
- GLEW_ATIX_texture_env_combine3 = glewGetExtension("GL_ATIX_texture_env_combine3");
+ CONST_CAST(GLEW_ATIX_texture_env_combine3) = glewGetExtension("GL_ATIX_texture_env_combine3");
#endif /* GL_ATIX_texture_env_combine3 */
#ifdef GL_ATIX_texture_env_route
- GLEW_ATIX_texture_env_route = glewGetExtension("GL_ATIX_texture_env_route");
+ CONST_CAST(GLEW_ATIX_texture_env_route) = glewGetExtension("GL_ATIX_texture_env_route");
#endif /* GL_ATIX_texture_env_route */
#ifdef GL_ATIX_vertex_shader_output_point_size
- GLEW_ATIX_vertex_shader_output_point_size = glewGetExtension("GL_ATIX_vertex_shader_output_point_size");
+ CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = glewGetExtension("GL_ATIX_vertex_shader_output_point_size");
#endif /* GL_ATIX_vertex_shader_output_point_size */
#ifdef GL_ATI_draw_buffers
- GLEW_ATI_draw_buffers = glewGetExtension("GL_ATI_draw_buffers");
- if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_draw_buffers) = glewGetExtension("GL_ATI_draw_buffers");
+ if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_draw_buffers */
#ifdef GL_ATI_element_array
- GLEW_ATI_element_array = glewGetExtension("GL_ATI_element_array");
- if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_element_array) = glewGetExtension("GL_ATI_element_array");
+ if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_element_array */
#ifdef GL_ATI_envmap_bumpmap
- GLEW_ATI_envmap_bumpmap = glewGetExtension("GL_ATI_envmap_bumpmap");
- if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_envmap_bumpmap) = glewGetExtension("GL_ATI_envmap_bumpmap");
+ if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_envmap_bumpmap */
#ifdef GL_ATI_fragment_shader
- GLEW_ATI_fragment_shader = glewGetExtension("GL_ATI_fragment_shader");
- if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_fragment_shader) = glewGetExtension("GL_ATI_fragment_shader");
+ if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_fragment_shader */
#ifdef GL_ATI_map_object_buffer
- GLEW_ATI_map_object_buffer = glewGetExtension("GL_ATI_map_object_buffer");
- if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_map_object_buffer) = glewGetExtension("GL_ATI_map_object_buffer");
+ if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_map_object_buffer */
#ifdef GL_ATI_pn_triangles
- GLEW_ATI_pn_triangles = glewGetExtension("GL_ATI_pn_triangles");
- if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_pn_triangles) = glewGetExtension("GL_ATI_pn_triangles");
+ if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_pn_triangles */
#ifdef GL_ATI_separate_stencil
- GLEW_ATI_separate_stencil = glewGetExtension("GL_ATI_separate_stencil");
- if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_separate_stencil) = glewGetExtension("GL_ATI_separate_stencil");
+ if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_separate_stencil */
+#ifdef GL_ATI_shader_texture_lod
+ CONST_CAST(GLEW_ATI_shader_texture_lod) = glewGetExtension("GL_ATI_shader_texture_lod");
+#endif /* GL_ATI_shader_texture_lod */
#ifdef GL_ATI_text_fragment_shader
- GLEW_ATI_text_fragment_shader = glewGetExtension("GL_ATI_text_fragment_shader");
+ CONST_CAST(GLEW_ATI_text_fragment_shader) = glewGetExtension("GL_ATI_text_fragment_shader");
#endif /* GL_ATI_text_fragment_shader */
#ifdef GL_ATI_texture_compression_3dc
- GLEW_ATI_texture_compression_3dc = glewGetExtension("GL_ATI_texture_compression_3dc");
+ CONST_CAST(GLEW_ATI_texture_compression_3dc) = glewGetExtension("GL_ATI_texture_compression_3dc");
#endif /* GL_ATI_texture_compression_3dc */
#ifdef GL_ATI_texture_env_combine3
- GLEW_ATI_texture_env_combine3 = glewGetExtension("GL_ATI_texture_env_combine3");
+ CONST_CAST(GLEW_ATI_texture_env_combine3) = glewGetExtension("GL_ATI_texture_env_combine3");
#endif /* GL_ATI_texture_env_combine3 */
#ifdef GL_ATI_texture_float
- GLEW_ATI_texture_float = glewGetExtension("GL_ATI_texture_float");
+ CONST_CAST(GLEW_ATI_texture_float) = glewGetExtension("GL_ATI_texture_float");
#endif /* GL_ATI_texture_float */
#ifdef GL_ATI_texture_mirror_once
- GLEW_ATI_texture_mirror_once = glewGetExtension("GL_ATI_texture_mirror_once");
+ CONST_CAST(GLEW_ATI_texture_mirror_once) = glewGetExtension("GL_ATI_texture_mirror_once");
#endif /* GL_ATI_texture_mirror_once */
#ifdef GL_ATI_vertex_array_object
- GLEW_ATI_vertex_array_object = glewGetExtension("GL_ATI_vertex_array_object");
- if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_vertex_array_object) = glewGetExtension("GL_ATI_vertex_array_object");
+ if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_vertex_array_object */
#ifdef GL_ATI_vertex_attrib_array_object
- GLEW_ATI_vertex_attrib_array_object = glewGetExtension("GL_ATI_vertex_attrib_array_object");
- if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = glewGetExtension("GL_ATI_vertex_attrib_array_object");
+ if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_vertex_attrib_array_object */
#ifdef GL_ATI_vertex_streams
- GLEW_ATI_vertex_streams = glewGetExtension("GL_ATI_vertex_streams");
- if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_ATI_vertex_streams) = glewGetExtension("GL_ATI_vertex_streams");
+ if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_ATI_vertex_streams */
#ifdef GL_EXT_422_pixels
- GLEW_EXT_422_pixels = glewGetExtension("GL_EXT_422_pixels");
+ CONST_CAST(GLEW_EXT_422_pixels) = glewGetExtension("GL_EXT_422_pixels");
#endif /* GL_EXT_422_pixels */
#ifdef GL_EXT_Cg_shader
- GLEW_EXT_Cg_shader = glewGetExtension("GL_EXT_Cg_shader");
+ CONST_CAST(GLEW_EXT_Cg_shader) = glewGetExtension("GL_EXT_Cg_shader");
#endif /* GL_EXT_Cg_shader */
#ifdef GL_EXT_abgr
- GLEW_EXT_abgr = glewGetExtension("GL_EXT_abgr");
+ CONST_CAST(GLEW_EXT_abgr) = glewGetExtension("GL_EXT_abgr");
#endif /* GL_EXT_abgr */
#ifdef GL_EXT_bgra
- GLEW_EXT_bgra = glewGetExtension("GL_EXT_bgra");
+ CONST_CAST(GLEW_EXT_bgra) = glewGetExtension("GL_EXT_bgra");
#endif /* GL_EXT_bgra */
+#ifdef GL_EXT_bindable_uniform
+ CONST_CAST(GLEW_EXT_bindable_uniform) = glewGetExtension("GL_EXT_bindable_uniform");
+ if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_bindable_uniform */
#ifdef GL_EXT_blend_color
- GLEW_EXT_blend_color = glewGetExtension("GL_EXT_blend_color");
- if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_blend_color) = glewGetExtension("GL_EXT_blend_color");
+ if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_blend_color */
#ifdef GL_EXT_blend_equation_separate
- GLEW_EXT_blend_equation_separate = glewGetExtension("GL_EXT_blend_equation_separate");
- if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_blend_equation_separate) = glewGetExtension("GL_EXT_blend_equation_separate");
+ if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_blend_equation_separate */
#ifdef GL_EXT_blend_func_separate
- GLEW_EXT_blend_func_separate = glewGetExtension("GL_EXT_blend_func_separate");
- if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_blend_func_separate) = glewGetExtension("GL_EXT_blend_func_separate");
+ if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_blend_func_separate */
#ifdef GL_EXT_blend_logic_op
- GLEW_EXT_blend_logic_op = glewGetExtension("GL_EXT_blend_logic_op");
+ CONST_CAST(GLEW_EXT_blend_logic_op) = glewGetExtension("GL_EXT_blend_logic_op");
#endif /* GL_EXT_blend_logic_op */
#ifdef GL_EXT_blend_minmax
- GLEW_EXT_blend_minmax = glewGetExtension("GL_EXT_blend_minmax");
- if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_blend_minmax) = glewGetExtension("GL_EXT_blend_minmax");
+ if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_blend_minmax */
#ifdef GL_EXT_blend_subtract
- GLEW_EXT_blend_subtract = glewGetExtension("GL_EXT_blend_subtract");
+ CONST_CAST(GLEW_EXT_blend_subtract) = glewGetExtension("GL_EXT_blend_subtract");
#endif /* GL_EXT_blend_subtract */
#ifdef GL_EXT_clip_volume_hint
- GLEW_EXT_clip_volume_hint = glewGetExtension("GL_EXT_clip_volume_hint");
+ CONST_CAST(GLEW_EXT_clip_volume_hint) = glewGetExtension("GL_EXT_clip_volume_hint");
#endif /* GL_EXT_clip_volume_hint */
#ifdef GL_EXT_cmyka
- GLEW_EXT_cmyka = glewGetExtension("GL_EXT_cmyka");
+ CONST_CAST(GLEW_EXT_cmyka) = glewGetExtension("GL_EXT_cmyka");
#endif /* GL_EXT_cmyka */
#ifdef GL_EXT_color_subtable
- GLEW_EXT_color_subtable = glewGetExtension("GL_EXT_color_subtable");
- if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_color_subtable) = glewGetExtension("GL_EXT_color_subtable");
+ if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_color_subtable */
#ifdef GL_EXT_compiled_vertex_array
- GLEW_EXT_compiled_vertex_array = glewGetExtension("GL_EXT_compiled_vertex_array");
- if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_compiled_vertex_array) = glewGetExtension("GL_EXT_compiled_vertex_array");
+ if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_compiled_vertex_array */
#ifdef GL_EXT_convolution
- GLEW_EXT_convolution = glewGetExtension("GL_EXT_convolution");
- if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_convolution) = glewGetExtension("GL_EXT_convolution");
+ if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_convolution */
#ifdef GL_EXT_coordinate_frame
- GLEW_EXT_coordinate_frame = glewGetExtension("GL_EXT_coordinate_frame");
- if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_coordinate_frame) = glewGetExtension("GL_EXT_coordinate_frame");
+ if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_coordinate_frame */
#ifdef GL_EXT_copy_texture
- GLEW_EXT_copy_texture = glewGetExtension("GL_EXT_copy_texture");
- if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_copy_texture) = glewGetExtension("GL_EXT_copy_texture");
+ if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_copy_texture */
#ifdef GL_EXT_cull_vertex
- GLEW_EXT_cull_vertex = glewGetExtension("GL_EXT_cull_vertex");
- if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_cull_vertex) = glewGetExtension("GL_EXT_cull_vertex");
+ if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_cull_vertex */
#ifdef GL_EXT_depth_bounds_test
- GLEW_EXT_depth_bounds_test = glewGetExtension("GL_EXT_depth_bounds_test");
- if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_depth_bounds_test) = glewGetExtension("GL_EXT_depth_bounds_test");
+ if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_depth_bounds_test */
+#ifdef GL_EXT_direct_state_access
+ CONST_CAST(GLEW_EXT_direct_state_access) = glewGetExtension("GL_EXT_direct_state_access");
+ if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_direct_state_access */
+#ifdef GL_EXT_draw_buffers2
+ CONST_CAST(GLEW_EXT_draw_buffers2) = glewGetExtension("GL_EXT_draw_buffers2");
+ if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_draw_buffers2 */
+#ifdef GL_EXT_draw_instanced
+ CONST_CAST(GLEW_EXT_draw_instanced) = glewGetExtension("GL_EXT_draw_instanced");
+ if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_draw_instanced */
#ifdef GL_EXT_draw_range_elements
- GLEW_EXT_draw_range_elements = glewGetExtension("GL_EXT_draw_range_elements");
- if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_draw_range_elements) = glewGetExtension("GL_EXT_draw_range_elements");
+ if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_draw_range_elements */
#ifdef GL_EXT_fog_coord
- GLEW_EXT_fog_coord = glewGetExtension("GL_EXT_fog_coord");
- if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_fog_coord) = glewGetExtension("GL_EXT_fog_coord");
+ if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_fog_coord */
#ifdef GL_EXT_fragment_lighting
- GLEW_EXT_fragment_lighting = glewGetExtension("GL_EXT_fragment_lighting");
- if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_fragment_lighting) = glewGetExtension("GL_EXT_fragment_lighting");
+ if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_fragment_lighting */
#ifdef GL_EXT_framebuffer_blit
- GLEW_EXT_framebuffer_blit = glewGetExtension("GL_EXT_framebuffer_blit");
- if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_framebuffer_blit) = glewGetExtension("GL_EXT_framebuffer_blit");
+ if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_framebuffer_blit */
#ifdef GL_EXT_framebuffer_multisample
- GLEW_EXT_framebuffer_multisample = glewGetExtension("GL_EXT_framebuffer_multisample");
- if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_framebuffer_multisample) = glewGetExtension("GL_EXT_framebuffer_multisample");
+ if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_framebuffer_multisample */
#ifdef GL_EXT_framebuffer_object
- GLEW_EXT_framebuffer_object = glewGetExtension("GL_EXT_framebuffer_object");
- if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_framebuffer_object) = glewGetExtension("GL_EXT_framebuffer_object");
+ if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_framebuffer_object */
+#ifdef GL_EXT_framebuffer_sRGB
+ CONST_CAST(GLEW_EXT_framebuffer_sRGB) = glewGetExtension("GL_EXT_framebuffer_sRGB");
+#endif /* GL_EXT_framebuffer_sRGB */
+#ifdef GL_EXT_geometry_shader4
+ CONST_CAST(GLEW_EXT_geometry_shader4) = glewGetExtension("GL_EXT_geometry_shader4");
+ if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_geometry_shader4 */
+#ifdef GL_EXT_gpu_program_parameters
+ CONST_CAST(GLEW_EXT_gpu_program_parameters) = glewGetExtension("GL_EXT_gpu_program_parameters");
+ if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_gpu_program_parameters */
+#ifdef GL_EXT_gpu_shader4
+ CONST_CAST(GLEW_EXT_gpu_shader4) = glewGetExtension("GL_EXT_gpu_shader4");
+ if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_gpu_shader4 */
#ifdef GL_EXT_histogram
- GLEW_EXT_histogram = glewGetExtension("GL_EXT_histogram");
- if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_histogram) = glewGetExtension("GL_EXT_histogram");
+ if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_histogram */
#ifdef GL_EXT_index_array_formats
- GLEW_EXT_index_array_formats = glewGetExtension("GL_EXT_index_array_formats");
+ CONST_CAST(GLEW_EXT_index_array_formats) = glewGetExtension("GL_EXT_index_array_formats");
#endif /* GL_EXT_index_array_formats */
#ifdef GL_EXT_index_func
- GLEW_EXT_index_func = glewGetExtension("GL_EXT_index_func");
- if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_index_func) = glewGetExtension("GL_EXT_index_func");
+ if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_index_func */
#ifdef GL_EXT_index_material
- GLEW_EXT_index_material = glewGetExtension("GL_EXT_index_material");
- if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_index_material) = glewGetExtension("GL_EXT_index_material");
+ if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_index_material */
#ifdef GL_EXT_index_texture
- GLEW_EXT_index_texture = glewGetExtension("GL_EXT_index_texture");
+ CONST_CAST(GLEW_EXT_index_texture) = glewGetExtension("GL_EXT_index_texture");
#endif /* GL_EXT_index_texture */
#ifdef GL_EXT_light_texture
- GLEW_EXT_light_texture = glewGetExtension("GL_EXT_light_texture");
- if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_light_texture) = glewGetExtension("GL_EXT_light_texture");
+ if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_light_texture */
#ifdef GL_EXT_misc_attribute
- GLEW_EXT_misc_attribute = glewGetExtension("GL_EXT_misc_attribute");
+ CONST_CAST(GLEW_EXT_misc_attribute) = glewGetExtension("GL_EXT_misc_attribute");
#endif /* GL_EXT_misc_attribute */
#ifdef GL_EXT_multi_draw_arrays
- GLEW_EXT_multi_draw_arrays = glewGetExtension("GL_EXT_multi_draw_arrays");
- if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_multi_draw_arrays) = glewGetExtension("GL_EXT_multi_draw_arrays");
+ if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_multi_draw_arrays */
#ifdef GL_EXT_multisample
- GLEW_EXT_multisample = glewGetExtension("GL_EXT_multisample");
- if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_multisample) = glewGetExtension("GL_EXT_multisample");
+ if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_multisample */
#ifdef GL_EXT_packed_depth_stencil
- GLEW_EXT_packed_depth_stencil = glewGetExtension("GL_EXT_packed_depth_stencil");
+ CONST_CAST(GLEW_EXT_packed_depth_stencil) = glewGetExtension("GL_EXT_packed_depth_stencil");
#endif /* GL_EXT_packed_depth_stencil */
+#ifdef GL_EXT_packed_float
+ CONST_CAST(GLEW_EXT_packed_float) = glewGetExtension("GL_EXT_packed_float");
+#endif /* GL_EXT_packed_float */
#ifdef GL_EXT_packed_pixels
- GLEW_EXT_packed_pixels = glewGetExtension("GL_EXT_packed_pixels");
+ CONST_CAST(GLEW_EXT_packed_pixels) = glewGetExtension("GL_EXT_packed_pixels");
#endif /* GL_EXT_packed_pixels */
#ifdef GL_EXT_paletted_texture
- GLEW_EXT_paletted_texture = glewGetExtension("GL_EXT_paletted_texture");
- if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_paletted_texture) = glewGetExtension("GL_EXT_paletted_texture");
+ if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_paletted_texture */
#ifdef GL_EXT_pixel_buffer_object
- GLEW_EXT_pixel_buffer_object = glewGetExtension("GL_EXT_pixel_buffer_object");
+ CONST_CAST(GLEW_EXT_pixel_buffer_object) = glewGetExtension("GL_EXT_pixel_buffer_object");
#endif /* GL_EXT_pixel_buffer_object */
#ifdef GL_EXT_pixel_transform
- GLEW_EXT_pixel_transform = glewGetExtension("GL_EXT_pixel_transform");
- if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_pixel_transform) = glewGetExtension("GL_EXT_pixel_transform");
+ if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_pixel_transform */
#ifdef GL_EXT_pixel_transform_color_table
- GLEW_EXT_pixel_transform_color_table = glewGetExtension("GL_EXT_pixel_transform_color_table");
+ CONST_CAST(GLEW_EXT_pixel_transform_color_table) = glewGetExtension("GL_EXT_pixel_transform_color_table");
#endif /* GL_EXT_pixel_transform_color_table */
#ifdef GL_EXT_point_parameters
- GLEW_EXT_point_parameters = glewGetExtension("GL_EXT_point_parameters");
- if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_point_parameters) = glewGetExtension("GL_EXT_point_parameters");
+ if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_point_parameters */
#ifdef GL_EXT_polygon_offset
- GLEW_EXT_polygon_offset = glewGetExtension("GL_EXT_polygon_offset");
- if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_polygon_offset) = glewGetExtension("GL_EXT_polygon_offset");
+ if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_polygon_offset */
#ifdef GL_EXT_rescale_normal
- GLEW_EXT_rescale_normal = glewGetExtension("GL_EXT_rescale_normal");
+ CONST_CAST(GLEW_EXT_rescale_normal) = glewGetExtension("GL_EXT_rescale_normal");
#endif /* GL_EXT_rescale_normal */
#ifdef GL_EXT_scene_marker
- GLEW_EXT_scene_marker = glewGetExtension("GL_EXT_scene_marker");
- if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_scene_marker) = glewGetExtension("GL_EXT_scene_marker");
+ if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_scene_marker */
#ifdef GL_EXT_secondary_color
- GLEW_EXT_secondary_color = glewGetExtension("GL_EXT_secondary_color");
- if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_secondary_color) = glewGetExtension("GL_EXT_secondary_color");
+ if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_secondary_color */
#ifdef GL_EXT_separate_specular_color
- GLEW_EXT_separate_specular_color = glewGetExtension("GL_EXT_separate_specular_color");
+ CONST_CAST(GLEW_EXT_separate_specular_color) = glewGetExtension("GL_EXT_separate_specular_color");
#endif /* GL_EXT_separate_specular_color */
#ifdef GL_EXT_shadow_funcs
- GLEW_EXT_shadow_funcs = glewGetExtension("GL_EXT_shadow_funcs");
+ CONST_CAST(GLEW_EXT_shadow_funcs) = glewGetExtension("GL_EXT_shadow_funcs");
#endif /* GL_EXT_shadow_funcs */
#ifdef GL_EXT_shared_texture_palette
- GLEW_EXT_shared_texture_palette = glewGetExtension("GL_EXT_shared_texture_palette");
+ CONST_CAST(GLEW_EXT_shared_texture_palette) = glewGetExtension("GL_EXT_shared_texture_palette");
#endif /* GL_EXT_shared_texture_palette */
#ifdef GL_EXT_stencil_clear_tag
- GLEW_EXT_stencil_clear_tag = glewGetExtension("GL_EXT_stencil_clear_tag");
+ CONST_CAST(GLEW_EXT_stencil_clear_tag) = glewGetExtension("GL_EXT_stencil_clear_tag");
#endif /* GL_EXT_stencil_clear_tag */
#ifdef GL_EXT_stencil_two_side
- GLEW_EXT_stencil_two_side = glewGetExtension("GL_EXT_stencil_two_side");
- if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_stencil_two_side) = glewGetExtension("GL_EXT_stencil_two_side");
+ if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_stencil_two_side */
#ifdef GL_EXT_stencil_wrap
- GLEW_EXT_stencil_wrap = glewGetExtension("GL_EXT_stencil_wrap");
+ CONST_CAST(GLEW_EXT_stencil_wrap) = glewGetExtension("GL_EXT_stencil_wrap");
#endif /* GL_EXT_stencil_wrap */
#ifdef GL_EXT_subtexture
- GLEW_EXT_subtexture = glewGetExtension("GL_EXT_subtexture");
- if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_subtexture) = glewGetExtension("GL_EXT_subtexture");
+ if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_subtexture */
#ifdef GL_EXT_texture
- GLEW_EXT_texture = glewGetExtension("GL_EXT_texture");
+ CONST_CAST(GLEW_EXT_texture) = glewGetExtension("GL_EXT_texture");
#endif /* GL_EXT_texture */
#ifdef GL_EXT_texture3D
- GLEW_EXT_texture3D = glewGetExtension("GL_EXT_texture3D");
- if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_texture3D) = glewGetExtension("GL_EXT_texture3D");
+ if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_texture3D */
+#ifdef GL_EXT_texture_array
+ CONST_CAST(GLEW_EXT_texture_array) = glewGetExtension("GL_EXT_texture_array");
+#endif /* GL_EXT_texture_array */
+#ifdef GL_EXT_texture_buffer_object
+ CONST_CAST(GLEW_EXT_texture_buffer_object) = glewGetExtension("GL_EXT_texture_buffer_object");
+ if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_texture_buffer_object */
#ifdef GL_EXT_texture_compression_dxt1
- GLEW_EXT_texture_compression_dxt1 = glewGetExtension("GL_EXT_texture_compression_dxt1");
+ CONST_CAST(GLEW_EXT_texture_compression_dxt1) = glewGetExtension("GL_EXT_texture_compression_dxt1");
#endif /* GL_EXT_texture_compression_dxt1 */
+#ifdef GL_EXT_texture_compression_latc
+ CONST_CAST(GLEW_EXT_texture_compression_latc) = glewGetExtension("GL_EXT_texture_compression_latc");
+#endif /* GL_EXT_texture_compression_latc */
+#ifdef GL_EXT_texture_compression_rgtc
+ CONST_CAST(GLEW_EXT_texture_compression_rgtc) = glewGetExtension("GL_EXT_texture_compression_rgtc");
+#endif /* GL_EXT_texture_compression_rgtc */
#ifdef GL_EXT_texture_compression_s3tc
- GLEW_EXT_texture_compression_s3tc = glewGetExtension("GL_EXT_texture_compression_s3tc");
+ CONST_CAST(GLEW_EXT_texture_compression_s3tc) = glewGetExtension("GL_EXT_texture_compression_s3tc");
#endif /* GL_EXT_texture_compression_s3tc */
#ifdef GL_EXT_texture_cube_map
- GLEW_EXT_texture_cube_map = glewGetExtension("GL_EXT_texture_cube_map");
+ CONST_CAST(GLEW_EXT_texture_cube_map) = glewGetExtension("GL_EXT_texture_cube_map");
#endif /* GL_EXT_texture_cube_map */
#ifdef GL_EXT_texture_edge_clamp
- GLEW_EXT_texture_edge_clamp = glewGetExtension("GL_EXT_texture_edge_clamp");
+ CONST_CAST(GLEW_EXT_texture_edge_clamp) = glewGetExtension("GL_EXT_texture_edge_clamp");
#endif /* GL_EXT_texture_edge_clamp */
#ifdef GL_EXT_texture_env
- GLEW_EXT_texture_env = glewGetExtension("GL_EXT_texture_env");
+ CONST_CAST(GLEW_EXT_texture_env) = glewGetExtension("GL_EXT_texture_env");
#endif /* GL_EXT_texture_env */
#ifdef GL_EXT_texture_env_add
- GLEW_EXT_texture_env_add = glewGetExtension("GL_EXT_texture_env_add");
+ CONST_CAST(GLEW_EXT_texture_env_add) = glewGetExtension("GL_EXT_texture_env_add");
#endif /* GL_EXT_texture_env_add */
#ifdef GL_EXT_texture_env_combine
- GLEW_EXT_texture_env_combine = glewGetExtension("GL_EXT_texture_env_combine");
+ CONST_CAST(GLEW_EXT_texture_env_combine) = glewGetExtension("GL_EXT_texture_env_combine");
#endif /* GL_EXT_texture_env_combine */
#ifdef GL_EXT_texture_env_dot3
- GLEW_EXT_texture_env_dot3 = glewGetExtension("GL_EXT_texture_env_dot3");
+ CONST_CAST(GLEW_EXT_texture_env_dot3) = glewGetExtension("GL_EXT_texture_env_dot3");
#endif /* GL_EXT_texture_env_dot3 */
#ifdef GL_EXT_texture_filter_anisotropic
- GLEW_EXT_texture_filter_anisotropic = glewGetExtension("GL_EXT_texture_filter_anisotropic");
+ CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = glewGetExtension("GL_EXT_texture_filter_anisotropic");
#endif /* GL_EXT_texture_filter_anisotropic */
+#ifdef GL_EXT_texture_integer
+ CONST_CAST(GLEW_EXT_texture_integer) = glewGetExtension("GL_EXT_texture_integer");
+ if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_texture_integer */
#ifdef GL_EXT_texture_lod_bias
- GLEW_EXT_texture_lod_bias = glewGetExtension("GL_EXT_texture_lod_bias");
+ CONST_CAST(GLEW_EXT_texture_lod_bias) = glewGetExtension("GL_EXT_texture_lod_bias");
#endif /* GL_EXT_texture_lod_bias */
#ifdef GL_EXT_texture_mirror_clamp
- GLEW_EXT_texture_mirror_clamp = glewGetExtension("GL_EXT_texture_mirror_clamp");
+ CONST_CAST(GLEW_EXT_texture_mirror_clamp) = glewGetExtension("GL_EXT_texture_mirror_clamp");
#endif /* GL_EXT_texture_mirror_clamp */
#ifdef GL_EXT_texture_object
- GLEW_EXT_texture_object = glewGetExtension("GL_EXT_texture_object");
- if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_texture_object) = glewGetExtension("GL_EXT_texture_object");
+ if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_texture_object */
#ifdef GL_EXT_texture_perturb_normal
- GLEW_EXT_texture_perturb_normal = glewGetExtension("GL_EXT_texture_perturb_normal");
- if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_texture_perturb_normal) = glewGetExtension("GL_EXT_texture_perturb_normal");
+ if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_texture_perturb_normal */
#ifdef GL_EXT_texture_rectangle
- GLEW_EXT_texture_rectangle = glewGetExtension("GL_EXT_texture_rectangle");
+ CONST_CAST(GLEW_EXT_texture_rectangle) = glewGetExtension("GL_EXT_texture_rectangle");
#endif /* GL_EXT_texture_rectangle */
#ifdef GL_EXT_texture_sRGB
- GLEW_EXT_texture_sRGB = glewGetExtension("GL_EXT_texture_sRGB");
+ CONST_CAST(GLEW_EXT_texture_sRGB) = glewGetExtension("GL_EXT_texture_sRGB");
#endif /* GL_EXT_texture_sRGB */
+#ifdef GL_EXT_texture_shared_exponent
+ CONST_CAST(GLEW_EXT_texture_shared_exponent) = glewGetExtension("GL_EXT_texture_shared_exponent");
+#endif /* GL_EXT_texture_shared_exponent */
+#ifdef GL_EXT_texture_swizzle
+ CONST_CAST(GLEW_EXT_texture_swizzle) = glewGetExtension("GL_EXT_texture_swizzle");
+#endif /* GL_EXT_texture_swizzle */
+#ifdef GL_EXT_timer_query
+ CONST_CAST(GLEW_EXT_timer_query) = glewGetExtension("GL_EXT_timer_query");
+ if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_timer_query */
+#ifdef GL_EXT_transform_feedback
+ CONST_CAST(GLEW_EXT_transform_feedback) = glewGetExtension("GL_EXT_transform_feedback");
+ if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_EXT_transform_feedback */
#ifdef GL_EXT_vertex_array
- GLEW_EXT_vertex_array = glewGetExtension("GL_EXT_vertex_array");
- if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_vertex_array) = glewGetExtension("GL_EXT_vertex_array");
+ if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_vertex_array */
+#ifdef GL_EXT_vertex_array_bgra
+ CONST_CAST(GLEW_EXT_vertex_array_bgra) = glewGetExtension("GL_EXT_vertex_array_bgra");
+#endif /* GL_EXT_vertex_array_bgra */
#ifdef GL_EXT_vertex_shader
- GLEW_EXT_vertex_shader = glewGetExtension("GL_EXT_vertex_shader");
- if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_vertex_shader) = glewGetExtension("GL_EXT_vertex_shader");
+ if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_vertex_shader */
#ifdef GL_EXT_vertex_weighting
- GLEW_EXT_vertex_weighting = glewGetExtension("GL_EXT_vertex_weighting");
- if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_EXT_vertex_weighting) = glewGetExtension("GL_EXT_vertex_weighting");
+ if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_EXT_vertex_weighting */
+#ifdef GL_GREMEDY_frame_terminator
+ CONST_CAST(GLEW_GREMEDY_frame_terminator) = glewGetExtension("GL_GREMEDY_frame_terminator");
+ if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_GREMEDY_frame_terminator */
#ifdef GL_GREMEDY_string_marker
- GLEW_GREMEDY_string_marker = glewGetExtension("GL_GREMEDY_string_marker");
- if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_GREMEDY_string_marker) = glewGetExtension("GL_GREMEDY_string_marker");
+ if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_GREMEDY_string_marker */
#ifdef GL_HP_convolution_border_modes
- GLEW_HP_convolution_border_modes = glewGetExtension("GL_HP_convolution_border_modes");
+ CONST_CAST(GLEW_HP_convolution_border_modes) = glewGetExtension("GL_HP_convolution_border_modes");
#endif /* GL_HP_convolution_border_modes */
#ifdef GL_HP_image_transform
- GLEW_HP_image_transform = glewGetExtension("GL_HP_image_transform");
- if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_HP_image_transform) = glewGetExtension("GL_HP_image_transform");
+ if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_HP_image_transform */
#ifdef GL_HP_occlusion_test
- GLEW_HP_occlusion_test = glewGetExtension("GL_HP_occlusion_test");
+ CONST_CAST(GLEW_HP_occlusion_test) = glewGetExtension("GL_HP_occlusion_test");
#endif /* GL_HP_occlusion_test */
#ifdef GL_HP_texture_lighting
- GLEW_HP_texture_lighting = glewGetExtension("GL_HP_texture_lighting");
+ CONST_CAST(GLEW_HP_texture_lighting) = glewGetExtension("GL_HP_texture_lighting");
#endif /* GL_HP_texture_lighting */
#ifdef GL_IBM_cull_vertex
- GLEW_IBM_cull_vertex = glewGetExtension("GL_IBM_cull_vertex");
+ CONST_CAST(GLEW_IBM_cull_vertex) = glewGetExtension("GL_IBM_cull_vertex");
#endif /* GL_IBM_cull_vertex */
#ifdef GL_IBM_multimode_draw_arrays
- GLEW_IBM_multimode_draw_arrays = glewGetExtension("GL_IBM_multimode_draw_arrays");
- if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_IBM_multimode_draw_arrays) = glewGetExtension("GL_IBM_multimode_draw_arrays");
+ if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_IBM_multimode_draw_arrays */
#ifdef GL_IBM_rasterpos_clip
- GLEW_IBM_rasterpos_clip = glewGetExtension("GL_IBM_rasterpos_clip");
+ CONST_CAST(GLEW_IBM_rasterpos_clip) = glewGetExtension("GL_IBM_rasterpos_clip");
#endif /* GL_IBM_rasterpos_clip */
#ifdef GL_IBM_static_data
- GLEW_IBM_static_data = glewGetExtension("GL_IBM_static_data");
+ CONST_CAST(GLEW_IBM_static_data) = glewGetExtension("GL_IBM_static_data");
#endif /* GL_IBM_static_data */
#ifdef GL_IBM_texture_mirrored_repeat
- GLEW_IBM_texture_mirrored_repeat = glewGetExtension("GL_IBM_texture_mirrored_repeat");
+ CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = glewGetExtension("GL_IBM_texture_mirrored_repeat");
#endif /* GL_IBM_texture_mirrored_repeat */
#ifdef GL_IBM_vertex_array_lists
- GLEW_IBM_vertex_array_lists = glewGetExtension("GL_IBM_vertex_array_lists");
- if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_IBM_vertex_array_lists) = glewGetExtension("GL_IBM_vertex_array_lists");
+ if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_IBM_vertex_array_lists */
#ifdef GL_INGR_color_clamp
- GLEW_INGR_color_clamp = glewGetExtension("GL_INGR_color_clamp");
+ CONST_CAST(GLEW_INGR_color_clamp) = glewGetExtension("GL_INGR_color_clamp");
#endif /* GL_INGR_color_clamp */
#ifdef GL_INGR_interlace_read
- GLEW_INGR_interlace_read = glewGetExtension("GL_INGR_interlace_read");
+ CONST_CAST(GLEW_INGR_interlace_read) = glewGetExtension("GL_INGR_interlace_read");
#endif /* GL_INGR_interlace_read */
#ifdef GL_INTEL_parallel_arrays
- GLEW_INTEL_parallel_arrays = glewGetExtension("GL_INTEL_parallel_arrays");
- if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_INTEL_parallel_arrays) = glewGetExtension("GL_INTEL_parallel_arrays");
+ if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_INTEL_parallel_arrays */
#ifdef GL_INTEL_texture_scissor
- GLEW_INTEL_texture_scissor = glewGetExtension("GL_INTEL_texture_scissor");
- if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_INTEL_texture_scissor) = glewGetExtension("GL_INTEL_texture_scissor");
+ if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_INTEL_texture_scissor */
#ifdef GL_KTX_buffer_region
- GLEW_KTX_buffer_region = glewGetExtension("GL_KTX_buffer_region");
- if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_KTX_buffer_region) = glewGetExtension("GL_KTX_buffer_region");
+ if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_KTX_buffer_region */
#ifdef GL_MESAX_texture_stack
- GLEW_MESAX_texture_stack = glewGetExtension("GL_MESAX_texture_stack");
+ CONST_CAST(GLEW_MESAX_texture_stack) = glewGetExtension("GL_MESAX_texture_stack");
#endif /* GL_MESAX_texture_stack */
#ifdef GL_MESA_pack_invert
- GLEW_MESA_pack_invert = glewGetExtension("GL_MESA_pack_invert");
+ CONST_CAST(GLEW_MESA_pack_invert) = glewGetExtension("GL_MESA_pack_invert");
#endif /* GL_MESA_pack_invert */
#ifdef GL_MESA_resize_buffers
- GLEW_MESA_resize_buffers = glewGetExtension("GL_MESA_resize_buffers");
- if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_MESA_resize_buffers) = glewGetExtension("GL_MESA_resize_buffers");
+ if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_MESA_resize_buffers */
#ifdef GL_MESA_window_pos
- GLEW_MESA_window_pos = glewGetExtension("GL_MESA_window_pos");
- if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_MESA_window_pos) = glewGetExtension("GL_MESA_window_pos");
+ if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_MESA_window_pos */
#ifdef GL_MESA_ycbcr_texture
- GLEW_MESA_ycbcr_texture = glewGetExtension("GL_MESA_ycbcr_texture");
+ CONST_CAST(GLEW_MESA_ycbcr_texture) = glewGetExtension("GL_MESA_ycbcr_texture");
#endif /* GL_MESA_ycbcr_texture */
#ifdef GL_NV_blend_square
- GLEW_NV_blend_square = glewGetExtension("GL_NV_blend_square");
+ CONST_CAST(GLEW_NV_blend_square) = glewGetExtension("GL_NV_blend_square");
#endif /* GL_NV_blend_square */
+#ifdef GL_NV_conditional_render
+ CONST_CAST(GLEW_NV_conditional_render) = glewGetExtension("GL_NV_conditional_render");
+ if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_conditional_render */
#ifdef GL_NV_copy_depth_to_color
- GLEW_NV_copy_depth_to_color = glewGetExtension("GL_NV_copy_depth_to_color");
+ CONST_CAST(GLEW_NV_copy_depth_to_color) = glewGetExtension("GL_NV_copy_depth_to_color");
#endif /* GL_NV_copy_depth_to_color */
+#ifdef GL_NV_depth_buffer_float
+ CONST_CAST(GLEW_NV_depth_buffer_float) = glewGetExtension("GL_NV_depth_buffer_float");
+ if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_depth_buffer_float */
#ifdef GL_NV_depth_clamp
- GLEW_NV_depth_clamp = glewGetExtension("GL_NV_depth_clamp");
+ CONST_CAST(GLEW_NV_depth_clamp) = glewGetExtension("GL_NV_depth_clamp");
#endif /* GL_NV_depth_clamp */
+#ifdef GL_NV_depth_range_unclamped
+ CONST_CAST(GLEW_NV_depth_range_unclamped) = glewGetExtension("GL_NV_depth_range_unclamped");
+#endif /* GL_NV_depth_range_unclamped */
#ifdef GL_NV_evaluators
- GLEW_NV_evaluators = glewGetExtension("GL_NV_evaluators");
- if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_evaluators) = glewGetExtension("GL_NV_evaluators");
+ if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_evaluators */
+#ifdef GL_NV_explicit_multisample
+ CONST_CAST(GLEW_NV_explicit_multisample) = glewGetExtension("GL_NV_explicit_multisample");
+ if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_explicit_multisample */
#ifdef GL_NV_fence
- GLEW_NV_fence = glewGetExtension("GL_NV_fence");
- if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_fence) = glewGetExtension("GL_NV_fence");
+ if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_fence */
#ifdef GL_NV_float_buffer
- GLEW_NV_float_buffer = glewGetExtension("GL_NV_float_buffer");
+ CONST_CAST(GLEW_NV_float_buffer) = glewGetExtension("GL_NV_float_buffer");
#endif /* GL_NV_float_buffer */
#ifdef GL_NV_fog_distance
- GLEW_NV_fog_distance = glewGetExtension("GL_NV_fog_distance");
+ CONST_CAST(GLEW_NV_fog_distance) = glewGetExtension("GL_NV_fog_distance");
#endif /* GL_NV_fog_distance */
#ifdef GL_NV_fragment_program
- GLEW_NV_fragment_program = glewGetExtension("GL_NV_fragment_program");
- if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_fragment_program) = glewGetExtension("GL_NV_fragment_program");
+ if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_fragment_program */
#ifdef GL_NV_fragment_program2
- GLEW_NV_fragment_program2 = glewGetExtension("GL_NV_fragment_program2");
+ CONST_CAST(GLEW_NV_fragment_program2) = glewGetExtension("GL_NV_fragment_program2");
#endif /* GL_NV_fragment_program2 */
+#ifdef GL_NV_fragment_program4
+ CONST_CAST(GLEW_NV_fragment_program4) = glewGetExtension("GL_NV_fragment_program4");
+#endif /* GL_NV_fragment_program4 */
#ifdef GL_NV_fragment_program_option
- GLEW_NV_fragment_program_option = glewGetExtension("GL_NV_fragment_program_option");
+ CONST_CAST(GLEW_NV_fragment_program_option) = glewGetExtension("GL_NV_fragment_program_option");
#endif /* GL_NV_fragment_program_option */
+#ifdef GL_NV_framebuffer_multisample_coverage
+ CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = glewGetExtension("GL_NV_framebuffer_multisample_coverage");
+ if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_framebuffer_multisample_coverage */
+#ifdef GL_NV_geometry_program4
+ CONST_CAST(GLEW_NV_geometry_program4) = glewGetExtension("GL_NV_geometry_program4");
+ if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_geometry_program4 */
+#ifdef GL_NV_geometry_shader4
+ CONST_CAST(GLEW_NV_geometry_shader4) = glewGetExtension("GL_NV_geometry_shader4");
+#endif /* GL_NV_geometry_shader4 */
+#ifdef GL_NV_gpu_program4
+ CONST_CAST(GLEW_NV_gpu_program4) = glewGetExtension("GL_NV_gpu_program4");
+ if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_gpu_program4 */
#ifdef GL_NV_half_float
- GLEW_NV_half_float = glewGetExtension("GL_NV_half_float");
- if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_half_float) = glewGetExtension("GL_NV_half_float");
+ if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_half_float */
#ifdef GL_NV_light_max_exponent
- GLEW_NV_light_max_exponent = glewGetExtension("GL_NV_light_max_exponent");
+ CONST_CAST(GLEW_NV_light_max_exponent) = glewGetExtension("GL_NV_light_max_exponent");
#endif /* GL_NV_light_max_exponent */
#ifdef GL_NV_multisample_filter_hint
- GLEW_NV_multisample_filter_hint = glewGetExtension("GL_NV_multisample_filter_hint");
+ CONST_CAST(GLEW_NV_multisample_filter_hint) = glewGetExtension("GL_NV_multisample_filter_hint");
#endif /* GL_NV_multisample_filter_hint */
#ifdef GL_NV_occlusion_query
- GLEW_NV_occlusion_query = glewGetExtension("GL_NV_occlusion_query");
- if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_occlusion_query) = glewGetExtension("GL_NV_occlusion_query");
+ if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_occlusion_query */
#ifdef GL_NV_packed_depth_stencil
- GLEW_NV_packed_depth_stencil = glewGetExtension("GL_NV_packed_depth_stencil");
+ CONST_CAST(GLEW_NV_packed_depth_stencil) = glewGetExtension("GL_NV_packed_depth_stencil");
#endif /* GL_NV_packed_depth_stencil */
+#ifdef GL_NV_parameter_buffer_object
+ CONST_CAST(GLEW_NV_parameter_buffer_object) = glewGetExtension("GL_NV_parameter_buffer_object");
+ if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_parameter_buffer_object */
#ifdef GL_NV_pixel_data_range
- GLEW_NV_pixel_data_range = glewGetExtension("GL_NV_pixel_data_range");
- if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_pixel_data_range) = glewGetExtension("GL_NV_pixel_data_range");
+ if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_pixel_data_range */
#ifdef GL_NV_point_sprite
- GLEW_NV_point_sprite = glewGetExtension("GL_NV_point_sprite");
- if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_point_sprite) = glewGetExtension("GL_NV_point_sprite");
+ if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_point_sprite */
+#ifdef GL_NV_present_video
+ CONST_CAST(GLEW_NV_present_video) = glewGetExtension("GL_NV_present_video");
+ if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_present_video */
#ifdef GL_NV_primitive_restart
- GLEW_NV_primitive_restart = glewGetExtension("GL_NV_primitive_restart");
- if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_primitive_restart) = glewGetExtension("GL_NV_primitive_restart");
+ if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_primitive_restart */
#ifdef GL_NV_register_combiners
- GLEW_NV_register_combiners = glewGetExtension("GL_NV_register_combiners");
- if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_register_combiners) = glewGetExtension("GL_NV_register_combiners");
+ if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_register_combiners */
#ifdef GL_NV_register_combiners2
- GLEW_NV_register_combiners2 = glewGetExtension("GL_NV_register_combiners2");
- if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_register_combiners2) = glewGetExtension("GL_NV_register_combiners2");
+ if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_register_combiners2 */
#ifdef GL_NV_texgen_emboss
- GLEW_NV_texgen_emboss = glewGetExtension("GL_NV_texgen_emboss");
+ CONST_CAST(GLEW_NV_texgen_emboss) = glewGetExtension("GL_NV_texgen_emboss");
#endif /* GL_NV_texgen_emboss */
#ifdef GL_NV_texgen_reflection
- GLEW_NV_texgen_reflection = glewGetExtension("GL_NV_texgen_reflection");
+ CONST_CAST(GLEW_NV_texgen_reflection) = glewGetExtension("GL_NV_texgen_reflection");
#endif /* GL_NV_texgen_reflection */
#ifdef GL_NV_texture_compression_vtc
- GLEW_NV_texture_compression_vtc = glewGetExtension("GL_NV_texture_compression_vtc");
+ CONST_CAST(GLEW_NV_texture_compression_vtc) = glewGetExtension("GL_NV_texture_compression_vtc");
#endif /* GL_NV_texture_compression_vtc */
#ifdef GL_NV_texture_env_combine4
- GLEW_NV_texture_env_combine4 = glewGetExtension("GL_NV_texture_env_combine4");
+ CONST_CAST(GLEW_NV_texture_env_combine4) = glewGetExtension("GL_NV_texture_env_combine4");
#endif /* GL_NV_texture_env_combine4 */
#ifdef GL_NV_texture_expand_normal
- GLEW_NV_texture_expand_normal = glewGetExtension("GL_NV_texture_expand_normal");
+ CONST_CAST(GLEW_NV_texture_expand_normal) = glewGetExtension("GL_NV_texture_expand_normal");
#endif /* GL_NV_texture_expand_normal */
#ifdef GL_NV_texture_rectangle
- GLEW_NV_texture_rectangle = glewGetExtension("GL_NV_texture_rectangle");
+ CONST_CAST(GLEW_NV_texture_rectangle) = glewGetExtension("GL_NV_texture_rectangle");
#endif /* GL_NV_texture_rectangle */
#ifdef GL_NV_texture_shader
- GLEW_NV_texture_shader = glewGetExtension("GL_NV_texture_shader");
+ CONST_CAST(GLEW_NV_texture_shader) = glewGetExtension("GL_NV_texture_shader");
#endif /* GL_NV_texture_shader */
#ifdef GL_NV_texture_shader2
- GLEW_NV_texture_shader2 = glewGetExtension("GL_NV_texture_shader2");
+ CONST_CAST(GLEW_NV_texture_shader2) = glewGetExtension("GL_NV_texture_shader2");
#endif /* GL_NV_texture_shader2 */
#ifdef GL_NV_texture_shader3
- GLEW_NV_texture_shader3 = glewGetExtension("GL_NV_texture_shader3");
+ CONST_CAST(GLEW_NV_texture_shader3) = glewGetExtension("GL_NV_texture_shader3");
#endif /* GL_NV_texture_shader3 */
+#ifdef GL_NV_transform_feedback
+ CONST_CAST(GLEW_NV_transform_feedback) = glewGetExtension("GL_NV_transform_feedback");
+ if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_NV_transform_feedback */
#ifdef GL_NV_vertex_array_range
- GLEW_NV_vertex_array_range = glewGetExtension("GL_NV_vertex_array_range");
- if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_vertex_array_range) = glewGetExtension("GL_NV_vertex_array_range");
+ if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_vertex_array_range */
#ifdef GL_NV_vertex_array_range2
- GLEW_NV_vertex_array_range2 = glewGetExtension("GL_NV_vertex_array_range2");
+ CONST_CAST(GLEW_NV_vertex_array_range2) = glewGetExtension("GL_NV_vertex_array_range2");
#endif /* GL_NV_vertex_array_range2 */
#ifdef GL_NV_vertex_program
- GLEW_NV_vertex_program = glewGetExtension("GL_NV_vertex_program");
- if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_NV_vertex_program) = glewGetExtension("GL_NV_vertex_program");
+ if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_NV_vertex_program */
#ifdef GL_NV_vertex_program1_1
- GLEW_NV_vertex_program1_1 = glewGetExtension("GL_NV_vertex_program1_1");
+ CONST_CAST(GLEW_NV_vertex_program1_1) = glewGetExtension("GL_NV_vertex_program1_1");
#endif /* GL_NV_vertex_program1_1 */
#ifdef GL_NV_vertex_program2
- GLEW_NV_vertex_program2 = glewGetExtension("GL_NV_vertex_program2");
+ CONST_CAST(GLEW_NV_vertex_program2) = glewGetExtension("GL_NV_vertex_program2");
#endif /* GL_NV_vertex_program2 */
#ifdef GL_NV_vertex_program2_option
- GLEW_NV_vertex_program2_option = glewGetExtension("GL_NV_vertex_program2_option");
+ CONST_CAST(GLEW_NV_vertex_program2_option) = glewGetExtension("GL_NV_vertex_program2_option");
#endif /* GL_NV_vertex_program2_option */
#ifdef GL_NV_vertex_program3
- GLEW_NV_vertex_program3 = glewGetExtension("GL_NV_vertex_program3");
+ CONST_CAST(GLEW_NV_vertex_program3) = glewGetExtension("GL_NV_vertex_program3");
#endif /* GL_NV_vertex_program3 */
+#ifdef GL_NV_vertex_program4
+ CONST_CAST(GLEW_NV_vertex_program4) = glewGetExtension("GL_NV_vertex_program4");
+#endif /* GL_NV_vertex_program4 */
+#ifdef GL_OES_byte_coordinates
+ CONST_CAST(GLEW_OES_byte_coordinates) = glewGetExtension("GL_OES_byte_coordinates");
+#endif /* GL_OES_byte_coordinates */
+#ifdef GL_OES_compressed_paletted_texture
+ CONST_CAST(GLEW_OES_compressed_paletted_texture) = glewGetExtension("GL_OES_compressed_paletted_texture");
+#endif /* GL_OES_compressed_paletted_texture */
+#ifdef GL_OES_read_format
+ CONST_CAST(GLEW_OES_read_format) = glewGetExtension("GL_OES_read_format");
+#endif /* GL_OES_read_format */
+#ifdef GL_OES_single_precision
+ CONST_CAST(GLEW_OES_single_precision) = glewGetExtension("GL_OES_single_precision");
+ if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GL_OES_single_precision */
#ifdef GL_OML_interlace
- GLEW_OML_interlace = glewGetExtension("GL_OML_interlace");
+ CONST_CAST(GLEW_OML_interlace) = glewGetExtension("GL_OML_interlace");
#endif /* GL_OML_interlace */
#ifdef GL_OML_resample
- GLEW_OML_resample = glewGetExtension("GL_OML_resample");
+ CONST_CAST(GLEW_OML_resample) = glewGetExtension("GL_OML_resample");
#endif /* GL_OML_resample */
#ifdef GL_OML_subsample
- GLEW_OML_subsample = glewGetExtension("GL_OML_subsample");
+ CONST_CAST(GLEW_OML_subsample) = glewGetExtension("GL_OML_subsample");
#endif /* GL_OML_subsample */
#ifdef GL_PGI_misc_hints
- GLEW_PGI_misc_hints = glewGetExtension("GL_PGI_misc_hints");
+ CONST_CAST(GLEW_PGI_misc_hints) = glewGetExtension("GL_PGI_misc_hints");
#endif /* GL_PGI_misc_hints */
#ifdef GL_PGI_vertex_hints
- GLEW_PGI_vertex_hints = glewGetExtension("GL_PGI_vertex_hints");
+ CONST_CAST(GLEW_PGI_vertex_hints) = glewGetExtension("GL_PGI_vertex_hints");
#endif /* GL_PGI_vertex_hints */
#ifdef GL_REND_screen_coordinates
- GLEW_REND_screen_coordinates = glewGetExtension("GL_REND_screen_coordinates");
+ CONST_CAST(GLEW_REND_screen_coordinates) = glewGetExtension("GL_REND_screen_coordinates");
#endif /* GL_REND_screen_coordinates */
#ifdef GL_S3_s3tc
- GLEW_S3_s3tc = glewGetExtension("GL_S3_s3tc");
+ CONST_CAST(GLEW_S3_s3tc) = glewGetExtension("GL_S3_s3tc");
#endif /* GL_S3_s3tc */
#ifdef GL_SGIS_color_range
- GLEW_SGIS_color_range = glewGetExtension("GL_SGIS_color_range");
+ CONST_CAST(GLEW_SGIS_color_range) = glewGetExtension("GL_SGIS_color_range");
#endif /* GL_SGIS_color_range */
#ifdef GL_SGIS_detail_texture
- GLEW_SGIS_detail_texture = glewGetExtension("GL_SGIS_detail_texture");
- if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_detail_texture) = glewGetExtension("GL_SGIS_detail_texture");
+ if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_detail_texture */
#ifdef GL_SGIS_fog_function
- GLEW_SGIS_fog_function = glewGetExtension("GL_SGIS_fog_function");
- if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_fog_function) = glewGetExtension("GL_SGIS_fog_function");
+ if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_fog_function */
#ifdef GL_SGIS_generate_mipmap
- GLEW_SGIS_generate_mipmap = glewGetExtension("GL_SGIS_generate_mipmap");
+ CONST_CAST(GLEW_SGIS_generate_mipmap) = glewGetExtension("GL_SGIS_generate_mipmap");
#endif /* GL_SGIS_generate_mipmap */
#ifdef GL_SGIS_multisample
- GLEW_SGIS_multisample = glewGetExtension("GL_SGIS_multisample");
- if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_multisample) = glewGetExtension("GL_SGIS_multisample");
+ if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_multisample */
#ifdef GL_SGIS_pixel_texture
- GLEW_SGIS_pixel_texture = glewGetExtension("GL_SGIS_pixel_texture");
+ CONST_CAST(GLEW_SGIS_pixel_texture) = glewGetExtension("GL_SGIS_pixel_texture");
#endif /* GL_SGIS_pixel_texture */
+#ifdef GL_SGIS_point_line_texgen
+ CONST_CAST(GLEW_SGIS_point_line_texgen) = glewGetExtension("GL_SGIS_point_line_texgen");
+#endif /* GL_SGIS_point_line_texgen */
#ifdef GL_SGIS_sharpen_texture
- GLEW_SGIS_sharpen_texture = glewGetExtension("GL_SGIS_sharpen_texture");
- if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_sharpen_texture) = glewGetExtension("GL_SGIS_sharpen_texture");
+ if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_sharpen_texture */
#ifdef GL_SGIS_texture4D
- GLEW_SGIS_texture4D = glewGetExtension("GL_SGIS_texture4D");
- if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_texture4D) = glewGetExtension("GL_SGIS_texture4D");
+ if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_texture4D */
#ifdef GL_SGIS_texture_border_clamp
- GLEW_SGIS_texture_border_clamp = glewGetExtension("GL_SGIS_texture_border_clamp");
+ CONST_CAST(GLEW_SGIS_texture_border_clamp) = glewGetExtension("GL_SGIS_texture_border_clamp");
#endif /* GL_SGIS_texture_border_clamp */
#ifdef GL_SGIS_texture_edge_clamp
- GLEW_SGIS_texture_edge_clamp = glewGetExtension("GL_SGIS_texture_edge_clamp");
+ CONST_CAST(GLEW_SGIS_texture_edge_clamp) = glewGetExtension("GL_SGIS_texture_edge_clamp");
#endif /* GL_SGIS_texture_edge_clamp */
#ifdef GL_SGIS_texture_filter4
- GLEW_SGIS_texture_filter4 = glewGetExtension("GL_SGIS_texture_filter4");
- if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIS_texture_filter4) = glewGetExtension("GL_SGIS_texture_filter4");
+ if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIS_texture_filter4 */
#ifdef GL_SGIS_texture_lod
- GLEW_SGIS_texture_lod = glewGetExtension("GL_SGIS_texture_lod");
+ CONST_CAST(GLEW_SGIS_texture_lod) = glewGetExtension("GL_SGIS_texture_lod");
#endif /* GL_SGIS_texture_lod */
#ifdef GL_SGIS_texture_select
- GLEW_SGIS_texture_select = glewGetExtension("GL_SGIS_texture_select");
+ CONST_CAST(GLEW_SGIS_texture_select) = glewGetExtension("GL_SGIS_texture_select");
#endif /* GL_SGIS_texture_select */
#ifdef GL_SGIX_async
- GLEW_SGIX_async = glewGetExtension("GL_SGIX_async");
- if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_async) = glewGetExtension("GL_SGIX_async");
+ if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_async */
#ifdef GL_SGIX_async_histogram
- GLEW_SGIX_async_histogram = glewGetExtension("GL_SGIX_async_histogram");
+ CONST_CAST(GLEW_SGIX_async_histogram) = glewGetExtension("GL_SGIX_async_histogram");
#endif /* GL_SGIX_async_histogram */
#ifdef GL_SGIX_async_pixel
- GLEW_SGIX_async_pixel = glewGetExtension("GL_SGIX_async_pixel");
+ CONST_CAST(GLEW_SGIX_async_pixel) = glewGetExtension("GL_SGIX_async_pixel");
#endif /* GL_SGIX_async_pixel */
#ifdef GL_SGIX_blend_alpha_minmax
- GLEW_SGIX_blend_alpha_minmax = glewGetExtension("GL_SGIX_blend_alpha_minmax");
+ CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = glewGetExtension("GL_SGIX_blend_alpha_minmax");
#endif /* GL_SGIX_blend_alpha_minmax */
#ifdef GL_SGIX_clipmap
- GLEW_SGIX_clipmap = glewGetExtension("GL_SGIX_clipmap");
+ CONST_CAST(GLEW_SGIX_clipmap) = glewGetExtension("GL_SGIX_clipmap");
#endif /* GL_SGIX_clipmap */
+#ifdef GL_SGIX_convolution_accuracy
+ CONST_CAST(GLEW_SGIX_convolution_accuracy) = glewGetExtension("GL_SGIX_convolution_accuracy");
+#endif /* GL_SGIX_convolution_accuracy */
#ifdef GL_SGIX_depth_texture
- GLEW_SGIX_depth_texture = glewGetExtension("GL_SGIX_depth_texture");
+ CONST_CAST(GLEW_SGIX_depth_texture) = glewGetExtension("GL_SGIX_depth_texture");
#endif /* GL_SGIX_depth_texture */
#ifdef GL_SGIX_flush_raster
- GLEW_SGIX_flush_raster = glewGetExtension("GL_SGIX_flush_raster");
- if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_flush_raster) = glewGetExtension("GL_SGIX_flush_raster");
+ if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_flush_raster */
#ifdef GL_SGIX_fog_offset
- GLEW_SGIX_fog_offset = glewGetExtension("GL_SGIX_fog_offset");
+ CONST_CAST(GLEW_SGIX_fog_offset) = glewGetExtension("GL_SGIX_fog_offset");
#endif /* GL_SGIX_fog_offset */
#ifdef GL_SGIX_fog_texture
- GLEW_SGIX_fog_texture = glewGetExtension("GL_SGIX_fog_texture");
- if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_fog_texture) = glewGetExtension("GL_SGIX_fog_texture");
+ if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_fog_texture */
#ifdef GL_SGIX_fragment_specular_lighting
- GLEW_SGIX_fragment_specular_lighting = glewGetExtension("GL_SGIX_fragment_specular_lighting");
- if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = glewGetExtension("GL_SGIX_fragment_specular_lighting");
+ if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_fragment_specular_lighting */
#ifdef GL_SGIX_framezoom
- GLEW_SGIX_framezoom = glewGetExtension("GL_SGIX_framezoom");
- if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_framezoom) = glewGetExtension("GL_SGIX_framezoom");
+ if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_framezoom */
#ifdef GL_SGIX_interlace
- GLEW_SGIX_interlace = glewGetExtension("GL_SGIX_interlace");
+ CONST_CAST(GLEW_SGIX_interlace) = glewGetExtension("GL_SGIX_interlace");
#endif /* GL_SGIX_interlace */
#ifdef GL_SGIX_ir_instrument1
- GLEW_SGIX_ir_instrument1 = glewGetExtension("GL_SGIX_ir_instrument1");
+ CONST_CAST(GLEW_SGIX_ir_instrument1) = glewGetExtension("GL_SGIX_ir_instrument1");
#endif /* GL_SGIX_ir_instrument1 */
#ifdef GL_SGIX_list_priority
- GLEW_SGIX_list_priority = glewGetExtension("GL_SGIX_list_priority");
+ CONST_CAST(GLEW_SGIX_list_priority) = glewGetExtension("GL_SGIX_list_priority");
#endif /* GL_SGIX_list_priority */
#ifdef GL_SGIX_pixel_texture
- GLEW_SGIX_pixel_texture = glewGetExtension("GL_SGIX_pixel_texture");
- if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_pixel_texture) = glewGetExtension("GL_SGIX_pixel_texture");
+ if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_pixel_texture */
#ifdef GL_SGIX_pixel_texture_bits
- GLEW_SGIX_pixel_texture_bits = glewGetExtension("GL_SGIX_pixel_texture_bits");
+ CONST_CAST(GLEW_SGIX_pixel_texture_bits) = glewGetExtension("GL_SGIX_pixel_texture_bits");
#endif /* GL_SGIX_pixel_texture_bits */
#ifdef GL_SGIX_reference_plane
- GLEW_SGIX_reference_plane = glewGetExtension("GL_SGIX_reference_plane");
- if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_reference_plane) = glewGetExtension("GL_SGIX_reference_plane");
+ if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_reference_plane */
#ifdef GL_SGIX_resample
- GLEW_SGIX_resample = glewGetExtension("GL_SGIX_resample");
+ CONST_CAST(GLEW_SGIX_resample) = glewGetExtension("GL_SGIX_resample");
#endif /* GL_SGIX_resample */
#ifdef GL_SGIX_shadow
- GLEW_SGIX_shadow = glewGetExtension("GL_SGIX_shadow");
+ CONST_CAST(GLEW_SGIX_shadow) = glewGetExtension("GL_SGIX_shadow");
#endif /* GL_SGIX_shadow */
#ifdef GL_SGIX_shadow_ambient
- GLEW_SGIX_shadow_ambient = glewGetExtension("GL_SGIX_shadow_ambient");
+ CONST_CAST(GLEW_SGIX_shadow_ambient) = glewGetExtension("GL_SGIX_shadow_ambient");
#endif /* GL_SGIX_shadow_ambient */
#ifdef GL_SGIX_sprite
- GLEW_SGIX_sprite = glewGetExtension("GL_SGIX_sprite");
- if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_sprite) = glewGetExtension("GL_SGIX_sprite");
+ if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_sprite */
#ifdef GL_SGIX_tag_sample_buffer
- GLEW_SGIX_tag_sample_buffer = glewGetExtension("GL_SGIX_tag_sample_buffer");
- if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGIX_tag_sample_buffer) = glewGetExtension("GL_SGIX_tag_sample_buffer");
+ if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGIX_tag_sample_buffer */
#ifdef GL_SGIX_texture_add_env
- GLEW_SGIX_texture_add_env = glewGetExtension("GL_SGIX_texture_add_env");
+ CONST_CAST(GLEW_SGIX_texture_add_env) = glewGetExtension("GL_SGIX_texture_add_env");
#endif /* GL_SGIX_texture_add_env */
#ifdef GL_SGIX_texture_coordinate_clamp
- GLEW_SGIX_texture_coordinate_clamp = glewGetExtension("GL_SGIX_texture_coordinate_clamp");
+ CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = glewGetExtension("GL_SGIX_texture_coordinate_clamp");
#endif /* GL_SGIX_texture_coordinate_clamp */
#ifdef GL_SGIX_texture_lod_bias
- GLEW_SGIX_texture_lod_bias = glewGetExtension("GL_SGIX_texture_lod_bias");
+ CONST_CAST(GLEW_SGIX_texture_lod_bias) = glewGetExtension("GL_SGIX_texture_lod_bias");
#endif /* GL_SGIX_texture_lod_bias */
#ifdef GL_SGIX_texture_multi_buffer
- GLEW_SGIX_texture_multi_buffer = glewGetExtension("GL_SGIX_texture_multi_buffer");
+ CONST_CAST(GLEW_SGIX_texture_multi_buffer) = glewGetExtension("GL_SGIX_texture_multi_buffer");
#endif /* GL_SGIX_texture_multi_buffer */
#ifdef GL_SGIX_texture_range
- GLEW_SGIX_texture_range = glewGetExtension("GL_SGIX_texture_range");
+ CONST_CAST(GLEW_SGIX_texture_range) = glewGetExtension("GL_SGIX_texture_range");
#endif /* GL_SGIX_texture_range */
#ifdef GL_SGIX_texture_scale_bias
- GLEW_SGIX_texture_scale_bias = glewGetExtension("GL_SGIX_texture_scale_bias");
+ CONST_CAST(GLEW_SGIX_texture_scale_bias) = glewGetExtension("GL_SGIX_texture_scale_bias");
#endif /* GL_SGIX_texture_scale_bias */
#ifdef GL_SGIX_vertex_preclip
- GLEW_SGIX_vertex_preclip = glewGetExtension("GL_SGIX_vertex_preclip");
+ CONST_CAST(GLEW_SGIX_vertex_preclip) = glewGetExtension("GL_SGIX_vertex_preclip");
#endif /* GL_SGIX_vertex_preclip */
#ifdef GL_SGIX_vertex_preclip_hint
- GLEW_SGIX_vertex_preclip_hint = glewGetExtension("GL_SGIX_vertex_preclip_hint");
+ CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = glewGetExtension("GL_SGIX_vertex_preclip_hint");
#endif /* GL_SGIX_vertex_preclip_hint */
#ifdef GL_SGIX_ycrcb
- GLEW_SGIX_ycrcb = glewGetExtension("GL_SGIX_ycrcb");
+ CONST_CAST(GLEW_SGIX_ycrcb) = glewGetExtension("GL_SGIX_ycrcb");
#endif /* GL_SGIX_ycrcb */
#ifdef GL_SGI_color_matrix
- GLEW_SGI_color_matrix = glewGetExtension("GL_SGI_color_matrix");
+ CONST_CAST(GLEW_SGI_color_matrix) = glewGetExtension("GL_SGI_color_matrix");
#endif /* GL_SGI_color_matrix */
#ifdef GL_SGI_color_table
- GLEW_SGI_color_table = glewGetExtension("GL_SGI_color_table");
- if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SGI_color_table) = glewGetExtension("GL_SGI_color_table");
+ if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SGI_color_table */
#ifdef GL_SGI_texture_color_table
- GLEW_SGI_texture_color_table = glewGetExtension("GL_SGI_texture_color_table");
+ CONST_CAST(GLEW_SGI_texture_color_table) = glewGetExtension("GL_SGI_texture_color_table");
#endif /* GL_SGI_texture_color_table */
#ifdef GL_SUNX_constant_data
- GLEW_SUNX_constant_data = glewGetExtension("GL_SUNX_constant_data");
- if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SUNX_constant_data) = glewGetExtension("GL_SUNX_constant_data");
+ if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SUNX_constant_data */
#ifdef GL_SUN_convolution_border_modes
- GLEW_SUN_convolution_border_modes = glewGetExtension("GL_SUN_convolution_border_modes");
+ CONST_CAST(GLEW_SUN_convolution_border_modes) = glewGetExtension("GL_SUN_convolution_border_modes");
#endif /* GL_SUN_convolution_border_modes */
#ifdef GL_SUN_global_alpha
- GLEW_SUN_global_alpha = glewGetExtension("GL_SUN_global_alpha");
- if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SUN_global_alpha) = glewGetExtension("GL_SUN_global_alpha");
+ if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SUN_global_alpha */
#ifdef GL_SUN_mesh_array
- GLEW_SUN_mesh_array = glewGetExtension("GL_SUN_mesh_array");
+ CONST_CAST(GLEW_SUN_mesh_array) = glewGetExtension("GL_SUN_mesh_array");
#endif /* GL_SUN_mesh_array */
#ifdef GL_SUN_read_video_pixels
- GLEW_SUN_read_video_pixels = glewGetExtension("GL_SUN_read_video_pixels");
- if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SUN_read_video_pixels) = glewGetExtension("GL_SUN_read_video_pixels");
+ if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SUN_read_video_pixels */
#ifdef GL_SUN_slice_accum
- GLEW_SUN_slice_accum = glewGetExtension("GL_SUN_slice_accum");
+ CONST_CAST(GLEW_SUN_slice_accum) = glewGetExtension("GL_SUN_slice_accum");
#endif /* GL_SUN_slice_accum */
#ifdef GL_SUN_triangle_list
- GLEW_SUN_triangle_list = glewGetExtension("GL_SUN_triangle_list");
- if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SUN_triangle_list) = glewGetExtension("GL_SUN_triangle_list");
+ if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SUN_triangle_list */
#ifdef GL_SUN_vertex
- GLEW_SUN_vertex = glewGetExtension("GL_SUN_vertex");
- if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_SUN_vertex) = glewGetExtension("GL_SUN_vertex");
+ if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_SUN_vertex */
#ifdef GL_WIN_phong_shading
- GLEW_WIN_phong_shading = glewGetExtension("GL_WIN_phong_shading");
+ CONST_CAST(GLEW_WIN_phong_shading) = glewGetExtension("GL_WIN_phong_shading");
#endif /* GL_WIN_phong_shading */
#ifdef GL_WIN_specular_fog
- GLEW_WIN_specular_fog = glewGetExtension("GL_WIN_specular_fog");
+ CONST_CAST(GLEW_WIN_specular_fog) = glewGetExtension("GL_WIN_specular_fog");
#endif /* GL_WIN_specular_fog */
#ifdef GL_WIN_swap_hint
- GLEW_WIN_swap_hint = glewGetExtension("GL_WIN_swap_hint");
- if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLEW_WIN_swap_hint) = glewGetExtension("GL_WIN_swap_hint");
+ if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_WIN_swap_hint */
return GLEW_OK;
@@ -5781,6 +7357,8 @@ PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL;
PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL;
PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL;
+PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL;
+
PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL;
PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL;
@@ -5859,9 +7437,33 @@ PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL;
PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL;
PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL;
+PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL;
+PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL;
+PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL;
+PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL;
+PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL;
+
+PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL;
+PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL;
+PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL;
+
+PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL;
+PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL;
+PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL;
+PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL;
+PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL;
+PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL;
+
PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL;
PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL;
+PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL;
+PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL;
+PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL;
+PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL;
+PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL;
+PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL;
+
PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL;
PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL;
PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL;
@@ -5871,7 +7473,9 @@ PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL;
GLboolean __WGLEW_3DFX_multisample = GL_FALSE;
GLboolean __WGLEW_3DL_stereo_control = GL_FALSE;
GLboolean __WGLEW_ARB_buffer_region = GL_FALSE;
+GLboolean __WGLEW_ARB_create_context = GL_FALSE;
GLboolean __WGLEW_ARB_extensions_string = GL_FALSE;
+GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE;
GLboolean __WGLEW_ARB_make_current_read = GL_FALSE;
GLboolean __WGLEW_ARB_multisample = GL_FALSE;
GLboolean __WGLEW_ARB_pbuffer = GL_FALSE;
@@ -5883,10 +7487,12 @@ GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE;
GLboolean __WGLEW_EXT_depth_float = GL_FALSE;
GLboolean __WGLEW_EXT_display_color_table = GL_FALSE;
GLboolean __WGLEW_EXT_extensions_string = GL_FALSE;
+GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE;
GLboolean __WGLEW_EXT_make_current_read = GL_FALSE;
GLboolean __WGLEW_EXT_multisample = GL_FALSE;
GLboolean __WGLEW_EXT_pbuffer = GL_FALSE;
GLboolean __WGLEW_EXT_pixel_format = GL_FALSE;
+GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE;
GLboolean __WGLEW_EXT_swap_control = GL_FALSE;
GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE;
GLboolean __WGLEW_I3D_gamma = GL_FALSE;
@@ -5895,9 +7501,13 @@ GLboolean __WGLEW_I3D_image_buffer = GL_FALSE;
GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE;
GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE;
GLboolean __WGLEW_NV_float_buffer = GL_FALSE;
+GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE;
+GLboolean __WGLEW_NV_present_video = GL_FALSE;
GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE;
GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE;
+GLboolean __WGLEW_NV_swap_group = GL_FALSE;
GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE;
+GLboolean __WGLEW_NV_video_output = GL_FALSE;
GLboolean __WGLEW_OML_sync_control = GL_FALSE;
#endif /* !GLEW_MX */
@@ -5935,6 +7545,19 @@ static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT)
#endif /* WGL_ARB_buffer_region */
+#ifdef WGL_ARB_create_context
+
+static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* WGL_ARB_create_context */
+
#ifdef WGL_ARB_extensions_string
static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -5948,6 +7571,10 @@ static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT
#endif /* WGL_ARB_extensions_string */
+#ifdef WGL_ARB_framebuffer_sRGB
+
+#endif /* WGL_ARB_framebuffer_sRGB */
+
#ifdef WGL_ARB_make_current_read
static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -6058,6 +7685,10 @@ static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT
#endif /* WGL_EXT_extensions_string */
+#ifdef WGL_EXT_framebuffer_sRGB
+
+#endif /* WGL_EXT_framebuffer_sRGB */
+
#ifdef WGL_EXT_make_current_read
static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -6108,6 +7739,10 @@ static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT)
#endif /* WGL_EXT_pixel_format */
+#ifdef WGL_EXT_pixel_format_packed_float
+
+#endif /* WGL_EXT_pixel_format_packed_float */
+
#ifdef WGL_EXT_swap_control
static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -6228,6 +7863,38 @@ static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT)
#endif /* WGL_NV_float_buffer */
+#ifdef WGL_NV_gpu_affinity
+
+static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r;
+ r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r;
+ r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r;
+ r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r;
+ r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* WGL_NV_gpu_affinity */
+
+#ifdef WGL_NV_present_video
+
+static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r;
+ r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r;
+ r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* WGL_NV_present_video */
+
#ifdef WGL_NV_render_depth_texture
#endif /* WGL_NV_render_depth_texture */
@@ -6236,6 +7903,24 @@ static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT)
#endif /* WGL_NV_render_texture_rectangle */
+#ifdef WGL_NV_swap_group
+
+static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r;
+ r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r;
+ r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r;
+ r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r;
+ r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r;
+ r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* WGL_NV_swap_group */
+
#ifdef WGL_NV_vertex_array_range
static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -6250,6 +7935,24 @@ static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT
#endif /* WGL_NV_vertex_array_range */
+#ifdef WGL_NV_video_output
+
+static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r;
+ r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r;
+ r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r;
+ r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r;
+ r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r;
+ r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* WGL_NV_video_output */
+
#ifdef WGL_OML_sync_control
static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT)
@@ -6300,125 +8003,152 @@ GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
{
GLboolean crippled;
/* find wgl extension string query functions */
- if (_wglewGetExtensionsStringARB == NULL)
- _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
- if (_wglewGetExtensionsStringEXT == NULL)
- _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
+ _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
+ _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
/* initialize extensions */
crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
#ifdef WGL_3DFX_multisample
- WGLEW_3DFX_multisample = wglewGetExtension("WGL_3DFX_multisample");
+ CONST_CAST(WGLEW_3DFX_multisample) = wglewGetExtension("WGL_3DFX_multisample");
#endif /* WGL_3DFX_multisample */
#ifdef WGL_3DL_stereo_control
- WGLEW_3DL_stereo_control = wglewGetExtension("WGL_3DL_stereo_control");
- if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_3DL_stereo_control) = wglewGetExtension("WGL_3DL_stereo_control");
+ if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_3DL_stereo_control */
#ifdef WGL_ARB_buffer_region
- WGLEW_ARB_buffer_region = wglewGetExtension("WGL_ARB_buffer_region");
- if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_buffer_region) = wglewGetExtension("WGL_ARB_buffer_region");
+ if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_buffer_region */
+#ifdef WGL_ARB_create_context
+ CONST_CAST(WGLEW_ARB_create_context) = wglewGetExtension("WGL_ARB_create_context");
+ if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_ARB_create_context */
#ifdef WGL_ARB_extensions_string
- WGLEW_ARB_extensions_string = wglewGetExtension("WGL_ARB_extensions_string");
- if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_extensions_string) = wglewGetExtension("WGL_ARB_extensions_string");
+ if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_extensions_string */
+#ifdef WGL_ARB_framebuffer_sRGB
+ CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = wglewGetExtension("WGL_ARB_framebuffer_sRGB");
+#endif /* WGL_ARB_framebuffer_sRGB */
#ifdef WGL_ARB_make_current_read
- WGLEW_ARB_make_current_read = wglewGetExtension("WGL_ARB_make_current_read");
- if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_make_current_read) = wglewGetExtension("WGL_ARB_make_current_read");
+ if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_make_current_read */
#ifdef WGL_ARB_multisample
- WGLEW_ARB_multisample = wglewGetExtension("WGL_ARB_multisample");
+ CONST_CAST(WGLEW_ARB_multisample) = wglewGetExtension("WGL_ARB_multisample");
#endif /* WGL_ARB_multisample */
#ifdef WGL_ARB_pbuffer
- WGLEW_ARB_pbuffer = wglewGetExtension("WGL_ARB_pbuffer");
- if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_pbuffer) = wglewGetExtension("WGL_ARB_pbuffer");
+ if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_pbuffer */
#ifdef WGL_ARB_pixel_format
- WGLEW_ARB_pixel_format = wglewGetExtension("WGL_ARB_pixel_format");
- if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_pixel_format) = wglewGetExtension("WGL_ARB_pixel_format");
+ if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_pixel_format */
#ifdef WGL_ARB_pixel_format_float
- WGLEW_ARB_pixel_format_float = wglewGetExtension("WGL_ARB_pixel_format_float");
+ CONST_CAST(WGLEW_ARB_pixel_format_float) = wglewGetExtension("WGL_ARB_pixel_format_float");
#endif /* WGL_ARB_pixel_format_float */
#ifdef WGL_ARB_render_texture
- WGLEW_ARB_render_texture = wglewGetExtension("WGL_ARB_render_texture");
- if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_ARB_render_texture) = wglewGetExtension("WGL_ARB_render_texture");
+ if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_ARB_render_texture */
#ifdef WGL_ATI_pixel_format_float
- WGLEW_ATI_pixel_format_float = wglewGetExtension("WGL_ATI_pixel_format_float");
+ CONST_CAST(WGLEW_ATI_pixel_format_float) = wglewGetExtension("WGL_ATI_pixel_format_float");
#endif /* WGL_ATI_pixel_format_float */
#ifdef WGL_ATI_render_texture_rectangle
- WGLEW_ATI_render_texture_rectangle = wglewGetExtension("WGL_ATI_render_texture_rectangle");
+ CONST_CAST(WGLEW_ATI_render_texture_rectangle) = wglewGetExtension("WGL_ATI_render_texture_rectangle");
#endif /* WGL_ATI_render_texture_rectangle */
#ifdef WGL_EXT_depth_float
- WGLEW_EXT_depth_float = wglewGetExtension("WGL_EXT_depth_float");
+ CONST_CAST(WGLEW_EXT_depth_float) = wglewGetExtension("WGL_EXT_depth_float");
#endif /* WGL_EXT_depth_float */
#ifdef WGL_EXT_display_color_table
- WGLEW_EXT_display_color_table = wglewGetExtension("WGL_EXT_display_color_table");
- if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_display_color_table) = wglewGetExtension("WGL_EXT_display_color_table");
+ if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_display_color_table */
#ifdef WGL_EXT_extensions_string
- WGLEW_EXT_extensions_string = wglewGetExtension("WGL_EXT_extensions_string");
- if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_extensions_string) = wglewGetExtension("WGL_EXT_extensions_string");
+ if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_extensions_string */
+#ifdef WGL_EXT_framebuffer_sRGB
+ CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = wglewGetExtension("WGL_EXT_framebuffer_sRGB");
+#endif /* WGL_EXT_framebuffer_sRGB */
#ifdef WGL_EXT_make_current_read
- WGLEW_EXT_make_current_read = wglewGetExtension("WGL_EXT_make_current_read");
- if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_make_current_read) = wglewGetExtension("WGL_EXT_make_current_read");
+ if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_make_current_read */
#ifdef WGL_EXT_multisample
- WGLEW_EXT_multisample = wglewGetExtension("WGL_EXT_multisample");
+ CONST_CAST(WGLEW_EXT_multisample) = wglewGetExtension("WGL_EXT_multisample");
#endif /* WGL_EXT_multisample */
#ifdef WGL_EXT_pbuffer
- WGLEW_EXT_pbuffer = wglewGetExtension("WGL_EXT_pbuffer");
- if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_pbuffer) = wglewGetExtension("WGL_EXT_pbuffer");
+ if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_pbuffer */
#ifdef WGL_EXT_pixel_format
- WGLEW_EXT_pixel_format = wglewGetExtension("WGL_EXT_pixel_format");
- if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_pixel_format) = wglewGetExtension("WGL_EXT_pixel_format");
+ if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_pixel_format */
+#ifdef WGL_EXT_pixel_format_packed_float
+ CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = wglewGetExtension("WGL_EXT_pixel_format_packed_float");
+#endif /* WGL_EXT_pixel_format_packed_float */
#ifdef WGL_EXT_swap_control
- WGLEW_EXT_swap_control = wglewGetExtension("WGL_EXT_swap_control");
- if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_EXT_swap_control) = wglewGetExtension("WGL_EXT_swap_control");
+ if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_EXT_swap_control */
#ifdef WGL_I3D_digital_video_control
- WGLEW_I3D_digital_video_control = wglewGetExtension("WGL_I3D_digital_video_control");
- if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_digital_video_control) = wglewGetExtension("WGL_I3D_digital_video_control");
+ if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_digital_video_control */
#ifdef WGL_I3D_gamma
- WGLEW_I3D_gamma = wglewGetExtension("WGL_I3D_gamma");
- if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_gamma) = wglewGetExtension("WGL_I3D_gamma");
+ if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_gamma */
#ifdef WGL_I3D_genlock
- WGLEW_I3D_genlock = wglewGetExtension("WGL_I3D_genlock");
- if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_genlock) = wglewGetExtension("WGL_I3D_genlock");
+ if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_genlock */
#ifdef WGL_I3D_image_buffer
- WGLEW_I3D_image_buffer = wglewGetExtension("WGL_I3D_image_buffer");
- if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_image_buffer) = wglewGetExtension("WGL_I3D_image_buffer");
+ if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_image_buffer */
#ifdef WGL_I3D_swap_frame_lock
- WGLEW_I3D_swap_frame_lock = wglewGetExtension("WGL_I3D_swap_frame_lock");
- if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_swap_frame_lock) = wglewGetExtension("WGL_I3D_swap_frame_lock");
+ if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_swap_frame_lock */
#ifdef WGL_I3D_swap_frame_usage
- WGLEW_I3D_swap_frame_usage = wglewGetExtension("WGL_I3D_swap_frame_usage");
- if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_I3D_swap_frame_usage) = wglewGetExtension("WGL_I3D_swap_frame_usage");
+ if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_I3D_swap_frame_usage */
#ifdef WGL_NV_float_buffer
- WGLEW_NV_float_buffer = wglewGetExtension("WGL_NV_float_buffer");
+ CONST_CAST(WGLEW_NV_float_buffer) = wglewGetExtension("WGL_NV_float_buffer");
#endif /* WGL_NV_float_buffer */
+#ifdef WGL_NV_gpu_affinity
+ CONST_CAST(WGLEW_NV_gpu_affinity) = wglewGetExtension("WGL_NV_gpu_affinity");
+ if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_NV_gpu_affinity */
+#ifdef WGL_NV_present_video
+ CONST_CAST(WGLEW_NV_present_video) = wglewGetExtension("WGL_NV_present_video");
+ if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_NV_present_video */
#ifdef WGL_NV_render_depth_texture
- WGLEW_NV_render_depth_texture = wglewGetExtension("WGL_NV_render_depth_texture");
+ CONST_CAST(WGLEW_NV_render_depth_texture) = wglewGetExtension("WGL_NV_render_depth_texture");
#endif /* WGL_NV_render_depth_texture */
#ifdef WGL_NV_render_texture_rectangle
- WGLEW_NV_render_texture_rectangle = wglewGetExtension("WGL_NV_render_texture_rectangle");
+ CONST_CAST(WGLEW_NV_render_texture_rectangle) = wglewGetExtension("WGL_NV_render_texture_rectangle");
#endif /* WGL_NV_render_texture_rectangle */
+#ifdef WGL_NV_swap_group
+ CONST_CAST(WGLEW_NV_swap_group) = wglewGetExtension("WGL_NV_swap_group");
+ if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_NV_swap_group */
#ifdef WGL_NV_vertex_array_range
- WGLEW_NV_vertex_array_range = wglewGetExtension("WGL_NV_vertex_array_range");
- if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_NV_vertex_array_range) = wglewGetExtension("WGL_NV_vertex_array_range");
+ if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_NV_vertex_array_range */
+#ifdef WGL_NV_video_output
+ CONST_CAST(WGLEW_NV_video_output) = wglewGetExtension("WGL_NV_video_output");
+ if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* WGL_NV_video_output */
#ifdef WGL_OML_sync_control
- WGLEW_OML_sync_control = wglewGetExtension("WGL_OML_sync_control");
- if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(WGLEW_OML_sync_control) = wglewGetExtension("WGL_OML_sync_control");
+ if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* WGL_OML_sync_control */
return GLEW_OK;
@@ -6446,6 +8176,8 @@ PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL;
PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL;
PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL;
+PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL;
+
PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL;
PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL;
PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL;
@@ -6455,6 +8187,9 @@ PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL;
PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL;
PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL;
+PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL;
+PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL;
+
PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL;
PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL;
@@ -6465,9 +8200,26 @@ PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL;
PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL;
+PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL;
+PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL;
+
+PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL;
+PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL;
+PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL;
+PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL;
+PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL;
+PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL;
+
PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL;
PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL;
+PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL;
+PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL;
+PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL;
+PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL;
+PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL;
+PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL;
+
#ifdef GLX_OML_sync_control
PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL;
PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL;
@@ -6483,6 +8235,15 @@ PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL;
PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL;
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL;
+PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL;
+PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL;
+PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL;
+PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL;
+PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL;
+PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL;
+PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL;
+PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL;
+
PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL;
PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL;
PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL;
@@ -6523,13 +8284,18 @@ GLboolean __GLXEW_VERSION_1_2 = GL_FALSE;
GLboolean __GLXEW_VERSION_1_3 = GL_FALSE;
GLboolean __GLXEW_VERSION_1_4 = GL_FALSE;
GLboolean __GLXEW_3DFX_multisample = GL_FALSE;
+GLboolean __GLXEW_ARB_create_context = GL_FALSE;
GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE;
+GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE;
GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE;
GLboolean __GLXEW_ARB_multisample = GL_FALSE;
GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE;
GLboolean __GLXEW_ATI_render_texture = GL_FALSE;
+GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE;
+GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE;
GLboolean __GLXEW_EXT_import_context = GL_FALSE;
GLboolean __GLXEW_EXT_scene_marker = GL_FALSE;
+GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE;
GLboolean __GLXEW_EXT_visual_info = GL_FALSE;
GLboolean __GLXEW_EXT_visual_rating = GL_FALSE;
GLboolean __GLXEW_MESA_agp_offset = GL_FALSE;
@@ -6538,7 +8304,10 @@ GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE;
GLboolean __GLXEW_MESA_release_buffers = GL_FALSE;
GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE;
GLboolean __GLXEW_NV_float_buffer = GL_FALSE;
+GLboolean __GLXEW_NV_present_video = GL_FALSE;
+GLboolean __GLXEW_NV_swap_group = GL_FALSE;
GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE;
+GLboolean __GLXEW_NV_video_output = GL_FALSE;
GLboolean __GLXEW_OML_swap_method = GL_FALSE;
#ifdef GLX_OML_sync_control
GLboolean __GLXEW_OML_sync_control = GL_FALSE;
@@ -6548,6 +8317,7 @@ GLboolean __GLXEW_SGIS_color_range = GL_FALSE;
GLboolean __GLXEW_SGIS_multisample = GL_FALSE;
GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE;
GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE;
+GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE;
GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE;
GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE;
GLboolean __GLXEW_SGIX_swap_group = GL_FALSE;
@@ -6612,10 +8382,27 @@ static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT)
#endif /* GLX_3DFX_multisample */
+#ifdef GLX_ARB_create_context
+
+static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_ARB_create_context */
+
#ifdef GLX_ARB_fbconfig_float
#endif /* GLX_ARB_fbconfig_float */
+#ifdef GLX_ARB_framebuffer_sRGB
+
+#endif /* GLX_ARB_framebuffer_sRGB */
+
#ifdef GLX_ARB_get_proc_address
#endif /* GLX_ARB_get_proc_address */
@@ -6643,6 +8430,14 @@ static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT)
#endif /* GLX_ATI_render_texture */
+#ifdef GLX_EXT_fbconfig_packed_float
+
+#endif /* GLX_EXT_fbconfig_packed_float */
+
+#ifdef GLX_EXT_framebuffer_sRGB
+
+#endif /* GLX_EXT_framebuffer_sRGB */
+
#ifdef GLX_EXT_import_context
static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT)
@@ -6663,6 +8458,20 @@ static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT)
#endif /* GLX_EXT_scene_marker */
+#ifdef GLX_EXT_texture_from_pixmap
+
+static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r;
+ r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_EXT_texture_from_pixmap */
+
#ifdef GLX_EXT_visual_info
#endif /* GLX_EXT_visual_info */
@@ -6740,6 +8549,38 @@ static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT)
#endif /* GLX_NV_float_buffer */
+#ifdef GLX_NV_present_video
+
+static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r;
+ r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_NV_present_video */
+
+#ifdef GLX_NV_swap_group
+
+static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r;
+ r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r;
+ r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r;
+ r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r;
+ r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r;
+ r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_NV_swap_group */
+
#ifdef GLX_NV_vertex_array_range
static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT)
@@ -6754,6 +8595,24 @@ static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT
#endif /* GLX_NV_vertex_array_range */
+#ifdef GLX_NV_video_output
+
+static GLboolean _glewInit_GLX_NV_video_output (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r;
+ r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r;
+ r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r;
+ r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r;
+ r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r;
+ r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_NV_video_output */
+
#ifdef GLX_OML_swap_method
#endif /* GLX_OML_swap_method */
@@ -6810,6 +8669,26 @@ static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT)
#endif /* GLX_SGIX_fbconfig */
+#ifdef GLX_SGIX_hyperpipe
+
+static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT)
+{
+ GLboolean r = GL_FALSE;
+
+ r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r;
+ r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r;
+ r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r;
+ r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r;
+ r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r;
+ r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r;
+ r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r;
+ r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r;
+
+ return r;
+}
+
+#endif /* GLX_SGIX_hyperpipe */
+
#ifdef GLX_SGIX_pbuffer
static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT)
@@ -6984,11 +8863,11 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
/* initialize core GLX 1.2 */
if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
/* initialize flags */
- GLXEW_VERSION_1_0 = GL_TRUE;
- GLXEW_VERSION_1_1 = GL_TRUE;
- GLXEW_VERSION_1_2 = GL_TRUE;
- GLXEW_VERSION_1_3 = GL_TRUE;
- GLXEW_VERSION_1_4 = GL_TRUE;
+ CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE;
+ CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE;
+ CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE;
+ CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE;
+ CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE;
/* query GLX version */
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
if (major == 1 && minor <= 3)
@@ -6996,11 +8875,11 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
switch (minor)
{
case 3:
- GLXEW_VERSION_1_4 = GL_FALSE;
+ CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
break;
case 2:
- GLXEW_VERSION_1_4 = GL_FALSE;
- GLXEW_VERSION_1_3 = GL_FALSE;
+ CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
+ CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE;
break;
default:
return GLEW_ERROR_GLX_VERSION_11_ONLY;
@@ -7009,133 +8888,166 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
}
/* initialize extensions */
#ifdef GLX_VERSION_1_3
- if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
+ if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_VERSION_1_3 */
#ifdef GLX_3DFX_multisample
- GLXEW_3DFX_multisample = glxewGetExtension("GLX_3DFX_multisample");
+ CONST_CAST(GLXEW_3DFX_multisample) = glxewGetExtension("GLX_3DFX_multisample");
#endif /* GLX_3DFX_multisample */
+#ifdef GLX_ARB_create_context
+ CONST_CAST(GLXEW_ARB_create_context) = glxewGetExtension("GLX_ARB_create_context");
+ if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_ARB_create_context */
#ifdef GLX_ARB_fbconfig_float
- GLXEW_ARB_fbconfig_float = glxewGetExtension("GLX_ARB_fbconfig_float");
+ CONST_CAST(GLXEW_ARB_fbconfig_float) = glxewGetExtension("GLX_ARB_fbconfig_float");
#endif /* GLX_ARB_fbconfig_float */
+#ifdef GLX_ARB_framebuffer_sRGB
+ CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = glxewGetExtension("GLX_ARB_framebuffer_sRGB");
+#endif /* GLX_ARB_framebuffer_sRGB */
#ifdef GLX_ARB_get_proc_address
- GLXEW_ARB_get_proc_address = glxewGetExtension("GLX_ARB_get_proc_address");
+ CONST_CAST(GLXEW_ARB_get_proc_address) = glxewGetExtension("GLX_ARB_get_proc_address");
#endif /* GLX_ARB_get_proc_address */
#ifdef GLX_ARB_multisample
- GLXEW_ARB_multisample = glxewGetExtension("GLX_ARB_multisample");
+ CONST_CAST(GLXEW_ARB_multisample) = glxewGetExtension("GLX_ARB_multisample");
#endif /* GLX_ARB_multisample */
#ifdef GLX_ATI_pixel_format_float
- GLXEW_ATI_pixel_format_float = glxewGetExtension("GLX_ATI_pixel_format_float");
+ CONST_CAST(GLXEW_ATI_pixel_format_float) = glxewGetExtension("GLX_ATI_pixel_format_float");
#endif /* GLX_ATI_pixel_format_float */
#ifdef GLX_ATI_render_texture
- GLXEW_ATI_render_texture = glxewGetExtension("GLX_ATI_render_texture");
- if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_ATI_render_texture) = glxewGetExtension("GLX_ATI_render_texture");
+ if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_ATI_render_texture */
+#ifdef GLX_EXT_fbconfig_packed_float
+ CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = glxewGetExtension("GLX_EXT_fbconfig_packed_float");
+#endif /* GLX_EXT_fbconfig_packed_float */
+#ifdef GLX_EXT_framebuffer_sRGB
+ CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = glxewGetExtension("GLX_EXT_framebuffer_sRGB");
+#endif /* GLX_EXT_framebuffer_sRGB */
#ifdef GLX_EXT_import_context
- GLXEW_EXT_import_context = glxewGetExtension("GLX_EXT_import_context");
- if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_EXT_import_context) = glxewGetExtension("GLX_EXT_import_context");
+ if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_EXT_import_context */
#ifdef GLX_EXT_scene_marker
- GLXEW_EXT_scene_marker = glxewGetExtension("GLX_EXT_scene_marker");
+ CONST_CAST(GLXEW_EXT_scene_marker) = glxewGetExtension("GLX_EXT_scene_marker");
#endif /* GLX_EXT_scene_marker */
+#ifdef GLX_EXT_texture_from_pixmap
+ CONST_CAST(GLXEW_EXT_texture_from_pixmap) = glxewGetExtension("GLX_EXT_texture_from_pixmap");
+ if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_EXT_texture_from_pixmap */
#ifdef GLX_EXT_visual_info
- GLXEW_EXT_visual_info = glxewGetExtension("GLX_EXT_visual_info");
+ CONST_CAST(GLXEW_EXT_visual_info) = glxewGetExtension("GLX_EXT_visual_info");
#endif /* GLX_EXT_visual_info */
#ifdef GLX_EXT_visual_rating
- GLXEW_EXT_visual_rating = glxewGetExtension("GLX_EXT_visual_rating");
+ CONST_CAST(GLXEW_EXT_visual_rating) = glxewGetExtension("GLX_EXT_visual_rating");
#endif /* GLX_EXT_visual_rating */
#ifdef GLX_MESA_agp_offset
- GLXEW_MESA_agp_offset = glxewGetExtension("GLX_MESA_agp_offset");
- if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_MESA_agp_offset) = glxewGetExtension("GLX_MESA_agp_offset");
+ if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_MESA_agp_offset */
#ifdef GLX_MESA_copy_sub_buffer
- GLXEW_MESA_copy_sub_buffer = glxewGetExtension("GLX_MESA_copy_sub_buffer");
- if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_MESA_copy_sub_buffer) = glxewGetExtension("GLX_MESA_copy_sub_buffer");
+ if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_MESA_copy_sub_buffer */
#ifdef GLX_MESA_pixmap_colormap
- GLXEW_MESA_pixmap_colormap = glxewGetExtension("GLX_MESA_pixmap_colormap");
- if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_MESA_pixmap_colormap) = glxewGetExtension("GLX_MESA_pixmap_colormap");
+ if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_MESA_pixmap_colormap */
#ifdef GLX_MESA_release_buffers
- GLXEW_MESA_release_buffers = glxewGetExtension("GLX_MESA_release_buffers");
- if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_MESA_release_buffers) = glxewGetExtension("GLX_MESA_release_buffers");
+ if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_MESA_release_buffers */
#ifdef GLX_MESA_set_3dfx_mode
- GLXEW_MESA_set_3dfx_mode = glxewGetExtension("GLX_MESA_set_3dfx_mode");
- if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_MESA_set_3dfx_mode) = glxewGetExtension("GLX_MESA_set_3dfx_mode");
+ if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_MESA_set_3dfx_mode */
#ifdef GLX_NV_float_buffer
- GLXEW_NV_float_buffer = glxewGetExtension("GLX_NV_float_buffer");
+ CONST_CAST(GLXEW_NV_float_buffer) = glxewGetExtension("GLX_NV_float_buffer");
#endif /* GLX_NV_float_buffer */
+#ifdef GLX_NV_present_video
+ CONST_CAST(GLXEW_NV_present_video) = glxewGetExtension("GLX_NV_present_video");
+ if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_NV_present_video */
+#ifdef GLX_NV_swap_group
+ CONST_CAST(GLXEW_NV_swap_group) = glxewGetExtension("GLX_NV_swap_group");
+ if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_NV_swap_group */
#ifdef GLX_NV_vertex_array_range
- GLXEW_NV_vertex_array_range = glxewGetExtension("GLX_NV_vertex_array_range");
- if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_NV_vertex_array_range) = glxewGetExtension("GLX_NV_vertex_array_range");
+ if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_NV_vertex_array_range */
+#ifdef GLX_NV_video_output
+ CONST_CAST(GLXEW_NV_video_output) = glxewGetExtension("GLX_NV_video_output");
+ if (glewExperimental || GLXEW_NV_video_output) CONST_CAST(GLXEW_NV_video_output) = !_glewInit_GLX_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_NV_video_output */
#ifdef GLX_OML_swap_method
- GLXEW_OML_swap_method = glxewGetExtension("GLX_OML_swap_method");
+ CONST_CAST(GLXEW_OML_swap_method) = glxewGetExtension("GLX_OML_swap_method");
#endif /* GLX_OML_swap_method */
#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#include
- GLXEW_OML_sync_control = glxewGetExtension("GLX_OML_sync_control");
- if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_OML_sync_control) = glxewGetExtension("GLX_OML_sync_control");
+ if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_OML_sync_control */
#ifdef GLX_SGIS_blended_overlay
- GLXEW_SGIS_blended_overlay = glxewGetExtension("GLX_SGIS_blended_overlay");
+ CONST_CAST(GLXEW_SGIS_blended_overlay) = glxewGetExtension("GLX_SGIS_blended_overlay");
#endif /* GLX_SGIS_blended_overlay */
#ifdef GLX_SGIS_color_range
- GLXEW_SGIS_color_range = glxewGetExtension("GLX_SGIS_color_range");
+ CONST_CAST(GLXEW_SGIS_color_range) = glxewGetExtension("GLX_SGIS_color_range");
#endif /* GLX_SGIS_color_range */
#ifdef GLX_SGIS_multisample
- GLXEW_SGIS_multisample = glxewGetExtension("GLX_SGIS_multisample");
+ CONST_CAST(GLXEW_SGIS_multisample) = glxewGetExtension("GLX_SGIS_multisample");
#endif /* GLX_SGIS_multisample */
#ifdef GLX_SGIS_shared_multisample
- GLXEW_SGIS_shared_multisample = glxewGetExtension("GLX_SGIS_shared_multisample");
+ CONST_CAST(GLXEW_SGIS_shared_multisample) = glxewGetExtension("GLX_SGIS_shared_multisample");
#endif /* GLX_SGIS_shared_multisample */
#ifdef GLX_SGIX_fbconfig
- GLXEW_SGIX_fbconfig = glxewGetExtension("GLX_SGIX_fbconfig");
- if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGIX_fbconfig) = glxewGetExtension("GLX_SGIX_fbconfig");
+ if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGIX_fbconfig */
+#ifdef GLX_SGIX_hyperpipe
+ CONST_CAST(GLXEW_SGIX_hyperpipe) = glxewGetExtension("GLX_SGIX_hyperpipe");
+ if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT);
+#endif /* GLX_SGIX_hyperpipe */
#ifdef GLX_SGIX_pbuffer
- GLXEW_SGIX_pbuffer = glxewGetExtension("GLX_SGIX_pbuffer");
- if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGIX_pbuffer) = glxewGetExtension("GLX_SGIX_pbuffer");
+ if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGIX_pbuffer */
#ifdef GLX_SGIX_swap_barrier
- GLXEW_SGIX_swap_barrier = glxewGetExtension("GLX_SGIX_swap_barrier");
- if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGIX_swap_barrier) = glxewGetExtension("GLX_SGIX_swap_barrier");
+ if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGIX_swap_barrier */
#ifdef GLX_SGIX_swap_group
- GLXEW_SGIX_swap_group = glxewGetExtension("GLX_SGIX_swap_group");
- if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGIX_swap_group) = glxewGetExtension("GLX_SGIX_swap_group");
+ if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGIX_swap_group */
#ifdef GLX_SGIX_video_resize
- GLXEW_SGIX_video_resize = glxewGetExtension("GLX_SGIX_video_resize");
- if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGIX_video_resize) = glxewGetExtension("GLX_SGIX_video_resize");
+ if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGIX_video_resize */
#ifdef GLX_SGIX_visual_select_group
- GLXEW_SGIX_visual_select_group = glxewGetExtension("GLX_SGIX_visual_select_group");
+ CONST_CAST(GLXEW_SGIX_visual_select_group) = glxewGetExtension("GLX_SGIX_visual_select_group");
#endif /* GLX_SGIX_visual_select_group */
#ifdef GLX_SGI_cushion
- GLXEW_SGI_cushion = glxewGetExtension("GLX_SGI_cushion");
- if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGI_cushion) = glxewGetExtension("GLX_SGI_cushion");
+ if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGI_cushion */
#ifdef GLX_SGI_make_current_read
- GLXEW_SGI_make_current_read = glxewGetExtension("GLX_SGI_make_current_read");
- if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGI_make_current_read) = glxewGetExtension("GLX_SGI_make_current_read");
+ if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGI_make_current_read */
#ifdef GLX_SGI_swap_control
- GLXEW_SGI_swap_control = glxewGetExtension("GLX_SGI_swap_control");
- if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGI_swap_control) = glxewGetExtension("GLX_SGI_swap_control");
+ if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGI_swap_control */
#ifdef GLX_SGI_video_sync
- GLXEW_SGI_video_sync = glxewGetExtension("GLX_SGI_video_sync");
- if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SGI_video_sync) = glxewGetExtension("GLX_SGI_video_sync");
+ if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SGI_video_sync */
#ifdef GLX_SUN_get_transparent_index
- GLXEW_SUN_get_transparent_index = glxewGetExtension("GLX_SUN_get_transparent_index");
- if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SUN_get_transparent_index) = glxewGetExtension("GLX_SUN_get_transparent_index");
+ if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SUN_get_transparent_index */
#ifdef GLX_SUN_video_resize
- GLXEW_SUN_video_resize = glxewGetExtension("GLX_SUN_video_resize");
- if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
+ CONST_CAST(GLXEW_SUN_video_resize) = glxewGetExtension("GLX_SUN_video_resize");
+ if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GLX_SUN_video_resize */
return GLEW_OK;
@@ -7164,7 +9076,10 @@ const GLubyte* glewGetString (GLenum name)
static const GLubyte* _glewString[] =
{
(const GLubyte*)NULL,
- (const GLubyte*)"1.3.4"
+ (const GLubyte*)"1.5.1",
+ (const GLubyte*)"1",
+ (const GLubyte*)"5",
+ (const GLubyte*)"1"
};
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
return _glewString[(int)name > max_string ? 0 : (int)name];
@@ -7245,6 +9160,20 @@ GLboolean glewIsSupported (const char* name)
ret = GLEW_VERSION_2_0;
continue;
}
+#endif
+#ifdef GL_VERSION_2_1
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3))
+ {
+ ret = GLEW_VERSION_2_1;
+ continue;
+ }
+#endif
+#ifdef GL_VERSION_3_0
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3))
+ {
+ ret = GLEW_VERSION_3_0;
+ continue;
+ }
#endif
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5))
@@ -7301,6 +9230,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_APPLE_flush_buffer_range
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18))
+ {
+ ret = GLEW_APPLE_flush_buffer_range;
+ continue;
+ }
+#endif
#ifdef GL_APPLE_pixel_buffer
if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12))
{
@@ -7360,6 +9296,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_depth_buffer_float
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18))
+ {
+ ret = GLEW_ARB_depth_buffer_float;
+ continue;
+ }
+#endif
#ifdef GL_ARB_depth_texture
if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13))
{
@@ -7374,6 +9317,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_draw_instanced
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14))
+ {
+ ret = GLEW_ARB_draw_instanced;
+ continue;
+ }
+#endif
#ifdef GL_ARB_fragment_program
if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16))
{
@@ -7395,6 +9345,27 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_framebuffer_object
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18))
+ {
+ ret = GLEW_ARB_framebuffer_object;
+ continue;
+ }
+#endif
+#ifdef GL_ARB_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = GLEW_ARB_framebuffer_sRGB;
+ continue;
+ }
+#endif
+#ifdef GL_ARB_geometry_shader4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
+ {
+ ret = GLEW_ARB_geometry_shader4;
+ continue;
+ }
+#endif
#ifdef GL_ARB_half_float_pixel
if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16))
{
@@ -7402,6 +9373,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_half_float_vertex
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17))
+ {
+ ret = GLEW_ARB_half_float_vertex;
+ continue;
+ }
+#endif
#ifdef GL_ARB_imaging
if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7))
{
@@ -7409,6 +9387,20 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_instanced_arrays
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16))
+ {
+ ret = GLEW_ARB_instanced_arrays;
+ continue;
+ }
+#endif
+#ifdef GL_ARB_map_buffer_range
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16))
+ {
+ ret = GLEW_ARB_map_buffer_range;
+ continue;
+ }
+#endif
#ifdef GL_ARB_matrix_palette
if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14))
{
@@ -7493,6 +9485,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_texture_buffer_object
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21))
+ {
+ ret = GLEW_ARB_texture_buffer_object;
+ continue;
+ }
+#endif
#ifdef GL_ARB_texture_compression
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19))
{
@@ -7500,6 +9499,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_texture_compression_rgtc
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24))
+ {
+ ret = GLEW_ARB_texture_compression_rgtc;
+ continue;
+ }
+#endif
#ifdef GL_ARB_texture_cube_map
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16))
{
@@ -7563,6 +9569,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_texture_rg
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10))
+ {
+ ret = GLEW_ARB_texture_rg;
+ continue;
+ }
+#endif
#ifdef GL_ARB_transpose_matrix
if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16))
{
@@ -7570,6 +9583,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ARB_vertex_array_object
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19))
+ {
+ ret = GLEW_ARB_vertex_array_object;
+ continue;
+ }
+#endif
#ifdef GL_ARB_vertex_blend
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12))
{
@@ -7688,6 +9708,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_ATI_shader_texture_lod
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18))
+ {
+ ret = GLEW_ATI_shader_texture_lod;
+ continue;
+ }
+#endif
#ifdef GL_ATI_text_fragment_shader
if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20))
{
@@ -7775,6 +9802,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_bindable_uniform
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16))
+ {
+ ret = GLEW_EXT_bindable_uniform;
+ continue;
+ }
+#endif
#ifdef GL_EXT_blend_color
if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11))
{
@@ -7880,6 +9914,27 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_direct_state_access
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19))
+ {
+ ret = GLEW_EXT_direct_state_access;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_draw_buffers2
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13))
+ {
+ ret = GLEW_EXT_draw_buffers2;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_draw_instanced
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14))
+ {
+ ret = GLEW_EXT_draw_instanced;
+ continue;
+ }
+#endif
#ifdef GL_EXT_draw_range_elements
if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19))
{
@@ -7922,6 +9977,34 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = GLEW_EXT_framebuffer_sRGB;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_geometry_shader4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
+ {
+ ret = GLEW_EXT_geometry_shader4;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_gpu_program_parameters
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22))
+ {
+ ret = GLEW_EXT_gpu_program_parameters;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_gpu_shader4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11))
+ {
+ ret = GLEW_EXT_gpu_shader4;
+ continue;
+ }
+#endif
#ifdef GL_EXT_histogram
if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9))
{
@@ -7992,6 +10075,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_packed_float
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12))
+ {
+ ret = GLEW_EXT_packed_float;
+ continue;
+ }
+#endif
#ifdef GL_EXT_packed_pixels
if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13))
{
@@ -8125,6 +10215,20 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_texture_array
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13))
+ {
+ ret = GLEW_EXT_texture_array;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_texture_buffer_object
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21))
+ {
+ ret = GLEW_EXT_texture_buffer_object;
+ continue;
+ }
+#endif
#ifdef GL_EXT_texture_compression_dxt1
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24))
{
@@ -8132,6 +10236,20 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_texture_compression_latc
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24))
+ {
+ ret = GLEW_EXT_texture_compression_latc;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_texture_compression_rgtc
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24))
+ {
+ ret = GLEW_EXT_texture_compression_rgtc;
+ continue;
+ }
+#endif
#ifdef GL_EXT_texture_compression_s3tc
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24))
{
@@ -8188,6 +10306,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_texture_integer
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15))
+ {
+ ret = GLEW_EXT_texture_integer;
+ continue;
+ }
+#endif
#ifdef GL_EXT_texture_lod_bias
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16))
{
@@ -8230,6 +10355,34 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_texture_shared_exponent
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23))
+ {
+ ret = GLEW_EXT_texture_shared_exponent;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_texture_swizzle
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15))
+ {
+ ret = GLEW_EXT_texture_swizzle;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_timer_query
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11))
+ {
+ ret = GLEW_EXT_timer_query;
+ continue;
+ }
+#endif
+#ifdef GL_EXT_transform_feedback
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18))
+ {
+ ret = GLEW_EXT_transform_feedback;
+ continue;
+ }
+#endif
#ifdef GL_EXT_vertex_array
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12))
{
@@ -8237,6 +10390,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_EXT_vertex_array_bgra
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17))
+ {
+ ret = GLEW_EXT_vertex_array_bgra;
+ continue;
+ }
+#endif
#ifdef GL_EXT_vertex_shader
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13))
{
@@ -8254,6 +10414,13 @@ GLboolean glewIsSupported (const char* name)
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8))
{
+#ifdef GL_GREMEDY_frame_terminator
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16))
+ {
+ ret = GLEW_GREMEDY_frame_terminator;
+ continue;
+ }
+#endif
#ifdef GL_GREMEDY_string_marker
if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13))
{
@@ -8432,6 +10599,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_conditional_render
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18))
+ {
+ ret = GLEW_NV_conditional_render;
+ continue;
+ }
+#endif
#ifdef GL_NV_copy_depth_to_color
if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19))
{
@@ -8439,6 +10613,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_depth_buffer_float
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18))
+ {
+ ret = GLEW_NV_depth_buffer_float;
+ continue;
+ }
+#endif
#ifdef GL_NV_depth_clamp
if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11))
{
@@ -8446,6 +10627,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_depth_range_unclamped
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21))
+ {
+ ret = GLEW_NV_depth_range_unclamped;
+ continue;
+ }
+#endif
#ifdef GL_NV_evaluators
if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10))
{
@@ -8453,6 +10641,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_explicit_multisample
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20))
+ {
+ ret = GLEW_NV_explicit_multisample;
+ continue;
+ }
+#endif
#ifdef GL_NV_fence
if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5))
{
@@ -8488,6 +10683,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_fragment_program4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17))
+ {
+ ret = GLEW_NV_fragment_program4;
+ continue;
+ }
+#endif
#ifdef GL_NV_fragment_program_option
if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23))
{
@@ -8495,6 +10697,34 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_framebuffer_multisample_coverage
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32))
+ {
+ ret = GLEW_NV_framebuffer_multisample_coverage;
+ continue;
+ }
+#endif
+#ifdef GL_NV_geometry_program4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17))
+ {
+ ret = GLEW_NV_geometry_program4;
+ continue;
+ }
+#endif
+#ifdef GL_NV_geometry_shader4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
+ {
+ ret = GLEW_NV_geometry_shader4;
+ continue;
+ }
+#endif
+#ifdef GL_NV_gpu_program4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12))
+ {
+ ret = GLEW_NV_gpu_program4;
+ continue;
+ }
+#endif
#ifdef GL_NV_half_float
if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10))
{
@@ -8530,6 +10760,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_parameter_buffer_object
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23))
+ {
+ ret = GLEW_NV_parameter_buffer_object;
+ continue;
+ }
+#endif
#ifdef GL_NV_pixel_data_range
if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16))
{
@@ -8544,6 +10781,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_present_video
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
+ {
+ ret = GLEW_NV_present_video;
+ continue;
+ }
+#endif
#ifdef GL_NV_primitive_restart
if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17))
{
@@ -8628,6 +10872,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_NV_transform_feedback
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18))
+ {
+ ret = GLEW_NV_transform_feedback;
+ continue;
+ }
+#endif
#ifdef GL_NV_vertex_array_range
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
{
@@ -8676,6 +10927,44 @@ GLboolean glewIsSupported (const char* name)
ret = GLEW_NV_vertex_program3;
continue;
}
+#endif
+#ifdef GL_NV_vertex_program4
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15))
+ {
+ ret = GLEW_NV_vertex_program4;
+ continue;
+ }
+#endif
+ }
+ if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4))
+ {
+#ifdef GL_OES_byte_coordinates
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16))
+ {
+ ret = GLEW_OES_byte_coordinates;
+ continue;
+ }
+#endif
+#ifdef GL_OES_compressed_paletted_texture
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27))
+ {
+ ret = GLEW_OES_compressed_paletted_texture;
+ continue;
+ }
+#endif
+#ifdef GL_OES_read_format
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11))
+ {
+ ret = GLEW_OES_read_format;
+ continue;
+ }
+#endif
+#ifdef GL_OES_single_precision
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16))
+ {
+ ret = GLEW_OES_single_precision;
+ continue;
+ }
#endif
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
@@ -8783,6 +11072,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_SGIS_point_line_texgen
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17))
+ {
+ ret = GLEW_SGIS_point_line_texgen;
+ continue;
+ }
+#endif
#ifdef GL_SGIS_sharpen_texture
if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15))
{
@@ -8870,6 +11166,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GL_SGIX_convolution_accuracy
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20))
+ {
+ ret = GLEW_SGIX_convolution_accuracy;
+ continue;
+ }
+#endif
#ifdef GL_SGIX_depth_texture
if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13))
{
@@ -9213,6 +11516,13 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_ARB_create_context
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14))
+ {
+ ret = WGLEW_ARB_create_context;
+ continue;
+ }
+#endif
#ifdef WGL_ARB_extensions_string
if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17))
{
@@ -9220,6 +11530,13 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_ARB_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = WGLEW_ARB_framebuffer_sRGB;
+ continue;
+ }
+#endif
#ifdef WGL_ARB_make_current_read
if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17))
{
@@ -9303,6 +11620,13 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_EXT_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = WGLEW_EXT_framebuffer_sRGB;
+ continue;
+ }
+#endif
#ifdef WGL_EXT_make_current_read
if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17))
{
@@ -9331,6 +11655,13 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_EXT_pixel_format_packed_float
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25))
+ {
+ ret = WGLEW_EXT_pixel_format_packed_float;
+ continue;
+ }
+#endif
#ifdef WGL_EXT_swap_control
if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12))
{
@@ -9393,6 +11724,20 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_NV_gpu_affinity
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12))
+ {
+ ret = WGLEW_NV_gpu_affinity;
+ continue;
+ }
+#endif
+#ifdef WGL_NV_present_video
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
+ {
+ ret = WGLEW_NV_present_video;
+ continue;
+ }
+#endif
#ifdef WGL_NV_render_depth_texture
if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20))
{
@@ -9407,12 +11752,26 @@ GLboolean wglewIsSupported (const char* name)
continue;
}
#endif
+#ifdef WGL_NV_swap_group
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10))
+ {
+ ret = WGLEW_NV_swap_group;
+ continue;
+ }
+#endif
#ifdef WGL_NV_vertex_array_range
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
{
ret = WGLEW_NV_vertex_array_range;
continue;
}
+#endif
+#ifdef WGL_NV_video_output
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12))
+ {
+ ret = WGLEW_NV_video_output;
+ continue;
+ }
#endif
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
@@ -9482,6 +11841,13 @@ GLboolean glxewIsSupported (const char* name)
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4))
{
+#ifdef GLX_ARB_create_context
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14))
+ {
+ ret = GLXEW_ARB_create_context;
+ continue;
+ }
+#endif
#ifdef GLX_ARB_fbconfig_float
if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14))
{
@@ -9489,6 +11855,13 @@ GLboolean glxewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GLX_ARB_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = GLXEW_ARB_framebuffer_sRGB;
+ continue;
+ }
+#endif
#ifdef GLX_ARB_get_proc_address
if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16))
{
@@ -9523,6 +11896,20 @@ GLboolean glxewIsSupported (const char* name)
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4))
{
+#ifdef GLX_EXT_fbconfig_packed_float
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21))
+ {
+ ret = GLXEW_EXT_fbconfig_packed_float;
+ continue;
+ }
+#endif
+#ifdef GLX_EXT_framebuffer_sRGB
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
+ {
+ ret = GLXEW_EXT_framebuffer_sRGB;
+ continue;
+ }
+#endif
#ifdef GLX_EXT_import_context
if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14))
{
@@ -9537,6 +11924,13 @@ GLboolean glxewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GLX_EXT_texture_from_pixmap
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19))
+ {
+ ret = GLXEW_EXT_texture_from_pixmap;
+ continue;
+ }
+#endif
#ifdef GLX_EXT_visual_info
if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11))
{
@@ -9599,12 +11993,33 @@ GLboolean glxewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GLX_NV_present_video
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
+ {
+ ret = GLXEW_NV_present_video;
+ continue;
+ }
+#endif
+#ifdef GLX_NV_swap_group
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10))
+ {
+ ret = GLXEW_NV_swap_group;
+ continue;
+ }
+#endif
#ifdef GLX_NV_vertex_array_range
if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
{
ret = GLXEW_NV_vertex_array_range;
continue;
}
+#endif
+#ifdef GLX_NV_video_output
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12))
+ {
+ ret = GLXEW_NV_video_output;
+ continue;
+ }
#endif
}
if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
@@ -9665,6 +12080,13 @@ GLboolean glxewIsSupported (const char* name)
continue;
}
#endif
+#ifdef GLX_SGIX_hyperpipe
+ if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9))
+ {
+ ret = GLXEW_SGIX_hyperpipe;
+ continue;
+ }
+#endif
#ifdef GLX_SGIX_pbuffer
if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7))
{
diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj
index 93dcdd66628..7c72ef70f06 100644
--- a/intern/audaspace/make/msvc_9_0/audaspace.vcproj
+++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj
@@ -341,6 +341,10 @@
RelativePath="..\..\intern\AUD_C-API.cpp"
>
+
+
@@ -758,10 +762,6 @@
>
-
-
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index bd812177f17..d4788ae9e86 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -406,6 +406,17 @@ extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
GHOST_TButtonMask mask,
int* isDown);
+
+/***************************************************************************************
+ ** Drag'n'drop operations
+ ***************************************************************************************/
+
+/**
+ * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
+ */
+extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept);
+
+
/**
* Returns the event type.
* @param eventhandle The handle to the event
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 08794dfd085..305caa70ae4 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -351,6 +351,11 @@ public:
*/
virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool& isDown) const = 0;
+
+ /***************************************************************************************
+ ** Access to clipboard.
+ ***************************************************************************************/
+
/**
* Returns the selection buffer
* @return Returns "unsinged char" from X11 XA_CUT_BUFFER0 buffer
@@ -363,6 +368,7 @@ public:
*/
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
+
protected:
/**
* Initialize the system.
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index 512fad877cb..5d1e0a67e7e 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -148,6 +148,17 @@ public:
*/
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0;
+ /**
+ * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
+ */
+ virtual void setAcceptDragOperation(bool canAccept) = 0;
+
+ /**
+ * Returns acceptance of the dropped object
+ * Usually called by the "object dropped" event handling function
+ */
+ virtual bool canAcceptDragOperation() const = 0;
+
/**
* Returns the state of the window (normal, minimized, maximized).
* @return The state of the window.
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index e98e58740ad..5c888e218d8 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -167,6 +167,12 @@ typedef enum {
GHOST_kEventWindowUpdate,
GHOST_kEventWindowSize,
GHOST_kEventWindowMove,
+
+ GHOST_kEventDraggingEntered,
+ GHOST_kEventDraggingUpdated,
+ GHOST_kEventDraggingExited,
+ GHOST_kEventDraggingDropDone,
+ GHOST_kEventDraggingDropOnIcon,
GHOST_kEventTimer,
@@ -368,6 +374,30 @@ typedef struct {
} GHOST_TEventWheelData;
+typedef enum {
+ GHOST_kDragnDropTypeUnknown =0,
+ GHOST_kDragnDropTypeFilenames, /*Array of strings representing file names (full path) */
+ GHOST_kDragnDropTypeString, /* Unformatted text UTF-8 string */
+ GHOST_kDragnDropTypeBitmap /*Bitmap image data */
+} GHOST_TDragnDropTypes;
+
+typedef struct {
+ /** The x-coordinate of the cursor position. */
+ GHOST_TInt32 x;
+ /** The y-coordinate of the cursor position. */
+ GHOST_TInt32 y;
+ /** The dropped item type */
+ GHOST_TDragnDropTypes dataType;
+ /** The "dropped content" */
+ GHOST_TEventDataPtr data;
+} GHOST_TEventDragnDropData;
+
+typedef struct {
+ int count;
+ GHOST_TUns8 **strings;
+} GHOST_TStringArray;
+
+
/* original patch used floats, but the driver return ints and uns. We will calibrate in view, no sense on doing conversions twice */
/* as all USB device controls are likely to use ints, this is also more future proof */
//typedef struct {
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 0160df552cc..556176809f4 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -404,6 +404,13 @@ GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
}
+void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept)
+{
+ GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;
+
+ window->setAcceptDragOperation(canAccept);
+}
+
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
{
diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
index f105928c9a3..99b2991df0d 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
+++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
@@ -155,11 +155,11 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(GHOST_TUns8 d
NULL);*/
#ifdef GHOST_DEBUG
- printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
+/* printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
printf(" setting.xPixels=%d\n", getValue(displayModeValues, kCGDisplayWidth));
printf(" setting.yPixels=%d\n", getValue(displayModeValues, kCGDisplayHeight));
printf(" setting.bpp=%d\n", getValue(displayModeValues, kCGDisplayBitsPerPixel));
- printf(" setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate));
+ printf(" setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate)); */
#endif // GHOST_DEBUG
//CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
diff --git a/intern/ghost/intern/GHOST_EventDragnDrop.h b/intern/ghost/intern/GHOST_EventDragnDrop.h
new file mode 100644
index 00000000000..85c18efb118
--- /dev/null
+++ b/intern/ghost/intern/GHOST_EventDragnDrop.h
@@ -0,0 +1,122 @@
+/**
+ * $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): Damien Plisson 11/2009
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef _GHOST_EVENT_DRAGNDROP_H_
+#define _GHOST_EVENT_DRAGNDROP_H_
+
+#include "GHOST_Event.h"
+
+/**
+ * Drag & drop event
+ *
+ * The dragging sequence is performed in four phases:
+ *
+ * Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type,
+ * and the entering mouse location
+ *
+ * Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position.
+ * Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at
+ * the current cursor position.
+ *
+ * Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.
+ *
+ * Send the dropped data (GHOST_kEventDraggingDropDone)
+ *
+ * Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object
+ * on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
+ *
+ *
Note that the mouse positions are given in Blender coordinates (y=0 at bottom)
+ *
+ *
Currently supported object types :
+ * UTF-8 string
+ * array of strings representing filenames (GHOST_TStringArray)
+ * bitmap image
+ */
+class GHOST_EventDragnDrop : public GHOST_Event
+{
+public:
+ /**
+ * Constructor.
+ * @param time The time this event was generated.
+ * @param type The type of this event.
+ * @param dataType The type of the drop candidate object
+ * @param window The window where the event occured
+ * @param x The x-coordinate of the location the cursor was at at the time of the event.
+ * @param y The y-coordinate of the location the cursor was at at the time of the event.
+ * @param data The "content" dropped in the window
+ */
+ GHOST_EventDragnDrop(GHOST_TUns64 time, GHOST_TEventType type, GHOST_TDragnDropTypes dataType, GHOST_IWindow* window,
+ int x, int y, GHOST_TEventDataPtr data)
+ : GHOST_Event(time, type, window)
+ {
+ m_dragnDropEventData.x = x;
+ m_dragnDropEventData.y = y;
+ m_dragnDropEventData.dataType = dataType;
+ m_dragnDropEventData.data = data;
+ m_data = &m_dragnDropEventData;
+ }
+
+ ~GHOST_EventDragnDrop()
+ {
+ //Free the dropped object data
+ if (m_dragnDropEventData.data == NULL)
+ return;
+
+ switch (m_dragnDropEventData.dataType) {
+ case GHOST_kDragnDropTypeBitmap:
+ //Not currently implemented
+ break;
+ case GHOST_kDragnDropTypeFilenames:
+ {
+ GHOST_TStringArray *strArray = (GHOST_TStringArray*)m_dragnDropEventData.data;
+ int i;
+
+ for (i=0;icount;i++)
+ free(strArray->strings[i]);
+
+ free(strArray);
+ }
+ break;
+ case GHOST_kDragnDropTypeString:
+ free(m_dragnDropEventData.data);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+
+protected:
+ /** The x,y-coordinates of the cursor position. */
+ GHOST_TEventDragnDropData m_dragnDropEventData;
+};
+
+#endif // _GHOST_EVENT_DRAGNDROP_H_
+
diff --git a/intern/ghost/intern/GHOST_EventPrinter.cpp b/intern/ghost/intern/GHOST_EventPrinter.cpp
index b4f5cc96083..c6b3416669e 100644
--- a/intern/ghost/intern/GHOST_EventPrinter.cpp
+++ b/intern/ghost/intern/GHOST_EventPrinter.cpp
@@ -33,6 +33,7 @@
#include "GHOST_EventPrinter.h"
#include
#include "GHOST_EventKey.h"
+#include "GHOST_EventDragnDrop.h"
#include "GHOST_Debug.h"
#ifdef HAVE_CONFIG_H
@@ -97,7 +98,77 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent* event)
std::cout << "GHOST_kEventKeyDown, key: " << str.Ptr();
}
break;
+
+ case GHOST_kEventDraggingEntered:
+ {
+ GHOST_TEventDragnDropData* dragnDropData = (GHOST_TEventDragnDropData*)((GHOST_IEvent*)event)->getData();
+ std::cout << "GHOST_kEventDraggingEntered, dragged object type : " << dragnDropData->dataType;
+ std::cout << " mouse at x=" << dragnDropData->x << " y=" << dragnDropData->y;
+ }
+ break;
+
+ case GHOST_kEventDraggingUpdated:
+ {
+ GHOST_TEventDragnDropData* dragnDropData = (GHOST_TEventDragnDropData*)((GHOST_IEvent*)event)->getData();
+ std::cout << "GHOST_kEventDraggingUpdated, dragged object type : " << dragnDropData->dataType;
+ std::cout << " mouse at x=" << dragnDropData->x << " y=" << dragnDropData->y;
+ }
+ break;
+ case GHOST_kEventDraggingExited:
+ {
+ GHOST_TEventDragnDropData* dragnDropData = (GHOST_TEventDragnDropData*)((GHOST_IEvent*)event)->getData();
+ std::cout << "GHOST_kEventDraggingExited, dragged object type : " << dragnDropData->dataType;
+ }
+ break;
+
+ case GHOST_kEventDraggingDropDone:
+ {
+ GHOST_TEventDragnDropData* dragnDropData = (GHOST_TEventDragnDropData*)((GHOST_IEvent*)event)->getData();
+ std::cout << "GHOST_kEventDraggingDropDone, dragged object type : " << dragnDropData->dataType;
+ std::cout << " mouse at x=" << dragnDropData->x << " y=" << dragnDropData->y;
+ 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;icount;i++)
+ std::cout << " Filename #" << i << ": " << strArray->strings[i];
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+
+ case GHOST_kEventDraggingDropOnIcon:
+ {
+ 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;icount;i++)
+ std::cout << " Filename #" << i << ": " << strArray->strings[i];
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+
case GHOST_kEventQuit:
std::cout << "GHOST_kEventQuit";
break;
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 84298d3e3ff..79d8389ffc6 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -275,7 +275,6 @@ GHOST_TSuccess GHOST_System::getButtonState(GHOST_TButtonMask mask, bool& isDown
return success;
}
-
GHOST_TSuccess GHOST_System::init()
{
m_timerManager = new GHOST_TimerManager ();
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 066fe4b93d3..e381b673957 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -231,7 +231,7 @@ public:
* @return Indication of success.
*/
virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool& isDown) const;
-
+
/***************************************************************************************
** Other (internal) functionality.
***************************************************************************************/
@@ -332,7 +332,7 @@ protected:
/** The N-degree of freedom device manager */
GHOST_NDOFManager* m_ndofManager;
-
+
/** Prints all the events. */
#ifdef GHOST_DEBUG
GHOST_EventPrinter* m_eventPrinter;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index e880f851267..684f028a833 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -194,11 +194,25 @@ public:
/**
* Handles a window event. Called by GHOST_WindowCocoa window delegate
- * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
+ * @param eventType The type of window event
+ * @param window The window on which the event occured
* @return Indication whether the event was handled.
*/
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
+
+ /**
+ * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
+ * @param eventType The type of drag'n'drop event
+ * @param draggedObjectType The type object concerned (currently array of file names, string, TIFF image)
+ * @param mouseX x mouse coordinate (in cocoa base window coordinates)
+ * @param mouseY y mouse coordinate
+ * @param window The window on which the event occured
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
+ GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data);
+
protected:
/**
* Initializes the system.
@@ -232,6 +246,9 @@ protected:
/** Start time at initialization. */
GHOST_TUns64 m_start_time;
+ /** Event has been processed directly by Cocoa and has sent a ghost event to be dispatched */
+ bool m_outsideLoopEventProcessed;
+
/** Mouse buttons state */
GHOST_TUns32 m_pressedMouseButtons;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 73be363dff1..86203a49da7 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -41,6 +41,7 @@
#include "GHOST_EventCursor.h"
#include "GHOST_EventWheel.h"
#include "GHOST_EventNDOF.h"
+#include "GHOST_EventDragnDrop.h"
#include "GHOST_TimerManager.h"
#include "GHOST_TimerTask.h"
@@ -413,6 +414,7 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) {
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
NSLog(@"\nGet open file event from cocoa : %@",filename);
+ systemCocoa->handleDraggingEvent(GHOST_kEventDraggingDropOnIcon, GHOST_kDragnDropTypeFilenames, nil, 0, 0, [NSArray arrayWithObject:filename]);
return YES;
}
@@ -447,12 +449,12 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
m_pressedMouseButtons =0;
m_cursorDelta_x=0;
m_cursorDelta_y=0;
+ m_outsideLoopEventProcessed = false;
m_displayManager = new GHOST_DisplayManagerCocoa ();
GHOST_ASSERT(m_displayManager, "GHOST_SystemCocoa::GHOST_SystemCocoa(): m_displayManager==0\n");
m_displayManager->initialize();
//NSEvent timeStamp is given in system uptime, state start date is boot time
- //FIXME : replace by Cocoa equivalent
int mib[2];
struct timeval boottime;
size_t len;
@@ -558,17 +560,13 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
GHOST_TUns64 GHOST_SystemCocoa::getMilliSeconds() const
{
//Cocoa equivalent exists in 10.6 ([[NSProcessInfo processInfo] systemUptime])
- int mib[2];
- struct timeval boottime;
- size_t len;
+ struct timeval currentTime;
- mib[0] = CTL_KERN;
- mib[1] = KERN_BOOTTIME;
- len = sizeof(struct timeval);
+ gettimeofday(¤tTime, NULL);
- sysctl(mib, 2, &boottime, &len, NULL, 0);
-
- return ((boottime.tv_sec*1000)+(boottime.tv_usec/1000));
+ //Return timestamp of system uptime
+
+ return ((currentTime.tv_sec*1000)+(currentTime.tv_usec/1000)-m_start_time);
}
@@ -742,6 +740,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
bool anyProcessed = false;
NSEvent *event;
+ m_outsideLoopEventProcessed = false;
+
// SetMouseCoalescingEnabled(false, NULL);
//TODO : implement timer ??
@@ -840,7 +840,7 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
- return anyProcessed;
+ return anyProcessed || m_outsideLoopEventProcessed;
}
//Note: called from NSWindow delegate
@@ -877,9 +877,108 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
return GHOST_kFailure;
break;
}
+
+ m_outsideLoopEventProcessed = true;
return GHOST_kSuccess;
}
+//Note: called from NSWindow subclass
+GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
+ GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data)
+{
+ if (!validWindow(window)) {
+ return GHOST_kFailure;
+ }
+ switch(eventType)
+ {
+ case GHOST_kEventDraggingEntered:
+ case GHOST_kEventDraggingUpdated:
+ case GHOST_kEventDraggingExited:
+ pushEvent(new GHOST_EventDragnDrop(getMilliSeconds(),eventType,draggedObjectType,window,mouseX,mouseY,NULL));
+ break;
+
+ case GHOST_kEventDraggingDropDone:
+ case GHOST_kEventDraggingDropOnIcon:
+ {
+ GHOST_TUns8 * temp_buff;
+ GHOST_TStringArray *strArray;
+ NSArray *droppedArray;
+ size_t pastedTextSize;
+ NSString *droppedStr;
+ GHOST_TEventDataPtr eventData;
+ int i;
+
+ 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;
+
+ strArray = (GHOST_TStringArray*)malloc(sizeof(GHOST_TStringArray));
+ if (!strArray) return GHOST_kFailure;
+
+ strArray->count = [droppedArray count];
+ if (strArray->count == 0) return GHOST_kFailure;
+
+ strArray->strings = (GHOST_TUns8**) malloc(strArray->count*sizeof(GHOST_TUns8*));
+
+ for (i=0;icount;i++)
+ {
+ droppedStr = [droppedArray objectAtIndex:i];
+
+ pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+ temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
+
+ if (!temp_buff) {
+ strArray->count = i;
+ break;
+ }
+
+ strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+ temp_buff[pastedTextSize] = '\0';
+
+ strArray->strings[i] = temp_buff;
+ }
+
+ eventData = (GHOST_TEventDataPtr) strArray;
+ break;
+
+ case GHOST_kDragnDropTypeString:
+ droppedStr = (NSString*)data;
+ pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
+
+ temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
+
+ if (temp_buff == NULL) {
+ return GHOST_kFailure;
+ }
+
+ strncpy((char*)temp_buff, [droppedStr cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
+
+ temp_buff[pastedTextSize] = '\0';
+
+ eventData = (GHOST_TEventDataPtr) temp_buff;
+ break;
+
+ default:
+ return GHOST_kFailure;
+ break;
+ }
+ pushEvent(new GHOST_EventDragnDrop(getMilliSeconds(),eventType,draggedObjectType,window,mouseX,mouseY,eventData));
+ }
+ break;
+ default:
+ return GHOST_kFailure;
+ }
+ m_outsideLoopEventProcessed = true;
+ return GHOST_kSuccess;
+}
+
+
GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
{
GHOST_Window* window = (GHOST_Window*)m_windowManager->getActiveWindow();
@@ -908,6 +1007,7 @@ GHOST_TUns8 GHOST_SystemCocoa::handleQuitRequest()
}
else {
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventQuit, NULL) );
+ m_outsideLoopEventProcessed = true;
return GHOST_kExitNow;
}
@@ -980,7 +1080,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
- pushEvent(new GHOST_EventButton([event timestamp], GHOST_kEventButtonDown, window, convertButton([event buttonNumber])));
+ pushEvent(new GHOST_EventButton([event timestamp]*1000, GHOST_kEventButtonDown, window, convertButton([event buttonNumber])));
//Handle tablet events combined with mouse events
switch ([event subtype]) {
case NX_SUBTYPE_TABLET_POINT:
@@ -998,7 +1098,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSLeftMouseUp:
case NSRightMouseUp:
case NSOtherMouseUp:
- pushEvent(new GHOST_EventButton([event timestamp], GHOST_kEventButtonUp, window, convertButton([event buttonNumber])));
+ pushEvent(new GHOST_EventButton([event timestamp]*1000, GHOST_kEventButtonUp, window, convertButton([event buttonNumber])));
//Handle tablet events combined with mouse events
switch ([event subtype]) {
case NX_SUBTYPE_TABLET_POINT:
@@ -1042,7 +1142,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
y_accum += -[event deltaY]; //Strange Apple implementation (inverted coordinates for the deltaY) ...
window->setCursorGrabAccum(x_accum, y_accum);
- pushEvent(new GHOST_EventCursor([event timestamp], GHOST_kEventCursorMove, window, x_warp+x_accum, y_warp+y_accum));
+ pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_warp+x_accum, y_warp+y_accum));
}
break;
case GHOST_kGrabWrap: //Wrap cursor at area/window boundaries
@@ -1086,14 +1186,14 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
//Post event
window->getCursorGrabInitPos(x_cur, y_cur);
- pushEvent(new GHOST_EventCursor([event timestamp], GHOST_kEventCursorMove, window, x_cur + x_accum, y_cur + y_accum));
+ pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, x_cur + x_accum, y_cur + y_accum));
}
break;
default:
{
//Normal cursor operation: send mouse position in window
NSPoint mousePos = [event locationInWindow];
- pushEvent(new GHOST_EventCursor([event timestamp], GHOST_kEventCursorMove, window, mousePos.x, mousePos.y));
+ pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, mousePos.x, mousePos.y));
m_cursorDelta_x=0;
m_cursorDelta_y=0; //Mouse motion occured between two cursor warps, so we can reset the delta counter
}
@@ -1109,7 +1209,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
if (deltaF == 0.0) break; //discard trackpad delta=0 events
delta = deltaF > 0.0 ? 1 : -1;
- pushEvent(new GHOST_EventWheel([event timestamp], window, delta));
+ pushEvent(new GHOST_EventWheel([event timestamp]*1000, window, delta));
}
break;
@@ -1168,26 +1268,26 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
break; //Cmd-Q is directly handled by Cocoa
if ([event type] == NSKeyDown) {
- pushEvent( new GHOST_EventKey([event timestamp], GHOST_kEventKeyDown, window, keyCode, ascii) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) );
//printf("\nKey pressed keyCode=%u ascii=%i %c",keyCode,ascii,ascii);
} else {
- pushEvent( new GHOST_EventKey([event timestamp], GHOST_kEventKeyUp, window, keyCode, ascii) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) );
}
break;
case NSFlagsChanged:
modifiers = [event modifierFlags];
if ((modifiers & NSShiftKeyMask) != (m_modifierMask & NSShiftKeyMask)) {
- pushEvent( new GHOST_EventKey([event timestamp], (modifiers & NSShiftKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSShiftKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftShift) );
}
if ((modifiers & NSControlKeyMask) != (m_modifierMask & NSControlKeyMask)) {
- pushEvent( new GHOST_EventKey([event timestamp], (modifiers & NSControlKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSControlKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftControl) );
}
if ((modifiers & NSAlternateKeyMask) != (m_modifierMask & NSAlternateKeyMask)) {
- pushEvent( new GHOST_EventKey([event timestamp], (modifiers & NSAlternateKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSAlternateKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt) );
}
if ((modifiers & NSCommandKeyMask) != (m_modifierMask & NSCommandKeyMask)) {
- pushEvent( new GHOST_EventKey([event timestamp], (modifiers & NSCommandKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyCommand) );
+ pushEvent( new GHOST_EventKey([event timestamp]*1000, (modifiers & NSCommandKeyMask)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyCommand) );
}
m_modifierMask = modifiers;
@@ -1220,7 +1320,7 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const
}
NSArray *supportedTypes =
- [NSArray arrayWithObjects: @"public.utf8-plain-text", nil];
+ [NSArray arrayWithObjects: NSStringPboardType, nil];
NSString *bestType = [[NSPasteboard generalPasteboard]
availableTypeFromArray:supportedTypes];
@@ -1230,14 +1330,14 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const
return NULL;
}
- NSString * textPasted = [pasteBoard stringForType:@"public.utf8-plain-text"];
+ NSString * textPasted = [pasteBoard stringForType:NSStringPboardType];
if (textPasted == nil) {
[pool drain];
return NULL;
}
- pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSISOLatin1StringEncoding];
temp_buff = (GHOST_TUns8*) malloc(pastedTextSize+1);
@@ -1246,7 +1346,7 @@ GHOST_TUns8* GHOST_SystemCocoa::getClipboard(bool selection) const
return NULL;
}
- strncpy((char*)temp_buff, [textPasted UTF8String], pastedTextSize);
+ strncpy((char*)temp_buff, [textPasted cStringUsingEncoding:NSISOLatin1StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0';
@@ -1274,13 +1374,13 @@ void GHOST_SystemCocoa::putClipboard(GHOST_TInt8 *buffer, bool selection) const
return;
}
- NSArray *supportedTypes = [NSArray arrayWithObject:@"public.utf8-plain-text"];
+ NSArray *supportedTypes = [NSArray arrayWithObject:NSStringPboardType];
[pasteBoard declareTypes:supportedTypes owner:nil];
- textToCopy = [NSString stringWithUTF8String:buffer];
+ textToCopy = [NSString stringWithCString:buffer encoding:NSISOLatin1StringEncoding];
- [pasteBoard setString:textToCopy forType:@"public.utf8-plain-text"];
+ [pasteBoard setString:textToCopy forType:NSStringPboardType];
[pool drain];
}
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index ff4a5956a12..3f5f52aa2ed 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -23,6 +23,9 @@
*
* Contributor(s): none yet.
*
+ * Part of this code has been taken from Qt, under LGPL license
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
* ***** END GPL LICENSE BLOCK *****
*/
@@ -126,6 +129,8 @@ GHOST_SystemX11(
m_xclip_out= XInternAtom(m_display, "XCLIP_OUT", False);
m_incr= XInternAtom(m_display, "INCR", False);
m_utf8_string= XInternAtom(m_display, "UTF8_STRING", False);
+ m_last_warp = 0;
+
// compute the initial time
timeval tv;
@@ -310,6 +315,61 @@ static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep) {
}
}
+/* This function borrowed from Qt's X11 support
+ * qclipboard_x11.cpp
+ * */
+struct init_timestamp_data
+{
+ Time timestamp;
+};
+
+static Bool init_timestamp_scanner(Display*, XEvent *event, XPointer arg)
+{
+ init_timestamp_data *data =
+ reinterpret_cast(arg);
+ switch(event->type)
+ {
+ case ButtonPress:
+ case ButtonRelease:
+ data->timestamp = event->xbutton.time;
+ break;
+ case MotionNotify:
+ data->timestamp = event->xmotion.time;
+ break;
+ case KeyPress:
+ case KeyRelease:
+ data->timestamp = event->xkey.time;
+ break;
+ case PropertyNotify:
+ data->timestamp = event->xproperty.time;
+ break;
+ case EnterNotify:
+ case LeaveNotify:
+ data->timestamp = event->xcrossing.time;
+ break;
+ case SelectionClear:
+ data->timestamp = event->xselectionclear.time;
+ break;
+ default:
+ break;
+ }
+
+ return false;
+}
+
+Time
+GHOST_SystemX11::
+lastEventTime(Time default_time) {
+ init_timestamp_data data;
+ data.timestamp = default_time;
+ XEvent ev;
+ XCheckIfEvent(m_display, &ev, &init_timestamp_scanner, (XPointer)&data);
+
+ return data.timestamp;
+}
+
+
+
bool
GHOST_SystemX11::
processEvents(
@@ -405,10 +465,15 @@ GHOST_SystemX11::processEvent(XEvent *xe)
window->getCursorGrabAccum(x_accum, y_accum);
if(x_new != xme.x_root || y_new != xme.y_root) {
- /* when wrapping we don't need to add an event because the
- * setCursorPosition call will cause a new event after */
- setCursorPosition(x_new, y_new); /* wrap */
- window->setCursorGrabAccum(x_accum + (xme.x_root - x_new), y_accum + (xme.y_root - y_new));
+ if (xme.time > m_last_warp) {
+ /* when wrapping we don't need to add an event because the
+ * setCursorPosition call will cause a new event after */
+ setCursorPosition(x_new, y_new); /* wrap */
+ window->setCursorGrabAccum(x_accum + (xme.x_root - x_new), y_accum + (xme.y_root - y_new));
+ m_last_warp = lastEventTime(xme.time);
+ } else {
+ setCursorPosition(x_new, y_new); /* wrap but don't accumulate */
+ }
}
else {
g_event = new
@@ -907,7 +972,7 @@ setCursorPosition(
int rely = y-cy;
XWarpPointer(m_display,None,None,0,0,0,0,relx,rely);
- XFlush(m_display);
+ XSync(m_display, 0); /* Sync to process all requests */
return GHOST_kSuccess;
}
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 782f08f6737..d76c3991beb 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -266,6 +266,10 @@ private :
/// A vector of keyboard key masks
char m_keyboard_vector[32];
+ /* to prevent multiple warp, we store the time of the last warp event
+ * and stop accumulating all events generated before that */
+ Time m_last_warp;
+
/**
* Return the ghost window associated with the
* X11 window xwind
@@ -281,6 +285,11 @@ private :
XEvent *xe
);
+ Time
+ lastEventTime(
+ Time default_time
+ );
+
bool
generateWindowExposeEvents(
);
diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp
index 33484284d7c..14a255e2e5e 100644
--- a/intern/ghost/intern/GHOST_Window.cpp
+++ b/intern/ghost/intern/GHOST_Window.cpp
@@ -53,6 +53,7 @@ GHOST_Window::GHOST_Window(
m_stereoVisual(stereoVisual)
{
m_isUnsavedChanges = false;
+ m_canAcceptDragOperation = false;
m_cursorGrabAccumPos[0] = 0;
m_cursorGrabAccumPos[1] = 0;
@@ -108,6 +109,8 @@ GHOST_TSuccess GHOST_Window::setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rec
m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1;
else if (bounds) {
m_cursorGrabBounds= *bounds;
+ } else { /* if bounds not defined, use window */
+ getClientBounds(m_cursorGrabBounds);
}
m_cursorGrab = mode;
return GHOST_kSuccess;
@@ -154,6 +157,15 @@ GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUn
}
}
+void GHOST_Window::setAcceptDragOperation(bool canAccept)
+{
+ m_canAcceptDragOperation = canAccept;
+}
+
+bool GHOST_Window::canAcceptDragOperation() const
+{
+ return m_canAcceptDragOperation;
+}
GHOST_TSuccess GHOST_Window::setModifiedState(bool isUnsavedChanges)
{
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index 86447a8623c..1b5681dc41c 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -183,6 +183,17 @@ public:
*/
virtual GHOST_TSuccess getCursorGrabBounds(GHOST_Rect& bounds);
+ /**
+ * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
+ */
+ virtual void setAcceptDragOperation(bool canAccept);
+
+ /**
+ * Returns acceptance of the dropped object
+ * Usually called by the "object dropped" event handling function
+ */
+ virtual bool canAcceptDragOperation() const;
+
/**
* Sets the window "modified" status, indicating unsaved changes
* @param isUnsavedChanges Unsaved changes or not
@@ -294,6 +305,9 @@ protected:
/** The current shape of the cursor */
GHOST_TStandardCursor m_cursorShape;
+ /** The acceptance of the "drop candidate" of the current drag'n'drop operation */
+ bool m_canAcceptDragOperation;
+
/** Modified state : are there unsaved changes */
bool m_isUnsavedChanges;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index e3479ada5d6..e59d9c17333 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -40,6 +40,8 @@
#include "GHOST_Window.h"
#include "STR_String.h"
+@class CocoaWindow;
+
class GHOST_SystemCocoa;
/**
@@ -264,7 +266,7 @@ protected:
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
/** The window containing the OpenGL view */
- NSWindow *m_window;
+ CocoaWindow *m_window;
/** The openGL view */
NSOpenGLView *m_openGLView;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 6d6829f3925..b1b23963b3d 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -124,16 +124,91 @@ extern "C" {
//We need to subclass it to tell that even borderless (fullscreen), it can become key (receive user events)
@interface CocoaWindow: NSWindow
{
-
+ GHOST_SystemCocoa *systemCocoa;
+ GHOST_WindowCocoa *associatedWindow;
+ GHOST_TDragnDropTypes m_draggedObjectType;
}
+- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa;
@end
@implementation CocoaWindow
+- (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa
+{
+ systemCocoa = sysCocoa;
+ associatedWindow = winCocoa;
+}
-(BOOL)canBecomeKeyWindow
{
return YES;
}
+//The drag'n'drop dragging destination methods
+- (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender
+{
+ NSPoint mouseLocation = [sender draggingLocation];
+ NSPasteboard *draggingPBoard = [sender draggingPasteboard];
+
+ if ([[draggingPBoard types] containsObject:NSTIFFPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeBitmap;
+ else if ([[draggingPBoard types] containsObject:NSFilenamesPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeFilenames;
+ else if ([[draggingPBoard types] containsObject:NSStringPboardType]) m_draggedObjectType = GHOST_kDragnDropTypeString;
+ else return NSDragOperationNone;
+
+ associatedWindow->setAcceptDragOperation(FALSE); //Drag operation needs to be accepted explicitly by the event manager
+ systemCocoa->handleDraggingEvent(GHOST_kEventDraggingEntered, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
+ return NSDragOperationCopy;
+}
+
+- (BOOL)wantsPeriodicDraggingUpdates
+{
+ return NO; //No need to overflow blender event queue. Events shall be sent only on changes
+}
+
+- (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender
+{
+ NSPoint mouseLocation = [sender draggingLocation];
+
+ systemCocoa->handleDraggingEvent(GHOST_kEventDraggingUpdated, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, nil);
+ return NSDragOperationCopy;
+}
+
+- (void)draggingExited:(id < NSDraggingInfo >)sender
+{
+ systemCocoa->handleDraggingEvent(GHOST_kEventDraggingExited, m_draggedObjectType, associatedWindow, 0, 0, nil);
+ m_draggedObjectType = GHOST_kDragnDropTypeUnknown;
+}
+
+- (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender
+{
+ if (associatedWindow->canAcceptDragOperation())
+ return YES;
+ else
+ return NO;
+}
+
+- (BOOL)performDragOperation:(id < NSDraggingInfo >)sender
+{
+ NSPoint mouseLocation = [sender draggingLocation];
+ NSPasteboard *draggingPBoard = [sender draggingPasteboard];
+ id data;
+
+ switch (m_draggedObjectType) {
+ case GHOST_kDragnDropTypeBitmap:
+ data = [draggingPBoard dataForType:NSTIFFPboardType];
+ break;
+ case GHOST_kDragnDropTypeFilenames:
+ data = [draggingPBoard propertyListForType:NSFilenamesPboardType];
+ break;
+ case GHOST_kDragnDropTypeString:
+ data = [draggingPBoard stringForType:NSStringPboardType];
+ break;
+ default:
+ return NO;
+ break;
+ }
+ systemCocoa->handleDraggingEvent(GHOST_kEventDraggingDropDone, m_draggedObjectType, associatedWindow, mouseLocation.x, mouseLocation.y, (void*)data);
+ return YES;
+}
+
@end
@@ -207,6 +282,8 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
return;
}
+ [m_window setSystemAndWindowCocoa:systemCocoa windowCocoa:this];
+
//Forbid to resize the window below the blender defined minimum one
minSize.width = 320;
minSize.height = 240;
@@ -259,6 +336,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
[m_window setAcceptsMouseMovedEvents:YES];
+ [m_window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
+ NSStringPboardType, NSTIFFPboardType, nil]];
+
if (state == GHOST_kWindowStateFullScreen)
setState(GHOST_kWindowStateFullScreen);
@@ -778,15 +858,18 @@ GHOST_TSuccess GHOST_WindowCocoa::installDrawingContext(GHOST_TDrawingContextTyp
if (!s_firstOpenGLcontext) s_firstOpenGLcontext = tmpOpenGLContext;
#ifdef WAIT_FOR_VSYNC
+ {
+ GLint swapInt = 1;
/* wait for vsync, to avoid tearing artifacts */
- [tmpOpenGLContext setValues:1 forParameter:NSOpenGLCPSwapInterval];
+ [tmpOpenGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
+ }
#endif
- [m_openGLView setOpenGLContext:tmpOpenGLContext];
- [tmpOpenGLContext setView:m_openGLView];
-
- m_openGLContext = tmpOpenGLContext;
+ [m_openGLView setOpenGLContext:tmpOpenGLContext];
+ [tmpOpenGLContext setView:m_openGLView];
+
+ m_openGLContext = tmpOpenGLContext;
break;
-
+
case GHOST_kDrawingContextTypeNone:
success = GHOST_kSuccess;
break;
diff --git a/intern/ghost/make/msvc_9_0/ghost.vcproj b/intern/ghost/make/msvc_9_0/ghost.vcproj
index 6b3a49cfc9c..9569fba5a0e 100644
--- a/intern/ghost/make/msvc_9_0/ghost.vcproj
+++ b/intern/ghost/make/msvc_9_0/ghost.vcproj
@@ -364,6 +364,10 @@
RelativePath="..\..\intern\GHOST_EventCursor.h"
>
+
+
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 9e3927314d3..e404f174935 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -73,6 +73,12 @@ extern "C" {
*/
short MEM_freeN(void *vmemh);
+
+ /**
+ * Return zero if memory is not in allocated list
+ */
+ short MEM_testN(void *vmemh);
+
/**
* Duplicates a block of memory, and returns a pointer to the
* newly allocated block. */
@@ -102,6 +108,9 @@ extern "C" {
* blocks. */
void MEM_printmemlist(void);
+ /** calls the function on all allocated memory blocks. */
+ void MEM_callbackmemlist(void (*func)(void*));
+
/** Print statistics about memory usage */
void MEM_printmemlist_stats(void);
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index ca7f2a4d506..d1114af2437 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -460,6 +460,47 @@ static void MEM_printmemlist_internal( int pydict )
mem_unlock_thread();
}
+void MEM_callbackmemlist(void (*func)(void*)) {
+ MemHead *membl;
+
+ mem_lock_thread();
+
+ membl = membase->first;
+ if (membl) membl = MEMNEXT(membl);
+
+ while(membl) {
+ func(membl+1);
+ if(membl->next)
+ membl= MEMNEXT(membl->next);
+ else break;
+ }
+
+ mem_unlock_thread();
+}
+
+short MEM_testN(void *vmemh) {
+ MemHead *membl;
+
+ mem_lock_thread();
+
+ membl = membase->first;
+ if (membl) membl = MEMNEXT(membl);
+
+ while(membl) {
+ if (vmemh == membl+1)
+ return 1;
+
+ if(membl->next)
+ membl= MEMNEXT(membl->next);
+ else break;
+ }
+
+ mem_unlock_thread();
+
+ print_error("Memoryblock %p: pointer not in memlist\n", vmemh);
+ return 0;
+}
+
void MEM_printmemlist( void ) {
MEM_printmemlist_internal(0);
}
@@ -500,7 +541,6 @@ short MEM_freeN(void *vmemh) /* anders compileertie niet meer */
}
mem_lock_thread();
-
if ((memh->tag1 == MEMTAG1) && (memh->tag2 == MEMTAG2) && ((memh->len & 0x3) == 0)) {
memt = (MemTail *)(((char *) memh) + sizeof(MemHead) + memh->len);
if (memt->tag3 == MEMTAG3){
diff --git a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
index 6137696fc59..42dd1c7cef0 100644
--- a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
+++ b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
@@ -387,6 +387,10 @@
RelativePath="..\..\..\source\blender\python\generic\Geometry.c"
>
+
+
diff --git a/projectfiles_vc9/blender/blender.sln b/projectfiles_vc9/blender/blender.sln
index deb9d216bf6..12f3f877c33 100644
--- a/projectfiles_vc9/blender/blender.sln
+++ b/projectfiles_vc9/blender/blender.sln
@@ -157,13 +157,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blenderplayer", "..\gameeng
{9C71A793-C177-4CAB-8EC5-923D500B39F8} = {9C71A793-C177-4CAB-8EC5-923D500B39F8}
{F90BD995-FFA4-4B18-81E8-FA4322C939E8} = {F90BD995-FFA4-4B18-81E8-FA4322C939E8}
{BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23} = {BB6AA598-B336-4F8B-9DF9-8CAE7BE71C23}
- {8154A59A-CAED-403D-AB94-BC4E7C032666} = {8154A59A-CAED-403D-AB94-BC4E7C032666}
{3648FB9A-C36F-43AB-AED0-1F1361E67FC7} = {3648FB9A-C36F-43AB-AED0-1F1361E67FC7}
{542A9FA1-B7FF-441C-AE15-054DB31D3488} = {542A9FA1-B7FF-441C-AE15-054DB31D3488}
{D8ABD6A5-1B36-4D62-934E-B5C6801130B0} = {D8ABD6A5-1B36-4D62-934E-B5C6801130B0}
{E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B} = {E109F1A5-FDD3-4F56-A1C4-96867EEA4C5B}
{727F90AC-ABE6-40BF-8937-C2F2F1D13DEA} = {727F90AC-ABE6-40BF-8937-C2F2F1D13DEA}
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4} = {E8904FB3-F8F7-BC21-87A6-029A57B901F4}
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = {E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = {8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = {4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
@@ -1097,6 +1097,7 @@ Global
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Blender Release|Win32.Build.0 = Blender Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{B093415D-C0F6-4E76-8F5A-6BC1917BCE9E}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
@@ -1155,6 +1156,7 @@ Global
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Blender Release|Win32.Build.0 = Blender Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {A90C4918-4B21-4277-93BD-AF65F30951D9}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{A90C4918-4B21-4277-93BD-AF65F30951D9}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
@@ -1329,12 +1331,12 @@ Global
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
- {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.ActiveCfg = BlenderPlayer Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Debug|Win32.Build.0 = BlenderPlayer Debug|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
- {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.ActiveCfg = Blender Debug|Win32
- {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.Build.0 = Blender Debug|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.ActiveCfg = BlenderPlayer Release|Win32
+ {884D8731-654C-4C7F-9A75-8F37A305BE1E}.Debug|Win32.Build.0 = BlenderPlayer Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Release|Win32.ActiveCfg = Blender Release|Win32
{884D8731-654C-4C7F-9A75-8F37A305BE1E}.Release|Win32.Build.0 = Blender Release|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.3D Plugin Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -1351,8 +1353,8 @@ Global
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Blender Release|Win32.Build.0 = Blender Release|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
- {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {FB88301F-F725-401B-ACD7-D2ABBF333B71}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Debug|Win32.Build.0 = Blender Debug|Win32
{FB88301F-F725-401B-ACD7-D2ABBF333B71}.Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1409,8 +1411,8 @@ Global
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}.Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -1431,8 +1433,8 @@ Global
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Blender Release|Win32.Build.0 = Blender Release|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
- {D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {D1A9312F-4557-4982-A0F4-4D08508235F4}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Debug|Win32.Build.0 = Blender Debug|Win32
{D1A9312F-4557-4982-A0F4-4D08508235F4}.Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1447,8 +1449,8 @@ Global
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{59567A5B-F63A-4A5C-B33A-0A45C300F4DC}.Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -1465,8 +1467,8 @@ Global
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}.Debug|Win32.ActiveCfg = Blender Debug|Win32
@@ -1487,8 +1489,8 @@ Global
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Blender Release|Win32.Build.0 = Blender Release|Win32
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
- {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {E8904FB3-F8F7-BC21-87A6-029A57B901F4}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{E8904FB3-F8F7-BC21-87A6-029A57B901F4}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
@@ -1507,8 +1509,8 @@ Global
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Blender Release|Win32.Build.0 = Blender Release|Win32
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
- {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.ActiveCfg = 3DPlugin Debug|Win32
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
@@ -1525,8 +1527,8 @@ Global
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
@@ -1545,8 +1547,8 @@ Global
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
+ {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
@@ -1567,8 +1569,8 @@ Global
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Blender Release|Win32.Build.0 = Blender Release|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Debug|Win32.Build.0 = Blender Debug|Win32
- {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Release|Win32.ActiveCfg = Blender Debug|Win32
- {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Release|Win32.Build.0 = Blender Debug|Win32
+ {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
+ {37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Debug|Win32.Build.0 = Blender Debug|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Release|Win32.ActiveCfg = Blender Release|Win32
@@ -1585,10 +1587,8 @@ Global
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.Build.0 = Blender Release|Win32
- {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
- {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
+ {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
- {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.Build.0 = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Release|Win32.ActiveCfg = Blender Release|Win32
diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj
index a5203aa8edb..ec863853daa 100644
--- a/projectfiles_vc9/blender/blender.vcproj
+++ b/projectfiles_vc9/blender/blender.vcproj
@@ -108,7 +108,7 @@
/>
diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
index 3f17da1ddab..ad40639db12 100644
--- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
+++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
@@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont;..\..\..\source\blender\ikplugin"
- PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG;GLEW_STATIC"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
@@ -195,7 +195,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont;..\..\..\source\blender\ikplugin"
- PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG;GLEW_STATIC"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
@@ -345,7 +345,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont;..\..\..\source\blender\ikplugin"
- PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FFMPEG"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FFMPEG;GLEW_STATIC"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
@@ -420,7 +420,7 @@
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\lib\windows\ffmpeg\include\msvc;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont;..\..\..\source\blender\ikplugin"
- PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_FFMPEG"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_FFMPEG;GLEW_STATIC"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
diff --git a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
index b883d8bf2b2..4626d3fbdec 100644
--- a/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
+++ b/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
@@ -479,10 +479,6 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
-
-
@@ -571,6 +567,34 @@
RelativePath="..\..\..\source\blender\blenlib\intern\listbase.c"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -620,10 +644,6 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
-
-
@@ -696,6 +716,34 @@
RelativePath="..\..\..\source\blender\blenlib\BLI_linklist.h"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj
index 4a8063bb5f0..fec46871e83 100644
--- a/projectfiles_vc9/blender/editors/ED_editors.vcproj
+++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj
@@ -695,6 +695,10 @@
RelativePath="..\..\..\source\blender\editors\space_node\drawnode.c"
>
+
+
diff --git a/projectfiles_vc9/blender/gpu/BL_gpu.vcproj b/projectfiles_vc9/blender/gpu/BL_gpu.vcproj
index af0b90796d1..a182a3eceb5 100644
--- a/projectfiles_vc9/blender/gpu/BL_gpu.vcproj
+++ b/projectfiles_vc9/blender/gpu/BL_gpu.vcproj
@@ -119,7 +119,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;DWORDS_LITTLEENDIAN;GLEW_STATIC"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="false"
@@ -195,7 +195,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;DWORDS_LITTLEENDIAN;GLEW_STATIC"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
@@ -345,7 +345,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
- PreprocessorDefinitions="_DEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ PreprocessorDefinitions="_DEBUG;WIN32;_LIB;DWORDS_LITTLEENDIAN;GLEW_STATIC"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="false"
@@ -420,7 +420,7 @@
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender\imbuf;..\..\..\source\blender\gpu"
- PreprocessorDefinitions="NDEBUG,WIN32,_LIB,DWORDS_LITTLEENDIAN"
+ PreprocessorDefinitions="NDEBUG;WIN32;_LIB;DWORDS_LITTLEENDIAN;GLEW_STATIC"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
diff --git a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
index b0ba1133393..272a56f58a4 100644
--- a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
+++ b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj
@@ -568,6 +568,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
@@ -561,6 +557,10 @@
RelativePath="..\..\..\source\gameengine\Converter\KX_IpoConvert.cpp"
>
+
+
-
-
@@ -650,6 +646,10 @@
RelativePath="..\..\..\source\gameengine\Converter\KX_IpoConvert.h"
>
+
+
diff --git a/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj b/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
index ad8f3338594..9e6b41997ac 100644
--- a/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj
@@ -342,10 +342,6 @@
RelativePath="..\..\..\..\source\gameengine\GamePlayer\common\GPC_MouseDevice.cpp"
>
-
-
diff --git a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
index 4d6b7a4cd8a..759c469bcf6 100644
--- a/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
+++ b/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj
@@ -44,7 +44,7 @@
@@ -234,6 +234,10 @@
RelativePath="..\..\..\..\source\gameengine\GamePlayer\ghost\GPG_System.cpp"
>
+
+
diff --git a/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj b/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
index b552b87e820..814db0bcb14 100644
--- a/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
+++ b/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj
@@ -43,7 +43,7 @@
0):
netsettings.jobs.remove(0)
- bpy.netrender_jobs = []
+ netrender.jobs = []
for j in jobs:
- bpy.netrender_jobs.append(j)
+ netrender.jobs.append(j)
netsettings.jobs.add()
job = netsettings.jobs[-1]
@@ -130,8 +133,8 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
if netsettings.active_slave_index >= 0:
# deal with data
- slave = bpy.netrender_slaves.pop(netsettings.active_slave_index)
- bpy.netrender_blacklist.append(slave)
+ slave = netrender.slaves.pop(netsettings.active_slave_index)
+ netrender.blacklist.append(slave)
# deal with rna
netsettings.slaves_blacklist.add()
@@ -160,8 +163,8 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
if netsettings.active_blacklisted_slave_index >= 0:
# deal with data
- slave = bpy.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
- bpy.netrender_slaves.append(slave)
+ slave = netrender.blacklist.pop(netsettings.active_blacklisted_slave_index)
+ netrender.slaves.append(slave)
# deal with rna
netsettings.slaves.add()
@@ -187,7 +190,7 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
def execute(self, context):
netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
conn.request("GET", "/slaves")
@@ -200,17 +203,17 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
while(len(netsettings.slaves) > 0):
netsettings.slaves.remove(0)
- bpy.netrender_slaves = []
+ netrender.slaves = []
for s in slaves:
- for i in range(len(bpy.netrender_blacklist)):
- slave = bpy.netrender_blacklist[i]
+ for i in range(len(netrender.blacklist)):
+ slave = netrender.blacklist[i]
if slave.id == s.id:
- bpy.netrender_blacklist[i] = s
+ netrender.blacklist[i] = s
netsettings.slaves_blacklist[i].name = s.name
break
else:
- bpy.netrender_slaves.append(s)
+ netrender.slaves.append(s)
netsettings.slaves.add()
slave = netsettings.slaves[-1]
@@ -233,10 +236,10 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
def execute(self, context):
netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
- job = bpy.netrender_jobs[netsettings.active_job_index]
+ job = netrender.jobs[netsettings.active_job_index]
conn.request("POST", "/cancel", headers={"job-id":job.id})
@@ -261,7 +264,7 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
def execute(self, context):
netsettings = context.scene.network_render
- conn = clientConnection(context.scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
conn.request("POST", "/clear")
@@ -291,10 +294,10 @@ class netclientdownload(bpy.types.Operator):
netsettings = context.scene.network_render
rd = context.scene.render_data
- conn = clientConnection(context.scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
- job = bpy.netrender_jobs[netsettings.active_job_index]
+ job = netrender.jobs[netsettings.active_job_index]
for frame in job.frames:
client.requestResult(conn, job.id, frame.number)
@@ -332,26 +335,16 @@ class netclientscan(bpy.types.Operator):
return True
def execute(self, context):
- netsettings = context.scene.network_render
-
- try:
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
- s.settimeout(30)
-
- s.bind(('', 8000))
-
- buf, address = s.recvfrom(64)
-
- print("received:", buf)
-
- netsettings.server_address = address[0]
- netsettings.server_port = int(str(buf, encoding='utf8'))
- except socket.timeout:
- print("no server info")
+ address, port = clientScan()
+
+ if address:
+ scene = context.scene
+ netsettings = scene.network_render
+ netsettings.server_address = address
+ netsettings.server_port = port
return ('FINISHED',)
-
+
def invoke(self, context, event):
return self.execute(context)
@@ -369,7 +362,7 @@ class netclientweb(bpy.types.Operator):
# open connection to make sure server exists
- conn = clientConnection(context.scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
conn.close()
diff --git a/release/scripts/io/netrender/slave.py b/release/scripts/io/netrender/slave.py
index 882af76202b..74fc44e23d2 100644
--- a/release/scripts/io/netrender/slave.py
+++ b/release/scripts/io/netrender/slave.py
@@ -23,6 +23,8 @@ import subprocess, time
from netrender.utils import *
import netrender.model
+BLENDER_PATH = sys.argv[0]
+
CANCEL_POLL_SPEED = 2
MAX_TIMEOUT = 10
INCREMENT_TIMEOUT = 1
@@ -85,13 +87,12 @@ def testFile(conn, job_id, slave_id, JOB_PREFIX, file_path, main_path = None):
return job_full_path
-def render_slave(engine, scene):
- netsettings = scene.network_render
+def render_slave(engine, netsettings):
timeout = 1
engine.update_stats("", "Network render node initiation")
- conn = clientConnection(scene)
+ conn = clientConnection(netsettings.server_address, netsettings.server_port)
if conn:
conn.request("POST", "/slave", repr(slave_Info().serialize()))
@@ -150,7 +151,7 @@ def render_slave(engine, scene):
frame_args += ["-f", str(frame.number)]
val = SetErrorMode()
- process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ process = subprocess.Popen([BLENDER_PATH, "-b", job_full_path, "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
RestoreErrorMode(val)
elif job.type == netrender.model.JOB_PROCESS:
command = job.frames[0].command
@@ -240,3 +241,6 @@ def render_slave(engine, scene):
return
conn.close()
+
+if __name__ == "__main__":
+ pass
\ No newline at end of file
diff --git a/release/scripts/io/netrender/ui.py b/release/scripts/io/netrender/ui.py
index df75c175cae..081d9952871 100644
--- a/release/scripts/io/netrender/ui.py
+++ b/release/scripts/io/netrender/ui.py
@@ -21,6 +21,7 @@ import sys, os
import http, http.client, http.server, urllib
import subprocess, shutil, time, hashlib
+import netrender
import netrender.slave as slave
import netrender.master as master
@@ -62,15 +63,15 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(scene.network_render, "mode")
- col.itemR(scene.network_render, "path")
- col.itemR(scene.network_render, "server_address")
- col.itemR(scene.network_render, "server_port")
+ col.prop(scene.network_render, "mode")
+ col.prop(scene.network_render, "path")
+ col.prop(scene.network_render, "server_address")
+ col.prop(scene.network_render, "server_port")
if scene.network_render.mode == "RENDER_MASTER":
- col.itemR(scene.network_render, "server_broadcast")
+ col.prop(scene.network_render, "server_broadcast")
else:
- col.itemO("render.netclientscan", icon="ICON_FILE_REFRESH", text="")
+ col.operator("render.netclientscan", icon="ICON_FILE_REFRESH", text="")
@rnaType
class RENDER_PT_network_job(RenderButtonsPanel):
@@ -92,13 +93,13 @@ class RENDER_PT_network_job(RenderButtonsPanel):
split = layout.split()
col = split.column()
- col.itemO("render.netclientanim", icon='ICON_RENDER_ANIMATION')
- col.itemO("render.netclientsend", icon="ICON_FILE_BLEND")
- col.itemO("render.netclientweb", icon="ICON_QUESTION")
- col.itemR(scene.network_render, "job_name")
+ col.operator("render.netclientanim", icon='ICON_RENDER_ANIMATION')
+ col.operator("render.netclientsend", icon="ICON_FILE_BLEND")
+ col.operator("render.netclientweb", icon="ICON_QUESTION")
+ col.prop(scene.network_render, "job_name")
row = col.row()
- row.itemR(scene.network_render, "priority")
- row.itemR(scene.network_render, "chunks")
+ row.prop(scene.network_render, "priority")
+ row.prop(scene.network_render, "chunks")
@rnaType
class RENDER_PT_network_slaves(RenderButtonsPanel):
@@ -119,22 +120,22 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
row.template_list(netsettings, "slaves", netsettings, "active_slave_index", rows=2)
sub = row.column(align=True)
- sub.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
- sub.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
+ sub.operator("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
+ sub.operator("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
- if len(bpy.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
+ if len(netrender.slaves) == 0 and len(netsettings.slaves) > 0:
while(len(netsettings.slaves) > 0):
netsettings.slaves.remove(0)
if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
- layout.itemS()
+ layout.separator()
- slave = bpy.netrender_slaves[netsettings.active_slave_index]
+ slave = netrender.slaves[netsettings.active_slave_index]
- layout.itemL(text="Name: " + slave.name)
- layout.itemL(text="Address: " + slave.address[0])
- layout.itemL(text="Seen: " + time.ctime(slave.last_seen))
- layout.itemL(text="Stats: " + slave.stats)
+ layout.label(text="Name: " + slave.name)
+ layout.label(text="Address: " + slave.address[0])
+ layout.label(text="Seen: " + time.ctime(slave.last_seen))
+ layout.label(text="Stats: " + slave.stats)
@rnaType
class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
@@ -155,21 +156,21 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
row.template_list(netsettings, "slaves_blacklist", netsettings, "active_blacklisted_slave_index", rows=2)
sub = row.column(align=True)
- sub.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
+ sub.operator("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
- if len(bpy.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
+ if len(netrender.blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
while(len(netsettings.slaves_blacklist) > 0):
netsettings.slaves_blacklist.remove(0)
if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
- layout.itemS()
+ layout.separator()
- slave = bpy.netrender_blacklist[netsettings.active_blacklisted_slave_index]
+ slave = netrender.blacklist[netsettings.active_blacklisted_slave_index]
- layout.itemL(text="Name: " + slave.name)
- layout.itemL(text="Address: " + slave.address[0])
- layout.itemL(text="Seen: " + slave.last_seen)
- layout.itemL(text="Stats: " + time.ctime(slave.stats))
+ layout.label(text="Name: " + slave.name)
+ layout.label(text="Address: " + slave.address[0])
+ layout.label(text="Seen: " + time.ctime(slave.last_seen))
+ layout.label(text="Stats: " + slave.stats)
@rnaType
class RENDER_PT_network_jobs(RenderButtonsPanel):
@@ -190,24 +191,24 @@ class RENDER_PT_network_jobs(RenderButtonsPanel):
row.template_list(netsettings, "jobs", netsettings, "active_job_index", rows=2)
sub = row.column(align=True)
- sub.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="")
- sub.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="")
- sub.itemO("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
- sub.itemO("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
+ sub.operator("render.netclientstatus", icon="ICON_FILE_REFRESH", text="")
+ sub.operator("render.netclientcancel", icon="ICON_ZOOMOUT", text="")
+ sub.operator("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
+ sub.operator("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
- if len(bpy.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
+ if len(netrender.jobs) == 0 and len(netsettings.jobs) > 0:
while(len(netsettings.jobs) > 0):
netsettings.jobs.remove(0)
if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
- layout.itemS()
+ layout.separator()
- job = bpy.netrender_jobs[netsettings.active_job_index]
+ job = netrender.jobs[netsettings.active_job_index]
- layout.itemL(text="Name: %s" % job.name)
- layout.itemL(text="Length: %04i" % len(job))
- layout.itemL(text="Done: %04i" % job.results[DONE])
- layout.itemL(text="Error: %04i" % job.results[ERROR])
+ layout.label(text="Name: %s" % job.name)
+ layout.label(text="Length: %04i" % len(job))
+ layout.label(text="Done: %04i" % job.results[DONE])
+ layout.label(text="Error: %04i" % job.results[ERROR])
@rnaType
class NetRenderSettings(bpy.types.IDPropertyGroup):
diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py
index a16043dd3cb..e549e872398 100644
--- a/release/scripts/io/netrender/utils.py
+++ b/release/scripts/io/netrender/utils.py
@@ -16,14 +16,18 @@
#
# ##### END GPL LICENSE BLOCK #####
-import bpy
import sys, os
import re
-import http, http.client, http.server, urllib
+import http, http.client, http.server, urllib, socket
import subprocess, shutil, time, hashlib
import netrender.model
+try:
+ import bpy
+except:
+ bpy = None
+
VERSION = b"0.5"
# Jobs status
@@ -39,27 +43,48 @@ DONE = 2
ERROR = 3
STATUS_TEXT = {
- QUEUED: "Queued",
- DISPATCHED: "Dispatched",
- DONE: "Done",
- ERROR: "Error"
- }
+ QUEUED: "Queued",
+ DISPATCHED: "Dispatched",
+ DONE: "Done",
+ ERROR: "Error"
+ }
def rnaType(rna_type):
- bpy.types.register(rna_type)
+ if bpy: bpy.types.register(rna_type)
return rna_type
def rnaOperator(rna_op):
- bpy.ops.add(rna_op)
+ if bpy: bpy.ops.add(rna_op)
return rna_op
-def clientConnection(scene):
- netsettings = scene.network_render
+def clientScan():
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
+ s.settimeout(30)
+
+ s.bind(('', 8000))
- if netsettings.server_address == "[default]":
- bpy.ops.render.netclientscan()
+ buf, address = s.recvfrom(64)
- conn = http.client.HTTPConnection(netsettings.server_address, netsettings.server_port)
+ print("received:", buf)
+
+ address = address[0]
+ port = int(str(buf, encoding='utf8'))
+ return (address, port)
+ except socket.timeout:
+ print("no server info")
+ return ("", 8000) # return default values
+
+def clientConnection(address, port):
+ if address == "[default]":
+# calling operator from python is fucked, scene isn't in context
+# if bpy:
+# bpy.ops.render.netclientscan()
+# else:
+ address, port = clientScan()
+
+ conn = http.client.HTTPConnection(address, port)
if clientVerifyVersion(conn):
return conn
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py
new file mode 100644
index 00000000000..39b8fd340ba
--- /dev/null
+++ b/release/scripts/modules/bpy/__init__.py
@@ -0,0 +1,85 @@
+# ##### 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 #####
+
+# internal blender C module
+import _bpy
+from _bpy import types, props
+
+data = _bpy.data
+context = _bpy.context
+
+# python modules
+from bpy import utils
+
+from bpy import ops as _ops_module
+
+# fake operator module
+ops = _ops_module.ops_fake_module
+
+def load_scripts(reload_scripts=False):
+ import os
+ import sys
+ import traceback
+
+ def test_import(module_name):
+ try:
+ return __import__(module_name)
+ except:
+ traceback.print_exc()
+ return None
+
+ for base_path in utils.script_paths():
+ for path_subdir in ("ui", "op", "io"):
+ path = os.path.join(base_path, path_subdir)
+ sys.path.insert(0, path)
+ for f in sorted(os.listdir(path)):
+ if f.endswith(".py"):
+ # python module
+ mod = test_import(f[0:-3])
+ elif "." not in f:
+ # python package
+ mod = test_import(f)
+ else:
+ mod = None
+
+ if reload_scripts and mod:
+ print("Reloading:", mod)
+ reload(mod)
+
+def _main():
+
+ # a bit nasty but this prevents help() and input() from locking blender
+ # Ideally we could have some way for the console to replace sys.stdin but
+ # python would lock blender while waiting for a return value, not easy :|
+ import sys
+ sys.stdin = None
+
+ if "-d" in sys.argv and False: # Enable this to measure startup speed
+ import cProfile
+ cProfile.run('import bpy; bpy.load_scripts()', 'blender.prof')
+
+ import pstats
+ p = pstats.Stats('blender.prof')
+ p.sort_stats('cumulative').print_stats(100)
+
+ else:
+ load_scripts()
+
+_main()
+
+
diff --git a/release/scripts/modules/bpy_ops.py b/release/scripts/modules/bpy/ops.py
similarity index 93%
rename from release/scripts/modules/bpy_ops.py
rename to release/scripts/modules/bpy/ops.py
index 35d986fe09d..5b3009db2bf 100644
--- a/release/scripts/modules/bpy_ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -19,12 +19,14 @@
#
# for slightly faster access
-from bpy.__ops__ import add as op_add
-from bpy.__ops__ import remove as op_remove
-from bpy.__ops__ import dir as op_dir
-from bpy.__ops__ import call as op_call
-from bpy.__ops__ import as_string as op_as_string
-from bpy.__ops__ import get_rna as op_get_rna
+from _bpy import ops as ops_module
+
+op_add = ops_module.add
+op_remove = ops_module.remove
+op_dir = ops_module.dir
+op_call = ops_module.call
+op_as_string = ops_module.as_string
+op_get_rna = ops_module.get_rna
# Keep in sync with WM_types.h
context_dict = {
@@ -190,5 +192,4 @@ class bpy_ops_submodule_op(object):
return "" % \
(self.module, self.func, id(self))
-import bpy
-bpy.ops = bpy_ops()
+ops_fake_module = bpy_ops()
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
new file mode 100644
index 00000000000..a10c8bc4dd9
--- /dev/null
+++ b/release/scripts/modules/bpy/utils.py
@@ -0,0 +1,78 @@
+# ##### 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 #####
+
+import bpy
+import os
+
+def expandpath(path):
+ if path.startswith("//"):
+ return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
+
+ return path
+
+
+_unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, \
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 58, 59, 60, 61, 62, 63, \
+ 64, 91, 92, 93, 94, 96, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, \
+ 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, \
+ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, \
+ 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, \
+ 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, \
+ 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, \
+ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, \
+ 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, \
+ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, \
+ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254]
+
+_unclean_chars = ''.join([chr(i) for i in _unclean_chars])
+
+def clean_name(name, replace="_"):
+ '''
+ All characters besides A-Z/a-z, 0-9 are replaced with "_"
+ or the replace argumet if defined.
+ '''
+ for ch in _unclean_chars:
+ name = name.replace(ch, replace)
+ return name
+
+
+# base scripts
+_scripts = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
+_scripts = (os.path.normpath(_scripts), )
+
+def script_paths(*args):
+ if not args:
+ return _scripts
+
+ subdir = os.path.join(*args)
+ script_paths = []
+ for path in _scripts:
+ script_paths.append(os.path.join(path, subdir))
+
+ return script_paths
+
+
+_presets = os.path.join(_scripts[0], "presets") # FIXME - multiple paths
+
+def preset_paths(subdir):
+ '''
+ Returns a list of paths for a spesific preset.
+ '''
+
+ return (os.path.join(_presets, subdir), )
diff --git a/release/scripts/modules/bpy_ext/Mesh.py b/release/scripts/modules/bpy_ext/Mesh.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/release/scripts/modules/bpy_ext/Object.py b/release/scripts/modules/bpy_ext/Object.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/release/scripts/modules/bpy_ext/__init__.py b/release/scripts/modules/bpy_ext/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index d2bed9f7faa..13d48f05d18 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -15,33 +15,126 @@
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
+from _bpy import types as bpy_types
-import bpy
-
-StructRNA = bpy.types.Struct.__bases__[0]
-# StructRNA = bpy.types.Struct
+StructRNA = bpy_types.Struct.__bases__[0]
+# StructRNA = bpy_types.Struct
-class Object(bpy.types.ID):
+class Context(StructRNA):
- def _get_children(self):
+ def copy(self):
+ new_context = {}
+ generic_keys = StructRNA.__dict__.keys()
+ for item in dir(self):
+ if item not in generic_keys:
+ new_context[item] = getattr(self, item)
+
+ return new_context
+
+
+class Object(bpy_types.ID):
+
+ @property
+ def children(self):
+ import bpy
return [child for child in bpy.data.objects if child.parent == self]
- children = property(_get_children)
+
+class _GenericBone:
+ '''
+ functions for bones, common between Armature/Pose/Edit bones.
+ internal subclassing use only.
+ '''
+ def parent_index(self, parent_test):
+ '''
+ The same as 'bone in other_bone.parent_recursive' but saved generating a list.
+ '''
+ # use the name so different types can be tested.
+ name = parent_test.name
+
+ parent = self.parent
+ i = 1
+ while parent:
+ if parent.name == name:
+ return i
+ parent = parent.parent
+ i += 1
+
+ return 0
+
+ @property
+ def parent_recursive(self):
+ parent_list = []
+ parent = self.parent
+
+ while parent:
+ if parent:
+ parent_list.append(parent)
+
+ parent = parent.parent
+
+ return parent_list
+
+ @property
+ def length(self):
+ return (self.head - self.tail).length
+
+ @property
+ def children(self):
+ return [child for child in self._other_bones if child.parent == self]
+
+ @property
+ def children_recursive(self):
+ bones_children = []
+ for bone in self._other_bones:
+ index = bone.parent_index(self)
+ if index:
+ bones_children.append((index, bone))
+
+ # sort by distance to parent
+ bones_children.sort(key=lambda bone_pair: bone_pair[0])
+ return [bone for index, bone in bones_children]
+
+ @property
+ def _other_bones(self):
+ id_data = self.id_data
+ id_data_type = type(id_data)
+
+ if id_data_type == bpy_types.Object:
+ bones = id_data.pose.bones
+ elif id_data_type == bpy_types.Armature:
+ bones = id_data.edit_bones
+ if not bones: # not in editmode
+ bones = id_data.bones
+
+ return bones
+
+
+class PoseBone(StructRNA, _GenericBone):
+ pass
+
+
+class Bone(StructRNA, _GenericBone):
+ pass
+
+
+class EditBone(StructRNA, _GenericBone):
+ pass
def ord_ind(i1,i2):
if i1 finger_driver.02
+ driver_bone_name = child_bone_name.split('.')
+ driver_bone_name = driver_bone_name[0] + "_driver." + ".".join(driver_bone_name[1:])
+
+ driver_ebone = arm.edit_bones.new(driver_bone_name)
+ driver_bone_name = driver_ebone.name # cant be too sure!
+ driver_ebone.layer = other_layer
+
+ new_len = pbone_child.bone.length / 2.0
+
+ head = child_ebone.head.copy()
+ tail = child_ebone.tail.copy()
+
+ driver_ebone.head = head
+ driver_ebone.tail = head + ((tail - head).normalize() * new_len)
+ driver_ebone.roll = child_ebone.roll
+
+ # Insert driver_ebone in the chain without connected parents
+ driver_ebone.connected = False
+ driver_ebone.parent = child_ebone.parent
+
+ child_ebone.connected = False
+ child_ebone.parent = driver_ebone
+
+ # Add the drivers to these when in posemode.
+ driver_bone_pairs.append((child_bone_name, driver_bone_name))
+
+ del control_ebone
+
+
+ # *** POSEMODE
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+
+ arm, orig_pbone, orig_bone = get_bone_data(obj, orig_bone_name)
+ arm, control_pbone, control_bone= get_bone_data(obj, control_bone_name)
+
+
+ # only allow Y scale
+ control_pbone.lock_scale = (True, False, True)
+
+ control_pbone["bend_ratio"] = 0.4
+ prop = rna_idprop_ui_prop_get(control_pbone, "bend_ratio", create=True)
+ prop["soft_min"] = 0.0
+ prop["soft_max"] = 1.0
+
+ con = orig_pbone.constraints.new('COPY_LOCATION')
+ con.target = obj
+ con.subtarget = control_bone_name
+
+ con = orig_pbone.constraints.new('COPY_ROTATION')
+ con.target = obj
+ con.subtarget = control_bone_name
+
+
+
+ # setup child drivers on each new smaller bone added. assume 2 for now.
+
+ # drives the bones
+ controller_path = control_pbone.path_to_id() # 'pose.bones["%s"]' % control_bone_name
+
+ i = 0
+ for child_bone_name, driver_bone_name in driver_bone_pairs:
+
+ # XXX - todo, any number
+ if i==2:
+ break
+
+ arm, driver_pbone, driver_bone = get_bone_data(obj, driver_bone_name)
+
+ driver_pbone.rotation_mode = 'YZX'
+ fcurve_driver = driver_pbone.driver_add("rotation_euler", 0)
+
+ #obj.driver_add('pose.bones["%s"].scale', 1)
+ #obj.animation_data.drivers[-1] # XXX, WATCH THIS
+ driver = fcurve_driver.driver
+
+ # scale target
+ tar = driver.targets.new()
+ tar.name = "scale"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + '.scale[1]'
+
+ # bend target
+ tar = driver.targets.new()
+ tar.name = "br"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + '["bend_ratio"]'
+
+ # XXX - todo, any number
+ if i==0:
+ driver.expression = '(-scale+1.0)*pi*2.0*(1.0-br)'
+ elif i==1:
+ driver.expression = '(-scale+1.0)*pi*2.0*br'
+
+ arm, child_pbone, child_bone = get_bone_data(obj, child_bone_name)
+
+ # only allow X rotation
+ driver_pbone.lock_rotation = child_pbone.lock_rotation = (False, True, True)
+
+ i += 1
+
+
+def gen_delta(obj, delta_name):
+ '''
+ Use this bone to define a delta thats applied to its child in pose mode.
+ '''
+
+ arm = obj.data
+
+ mode_orig = obj.mode
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ delta_pbone = obj.pose.bones[delta_name]
+ children = delta_pbone.children
+
+ if len(children) != 1:
+ print("only 1 child supported for delta")
+
+ child_name = children[0].name
+ arm, child_pbone, child_bone = get_bone_data(obj, child_name)
+
+ delta_phead = delta_pbone.head.copy()
+ delta_ptail = delta_pbone.tail.copy()
+ delta_pmatrix = delta_pbone.matrix.copy()
+
+ child_phead = child_pbone.head.copy()
+ child_ptail = child_pbone.tail.copy()
+ child_pmatrix = child_pbone.matrix.copy()
+
+
+ children = delta_pbone.children
+
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ delta_ebone = arm.edit_bones[delta_name]
+ child_ebone = arm.edit_bones[child_name]
+
+ delta_head = delta_ebone.head.copy()
+ delta_tail = delta_ebone.tail.copy()
+
+ # arm, parent_pbone, parent_bone = get_bone_data(obj, delta_name)
+ child_head = child_ebone.head.copy()
+ child_tail = child_ebone.tail.copy()
+
+ arm.edit_bones.remove(delta_ebone)
+ del delta_ebone # cant use thz
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+
+ # Move the child bone to the deltas location
+ obj.animation_data_create()
+ child_pbone = obj.pose.bones[child_name]
+
+ # ------------------- drivers
+
+ child_pbone.rotation_mode = 'XYZ'
+
+ rot = delta_pmatrix.invert().rotationPart() * child_pmatrix.rotationPart()
+ rot = rot.invert().toEuler()
+
+ fcurve_drivers = child_pbone.driver_add("rotation_euler", -1)
+ for i, fcurve_driver in enumerate(fcurve_drivers):
+ driver = fcurve_driver.driver
+ driver.type = 'AVERAGE'
+ #mod = fcurve_driver.modifiers.new('GENERATOR')
+ mod = fcurve_driver.modifiers[0]
+ mod.poly_order = 1
+ mod.coefficients[0] = rot[i]
+ mod.coefficients[1] = 0.0
+
+ # tricky, find the transform to drive the bone to this location.
+ delta_head_offset = child_pmatrix.rotationPart() * (delta_phead - child_phead)
+
+ fcurve_drivers = child_pbone.driver_add("location", -1)
+ for i, fcurve_driver in enumerate(fcurve_drivers):
+ driver = fcurve_driver.driver
+ driver.type = 'AVERAGE'
+ #mod = fcurve_driver.modifiers.new('GENERATOR')
+ mod = fcurve_driver.modifiers[0]
+ mod.poly_order = 1
+ mod.coefficients[0] = delta_head_offset[i]
+ mod.coefficients[1] = 0.0
+
+
+ # arm, parent_pbone, parent_bone = get_bone_data(obj, delta_name)
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ bpy.ops.object.mode_set(mode=mode_orig)
+
+
+def gen_arm(obj, orig_bone_name):
+ """
+ the bone with the 'arm' property is the upper arm, this assumes a chain as follows.
+ [shoulder, upper_arm, forearm, hand]
+ ...where this bone is 'upper_arm'
+
+ there are 3 chains
+ - Original
+ - IK, MCH-%s_ik
+ - IKSwitch, MCH-%s ()
+ """
+
+ # Since there are 3 chains, this gets confusing so divide into 3 chains
+ # Initialize container classes for convenience
+ mt = bone_class_instance(obj, ["shoulder", "arm", "forearm", "hand"]) # meta
+ ik = bone_class_instance(obj, ["arm", "forearm", "pole", "hand"]) # ik
+ sw = bone_class_instance(obj, ["socket", "shoulder", "arm", "forearm", "hand"]) # hinge
+ ex = bone_class_instance(obj, ["arm_hinge"]) # hinge & extras
+
+
+ def chain_init():
+ '''
+ Sanity check and return the arm as a list of bone names.
+ '''
+ # do a sanity check
+ mt.arm = orig_bone_name
+ mt.update()
+
+ mt.shoulder_p = mt.arm_p.parent
+ mt.shoulder = mt.shoulder_p.name
+
+ if not mt.shoulder_p:
+ print("could not find 'arm' parent, skipping:", orig_bone_name)
+ return
+
+ # We could have some bones attached, find the bone that has this as its 2nd parent
+ hands = []
+ for pbone in obj.pose.bones:
+ index = pbone.parent_index(mt.arm_p)
+ if index == 2:
+ hands.append(pbone)
+
+ if len(hands) > 1:
+ print("more then 1 hand found on:", orig_bone_name)
+ return
+
+ # first add the 2 new bones
+ mt.hand_p = hands[0]
+ mt.hand = mt.hand_p.name
+
+ mt.forearm_p = mt.hand_p.parent
+ mt.forearm = mt.forearm_p.name
+
+ arm = obj.data
+
+
+ def chain_ik(prefix="MCH-%s_ik"):
+
+ mt.update()
+
+ # Add the edit bones
+ ik.hand_e = copy_bone_simple(arm, mt.hand, prefix % mt.hand)
+ ik.hand = ik.hand_e.name
+
+ ik.arm_e = copy_bone_simple(arm, mt.arm, prefix % mt.arm)
+ ik.arm = ik.arm_e.name
+
+ ik.forearm_e = copy_bone_simple(arm, mt.forearm, prefix % mt.forearm)
+ ik.forearm = ik.forearm_e.name
+
+ ik.arm_e.parent = mt.arm_e.parent
+ ik.forearm_e.connected = mt.arm_e.connected
+
+ ik.forearm_e.parent = ik.arm_e
+ ik.forearm_e.connected = True
+
+
+ # Add the bone used for the arms poll target
+ ik.pole = add_pole_target_bone(obj, mt.forearm, "elbow_poll", mode='+Z')
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ ik.update()
+
+ con = ik.forearm_p.constraints.new('IK')
+ con.target = obj
+ con.subtarget = ik.hand
+ con.pole_target = obj
+ con.pole_subtarget = ik.pole
+
+ con.use_tail = True
+ con.use_stretch = True
+ con.use_target = True
+ con.use_rotation = False
+ con.chain_length = 2
+ con.pole_angle = -90.0 # XXX, RAD2DEG
+
+ # ID Propery on the hand for IK/FK switch
+
+ prop = rna_idprop_ui_prop_get(ik.hand_p, "ik", create=True)
+ ik.hand_p["ik"] = 0.5
+ prop["soft_min"] = 0.0
+ prop["soft_max"] = 1.0
+
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ ik.arm = ik.arm
+ ik.forearm = ik.forearm
+ ik.hand = ik.hand
+ ik.pole = ik.pole
+
+ def chain_switch(prefix="MCH-%s"):
+
+ sw.update()
+ mt.update()
+
+ sw.shoulder_e = copy_bone_simple(arm, mt.shoulder, prefix % mt.shoulder)
+ sw.shoulder = sw.shoulder_e.name
+ sw.shoulder_e.parent = mt.shoulder_e.parent
+ sw.shoulder_e.connected = mt.shoulder_e.connected
+
+ sw.arm_e = copy_bone_simple(arm, mt.arm, prefix % mt.arm)
+ sw.arm = sw.arm_e.name
+ sw.arm_e.parent = sw.shoulder_e
+ sw.arm_e.connected = arm.edit_bones[mt.shoulder].connected
+
+ sw.forearm_e = copy_bone_simple(arm, mt.forearm, prefix % mt.forearm)
+ sw.forearm = sw.forearm_e.name
+ sw.forearm_e.parent = sw.arm_e
+ sw.forearm_e.connected = arm.edit_bones[mt.forearm].connected
+
+ sw.hand_e = copy_bone_simple(arm, mt.hand, prefix % mt.hand)
+ sw.hand = sw.hand_e.name
+ sw.hand_e.parent = sw.forearm_e
+ sw.hand_e.connected = arm.edit_bones[mt.hand].connected
+
+ # The sw.hand_e needs to own all the children on the metarig's hand
+ for child in mt.hand_e.children:
+ child.parent = sw.hand_e
+
+
+ # These are made the children of sw.shoulder_e
+
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ # Add constraints
+ sw.update()
+
+ #dummy, ik.arm, ik.forearm, ik.hand, ik.pole = ik_chain_tuple
+
+ ik_driver_path = obj.pose.bones[ik.hand].path_to_id() + '["ik"]'
+
+
+ def ik_fk_driver(con):
+ '''
+ 3 bones use this for ik/fk switching
+ '''
+ fcurve = con.driver_add("influence", 0)
+ driver = fcurve.driver
+ tar = driver.targets.new()
+ driver.type = 'AVERAGE'
+ tar.name = "ik"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = ik_driver_path
+
+ # ***********
+ con = sw.arm_p.constraints.new('COPY_ROTATION')
+ con.name = "FK"
+ con.target = obj
+ con.subtarget = mt.arm
+
+ con = sw.arm_p.constraints.new('COPY_ROTATION')
+
+ con.target = obj
+ con.subtarget = ik.arm
+ con.influence = 0.5
+ ik_fk_driver(con)
+
+ # ***********
+ con = sw.forearm_p.constraints.new('COPY_ROTATION')
+ con.name = "FK"
+ con.target = obj
+ con.subtarget = mt.forearm
+
+ con = sw.forearm_p.constraints.new('COPY_ROTATION')
+ con.name = "IK"
+ con.target = obj
+ con.subtarget = ik.forearm
+ con.influence = 0.5
+ ik_fk_driver(con)
+
+ # ***********
+ con = sw.hand_p.constraints.new('COPY_ROTATION')
+ con.name = "FK"
+ con.target = obj
+ con.subtarget = mt.hand
+
+ con = sw.hand_p.constraints.new('COPY_ROTATION')
+ con.name = "IK"
+ con.target = obj
+ con.subtarget = ik.hand
+ con.influence = 0.5
+ ik_fk_driver(con)
+
+
+ add_stretch_to(obj, sw.forearm, ik.pole, "VIS-elbow_ik_poll")
+ add_stretch_to(obj, sw.hand, ik.hand, "VIS-hand_ik")
+
+ bpy.ops.object.mode_set(mode='EDIT')
+
+
+ def chain_shoulder(prefix="MCH-%s"):
+
+ sw.socket_e = copy_bone_simple(arm, mt.arm, (prefix % mt.arm) + "_socket")
+ sw.socket = sw.socket_e.name
+ sw.socket_e.tail = arm.edit_bones[mt.shoulder].tail
+
+
+ # Set the shoulder as parent
+ ik.update()
+ sw.update()
+ mt.update()
+
+ sw.socket_e.parent = sw.shoulder_e
+ ik.arm_e.parent = sw.shoulder_e
+
+
+ # ***** add the shoulder hinge
+ # yes this is correct, the shoulder copy gets the arm's name
+ ex.arm_hinge_e = copy_bone_simple(arm, mt.shoulder, (prefix % mt.arm) + "_hinge")
+ ex.arm_hinge = ex.arm_hinge_e.name
+ offset = ex.arm_hinge_e.length / 2.0
+
+ ex.arm_hinge_e.head.y += offset
+ ex.arm_hinge_e.tail.y += offset
+
+ # Note: meta arm becomes child of hinge
+ mt.arm_e.parent = ex.arm_hinge_e
+
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ ex.update()
+
+ con = mt.arm_p.constraints.new('COPY_LOCATION')
+ con.target = obj
+ con.subtarget = sw.socket
+
+
+ # Hinge constraint & driver
+ con = ex.arm_hinge_p.constraints.new('COPY_ROTATION')
+ con.name = "hinge"
+ con.target = obj
+ con.subtarget = sw.shoulder
+ driver_fcurve = con.driver_add("influence", 0)
+ driver = driver_fcurve.driver
+
+
+ controller_path = mt.arm_p.path_to_id()
+ # add custom prop
+ mt.arm_p["hinge"] = 0.0
+ prop = rna_idprop_ui_prop_get(mt.arm_p, "hinge", create=True)
+ prop["soft_min"] = 0.0
+ prop["soft_max"] = 1.0
+
+
+ # *****
+ driver = driver_fcurve.driver
+ driver.type = 'AVERAGE'
+
+ tar = driver.targets.new()
+ tar.name = "hinge"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + '["hinge"]'
+
+
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ # remove the shoulder and re-parent
+
+
+
+ chain_init()
+ chain_ik()
+ chain_switch()
+ chain_shoulder()
+
+ # Shoulder with its delta and hinge.
+
+
+
+
+
+def gen_palm(obj, orig_bone_name):
+ arm, palm_pbone, palm_ebone = get_bone_data(obj, orig_bone_name)
+ children = [ebone.name for ebone in palm_ebone.children]
+ children.sort() # simply assume the pinky has the lowest name
+
+ # Make a copy of the pinky
+ pinky_ebone = arm.edit_bones[children[0]]
+ control_ebone = copy_bone_simple(arm, pinky_ebone.name, "palm_control", parent=True)
+ control_name = control_ebone.name
+
+ offset = (arm.edit_bones[children[0]].head - arm.edit_bones[children[1]].head)
+
+ control_ebone.head += offset
+ control_ebone.tail += offset
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+
+ arm, control_pbone, control_ebone = get_bone_data(obj, control_name)
+ arm, pinky_pbone, pinky_ebone = get_bone_data(obj, children[0])
+
+ control_pbone.rotation_mode = 'YZX'
+ control_pbone.lock_rotation = False, True, True
+
+ driver_fcurves = pinky_pbone.driver_add("rotation_euler")
+
+
+ controller_path = control_pbone.path_to_id()
+
+ # add custom prop
+ control_pbone["spread"] = 0.0
+ prop = rna_idprop_ui_prop_get(control_pbone, "spread", create=True)
+ prop["soft_min"] = -1.0
+ prop["soft_max"] = 1.0
+
+
+ # *****
+ driver = driver_fcurves[0].driver
+ driver.type = 'AVERAGE'
+
+ tar = driver.targets.new()
+ tar.name = "x"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + ".rotation_euler[0]"
+
+
+ # *****
+ driver = driver_fcurves[1].driver
+ driver.expression = "-x/4.0"
+
+ tar = driver.targets.new()
+ tar.name = "x"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + ".rotation_euler[0]"
+
+
+ # *****
+ driver = driver_fcurves[2].driver
+ driver.expression = "(1.0-cos(x))-s"
+ tar = driver.targets.new()
+ tar.name = "x"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + ".rotation_euler[0]"
+
+ tar = driver.targets.new()
+ tar.name = "s"
+ tar.id_type = 'OBJECT'
+ tar.id = obj
+ tar.rna_path = controller_path + '["spread"]'
+
+
+ for i, child_name in enumerate(children):
+ child_pbone = obj.pose.bones[child_name]
+ child_pbone.rotation_mode = 'YZX'
+
+ if child_name != children[-1] and child_name != children[0]:
+
+ # this is somewhat arbitrary but seems to look good
+ inf = i / (len(children)+1)
+ inf = 1.0 - inf
+ inf = ((inf * inf) + inf) / 2.0
+
+ # used for X/Y constraint
+ inf_minor = inf * inf
+
+ con = child_pbone.constraints.new('COPY_ROTATION')
+ con.name = "Copy Z Rot"
+ con.target = obj
+ con.subtarget = children[0] # also pinky_pbone
+ con.owner_space = con.target_space = 'LOCAL'
+ con.use_x, con.use_y, con.use_z = False, False, True
+ con.influence = inf
+
+ con = child_pbone.constraints.new('COPY_ROTATION')
+ con.name = "Copy XY Rot"
+ con.target = obj
+ con.subtarget = children[0] # also pinky_pbone
+ con.owner_space = con.target_space = 'LOCAL'
+ con.use_x, con.use_y, con.use_z = True, True, False
+ con.influence = inf_minor
+
+
+ child_pbone = obj.pose.bones[children[-1]]
+ child_pbone.rotation_mode = 'QUATERNION'
+
+
+gen_table = {
+ "":gen_none, \
+ "finger":gen_finger, \
+ "delta":gen_delta, \
+ "arm":gen_arm, \
+ "palm":gen_palm, \
+}
+
+def generate_rig(context, ob):
+
+ global_undo = context.user_preferences.edit.global_undo
+ context.user_preferences.edit.global_undo = False
+
+ # add_stretch_to(ob, "a", "b", "c")
+
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+
+ # copy object and data
+ ob.selected = False
+ ob_new = ob.copy()
+ ob_new.data = ob.data.copy()
+ scene = context.scene
+ scene.objects.link(ob_new)
+ scene.objects.active = ob_new
+ ob_new.selected = True
+
+ # enter armature editmode
+
+
+ for pbone_name in ob_new.pose.bones.keys():
+ bone_type = ob_new.pose.bones[pbone_name].get("type", "")
+
+ try:
+ func = gen_table[bone_type]
+ except KeyError:
+ print("\tunknown type '%s', bone '%s'" % (bone_type, pbone_name))
+
+
+ # Toggle editmode so the pose data is always up to date
+ bpy.ops.object.mode_set(mode='EDIT')
+ func(ob_new, pbone_name)
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ # needed to update driver deps
+ # context.scene.update()
+
+ # Only for demo'ing
+ ob.restrict_view = True
+ ob_new.data.draw_axes = False
+
+ context.user_preferences.edit.global_undo = global_undo
+
+if __name__ == "__main__":
+ generate_rig(bpy.context, bpy.context.object)
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
new file mode 100644
index 00000000000..d19449f9404
--- /dev/null
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -0,0 +1,276 @@
+# ##### 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 #####
+
+#
+
+import bpy
+
+def rna_idprop_ui_get(item, create=True):
+ try:
+ return item['_RNA_UI']
+ except:
+ if create:
+ item['_RNA_UI'] = {}
+ return item['_RNA_UI']
+ else:
+ return None
+
+
+def rna_idprop_ui_prop_get(item, prop, create=True):
+
+ rna_ui = rna_idprop_ui_get(item, create)
+
+ if rna_ui == None:
+ return None
+
+ try:
+ return rna_ui[prop]
+ except:
+ rna_ui[prop] = {}
+ return rna_ui[prop]
+
+
+def rna_idprop_ui_prop_clear(item, prop):
+ rna_ui = rna_idprop_ui_get(item, False)
+
+ if rna_ui == None:
+ return
+
+ try:
+ del rna_ui[prop]
+ except:
+ pass
+
+
+def draw(layout, context, context_member, use_edit = True):
+
+ def assign_props(prop, val, key):
+ prop.path = context_member
+ prop.property = key
+
+ try:
+ prop.value = str(val)
+ except:
+ pass
+
+ rna_item = eval("context." + context_member)
+
+ # poll should really get this...
+ if not rna_item:
+ return
+
+ items = rna_item.items()
+ items.sort()
+
+ if use_edit:
+ row = layout.row()
+ props = row.operator("wm.properties_add", text="Add")
+ props.path = context_member
+ del row
+
+ for key, val in items:
+
+ if key == '_RNA_UI':
+ continue
+
+ row = layout.row()
+ convert_to_pyobject = getattr(val, "convert_to_pyobject", None)
+
+ val_orig = val
+ if convert_to_pyobject:
+ val_draw = val = val.convert_to_pyobject()
+ val_draw = str(val_draw)
+ else:
+ val_draw = val
+
+ box = row.box()
+
+ if use_edit:
+ split = box.split(percentage=0.75)
+ row = split.row()
+ else:
+ row = box.row()
+
+ row.label(text=key)
+
+ # explicit exception for arrays
+ if convert_to_pyobject and not hasattr(val_orig, "len"):
+ row.label(text=val_draw)
+ else:
+ row.prop(rna_item, '["%s"]' % key, text="")
+
+ if use_edit:
+ row = split.row(align=True)
+ prop = row.operator("wm.properties_edit", text="edit")
+ assign_props(prop, val_draw, key)
+
+ prop = row.operator("wm.properties_remove", text="", icon='ICON_ZOOMOUT')
+ assign_props(prop, val_draw, key)
+
+
+from bpy.props import *
+
+
+rna_path = StringProperty(name="Property Edit",
+ description="Property path edit", maxlen=1024, default="", hidden=True)
+
+rna_value = StringProperty(name="Property Value",
+ description="Property value edit", maxlen=1024, default="")
+
+rna_property = StringProperty(name="Property Name",
+ description="Property name edit", maxlen=1024, default="")
+
+rna_min = FloatProperty(name="Min", default=0.0, precision=3)
+rna_max = FloatProperty(name="Max", default=1.0, precision=3)
+
+class WM_OT_properties_edit(bpy.types.Operator):
+ '''Internal use (edit a property path)'''
+ bl_idname = "wm.properties_edit"
+ bl_label = "Edit Property!"
+
+ path = rna_path
+ property = rna_property
+ value = rna_value
+ min = rna_min
+ max = rna_max
+ description = StringProperty(name="Tip", default="")
+
+ # the class instance is not persistant, need to store in the class
+ # not ideal but changes as the op runs.
+ _last_prop = ['']
+
+ def execute(self, context):
+ path = self.properties.path
+ value = self.properties.value
+ prop = self.properties.property
+ prop_old = self._last_prop[0]
+
+ try:
+ value_eval = eval(value)
+ except:
+ value_eval = value
+
+ if type(value_eval) == str:
+ value_eval = '"' + value_eval + '"'
+
+ # First remove
+ item = eval("context.%s" % path)
+
+ rna_idprop_ui_prop_clear(item, prop_old)
+ exec_str = "del item['%s']" % prop_old
+ # print(exec_str)
+ exec(exec_str)
+
+
+ # Reassign
+ exec_str = "item['%s'] = %s" % (prop, value_eval)
+ # print(exec_str)
+ exec(exec_str)
+ self._last_prop[:] = [prop]
+
+ prop_type = type(item[prop])
+
+ prop_ui = rna_idprop_ui_prop_get(item, prop)
+
+ if prop_type in (float, int):
+
+ prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.properties.min)
+ prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.properties.max)
+
+ prop_ui['description'] = self.properties.description
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+
+ self._last_prop[:] = [self.properties.property]
+
+ item = eval("context.%s" % self.properties.path)
+
+ # setup defaults
+ prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
+ if prop_ui:
+ self.properties.min = prop_ui.get("min", -1000000000)
+ self.properties.max = prop_ui.get("max", 1000000000)
+ self.properties.description = prop_ui.get("description", "")
+
+ if 0:
+ _message= "PyConsole, press Ctrl+D to unlock the BGE"
+ import sys
+
+ # evaluate commands in current namespace
+ frame= sys._getframe()
+ namespace = frame.f_globals.copy()
+ namespace.update(frame.f_locals)
+
+ import code
+
+ # Autocomp in python, not as comprehensive as IPython
+ import rlcompleter
+
+ try: # ick, some pythons dont have this
+ import readline
+ readline.parse_and_bind("tab: complete")
+ except:
+ pass
+
+ code.interact(banner=_message, local=namespace)
+
+ wm = context.manager
+ wm.invoke_props_popup(self, event)
+ return ('RUNNING_MODAL',)
+
+
+class WM_OT_properties_add(bpy.types.Operator):
+ '''Internal use (edit a property path)'''
+ bl_idname = "wm.properties_add"
+ bl_label = "Add Property"
+
+ path = rna_path
+
+ def execute(self, context):
+ item = eval("context.%s" % self.properties.path)
+
+ def unique_name(names):
+ prop = 'prop'
+ prop_new = prop
+ i = 1
+ while prop_new in names:
+ prop_new = prop + str(i)
+ i+=1
+
+ return prop_new
+
+ property = unique_name(item.keys())
+
+ item[property] = 1.0
+ return ('FINISHED',)
+
+class WM_OT_properties_remove(bpy.types.Operator):
+ '''Internal use (edit a property path)'''
+ bl_idname = "wm.properties_remove"
+ bl_label = "Add Property"
+
+ path = rna_path
+ property = rna_property
+
+ def execute(self, context):
+ 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 ddc4f0b9770..fe8feecf43d 100644
--- a/release/scripts/op/add_mesh_torus.py
+++ b/release/scripts/op/add_mesh_torus.py
@@ -96,10 +96,10 @@ class AddTorus(bpy.types.Operator):
def execute(self, context):
- verts_loc, faces = add_torus(self.major_radius,
- self.minor_radius,
- self.major_segments,
- self.minor_segments)
+ verts_loc, faces = add_torus(self.properties.major_radius,
+ self.properties.minor_radius,
+ self.properties.major_segments,
+ self.properties.minor_segments)
mesh = bpy.data.add_mesh("Torus")
@@ -116,7 +116,7 @@ class AddTorus(bpy.types.Operator):
mesh.update()
ob_new = bpy.data.add_object('MESH', "Torus")
ob_new.data = mesh
- scene.add_object(ob_new)
+ scene.objects.link(ob_new)
scene.objects.active = ob_new
ob_new.selected = True
@@ -130,7 +130,7 @@ bpy.ops.add(AddTorus)
# Add to a menu
import dynamic_menu
-menu_func = (lambda self, context: self.layout.itemO(AddTorus.bl_idname,
+menu_func = (lambda self, context: self.layout.operator(AddTorus.bl_idname,
text="Torus", icon='ICON_MESH_DONUT'))
menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, menu_func)
diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py
index d3b745c7ead..532602655fa 100644
--- a/release/scripts/op/console_python.py
+++ b/release/scripts/op/console_python.py
@@ -66,160 +66,130 @@ def get_console(console_id):
return console, stdout, stderr
-class PyConsoleExec(bpy.types.Operator):
- '''Execute the current console line as a python expression.'''
- bl_idname = "console.execute_" + language_id
- bl_label = "Console Execute"
- bl_register = False
+# Both prompts must be the same length
+PROMPT = '>>> '
+PROMPT_MULTI = '... '
- # Both prompts must be the same length
- PROMPT = '>>> '
- PROMPT_MULTI = '... '
+def execute(context):
+ sc = context.space_data
- # is this working???
- '''
- def poll(self, context):
- return (context.space_data.type == 'PYTHON')
- '''
- # its not :|
+ try:
+ line = sc.history[-1].line
+ except:
+ return ('CANCELLED',)
- def execute(self, context):
- sc = context.space_data
+ if sc.console_type != 'PYTHON':
+ return ('CANCELLED',)
- try:
- line = sc.history[-1].line
- except:
- return ('CANCELLED',)
+ console, stdout, stderr = get_console(hash(context.region))
- if sc.console_type != 'PYTHON':
- return ('CANCELLED',)
+ # Hack, useful but must add some other way to access
+ #if "C" not in console.locals:
+ console.locals["C"] = context
- console, stdout, stderr = get_console(hash(context.region))
+ # redirect output
+ sys.stdout = stdout
+ sys.stderr = stderr
- # Hack, useful but must add some other way to access
- #if "C" not in console.locals:
- console.locals["C"] = context
+ # run the console
+ if not line.strip():
+ line_exec = '\n' # executes a multiline statement
+ else:
+ line_exec = line
- # redirect output
- sys.stdout = stdout
- sys.stderr = stderr
+ is_multiline = console.push(line_exec)
- # run the console
- if not line.strip():
- line_exec = '\n' # executes a multiline statement
- else:
- line_exec = line
+ stdout.seek(0)
+ stderr.seek(0)
- is_multiline = console.push(line_exec)
+ output = stdout.read()
+ output_err = stderr.read()
- stdout.seek(0)
- stderr.seek(0)
+ # cleanup
+ sys.stdout = sys.__stdout__
+ sys.stderr = sys.__stderr__
+ sys.last_traceback = None
- output = stdout.read()
- output_err = stderr.read()
+ # So we can reuse, clear all data
+ stdout.truncate(0)
+ stderr.truncate(0)
- # cleanup
- sys.stdout = sys.__stdout__
- sys.stderr = sys.__stderr__
- sys.last_traceback = None
+ bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT')
- # So we can reuse, clear all data
- stdout.truncate(0)
- stderr.truncate(0)
+ if is_multiline:
+ sc.prompt = PROMPT_MULTI
+ else:
+ sc.prompt = PROMPT
- bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT')
+ # insert a new blank line
+ bpy.ops.console.history_append(text="", current_character=0,
+ remove_duplicates=True)
- if is_multiline:
- sc.prompt = self.PROMPT_MULTI
- else:
- sc.prompt = self.PROMPT
+ # Insert the output into the editor
+ # not quite correct because the order might have changed,
+ # but ok 99% of the time.
+ if output:
+ add_scrollback(output, 'OUTPUT')
+ if output_err:
+ add_scrollback(output_err, 'ERROR')
- # insert a new blank line
- bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
-
- # Insert the output into the editor
- # not quite correct because the order might have changed,
- # but ok 99% of the time.
- if output:
- add_scrollback(output, 'OUTPUT')
- if output_err:
- add_scrollback(output_err, 'ERROR')
-
- return ('FINISHED',)
+ return ('FINISHED',)
-class PyConsoleAutocomplete(bpy.types.Operator):
- '''Evaluate the namespace up until the cursor and give a list of
- options or complete the name if there is only one.'''
- bl_idname = "console.autocomplete_" + language_id
- bl_label = "Python Console Autocomplete"
- bl_register = False
+def autocomplete(context):
+ from console import intellisense
- def poll(self, context):
- return context.space_data.console_type == 'PYTHON'
+ sc = context.space_data
- def execute(self, context):
- from console import intellisense
+ console = get_console(hash(context.region))[0]
- sc = context.space_data
+ current_line = sc.history[-1]
+ line = current_line.line
- console = get_console(hash(context.region))[0]
-
- current_line = sc.history[-1]
- line = current_line.line
+ if not console:
+ return ('CANCELLED',)
- if not console:
- return ('CANCELLED',)
+ if sc.console_type != 'PYTHON':
+ return ('CANCELLED',)
- if sc.console_type != 'PYTHON':
- return ('CANCELLED',)
+ # This function isnt aware of the text editor or being an operator
+ # just does the autocomp then copy its results back
+ current_line.line, current_line.current_character, scrollback = \
+ intellisense.expand(
+ line=current_line.line,
+ cursor=current_line.current_character,
+ namespace=console.locals,
+ private='-d' in sys.argv)
- # This function isnt aware of the text editor or being an operator
- # just does the autocomp then copy its results back
- current_line.line, current_line.current_character, scrollback = \
- intellisense.expand(
- line=current_line.line,
- cursor=current_line.current_character,
- namespace=console.locals,
- private='-d' in sys.argv)
+ # Now we need to copy back the line from blender back into the
+ # text editor. This will change when we dont use the text editor
+ # anymore
+ if scrollback:
+ add_scrollback(scrollback, 'INFO')
- # Now we need to copy back the line from blender back into the
- # text editor. This will change when we dont use the text editor
- # anymore
- if scrollback:
- add_scrollback(scrollback, 'INFO')
+ context.area.tag_redraw()
- context.area.tag_redraw()
-
- return ('FINISHED',)
+ return ('FINISHED',)
-class PyConsoleBanner(bpy.types.Operator):
- bl_idname = "console.banner_" + language_id
+def banner(context):
+ sc = context.space_data
+ version_string = sys.version.strip().replace('\n', ' ')
- def execute(self, context):
- sc = context.space_data
- version_string = sys.version.strip().replace('\n', ' ')
+ add_scrollback(" * Python Interactive Console %s *" % version_string, 'OUTPUT')
+ add_scrollback("Command History: Up/Down Arrow", 'OUTPUT')
+ add_scrollback("Cursor: Left/Right Home/End", 'OUTPUT')
+ add_scrollback("Remove: Backspace/Delete", 'OUTPUT')
+ add_scrollback("Execute: Enter", 'OUTPUT')
+ add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT')
+ add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT')
+ add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, Mathutils, Geometry, BGL", 'OUTPUT')
+ add_scrollback("", 'OUTPUT')
+ add_scrollback("", 'OUTPUT')
+ sc.prompt = PROMPT
- add_scrollback(" * Python Interactive Console %s *" % version_string, 'OUTPUT')
- add_scrollback("Command History: Up/Down Arrow", 'OUTPUT')
- add_scrollback("Cursor: Left/Right Home/End", 'OUTPUT')
- add_scrollback("Remove: Backspace/Delete", 'OUTPUT')
- add_scrollback("Execute: Enter", 'OUTPUT')
- add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT')
- add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT')
- add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, Mathutils, Geometry, BGL", 'OUTPUT')
- add_scrollback("", 'OUTPUT')
- add_scrollback("", 'OUTPUT')
- sc.prompt = PyConsoleExec.PROMPT
+ # Add context into the namespace for quick access
+ console = get_console(hash(context.region))[0]
+ console.locals["C"] = bpy.context
- # Add context into the namespace for quick access
- console = get_console(hash(context.region))[0]
- console.locals["C"] = bpy.context
-
- return ('FINISHED',)
-
-bpy.ops.add(PyConsoleExec)
-bpy.ops.add(PyConsoleAutocomplete)
-bpy.ops.add(PyConsoleBanner)
+ return ('FINISHED',)
diff --git a/release/scripts/op/console_shell.py b/release/scripts/op/console_shell.py
index 874101d1c79..7262a434a51 100644
--- a/release/scripts/op/console_shell.py
+++ b/release/scripts/op/console_shell.py
@@ -41,73 +41,40 @@ def shell_run(text):
add_scrollback(output, style)
-
-class ShellConsoleExec(bpy.types.Operator):
- '''Execute the current console line as a python expression.'''
- bl_idname = "console.execute_" + language_id
- bl_label = "Console Execute"
- bl_register = False
-
- # Both prompts must be the same length
- PROMPT = '$ '
-
- # is this working???
- '''
- def poll(self, context):
- return (context.space_data.type == 'PYTHON')
- '''
- # its not :|
-
- def execute(self, context):
- sc = context.space_data
-
- try:
- line = sc.history[-1].line
- except:
- return ('CANCELLED',)
-
- bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT')
-
- shell_run(line)
-
- # insert a new blank line
- bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
-
- sc.prompt = os.getcwd()+ShellConsoleExec.PROMPT
- return ('FINISHED',)
+PROMPT = '$ '
-class ShellConsoleAutocomplete(bpy.types.Operator):
- '''Evaluate the namespace up until the cursor and give a list of
- options or complete the name if there is only one.'''
- bl_idname = "console.autocomplete_" + language_id
- bl_label = "Python Console Autocomplete"
- bl_register = False
+def execute(context):
+ sc = context.space_data
- def poll(self, context):
- return context.space_data.console_type == 'PYTHON'
-
- def execute(self, context):
- from console import intellisense
-
- sc = context.space_data
-
- # TODO
+ try:
+ line = sc.history[-1].line
+ except:
return ('CANCELLED',)
+ bpy.ops.console.scrollback_append(text=sc.prompt + line, type='INPUT')
-class ShellConsoleBanner(bpy.types.Operator):
- bl_idname = "console.banner_" + language_id
+ shell_run(line)
- def execute(self, context):
- sc = context.space_data
-
- shell_run("bash --version")
- sc.prompt = os.getcwd()+ShellConsoleExec.PROMPT
+ # insert a new blank line
+ bpy.ops.console.history_append(text="", current_character=0,
+ remove_duplicates=True)
- return ('FINISHED',)
+ sc.prompt = os.getcwd()+PROMPT
+ return ('FINISHED',)
+
+
+def autocomplete(context):
+ # sc = context.space_data
+ # TODO
+ return ('CANCELLED',)
+
+
+def banner(context):
+ sc = context.space_data
+
+ shell_run("bash --version")
+ sc.prompt = os.getcwd()+PROMPT
+
+ return ('FINISHED',)
-bpy.ops.add(ShellConsoleExec)
-bpy.ops.add(ShellConsoleAutocomplete)
-bpy.ops.add(ShellConsoleBanner)
diff --git a/release/scripts/op/mesh.py b/release/scripts/op/mesh.py
index f78e33730f0..0e57bc440d1 100644
--- a/release/scripts/op/mesh.py
+++ b/release/scripts/op/mesh.py
@@ -4,12 +4,12 @@
# 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.
@@ -26,12 +26,12 @@ def main(context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
mesh = ob.data
-
+
face_list = [face for face in mesh.faces]
face_edge_keys = [face.edge_keys for face in face_list]
edge_face_count = mesh.edge_face_count_dict
-
+
def test_interior(index):
for key in face_edge_keys[index]:
if edge_face_count[key] < 3:
diff --git a/release/scripts/op/mesh_skin.py b/release/scripts/op/mesh_skin.py
index f9a92c8cd82..5cf526cc23e 100644
--- a/release/scripts/op/mesh_skin.py
+++ b/release/scripts/op/mesh_skin.py
@@ -4,12 +4,12 @@
# 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.
@@ -29,612 +29,620 @@ from Mathutils import AngleBetweenVecs as _AngleBetweenVecs_
BIG_NUM = 1<<30
global CULL_METHOD
-CULL_METHOD = 0
+CULL_METHOD = 0
def AngleBetweenVecs(a1,a2):
- import math
- try:
- return math.degrees(_AngleBetweenVecs_(a1,a2))
- except:
- return 180.0
+ import math
+ try:
+ return math.degrees(_AngleBetweenVecs_(a1,a2))
+ except:
+ return 180.0
class edge(object):
- __slots__ = 'v1', 'v2', 'co1', 'co2', 'length', 'removed', 'match', 'cent', 'angle', 'next', 'prev', 'normal', 'fake'
- def __init__(self, v1,v2):
- self.v1 = v1
- self.v2 = v2
- co1, co2= v1.co, v2.co
- self.co1= co1
- self.co2= co2
-
- # uv1 uv2 vcol1 vcol2 # Add later
- self.length = (co1 - co2).length
- self.removed = 0 # Have we been culled from the eloop
- self.match = None # The other edge were making a face with
-
- self.cent= MidpointVecs(co1, co2)
- self.angle= 0.0
- self.fake= False
+ __slots__ = 'v1', 'v2', 'co1', 'co2', 'length', 'removed', 'match', 'cent', 'angle', 'next', 'prev', 'normal', 'fake'
+ def __init__(self, v1,v2):
+ self.v1 = v1
+ self.v2 = v2
+ co1, co2= v1.co, v2.co
+ self.co1= co1
+ self.co2= co2
+
+ # uv1 uv2 vcol1 vcol2 # Add later
+ self.length = (co1 - co2).length
+ self.removed = 0 # Have we been culled from the eloop
+ self.match = None # The other edge were making a face with
+
+ self.cent= MidpointVecs(co1, co2)
+ self.angle= 0.0
+ self.fake= False
class edgeLoop(object):
- __slots__ = 'centre', 'edges', 'normal', 'closed', 'backup_edges'
- def __init__(self, loop, me, closed): # Vert loop
- # Use next and prev, nextDist, prevDist
-
- # Get Loops centre.
- fac= len(loop)
- verts = me.verts
- self.centre= functools.reduce(lambda a,b: a+verts[b].co/fac, loop, Vector())
-
- # Convert Vert loop to Edges.
- self.edges = [edge(verts[loop[vIdx-1]], verts[loop[vIdx]]) for vIdx in range(len(loop))]
-
- if not closed:
- self.edges[0].fake = True # fake edge option
-
- self.closed = closed
-
-
- # Assign linked list
- for eIdx in range(len(self.edges)-1):
- self.edges[eIdx].next = self.edges[eIdx+1]
- self.edges[eIdx].prev = self.edges[eIdx-1]
- # Now last
- self.edges[-1].next = self.edges[0]
- self.edges[-1].prev = self.edges[-2]
-
-
-
- # GENERATE AN AVERAGE NORMAL FOR THE WHOLE LOOP.
- self.normal = Vector()
- for e in self.edges:
- n = (self.centre-e.co1).cross(self.centre-e.co2)
- # Do we realy need tot normalize?
- n.normalize()
- self.normal += n
-
- # Generate the angle
- va= e.cent - e.prev.cent
- vb= e.next.cent - e.cent
-
- e.angle= AngleBetweenVecs(va, vb)
-
- # Blur the angles
- #for e in self.edges:
- # e.angle= (e.angle+e.next.angle)/2
-
- # Blur the angles
- #for e in self.edges:
- # e.angle= (e.angle+e.prev.angle)/2
-
- self.normal.normalize()
-
- # Generate a normal for each edge.
- for e in self.edges:
-
- n1 = e.co1
- n2 = e.co2
- n3 = e.prev.co1
-
- a = n1-n2
- b = n1-n3
- normal1 = a.cross(b)
- normal1.normalize()
-
- n1 = e.co2
- n3 = e.next.co2
- n2 = e.co1
-
- a = n1-n2
- b = n1-n3
-
- normal2 = a.cross(b)
- normal2.normalize()
-
- # Reuse normal1 var
- normal1 += normal1 + normal2
- normal1.normalize()
-
- e.normal = normal1
- #print e.normal
+ __slots__ = 'centre', 'edges', 'normal', 'closed', 'backup_edges'
+ def __init__(self, loop, me, closed): # Vert loop
+ # Use next and prev, nextDist, prevDist
+
+ # Get Loops centre.
+ fac= len(loop)
+ verts = me.verts
+ self.centre= functools.reduce(lambda a,b: a+verts[b].co/fac, loop, Vector())
+
+ # Convert Vert loop to Edges.
+ self.edges = [edge(verts[loop[vIdx-1]], verts[loop[vIdx]]) for vIdx in range(len(loop))]
+
+ if not closed:
+ self.edges[0].fake = True # fake edge option
+
+ self.closed = closed
-
- def backup(self):
- # Keep a backup of the edges
- self.backup_edges = self.edges[:]
-
- def restore(self):
- self.edges = self.backup_edges[:]
- for e in self.edges:
- e.removed = 0
-
- def reverse(self):
- self.edges.reverse()
- self.normal.negate()
-
- for e in self.edges:
- e.normal.negate()
- e.v1, e.v2 = e.v2, e.v1
- e.co1, e.co2 = e.co2, e.co1
- e.next, e.prev = e.prev, e.next
-
-
- def removeSmallest(self, cullNum, otherLoopLen):
- '''
- Removes N Smallest edges and backs up the loop,
- this is so we can loop between 2 loops as if they are the same length,
- backing up and restoring incase the loop needs to be skinned with another loop of a different length.
- '''
- global CULL_METHOD
- if CULL_METHOD == 1: # Shortest edge
- eloopCopy = self.edges[:]
-
- # Length sort, smallest first
- try: eloopCopy.sort(key = lambda e1: e1.length)
- except: eloopCopy.sort(lambda e1, e2: cmp(e1.length, e2.length ))
-
- # Dont use atm
- #eloopCopy.sort(lambda e1, e2: cmp(e1.angle*e1.length, e2.angle*e2.length)) # Length sort, smallest first
- #eloopCopy.sort(lambda e1, e2: cmp(e1.angle, e2.angle)) # Length sort, smallest first
-
- remNum = 0
- for i, e in enumerate(eloopCopy):
- if not e.fake:
- e.removed = 1
- self.edges.remove( e ) # Remove from own list, still in linked list.
- remNum += 1
-
- if not remNum < cullNum:
- break
-
- else: # CULL METHOD is even
-
- culled = 0
-
- step = int(otherLoopLen / float(cullNum)) * 2
-
- currentEdge = self.edges[0]
- while culled < cullNum:
-
- # Get the shortest face in the next STEP
- step_count= 0
- bestAng= 360.0
- smallestEdge= None
- while step_count<=step or smallestEdge==None:
- step_count+=1
- if not currentEdge.removed: # 0 or -1 will not be accepted
- if currentEdge.angle 2:
- return None
-
- vert_used[i] = True
-
- # do an edgeloop seek
- if len(sbl) == 2:
- contextVertLoop= [sbl[0], i, sbl[1]] # start the vert loop
- vert_used[contextVertLoop[ 0]] = True
- vert_used[contextVertLoop[-1]] = True
- else:
- contextVertLoop= [i, sbl[0]]
- vert_used[contextVertLoop[ 1]] = True
-
- # Always seek up
- ok = True
- while ok:
- ok = False
- closed = False
- sbl = vert_siblings[contextVertLoop[-1]]
- if len(sbl) == 2:
- next = sbl[not sbl.index( contextVertLoop[-2] )]
- if vert_used[next]:
- closed = True
- # break
- else:
- contextVertLoop.append( next ) # get the vert that isnt the second last
- vert_used[next] = True
- ok = True
-
- # Seek down as long as the starting vert was not at the edge.
- if not closed and len(vert_siblings[i]) == 2:
-
- ok = True
- while ok:
- ok = False
- sbl = vert_siblings[contextVertLoop[0]]
- if len(sbl) == 2:
- next = sbl[not sbl.index( contextVertLoop[1] )]
- if vert_used[next]:
- closed = True
- else:
- contextVertLoop.insert(0, next) # get the vert that isnt the second last
- vert_used[next] = True
- ok = True
-
- mainVertLoops.append((contextVertLoop, closed))
-
-
- verts = me.verts
- # convert from indicies to verts
- # mainVertLoops = [([verts[i] for i in contextVertLoop], closed) for contextVertLoop, closed in mainVertLoops]
- # print len(mainVertLoops)
- return mainVertLoops
-
+ '''
+ return a list of vert loops, closed and open [(loop, closed)...]
+ '''
+
+ mainVertLoops = []
+ # second method
+ tot = len(me.verts)
+ vert_siblings = [[] for i in range(tot)]
+ vert_used = [False] * tot
+
+ for ed in selEdges:
+ i1, i2 = ed.key
+ vert_siblings[i1].append(i2)
+ vert_siblings[i2].append(i1)
+
+ # find the first used vert and keep looping.
+ for i in range(tot):
+ if vert_siblings[i] and not vert_used[i]:
+ sbl = vert_siblings[i] # siblings
+
+ if len(sbl) > 2:
+ return None
+
+ vert_used[i] = True
+
+ # do an edgeloop seek
+ if len(sbl) == 2:
+ contextVertLoop= [sbl[0], i, sbl[1]] # start the vert loop
+ vert_used[contextVertLoop[ 0]] = True
+ vert_used[contextVertLoop[-1]] = True
+ else:
+ contextVertLoop= [i, sbl[0]]
+ vert_used[contextVertLoop[ 1]] = True
+
+ # Always seek up
+ ok = True
+ while ok:
+ ok = False
+ closed = False
+ sbl = vert_siblings[contextVertLoop[-1]]
+ if len(sbl) == 2:
+ next = sbl[not sbl.index( contextVertLoop[-2] )]
+ if vert_used[next]:
+ closed = True
+ # break
+ else:
+ contextVertLoop.append( next ) # get the vert that isnt the second last
+ vert_used[next] = True
+ ok = True
+
+ # Seek down as long as the starting vert was not at the edge.
+ if not closed and len(vert_siblings[i]) == 2:
+
+ ok = True
+ while ok:
+ ok = False
+ sbl = vert_siblings[contextVertLoop[0]]
+ if len(sbl) == 2:
+ next = sbl[not sbl.index( contextVertLoop[1] )]
+ if vert_used[next]:
+ closed = True
+ else:
+ contextVertLoop.insert(0, next) # get the vert that isnt the second last
+ vert_used[next] = True
+ ok = True
+
+ mainVertLoops.append((contextVertLoop, closed))
+
+
+ verts = me.verts
+ # convert from indicies to verts
+ # mainVertLoops = [([verts[i] for i in contextVertLoop], closed) for contextVertLoop, closed in mainVertLoops]
+ # print len(mainVertLoops)
+ return mainVertLoops
+
def skin2EdgeLoops(eloop1, eloop2, me, ob, MODE):
-
- new_faces= [] #
-
- # Make sure e1 loops is bigger then e2
- if len(eloop1.edges) != len(eloop2.edges):
- if len(eloop1.edges) < len(eloop2.edges):
- eloop1, eloop2 = eloop2, eloop1
-
- eloop1.backup() # were about to cull faces
- CULL_FACES = len(eloop1.edges) - len(eloop2.edges)
- eloop1.removeSmallest(CULL_FACES, len(eloop1.edges))
- else:
- CULL_FACES = 0
- # First make sure poly vert loops are in sync with eachother.
-
- # The vector allong which we are skinning.
- skinVector = eloop1.centre - eloop2.centre
-
- loopDist = skinVector.length
-
- # IS THE LOOP FLIPPED, IF SO FLIP BACK. we keep it flipped, its ok,
- if eloop1.closed or eloop2.closed:
- angleBetweenLoopNormals = AngleBetweenVecs(eloop1.normal, eloop2.normal)
- if angleBetweenLoopNormals > 90:
- eloop2.reverse()
-
- DIR= eloop1.centre - eloop2.centre
-
- # if eloop2.closed:
- bestEloopDist = BIG_NUM
- bestOffset = 0
- # Loop rotation offset to test.1
- eLoopIdxs = list(range(len(eloop1.edges)))
- for offset in range(len(eloop1.edges)):
- totEloopDist = 0 # Measure this total distance for thsi loop.
-
- offsetIndexLs = eLoopIdxs[offset:] + eLoopIdxs[:offset] # Make offset index list
-
-
- # e1Idx is always from 0uu to N, e2Idx is offset.
- for e1Idx, e2Idx in enumerate(offsetIndexLs):
- e1= eloop1.edges[e1Idx]
- e2= eloop2.edges[e2Idx]
-
-
- # Include fan connections in the measurement.
- OK= True
- while OK or e1.removed:
- OK= False
-
- # Measure the vloop distance ===============
- diff= ((e1.cent - e2.cent).length) #/ nangle1
-
- ed_dir= e1.cent-e2.cent
- a_diff= AngleBetweenVecs(DIR, ed_dir)/18 # 0 t0 18
-
- totEloopDist += (diff * (1+a_diff)) / (1+loopDist)
-
- # Premeture break if where no better off
- if totEloopDist > bestEloopDist:
- break
-
- e1=e1.next
-
- if totEloopDist < bestEloopDist:
- bestOffset = offset
- bestEloopDist = totEloopDist
-
- # Modify V2 LS for Best offset
- eloop2.edges = eloop2.edges[bestOffset:] + eloop2.edges[:bestOffset]
-
- else:
- # Both are open loops, easier to calculate.
-
-
- # Make sure the fake edges are at the start.
- for i, edloop in enumerate((eloop1, eloop2)):
- # print "LOOPO"
- if edloop.edges[0].fake:
- # alredy at the start
- #print "A"
- pass
- elif edloop.edges[-1].fake:
- # put the end at the start
- edloop.edges.insert(0, edloop.edges.pop())
- #print "B"
-
- else:
- for j, ed in enumerate(edloop.edges):
- if ed.fake:
- #print "C"
- edloop.edges = edloop.edges = edloop.edges[j:] + edloop.edges[:j]
- break
- # print "DONE"
- ed1, ed2 = eloop1.edges[0], eloop2.edges[0]
-
- if not ed1.fake or not ed2.fake:
- raise "Error"
-
- # Find the join that isnt flipped (juts like detecting a bow-tie face)
- a1 = (ed1.co1 - ed2.co1).length + (ed1.co2 - ed2.co2).length
- a2 = (ed1.co1 - ed2.co2).length + (ed1.co2 - ed2.co1).length
-
- if a1 > a2:
- eloop2.reverse()
- # make the first edge the start edge still
- eloop2.edges.insert(0, eloop2.edges.pop())
-
-
-
-
- for loopIdx in range(len(eloop2.edges)):
- e1 = eloop1.edges[loopIdx]
- e2 = eloop2.edges[loopIdx]
-
- # Remember the pairs for fan filling culled edges.
- e1.match = e2; e2.match = e1
-
- if not (e1.fake or e2.fake):
- new_faces.append([e1.v1, e1.v2, e2.v2, e2.v1])
-
- # FAN FILL MISSING FACES.
- if CULL_FACES:
- # Culled edges will be in eloop1.
- FAN_FILLED_FACES = 0
-
- contextEdge = eloop1.edges[0] # The larger of teh 2
- while FAN_FILLED_FACES < CULL_FACES:
- while contextEdge.next.removed == 0:
- contextEdge = contextEdge.next
-
- vertFanPivot = contextEdge.match.v2
-
- while contextEdge.next.removed == 1:
- #if not contextEdge.next.fake:
- new_faces.append([contextEdge.next.v1, contextEdge.next.v2, vertFanPivot])
-
- # Should we use another var?, this will work for now.
- contextEdge.next.removed = 1
-
- contextEdge = contextEdge.next
- FAN_FILLED_FACES += 1
-
- # may need to fan fill backwards 1 for non closed loops.
-
- eloop1.restore() # Add culled back into the list.
-
- return new_faces
+ new_faces= [] #
+
+ # Make sure e1 loops is bigger then e2
+ if len(eloop1.edges) != len(eloop2.edges):
+ if len(eloop1.edges) < len(eloop2.edges):
+ eloop1, eloop2 = eloop2, eloop1
+
+ eloop1.backup() # were about to cull faces
+ CULL_FACES = len(eloop1.edges) - len(eloop2.edges)
+ eloop1.removeSmallest(CULL_FACES, len(eloop1.edges))
+ else:
+ CULL_FACES = 0
+ # First make sure poly vert loops are in sync with eachother.
+
+ # The vector allong which we are skinning.
+ skinVector = eloop1.centre - eloop2.centre
+
+ loopDist = skinVector.length
+
+ # IS THE LOOP FLIPPED, IF SO FLIP BACK. we keep it flipped, its ok,
+ if eloop1.closed or eloop2.closed:
+ angleBetweenLoopNormals = AngleBetweenVecs(eloop1.normal, eloop2.normal)
+ if angleBetweenLoopNormals > 90:
+ eloop2.reverse()
+
+
+ DIR= eloop1.centre - eloop2.centre
+
+ # if eloop2.closed:
+ bestEloopDist = BIG_NUM
+ bestOffset = 0
+ # Loop rotation offset to test.1
+ eLoopIdxs = list(range(len(eloop1.edges)))
+ for offset in range(len(eloop1.edges)):
+ totEloopDist = 0 # Measure this total distance for thsi loop.
+
+ offsetIndexLs = eLoopIdxs[offset:] + eLoopIdxs[:offset] # Make offset index list
+
+
+ # e1Idx is always from 0uu to N, e2Idx is offset.
+ for e1Idx, e2Idx in enumerate(offsetIndexLs):
+ e1= eloop1.edges[e1Idx]
+ e2= eloop2.edges[e2Idx]
+
+
+ # Include fan connections in the measurement.
+ OK= True
+ while OK or e1.removed:
+ OK= False
+
+ # Measure the vloop distance ===============
+ diff= ((e1.cent - e2.cent).length) #/ nangle1
+
+ ed_dir= e1.cent-e2.cent
+ a_diff= AngleBetweenVecs(DIR, ed_dir)/18 # 0 t0 18
+
+ totEloopDist += (diff * (1+a_diff)) / (1+loopDist)
+
+ # Premeture break if where no better off
+ if totEloopDist > bestEloopDist:
+ break
+
+ e1=e1.next
+
+ if totEloopDist < bestEloopDist:
+ bestOffset = offset
+ bestEloopDist = totEloopDist
+
+ # Modify V2 LS for Best offset
+ eloop2.edges = eloop2.edges[bestOffset:] + eloop2.edges[:bestOffset]
+
+ else:
+ # Both are open loops, easier to calculate.
+
+
+ # Make sure the fake edges are at the start.
+ for i, edloop in enumerate((eloop1, eloop2)):
+ # print "LOOPO"
+ if edloop.edges[0].fake:
+ # alredy at the start
+ #print "A"
+ pass
+ elif edloop.edges[-1].fake:
+ # put the end at the start
+ edloop.edges.insert(0, edloop.edges.pop())
+ #print "B"
+
+ else:
+ for j, ed in enumerate(edloop.edges):
+ if ed.fake:
+ #print "C"
+ edloop.edges = edloop.edges = edloop.edges[j:] + edloop.edges[:j]
+ break
+ # print "DONE"
+ ed1, ed2 = eloop1.edges[0], eloop2.edges[0]
+
+ if not ed1.fake or not ed2.fake:
+ raise "Error"
+
+ # Find the join that isnt flipped (juts like detecting a bow-tie face)
+ a1 = (ed1.co1 - ed2.co1).length + (ed1.co2 - ed2.co2).length
+ a2 = (ed1.co1 - ed2.co2).length + (ed1.co2 - ed2.co1).length
+
+ if a1 > a2:
+ eloop2.reverse()
+ # make the first edge the start edge still
+ eloop2.edges.insert(0, eloop2.edges.pop())
+
+
+
+
+ for loopIdx in range(len(eloop2.edges)):
+ e1 = eloop1.edges[loopIdx]
+ e2 = eloop2.edges[loopIdx]
+
+ # Remember the pairs for fan filling culled edges.
+ e1.match = e2; e2.match = e1
+
+ if not (e1.fake or e2.fake):
+ new_faces.append([e1.v1, e1.v2, e2.v2, e2.v1])
+
+ # FAN FILL MISSING FACES.
+ if CULL_FACES:
+ # Culled edges will be in eloop1.
+ FAN_FILLED_FACES = 0
+
+ contextEdge = eloop1.edges[0] # The larger of teh 2
+ while FAN_FILLED_FACES < CULL_FACES:
+ while contextEdge.next.removed == 0:
+ contextEdge = contextEdge.next
+
+ vertFanPivot = contextEdge.match.v2
+
+ while contextEdge.next.removed == 1:
+ #if not contextEdge.next.fake:
+ new_faces.append([contextEdge.next.v1, contextEdge.next.v2, vertFanPivot])
+
+ # Should we use another var?, this will work for now.
+ contextEdge.next.removed = 1
+
+ contextEdge = contextEdge.next
+ FAN_FILLED_FACES += 1
+
+ # may need to fan fill backwards 1 for non closed loops.
+
+ eloop1.restore() # Add culled back into the list.
+
+ return new_faces
def main(context):
- global CULL_METHOD
-
- ob = context.object
-
- is_editmode = (ob.mode=='EDIT')
- if is_editmode: bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
- if ob == None or ob.type != 'MESH':
- raise Exception("BPyMessages.Error_NoMeshActive()")
- return
-
- me = ob.data
-
- time1 = time.time()
- selEdges = getSelectedEdges(context, me, ob)
- vertLoops = getVertLoops(selEdges, me) # list of lists of edges.
- if vertLoops == None:
- raise Exception('Error%t|Selection includes verts that are a part of more then 1 loop')
- if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
- return
- # print len(vertLoops)
-
-
- if len(vertLoops) > 2:
- choice = PupMenu('Loft '+str(len(vertLoops))+' edge loops%t|loop|segment')
- if choice == -1:
- if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
- return
-
- elif len(vertLoops) < 2:
- raise Exception('Error%t|No Vertloops found!')
- if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
- return
- else:
- choice = 2
-
-
- # The line below checks if any of the vert loops are differenyt in length.
- if False in [len(v[0]) == len(vertLoops[0][0]) for v in vertLoops]:
- CULL_METHOD = PupMenu('Small to large edge loop distrobution method%t|remove edges evenly|remove smallest edges')
- if CULL_METHOD == -1:
- if is_editmode: Window.EditMode(1)
- return
-
- if CULL_METHOD ==1: # RESET CULL_METHOD
- CULL_METHOD = 0 # shortest
- else:
- CULL_METHOD = 1 # even
-
-
- time1 = time.time()
- # Convert to special edge data.
- edgeLoops = []
- for vloop, closed in vertLoops:
- edgeLoops.append(edgeLoop(vloop, me, closed))
-
-
- # VERT LOOP ORDERING CODE
- # "Build a worm" list - grow from Both ends
- edgeOrderedList = [edgeLoops.pop()]
-
- # Find the closest.
- bestSoFar = BIG_NUM
- bestIdxSoFar = None
- for edLoopIdx, edLoop in enumerate(edgeLoops):
- l =(edgeOrderedList[-1].centre - edLoop.centre).length
- if l < bestSoFar:
- bestIdxSoFar = edLoopIdx
- bestSoFar = l
-
- edgeOrderedList.append( edgeLoops.pop(bestIdxSoFar) )
-
- # Now we have the 2 closest, append to either end-
- # Find the closest.
- while edgeLoops:
- bestSoFar = BIG_NUM
- bestIdxSoFar = None
- first_or_last = 0 # Zero is first
- for edLoopIdx, edLoop in enumerate(edgeLoops):
- l1 =(edgeOrderedList[-1].centre - edLoop.centre).length
-
- if l1 < bestSoFar:
- bestIdxSoFar = edLoopIdx
- bestSoFar = l1
- first_or_last = 1 # last
-
- l2 =(edgeOrderedList[0].centre - edLoop.centre).length
- if l2 < bestSoFar:
- bestIdxSoFar = edLoopIdx
- bestSoFar = l2
- first_or_last = 0 # last
-
- if first_or_last: # add closest Last
- edgeOrderedList.append( edgeLoops.pop(bestIdxSoFar) )
- else: # Add closest First
- edgeOrderedList.insert(0, edgeLoops.pop(bestIdxSoFar) ) # First
-
- faces = []
-
- for i in range(len(edgeOrderedList)-1):
- faces.extend( skin2EdgeLoops(edgeOrderedList[i], edgeOrderedList[i+1], me, ob, 0) )
- if choice == 1 and len(edgeOrderedList) > 2: # Loop
- faces.extend( skin2EdgeLoops(edgeOrderedList[0], edgeOrderedList[-1], me, ob, 0) )
-
- # REMOVE SELECTED FACES.
- MESH_MODE= ob.mode
- if MESH_MODE == 'EDGE' or MESH_MODE == 'VERTEX': pass
- elif MESH_MODE == 'FACE':
- try: me.faces.delete(1, [ f for f in me.faces if f.sel ])
- except: pass
-
- if 1: # 2.5
- mesh_faces_extend(me, faces, ob.active_material_index)
- me.update(calc_edges=True)
- else:
- me.faces.extend(faces, smooth = True)
-
- print('\nSkin done in %.4f sec.' % (time.time()-time1))
-
- if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
+ global CULL_METHOD
+
+ ob = context.object
+
+ is_editmode = (ob.mode=='EDIT')
+ if is_editmode: bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
+ if ob == None or ob.type != 'MESH':
+ raise Exception("BPyMessages.Error_NoMeshActive()")
+ return
+
+ me = ob.data
+
+ time1 = time.time()
+ selEdges = getSelectedEdges(context, me, ob)
+ vertLoops = getVertLoops(selEdges, me) # list of lists of edges.
+ if vertLoops == None:
+ raise Exception('Error%t|Selection includes verts that are a part of more then 1 loop')
+ if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
+ return
+ # print len(vertLoops)
+
+
+ if len(vertLoops) > 2:
+ choice = PupMenu('Loft '+str(len(vertLoops))+' edge loops%t|loop|segment')
+ if choice == -1:
+ if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
+ return
+
+ elif len(vertLoops) < 2:
+ raise Exception('Error%t|No Vertloops found!')
+ if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
+ return
+ else:
+ choice = 2
+
+
+ # The line below checks if any of the vert loops are differenyt in length.
+ if False in [len(v[0]) == len(vertLoops[0][0]) for v in vertLoops]:
+#XXX CULL_METHOD = PupMenu('Small to large edge loop distrobution method%t|remove edges evenly|remove smallest edges')
+#XXX if CULL_METHOD == -1:
+#XXX if is_editmode: Window.EditMode(1)
+#XXX return
+
+ CULL_METHOD = 1 # XXX FIXME
+
+
+
+
+ if CULL_METHOD ==1: # RESET CULL_METHOD
+ CULL_METHOD = 0 # shortest
+ else:
+ CULL_METHOD = 1 # even
+
+
+ time1 = time.time()
+ # Convert to special edge data.
+ edgeLoops = []
+ for vloop, closed in vertLoops:
+ edgeLoops.append(edgeLoop(vloop, me, closed))
+
+
+ # VERT LOOP ORDERING CODE
+ # "Build a worm" list - grow from Both ends
+ edgeOrderedList = [edgeLoops.pop()]
+
+ # Find the closest.
+ bestSoFar = BIG_NUM
+ bestIdxSoFar = None
+ for edLoopIdx, edLoop in enumerate(edgeLoops):
+ l =(edgeOrderedList[-1].centre - edLoop.centre).length
+ if l < bestSoFar:
+ bestIdxSoFar = edLoopIdx
+ bestSoFar = l
+
+ edgeOrderedList.append( edgeLoops.pop(bestIdxSoFar) )
+
+ # Now we have the 2 closest, append to either end-
+ # Find the closest.
+ while edgeLoops:
+ bestSoFar = BIG_NUM
+ bestIdxSoFar = None
+ first_or_last = 0 # Zero is first
+ for edLoopIdx, edLoop in enumerate(edgeLoops):
+ l1 =(edgeOrderedList[-1].centre - edLoop.centre).length
+
+ if l1 < bestSoFar:
+ bestIdxSoFar = edLoopIdx
+ bestSoFar = l1
+ first_or_last = 1 # last
+
+ l2 =(edgeOrderedList[0].centre - edLoop.centre).length
+ if l2 < bestSoFar:
+ bestIdxSoFar = edLoopIdx
+ bestSoFar = l2
+ first_or_last = 0 # last
+
+ if first_or_last: # add closest Last
+ edgeOrderedList.append( edgeLoops.pop(bestIdxSoFar) )
+ else: # Add closest First
+ edgeOrderedList.insert(0, edgeLoops.pop(bestIdxSoFar) ) # First
+
+ faces = []
+
+ for i in range(len(edgeOrderedList)-1):
+ faces.extend( skin2EdgeLoops(edgeOrderedList[i], edgeOrderedList[i+1], me, ob, 0) )
+ if choice == 1 and len(edgeOrderedList) > 2: # Loop
+ faces.extend( skin2EdgeLoops(edgeOrderedList[0], edgeOrderedList[-1], me, ob, 0) )
+
+ # REMOVE SELECTED FACES.
+ MESH_MODE= ob.mode
+ if MESH_MODE == 'EDGE' or MESH_MODE == 'VERTEX': pass
+ elif MESH_MODE == 'FACE':
+ try: me.faces.delete(1, [ f for f in me.faces if f.sel ])
+ except: pass
+
+ if 1: # 2.5
+ mesh_faces_extend(me, faces, ob.active_material_index)
+ me.update(calc_edges=True)
+ else:
+ me.faces.extend(faces, smooth = True)
+
+ print('\nSkin done in %.4f sec.' % (time.time()-time1))
+
+ if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False)
class MESH_OT_skin(bpy.types.Operator):
- '''Bridge face loops.'''
-
- bl_idname = "mesh.skin"
- bl_label = "Add Torus"
- bl_register = True
- bl_undo = True
-
- '''
- loft_method = EnumProperty(attr="loft_method", items=[(), ()], description="", default= True)
-
- '''
-
- def execute(self, context):
- main(context)
- return ('FINISHED',)
+ '''Bridge face loops.'''
+
+ bl_idname = "mesh.skin"
+ bl_label = "Add Torus"
+ bl_register = True
+ bl_undo = True
+
+ '''
+ loft_method = EnumProperty(attr="loft_method", items=[(), ()], description="", default= True)
+
+ '''
+
+ def execute(self, context):
+ main(context)
+ return ('FINISHED',)
# Register the operator
@@ -642,7 +650,7 @@ bpy.ops.add(MESH_OT_skin)
# Add to a menu
import dynamic_menu
-menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_edit_mesh_faces, (lambda self, context: self.layout.itemO("mesh.skin", text="Bridge Faces")) )
+menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_edit_mesh_faces, (lambda self, context: self.layout.operator("mesh.skin", text="Bridge Faces")) )
if __name__ == "__main__":
- bpy.ops.mesh.skin()
+ bpy.ops.mesh.skin()
diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py
new file mode 100644
index 00000000000..8823045e07d
--- /dev/null
+++ b/release/scripts/op/object.py
@@ -0,0 +1,99 @@
+# ##### 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 #####
+
+import bpy
+from bpy.props import *
+
+
+class SelectPattern(bpy.types.Operator):
+ '''Select object matching a naming pattern.'''
+ bl_idname = "object.select_pattern"
+ bl_label = "Select Pattern"
+ bl_register = True
+ bl_undo = True
+
+ pattern = StringProperty(name="Pattern", description="Name filter using '*' and '?' wildcard chars", maxlen=32, default="*")
+ case_sensitive = BoolProperty(name="Case Sensitive", description="Do a case sensitive compare", default=False)
+ extend = BoolProperty(name="Extend", description="Extend the existing selection", default=True)
+
+ def execute(self, context):
+
+ import fnmatch
+
+ if self.properties.case_sensitive:
+ pattern_match = fnmatch.fnmatchcase
+ else:
+ pattern_match = lambda a, b: fnmatch.fnmatchcase(a.upper(), b.upper())
+
+ for ob in context.visible_objects:
+ if pattern_match(ob.name, self.properties.pattern):
+ ob.selected = True
+ elif not self.properties.extend:
+ ob.selected = False
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ wm = context.manager
+ wm.invoke_props_popup(self, event)
+ return ('RUNNING_MODAL',)
+
+ def draw(self, context):
+ print("WoW")
+ layout = self.layout
+ props = self.properties
+
+ layout.prop(props, "pattern")
+ row = layout.row()
+ row.prop(props, "case_sensitive")
+ row.prop(props, "extend")
+
+
+
+class SubsurfSet(bpy.types.Operator):
+ '''Sets a Subdivision Surface Level (1-5)'''
+
+ bl_idname = "object.subsurf_set"
+ bl_label = "Subsurf Set"
+ bl_register = True
+ bl_undo = True
+
+ level = IntProperty(name="Level",
+ default=1, min=0, max=6)
+
+ def poll(self, context):
+ ob = context.active_object
+ return (ob and ob.type == 'MESH')
+
+ def execute(self, context):
+ level = self.properties.level
+ ob = context.active_object
+ for mod in ob.modifiers:
+ if mod.type == 'SUBSURF':
+ if mod.levels != level:
+ mod.levels = level
+ return ('FINISHED',)
+
+ # adda new modifier
+ mod = ob.modifiers.new("Subsurf", 'SUBSURF')
+ mod.levels = level
+ return ('FINISHED',)
+
+
+bpy.ops.add(SelectPattern)
+bpy.ops.add(SubsurfSet)
diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py
new file mode 100644
index 00000000000..84a60765fa4
--- /dev/null
+++ b/release/scripts/op/presets.py
@@ -0,0 +1,124 @@
+# ##### 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 #####
+
+import bpy
+import os
+
+class AddPresetBase(bpy.types.Operator):
+ '''Base preset class, only for subclassing
+ subclasses must define
+ - preset_values
+ - preset_subdir '''
+ bl_idname = "render.preset_add"
+ bl_label = "Add Render Preset"
+
+ name = bpy.props.StringProperty(name="Name", description="Name of the preset, used to make the path name", maxlen= 64, default= "")
+
+ def _as_filename(self, name): # could reuse for other presets
+ for char in " !@#$%^&*(){}:\";'[]<>,./?":
+ name = name.replace('.', '_')
+ return name.lower()
+
+ def execute(self, context):
+
+ if not self.properties.name:
+ return ('FINISHED',)
+
+ filename = self._as_filename(self.properties.name) + ".py"
+
+ target_path = bpy.utils.preset_paths(self.preset_subdir)[0] # we need some way to tell the user and system preset path
+
+ file_preset = open(os.path.join(target_path, filename), 'w')
+
+ for rna_path in self.preset_values:
+ file_preset.write("%s = %s\n" % (rna_path, eval(rna_path)))
+
+ file_preset.close()
+
+ return ('FINISHED',)
+
+ def invoke(self, context, event):
+ wm = context.manager
+ wm.invoke_props_popup(self, event)
+ return ('RUNNING_MODAL',)
+
+
+class AddPresetRender(AddPresetBase):
+ '''Add a Render Preset.'''
+ bl_idname = "render.preset_add"
+ bl_label = "Add Render Preset"
+ name = AddPresetBase.name
+
+ preset_values = [
+ "bpy.context.scene.render_data.resolution_x",
+ "bpy.context.scene.render_data.resolution_y",
+ "bpy.context.scene.render_data.pixel_aspect_x",
+ "bpy.context.scene.render_data.pixel_aspect_y",
+ "bpy.context.scene.render_data.fps",
+ "bpy.context.scene.render_data.fps_base",
+ "bpy.context.scene.render_data.resolution_percentage",
+ ]
+
+ preset_subdir = "render"
+
+
+class AddPresetSSS(AddPresetBase):
+ '''Add a Subsurface Scattering Preset.'''
+ bl_idname = "material.sss_preset_add"
+ bl_label = "Add SSS Preset"
+ name = AddPresetBase.name
+
+ preset_values = [
+ "bpy.context.material.subsurface_scattering.back",
+ "bpy.context.material.subsurface_scattering.color[0]",
+ "bpy.context.material.subsurface_scattering.color[1]",
+ "bpy.context.material.subsurface_scattering.color[2]",
+ "bpy.context.material.subsurface_scattering.color_factor",
+ "bpy.context.material.subsurface_scattering.error_tolerance",
+ "bpy.context.material.subsurface_scattering.front",
+ "bpy.context.material.subsurface_scattering.ior",
+ "bpy.context.material.subsurface_scattering.radius[0]",
+ "bpy.context.material.subsurface_scattering.radius[1]",
+ "bpy.context.material.subsurface_scattering.radius[2]",
+ "bpy.context.material.subsurface_scattering.scale",
+ "bpy.context.material.subsurface_scattering.texture_factor",
+ ]
+
+ preset_subdir = "sss"
+
+class AddPresetCloth(AddPresetBase):
+ '''Add a Cloth Preset.'''
+ bl_idname = "cloth.preset_add"
+ bl_label = "Add Cloth Preset"
+ name = AddPresetBase.name
+
+ preset_values = [
+ "bpy.context.cloth.settings.quality",
+ "bpy.context.cloth.settings.mass",
+ "bpy.context.cloth.settings.structural_stiffness",
+ "bpy.context.cloth.settings.bending_stiffness",
+ "bpy.context.cloth.settings.spring_damping",
+ "bpy.context.cloth.settings.air_damping",
+ ]
+
+ preset_subdir = "cloth"
+
+bpy.ops.add(AddPresetRender)
+bpy.ops.add(AddPresetSSS)
+bpy.ops.add(AddPresetCloth)
+
diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py
index 11202329a3d..2da7174ed99 100644
--- a/release/scripts/op/uvcalc_smart_project.py
+++ b/release/scripts/op/uvcalc_smart_project.py
@@ -1,24 +1,24 @@
-# --------------------------------------------------------------------------
-# Smart Projection UV Projection Unwrapper v1.2 by Campbell Barton (AKA Ideasman)
-# --------------------------------------------------------------------------
-# ***** 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 LICENCE BLOCK *****
-# --------------------------------------------------------------------------
+# --------------------------------------------------------------------------
+# Smart Projection UV Projection Unwrapper v1.2 by Campbell Barton (AKA Ideasman)
+# --------------------------------------------------------------------------
+# ***** 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 LICENCE BLOCK *****
+# --------------------------------------------------------------------------
#from Blender import Object, Draw, Window, sys, Mesh, Geometry
@@ -40,96 +40,96 @@ USER_FILL_HOLES_QUALITY = None
dict_matrix = {}
def pointInTri2D(v, v1, v2, v3):
- global dict_matrix
-
- key = v1.x, v1.y, v2.x, v2.y, v3.x, v3.y
-
- # Commented because its slower to do teh bounds check, we should realy cache the bounds info for each face.
- '''
- # BOUNDS CHECK
- xmin= 1000000
- ymin= 1000000
-
- xmax= -1000000
- ymax= -1000000
-
- for i in (0,2,4):
- x= key[i]
- y= key[i+1]
-
- if xmaxx: xmin= x
- if ymin>y: ymin= y
-
- x= v.x
- y= v.y
-
- if xxmax or y < ymin or y > ymax:
- return False
- # Done with bounds check
- '''
- try:
- mtx = dict_matrix[key]
- if not mtx:
- return False
- except:
- side1 = v2 - v1
- side2 = v3 - v1
-
- nor = side1.cross(side2)
-
- l1 = [side1[0], side1[1], side1[2]]
- l2 = [side2[0], side2[1], side2[2]]
- l3 = [nor[0], nor[1], nor[2]]
-
- mtx = Matrix(l1, l2, l3)
-
- # Zero area 2d tri, even tho we throw away zerop area faces
- # the projection UV can result in a zero area UV.
- if not mtx.determinant():
- dict_matrix[key] = None
- return False
-
- mtx.invert()
-
- dict_matrix[key] = mtx
-
- uvw = (v - v1) * mtx
- return 0 <= uvw[0] and 0 <= uvw[1] and uvw[0] + uvw[1] <= 1
+ global dict_matrix
+
+ key = v1.x, v1.y, v2.x, v2.y, v3.x, v3.y
+
+ # Commented because its slower to do teh bounds check, we should realy cache the bounds info for each face.
+ '''
+ # BOUNDS CHECK
+ xmin= 1000000
+ ymin= 1000000
+
+ xmax= -1000000
+ ymax= -1000000
+
+ for i in (0,2,4):
+ x= key[i]
+ y= key[i+1]
+
+ if xmaxx: xmin= x
+ if ymin>y: ymin= y
+
+ x= v.x
+ y= v.y
+
+ if xxmax or y < ymin or y > ymax:
+ return False
+ # Done with bounds check
+ '''
+ try:
+ mtx = dict_matrix[key]
+ if not mtx:
+ return False
+ except:
+ side1 = v2 - v1
+ side2 = v3 - v1
+
+ nor = side1.cross(side2)
+
+ l1 = [side1[0], side1[1], side1[2]]
+ l2 = [side2[0], side2[1], side2[2]]
+ l3 = [nor[0], nor[1], nor[2]]
+
+ mtx = Matrix(l1, l2, l3)
+
+ # Zero area 2d tri, even tho we throw away zerop area faces
+ # the projection UV can result in a zero area UV.
+ if not mtx.determinant():
+ dict_matrix[key] = None
+ return False
+
+ mtx.invert()
+
+ dict_matrix[key] = mtx
+
+ uvw = (v - v1) * mtx
+ return 0 <= uvw[0] and 0 <= uvw[1] and uvw[0] + uvw[1] <= 1
+
-
def boundsIsland(faces):
- minx = maxx = faces[0].uv[0][0] # Set initial bounds.
- miny = maxy = faces[0].uv[0][1]
- # print len(faces), minx, maxx, miny , maxy
- for f in faces:
- for uv in f.uv:
- x= uv.x
- y= uv.y
- if xmaxx: maxx= x
- if y>maxy: maxy= y
-
- return minx, miny, maxx, maxy
+ minx = maxx = faces[0].uv[0][0] # Set initial bounds.
+ miny = maxy = faces[0].uv[0][1]
+ # print len(faces), minx, maxx, miny , maxy
+ for f in faces:
+ for uv in f.uv:
+ x= uv.x
+ y= uv.y
+ if xmaxx: maxx= x
+ if y>maxy: maxy= y
+
+ return minx, miny, maxx, maxy
"""
def boundsEdgeLoop(edges):
- minx = maxx = edges[0][0] # Set initial bounds.
- miny = maxy = edges[0][1]
- # print len(faces), minx, maxx, miny , maxy
- for ed in edges:
- for pt in ed:
- print 'ass'
- x= pt[0]
- y= pt[1]
- if xmaxx: x= maxx
- if y>maxy: y= maxy
-
- return minx, miny, maxx, maxy
+ minx = maxx = edges[0][0] # Set initial bounds.
+ miny = maxy = edges[0][1]
+ # print len(faces), minx, maxx, miny , maxy
+ for ed in edges:
+ for pt in ed:
+ print 'ass'
+ x= pt[0]
+ y= pt[1]
+ if xmaxx: x= maxx
+ if y>maxy: y= maxy
+
+ return minx, miny, maxx, maxy
"""
# Turns the islands into a list of unpordered edges (Non internal)
@@ -137,44 +137,44 @@ def boundsEdgeLoop(edges):
# only returns outline edges for intersection tests. and unique points.
def island2Edge(island):
-
- # Vert index edges
- edges = {}
-
- unique_points= {}
-
- for f in island:
- f_uvkey= map(tuple, f.uv)
-
-
- for vIdx, edkey in enumerate(f.edge_keys):
- unique_points[f_uvkey[vIdx]] = f.uv[vIdx]
-
- if f.v[vIdx].index > f.v[vIdx-1].index:
- i1= vIdx-1; i2= vIdx
- else:
- i1= vIdx; i2= vIdx-1
-
- try: edges[ f_uvkey[i1], f_uvkey[i2] ] *= 0 # sets eny edge with more then 1 user to 0 are not returned.
- except: edges[ f_uvkey[i1], f_uvkey[i2] ] = (f.uv[i1] - f.uv[i2]).length,
-
- # If 2 are the same then they will be together, but full [a,b] order is not correct.
-
- # Sort by length
-
-
- length_sorted_edges = [(Vector(key[0]), Vector(key[1]), value) for key, value in edges.items() if value != 0]
-
- try: length_sorted_edges.sort(key = lambda A: -A[2]) # largest first
- except: length_sorted_edges.sort(lambda A, B: cmp(B[2], A[2]))
-
- # Its okay to leave the length in there.
- #for e in length_sorted_edges:
- # e.pop(2)
-
- # return edges and unique points
- return length_sorted_edges, [v.__copy__().resize3D() for v in unique_points.values()]
-
+
+ # Vert index edges
+ edges = {}
+
+ unique_points= {}
+
+ for f in island:
+ f_uvkey= map(tuple, f.uv)
+
+
+ for vIdx, edkey in enumerate(f.edge_keys):
+ unique_points[f_uvkey[vIdx]] = f.uv[vIdx]
+
+ if f.v[vIdx].index > f.v[vIdx-1].index:
+ i1= vIdx-1; i2= vIdx
+ else:
+ i1= vIdx; i2= vIdx-1
+
+ try: edges[ f_uvkey[i1], f_uvkey[i2] ] *= 0 # sets eny edge with more then 1 user to 0 are not returned.
+ except: edges[ f_uvkey[i1], f_uvkey[i2] ] = (f.uv[i1] - f.uv[i2]).length,
+
+ # If 2 are the same then they will be together, but full [a,b] order is not correct.
+
+ # Sort by length
+
+
+ length_sorted_edges = [(Vector(key[0]), Vector(key[1]), value) for key, value in edges.items() if value != 0]
+
+ try: length_sorted_edges.sort(key = lambda A: -A[2]) # largest first
+ except: length_sorted_edges.sort(lambda A, B: cmp(B[2], A[2]))
+
+ # Its okay to leave the length in there.
+ #for e in length_sorted_edges:
+ # e.pop(2)
+
+ # return edges and unique points
+ return length_sorted_edges, [v.__copy__().resize3D() for v in unique_points.values()]
+
# ========================= NOT WORKING????
# Find if a points inside an edge loop, un-orderd.
# pt is and x/y
@@ -182,97 +182,97 @@ def island2Edge(island):
# #offsets are the edge x and y offset.
"""
def pointInEdges(pt, edges):
- #
- x1 = pt[0]
- y1 = pt[1]
-
- # Point to the left of this line.
- x2 = -100000
- y2 = -10000
- intersectCount = 0
- for ed in edges:
- xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1])
- if xi != None: # Is there an intersection.
- intersectCount+=1
-
- return intersectCount % 2
+ #
+ x1 = pt[0]
+ y1 = pt[1]
+
+ # Point to the left of this line.
+ x2 = -100000
+ y2 = -10000
+ intersectCount = 0
+ for ed in edges:
+ xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1])
+ if xi != None: # Is there an intersection.
+ intersectCount+=1
+
+ return intersectCount % 2
"""
def pointInIsland(pt, island):
- vec1 = Vector(); vec2 = Vector(); vec3 = Vector()
- for f in island:
- vec1.x, vec1.y = f.uv[0]
- vec2.x, vec2.y = f.uv[1]
- vec3.x, vec3.y = f.uv[2]
+ vec1 = Vector(); vec2 = Vector(); vec3 = Vector()
+ for f in island:
+ vec1.x, vec1.y = f.uv[0]
+ vec2.x, vec2.y = f.uv[1]
+ vec3.x, vec3.y = f.uv[2]
- if pointInTri2D(pt, vec1, vec2, vec3):
- return True
-
- if len(f.v) == 4:
- vec1.x, vec1.y = f.uv[0]
- vec2.x, vec2.y = f.uv[2]
- vec3.x, vec3.y = f.uv[3]
- if pointInTri2D(pt, vec1, vec2, vec3):
- return True
- return False
+ if pointInTri2D(pt, vec1, vec2, vec3):
+ return True
+
+ if len(f.v) == 4:
+ vec1.x, vec1.y = f.uv[0]
+ vec2.x, vec2.y = f.uv[2]
+ vec3.x, vec3.y = f.uv[3]
+ if pointInTri2D(pt, vec1, vec2, vec3):
+ return True
+ return False
# box is (left,bottom, right, top)
def islandIntersectUvIsland(source, target, SourceOffset):
- # Is 1 point in the box, inside the vertLoops
- edgeLoopsSource = source[6] # Pretend this is offset
- edgeLoopsTarget = target[6]
-
- # Edge intersect test
- for ed in edgeLoopsSource:
- for seg in edgeLoopsTarget:
- i = Geometry.LineIntersect2D(\
- seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1])
- if i:
- return 1 # LINE INTERSECTION
-
- # 1 test for source being totally inside target
- SourceOffset.resize3D()
- for pv in source[7]:
- if pointInIsland(pv+SourceOffset, target[0]):
- return 2 # SOURCE INSIDE TARGET
-
- # 2 test for a part of the target being totaly inside the source.
- for pv in target[7]:
- if pointInIsland(pv-SourceOffset, source[0]):
- return 3 # PART OF TARGET INSIDE SOURCE.
+ # Is 1 point in the box, inside the vertLoops
+ edgeLoopsSource = source[6] # Pretend this is offset
+ edgeLoopsTarget = target[6]
- return 0 # NO INTERSECTION
+ # Edge intersect test
+ for ed in edgeLoopsSource:
+ for seg in edgeLoopsTarget:
+ i = Geometry.LineIntersect2D(\
+ seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1])
+ if i:
+ return 1 # LINE INTERSECTION
+
+ # 1 test for source being totally inside target
+ SourceOffset.resize3D()
+ for pv in source[7]:
+ if pointInIsland(pv+SourceOffset, target[0]):
+ return 2 # SOURCE INSIDE TARGET
+
+ # 2 test for a part of the target being totaly inside the source.
+ for pv in target[7]:
+ if pointInIsland(pv-SourceOffset, source[0]):
+ return 3 # PART OF TARGET INSIDE SOURCE.
+
+ return 0 # NO INTERSECTION
# Returns the X/y Bounds of a list of vectors.
def testNewVecLs2DRotIsBetter(vecs, mat=-1, bestAreaSoFar = -1):
-
- # UV's will never extend this far.
- minx = miny = BIG_NUM
- maxx = maxy = -BIG_NUM
-
- for i, v in enumerate(vecs):
-
- # Do this allong the way
- if mat != -1:
- v = vecs[i] = v*mat
- x= v.x
- y= v.y
- if xmaxx: maxx= x
- if y>maxy: maxy= y
-
- # Spesific to this algo, bail out if we get bigger then the current area
- if bestAreaSoFar != -1 and (maxx-minx) * (maxy-miny) > bestAreaSoFar:
- return (BIG_NUM, None), None
- w = maxx-minx
- h = maxy-miny
- return (w*h, w,h), vecs # Area, vecs
-
+
+ # UV's will never extend this far.
+ minx = miny = BIG_NUM
+ maxx = maxy = -BIG_NUM
+
+ for i, v in enumerate(vecs):
+
+ # Do this allong the way
+ if mat != -1:
+ v = vecs[i] = v*mat
+ x= v.x
+ y= v.y
+ if xmaxx: maxx= x
+ if y>maxy: maxy= y
+
+ # Spesific to this algo, bail out if we get bigger then the current area
+ if bestAreaSoFar != -1 and (maxx-minx) * (maxy-miny) > bestAreaSoFar:
+ return (BIG_NUM, None), None
+ w = maxx-minx
+ h = maxy-miny
+ return (w*h, w,h), vecs # Area, vecs
+
# Takes a list of faces that make up a UV island and rotate
# until they optimally fit inside a square.
ROTMAT_2D_POS_90D = RotationMatrix( radians(90.0), 2)
@@ -281,866 +281,866 @@ ROTMAT_2D_POS_45D = RotationMatrix( radians(45.0), 2)
RotMatStepRotation = []
rot_angle = 22.5 #45.0/2
while rot_angle > 0.1:
- RotMatStepRotation.append([\
- RotationMatrix( radians(rot_angle), 2),\
- RotationMatrix( radians(-rot_angle), 2)])
-
- rot_angle = rot_angle/2.0
-
+ RotMatStepRotation.append([\
+ RotationMatrix( radians(rot_angle), 2),\
+ RotationMatrix( radians(-rot_angle), 2)])
+
+ rot_angle = rot_angle/2.0
+
def optiRotateUvIsland(faces):
- global currentArea
-
- # Bestfit Rotation
- def best2dRotation(uvVecs, MAT1, MAT2):
- global currentArea
-
- newAreaPos, newfaceProjectionGroupListPos =\
- testNewVecLs2DRotIsBetter(uvVecs[:], MAT1, currentArea[0])
-
-
- # Why do I use newpos here? May as well give the best area to date for an early bailout
- # some slight speed increase in this.
- # If the new rotation is smaller then the existing, we can
- # avoid copying a list and overwrite the old, crappy one.
-
- if newAreaPos[0] < currentArea[0]:
- newAreaNeg, newfaceProjectionGroupListNeg =\
- testNewVecLs2DRotIsBetter(uvVecs, MAT2, newAreaPos[0]) # Reuse the old bigger list.
- else:
- newAreaNeg, newfaceProjectionGroupListNeg =\
- testNewVecLs2DRotIsBetter(uvVecs[:], MAT2, currentArea[0]) # Cant reuse, make a copy.
-
-
- # Now from the 3 options we need to discover which to use
- # we have cerrentArea/newAreaPos/newAreaNeg
- bestArea = min(currentArea[0], newAreaPos[0], newAreaNeg[0])
-
- if currentArea[0] == bestArea:
- return uvVecs
- elif newAreaPos[0] == bestArea:
- uvVecs = newfaceProjectionGroupListPos
- currentArea = newAreaPos
- elif newAreaNeg[0] == bestArea:
- uvVecs = newfaceProjectionGroupListNeg
- currentArea = newAreaNeg
-
- return uvVecs
-
-
- # Serialized UV coords to Vectors
- uvVecs = [uv for f in faces for uv in f.uv]
-
- # Theres a small enough number of these to hard code it
- # rather then a loop.
-
- # Will not modify anything
- currentArea, dummy =\
- testNewVecLs2DRotIsBetter(uvVecs)
-
-
- # Try a 45d rotation
- newAreaPos, newfaceProjectionGroupListPos = testNewVecLs2DRotIsBetter(uvVecs[:], ROTMAT_2D_POS_45D, currentArea[0])
-
- if newAreaPos[0] < currentArea[0]:
- uvVecs = newfaceProjectionGroupListPos
- currentArea = newAreaPos
- # 45d done
-
- # Testcase different rotations and find the onfe that best fits in a square
- for ROTMAT in RotMatStepRotation:
- uvVecs = best2dRotation(uvVecs, ROTMAT[0], ROTMAT[1])
-
- # Only if you want it, make faces verticle!
- if currentArea[1] > currentArea[2]:
- # Rotate 90d
- # Work directly on the list, no need to return a value.
- testNewVecLs2DRotIsBetter(uvVecs, ROTMAT_2D_POS_90D)
-
-
- # Now write the vectors back to the face UV's
- i = 0 # count the serialized uv/vectors
- for f in faces:
- #f.uv = [uv for uv in uvVecs[i:len(f)+i] ]
- for j, k in enumerate(range(i, len(f.v)+i)):
- f.uv[j][:] = uvVecs[k]
- i += len(f.v)
+ global currentArea
+
+ # Bestfit Rotation
+ def best2dRotation(uvVecs, MAT1, MAT2):
+ global currentArea
+
+ newAreaPos, newfaceProjectionGroupListPos =\
+ testNewVecLs2DRotIsBetter(uvVecs[:], MAT1, currentArea[0])
+
+
+ # Why do I use newpos here? May as well give the best area to date for an early bailout
+ # some slight speed increase in this.
+ # If the new rotation is smaller then the existing, we can
+ # avoid copying a list and overwrite the old, crappy one.
+
+ if newAreaPos[0] < currentArea[0]:
+ newAreaNeg, newfaceProjectionGroupListNeg =\
+ testNewVecLs2DRotIsBetter(uvVecs, MAT2, newAreaPos[0]) # Reuse the old bigger list.
+ else:
+ newAreaNeg, newfaceProjectionGroupListNeg =\
+ testNewVecLs2DRotIsBetter(uvVecs[:], MAT2, currentArea[0]) # Cant reuse, make a copy.
+
+
+ # Now from the 3 options we need to discover which to use
+ # we have cerrentArea/newAreaPos/newAreaNeg
+ bestArea = min(currentArea[0], newAreaPos[0], newAreaNeg[0])
+
+ if currentArea[0] == bestArea:
+ return uvVecs
+ elif newAreaPos[0] == bestArea:
+ uvVecs = newfaceProjectionGroupListPos
+ currentArea = newAreaPos
+ elif newAreaNeg[0] == bestArea:
+ uvVecs = newfaceProjectionGroupListNeg
+ currentArea = newAreaNeg
+
+ return uvVecs
+
+
+ # Serialized UV coords to Vectors
+ uvVecs = [uv for f in faces for uv in f.uv]
+
+ # Theres a small enough number of these to hard code it
+ # rather then a loop.
+
+ # Will not modify anything
+ currentArea, dummy =\
+ testNewVecLs2DRotIsBetter(uvVecs)
+
+
+ # Try a 45d rotation
+ newAreaPos, newfaceProjectionGroupListPos = testNewVecLs2DRotIsBetter(uvVecs[:], ROTMAT_2D_POS_45D, currentArea[0])
+
+ if newAreaPos[0] < currentArea[0]:
+ uvVecs = newfaceProjectionGroupListPos
+ currentArea = newAreaPos
+ # 45d done
+
+ # Testcase different rotations and find the onfe that best fits in a square
+ for ROTMAT in RotMatStepRotation:
+ uvVecs = best2dRotation(uvVecs, ROTMAT[0], ROTMAT[1])
+
+ # Only if you want it, make faces verticle!
+ if currentArea[1] > currentArea[2]:
+ # Rotate 90d
+ # Work directly on the list, no need to return a value.
+ testNewVecLs2DRotIsBetter(uvVecs, ROTMAT_2D_POS_90D)
+
+
+ # Now write the vectors back to the face UV's
+ i = 0 # count the serialized uv/vectors
+ for f in faces:
+ #f.uv = [uv for uv in uvVecs[i:len(f)+i] ]
+ for j, k in enumerate(range(i, len(f.v)+i)):
+ f.uv[j][:] = uvVecs[k]
+ i += len(f.v)
# Takes an island list and tries to find concave, hollow areas to pack smaller islands into.
def mergeUvIslands(islandList):
- global USER_FILL_HOLES
- global USER_FILL_HOLES_QUALITY
-
-
- # Pack islands to bottom LHS
- # Sync with island
-
- #islandTotFaceArea = [] # A list of floats, each island area
- #islandArea = [] # a list of tuples ( area, w,h)
-
-
- decoratedIslandList = []
-
- islandIdx = len(islandList)
- while islandIdx:
- islandIdx-=1
- minx, miny, maxx, maxy = boundsIsland(islandList[islandIdx])
- w, h = maxx-minx, maxy-miny
-
- totFaceArea = 0
- offset= Vector(minx, miny)
- for f in islandList[islandIdx]:
- for uv in f.uv:
- uv -= offset
-
- totFaceArea += f.area
-
- islandBoundsArea = w*h
- efficiency = abs(islandBoundsArea - totFaceArea)
-
- # UV Edge list used for intersections as well as unique points.
- edges, uniqueEdgePoints = island2Edge(islandList[islandIdx])
-
- decoratedIslandList.append([islandList[islandIdx], totFaceArea, efficiency, islandBoundsArea, w,h, edges, uniqueEdgePoints])
-
-
- # Sort by island bounding box area, smallest face area first.
- # no.. chance that to most simple edge loop first.
- decoratedIslandListAreaSort =decoratedIslandList[:]
-
- decoratedIslandListAreaSort.sort(key = lambda A: A[3])
-
- # sort by efficiency, Least Efficient first.
- decoratedIslandListEfficSort = decoratedIslandList[:]
- # decoratedIslandListEfficSort.sort(lambda A, B: cmp(B[2], A[2]))
+ global USER_FILL_HOLES
+ global USER_FILL_HOLES_QUALITY
- decoratedIslandListEfficSort.sort(key = lambda A: -A[2])
- # ================================================== THESE CAN BE TWEAKED.
- # This is a quality value for the number of tests.
- # from 1 to 4, generic quality value is from 1 to 100
- USER_STEP_QUALITY = ((USER_FILL_HOLES_QUALITY - 1) / 25.0) + 1
-
- # If 100 will test as long as there is enough free space.
- # this is rarely enough, and testing takes a while, so lower quality speeds this up.
-
- # 1 means they have the same quality
- USER_FREE_SPACE_TO_TEST_QUALITY = 1 + (((100 - USER_FILL_HOLES_QUALITY)/100.0) *5)
-
- #print 'USER_STEP_QUALITY', USER_STEP_QUALITY
- #print 'USER_FREE_SPACE_TO_TEST_QUALITY', USER_FREE_SPACE_TO_TEST_QUALITY
-
- removedCount = 0
-
- areaIslandIdx = 0
- ctrl = Window.Qual.CTRL
- BREAK= False
- while areaIslandIdx < len(decoratedIslandListAreaSort) and not BREAK:
- sourceIsland = decoratedIslandListAreaSort[areaIslandIdx]
- # Alredy packed?
- if not sourceIsland[0]:
- areaIslandIdx+=1
- else:
- efficIslandIdx = 0
- while efficIslandIdx < len(decoratedIslandListEfficSort) and not BREAK:
-
- if Window.GetKeyQualifiers() & ctrl:
- BREAK= True
- break
-
- # Now we have 2 islands, is the efficience of the islands lowers theres an
- # increasing likely hood that we can fit merge into the bigger UV island.
- # this ensures a tight fit.
-
- # Just use figures we have about user/unused area to see if they might fit.
-
- targetIsland = decoratedIslandListEfficSort[efficIslandIdx]
-
-
- if sourceIsland[0] == targetIsland[0] or\
- not targetIsland[0] or\
- not sourceIsland[0]:
- pass
- else:
-
- # ([island, totFaceArea, efficiency, islandArea, w,h])
- # Waisted space on target is greater then UV bounding island area.
-
-
- # if targetIsland[3] > (sourceIsland[2]) and\ #
- # print USER_FREE_SPACE_TO_TEST_QUALITY, 'ass'
- if targetIsland[2] > (sourceIsland[1] * USER_FREE_SPACE_TO_TEST_QUALITY) and\
- targetIsland[4] > sourceIsland[4] and\
- targetIsland[5] > sourceIsland[5]:
-
- # DEBUG # print '%.10f %.10f' % (targetIsland[3], sourceIsland[1])
-
- # These enough spare space lets move the box until it fits
-
- # How many times does the source fit into the target x/y
- blockTestXUnit = targetIsland[4]/sourceIsland[4]
- blockTestYUnit = targetIsland[5]/sourceIsland[5]
-
- boxLeft = 0
-
-
- # Distllllance we can move between whilst staying inside the targets bounds.
- testWidth = targetIsland[4] - sourceIsland[4]
- testHeight = targetIsland[5] - sourceIsland[5]
-
- # Increment we move each test. x/y
- xIncrement = (testWidth / (blockTestXUnit * ((USER_STEP_QUALITY/50)+0.1)))
- yIncrement = (testHeight / (blockTestYUnit * ((USER_STEP_QUALITY/50)+0.1)))
+ # Pack islands to bottom LHS
+ # Sync with island
- # Make sure were not moving less then a 3rg of our width/height
- if xIncrement (sourceIsland[2]) and\ #
+ # print USER_FREE_SPACE_TO_TEST_QUALITY, 'ass'
+ if targetIsland[2] > (sourceIsland[1] * USER_FREE_SPACE_TO_TEST_QUALITY) and\
+ targetIsland[4] > sourceIsland[4] and\
+ targetIsland[5] > sourceIsland[5]:
+
+ # DEBUG # print '%.10f %.10f' % (targetIsland[3], sourceIsland[1])
+
+ # These enough spare space lets move the box until it fits
+
+ # How many times does the source fit into the target x/y
+ blockTestXUnit = targetIsland[4]/sourceIsland[4]
+ blockTestYUnit = targetIsland[5]/sourceIsland[5]
+
+ boxLeft = 0
+
+
+ # Distllllance we can move between whilst staying inside the targets bounds.
+ testWidth = targetIsland[4] - sourceIsland[4]
+ testHeight = targetIsland[5] - sourceIsland[5]
+
+ # Increment we move each test. x/y
+ xIncrement = (testWidth / (blockTestXUnit * ((USER_STEP_QUALITY/50)+0.1)))
+ yIncrement = (testHeight / (blockTestYUnit * ((USER_STEP_QUALITY/50)+0.1)))
+
+ # Make sure were not moving less then a 3rg of our width/height
+ if xIncrement testWidth:
- boxBottom += yIncrement
- boxLeft = 0.0
- else:
- boxLeft += xIncrement
- ##print testcount
-
- efficIslandIdx+=1
- areaIslandIdx+=1
-
- # Remove empty islands
- i = len(islandList)
- while i:
- i-=1
- if not islandList[i]:
- del islandList[i] # Can increment islands removed here.
+ # Move faces into new island and offset
+ targetIsland[0].extend(sourceIsland[0])
+ offset= Vector(boxLeft, boxBottom)
+
+ for f in sourceIsland[0]:
+ for uv in f.uv:
+ uv+= offset
+
+ sourceIsland[0][:] = [] # Empty
+
+
+ # Move edge loop into new and offset.
+ # targetIsland[6].extend(sourceIsland[6])
+ #while sourceIsland[6]:
+ targetIsland[6].extend( [ (\
+ (e[0]+offset, e[1]+offset, e[2])\
+ ) for e in sourceIsland[6] ] )
+
+ sourceIsland[6][:] = [] # Empty
+
+ # Sort by edge length, reverse so biggest are first.
+
+ try: targetIsland[6].sort(key = lambda A: A[2])
+ except: targetIsland[6].sort(lambda B,A: cmp(A[2], B[2] ))
+
+
+ targetIsland[7].extend(sourceIsland[7])
+ offset= Vector(boxLeft, boxBottom, 0)
+ for p in sourceIsland[7]:
+ p+= offset
+
+ sourceIsland[7][:] = []
+
+
+ # Decrement the efficiency
+ targetIsland[1]+=sourceIsland[1] # Increment totFaceArea
+ targetIsland[2]-=sourceIsland[1] # Decrement efficiency
+ # IF we ever used these again, should set to 0, eg
+ sourceIsland[2] = 0 # No area if anyone wants to know
+
+ break
+
+
+ # INCREMENR NEXT LOCATION
+ if boxLeft > testWidth:
+ boxBottom += yIncrement
+ boxLeft = 0.0
+ else:
+ boxLeft += xIncrement
+ ##print testcount
+
+ efficIslandIdx+=1
+ areaIslandIdx+=1
+
+ # Remove empty islands
+ i = len(islandList)
+ while i:
+ i-=1
+ if not islandList[i]:
+ del islandList[i] # Can increment islands removed here.
# Takes groups of faces. assumes face groups are UV groups.
def getUvIslands(faceGroups, me):
-
- # Get seams so we dont cross over seams
- edge_seams = {} # shoudl be a set
- for ed in me.edges:
- if ed.seam:
- edge_seams[ed.key] = None # dummy var- use sets!
- # Done finding seams
-
-
- islandList = []
-
+
+ # Get seams so we dont cross over seams
+ edge_seams = {} # shoudl be a set
+ for ed in me.edges:
+ if ed.seam:
+ edge_seams[ed.key] = None # dummy var- use sets!
+ # Done finding seams
+
+
+ islandList = []
+
#XXX Window.DrawProgressBar(0.0, 'Splitting %d projection groups into UV islands:' % len(faceGroups))
- #print '\tSplitting %d projection groups into UV islands:' % len(faceGroups),
- # Find grouped faces
-
- faceGroupIdx = len(faceGroups)
-
- while faceGroupIdx:
- faceGroupIdx-=1
- faces = faceGroups[faceGroupIdx]
-
- if not faces:
- continue
-
- # Build edge dict
- edge_users = {}
-
- for i, f in enumerate(faces):
- for ed_key in f.edge_keys:
- if ed_key in edge_seams: # DELIMIT SEAMS! ;)
- edge_users[ed_key] = [] # so as not to raise an error
- else:
- try: edge_users[ed_key].append(i)
- except: edge_users[ed_key] = [i]
-
- # Modes
- # 0 - face not yet touched.
- # 1 - added to island list, and need to search
- # 2 - touched and searched - dont touch again.
- face_modes = [0] * len(faces) # initialize zero - untested.
-
- face_modes[0] = 1 # start the search with face 1
-
- newIsland = []
-
- newIsland.append(faces[0])
-
-
- ok = True
- while ok:
-
- ok = True
- while ok:
- ok= False
- for i in range(len(faces)):
- if face_modes[i] == 1: # search
- for ed_key in faces[i].edge_keys:
- for ii in edge_users[ed_key]:
- if i != ii and face_modes[ii] == 0:
- face_modes[ii] = ok = 1 # mark as searched
- newIsland.append(faces[ii])
-
- # mark as searched, dont look again.
- face_modes[i] = 2
-
- islandList.append(newIsland)
-
- ok = False
- for i in range(len(faces)):
- if face_modes[i] == 0:
- newIsland = []
- newIsland.append(faces[i])
-
- face_modes[i] = ok = 1
- break
- # if not ok will stop looping
-
+ #print '\tSplitting %d projection groups into UV islands:' % len(faceGroups),
+ # Find grouped faces
+
+ faceGroupIdx = len(faceGroups)
+
+ while faceGroupIdx:
+ faceGroupIdx-=1
+ faces = faceGroups[faceGroupIdx]
+
+ if not faces:
+ continue
+
+ # Build edge dict
+ edge_users = {}
+
+ for i, f in enumerate(faces):
+ for ed_key in f.edge_keys:
+ if ed_key in edge_seams: # DELIMIT SEAMS! ;)
+ edge_users[ed_key] = [] # so as not to raise an error
+ else:
+ try: edge_users[ed_key].append(i)
+ except: edge_users[ed_key] = [i]
+
+ # Modes
+ # 0 - face not yet touched.
+ # 1 - added to island list, and need to search
+ # 2 - touched and searched - dont touch again.
+ face_modes = [0] * len(faces) # initialize zero - untested.
+
+ face_modes[0] = 1 # start the search with face 1
+
+ newIsland = []
+
+ newIsland.append(faces[0])
+
+
+ ok = True
+ while ok:
+
+ ok = True
+ while ok:
+ ok= False
+ for i in range(len(faces)):
+ if face_modes[i] == 1: # search
+ for ed_key in faces[i].edge_keys:
+ for ii in edge_users[ed_key]:
+ if i != ii and face_modes[ii] == 0:
+ face_modes[ii] = ok = 1 # mark as searched
+ newIsland.append(faces[ii])
+
+ # mark as searched, dont look again.
+ face_modes[i] = 2
+
+ islandList.append(newIsland)
+
+ ok = False
+ for i in range(len(faces)):
+ if face_modes[i] == 0:
+ newIsland = []
+ newIsland.append(faces[i])
+
+ face_modes[i] = ok = 1
+ break
+ # if not ok will stop looping
+
#XXX Window.DrawProgressBar(0.1, 'Optimizing Rotation for %i UV Islands' % len(islandList))
-
- for island in islandList:
- optiRotateUvIsland(island)
-
- return islandList
-
+
+ for island in islandList:
+ optiRotateUvIsland(island)
+
+ return islandList
+
def packIslands(islandList):
- if USER_FILL_HOLES:
+ if USER_FILL_HOLES:
#XXX Window.DrawProgressBar(0.1, 'Merging Islands (Ctrl: skip merge)...')
- mergeUvIslands(islandList) # Modify in place
-
-
- # Now we have UV islands, we need to pack them.
-
- # Make a synchronised list with the islands
- # so we can box pak the islands.
- packBoxes = []
-
- # Keep a list of X/Y offset so we can save time by writing the
- # uv's and packed data in one pass.
- islandOffsetList = []
-
- islandIdx = 0
-
- while islandIdx < len(islandList):
- minx, miny, maxx, maxy = boundsIsland(islandList[islandIdx])
-
- w, h = maxx-minx, maxy-miny
-
- if USER_ISLAND_MARGIN:
- minx -= USER_ISLAND_MARGIN# *w
- miny -= USER_ISLAND_MARGIN# *h
- maxx += USER_ISLAND_MARGIN# *w
- maxy += USER_ISLAND_MARGIN# *h
-
- # recalc width and height
- w, h = maxx-minx, maxy-miny
-
- if w < 0.00001 or h < 0.00001:
- del islandList[islandIdx]
- islandIdx -=1
- continue
-
- '''Save the offset to be applied later,
- we could apply to the UVs now and allign them to the bottom left hand area
- of the UV coords like the box packer imagines they are
- but, its quicker just to remember their offset and
- apply the packing and offset in 1 pass '''
- islandOffsetList.append((minx, miny))
-
- # Add to boxList. use the island idx for the BOX id.
- packBoxes.append([0, 0, w, h])
- islandIdx+=1
-
- # Now we have a list of boxes to pack that syncs
- # with the islands.
-
- #print '\tPacking UV Islands...'
+ mergeUvIslands(islandList) # Modify in place
+
+
+ # Now we have UV islands, we need to pack them.
+
+ # Make a synchronised list with the islands
+ # so we can box pak the islands.
+ packBoxes = []
+
+ # Keep a list of X/Y offset so we can save time by writing the
+ # uv's and packed data in one pass.
+ islandOffsetList = []
+
+ islandIdx = 0
+
+ while islandIdx < len(islandList):
+ minx, miny, maxx, maxy = boundsIsland(islandList[islandIdx])
+
+ w, h = maxx-minx, maxy-miny
+
+ if USER_ISLAND_MARGIN:
+ minx -= USER_ISLAND_MARGIN# *w
+ miny -= USER_ISLAND_MARGIN# *h
+ maxx += USER_ISLAND_MARGIN# *w
+ maxy += USER_ISLAND_MARGIN# *h
+
+ # recalc width and height
+ w, h = maxx-minx, maxy-miny
+
+ if w < 0.00001 or h < 0.00001:
+ del islandList[islandIdx]
+ islandIdx -=1
+ continue
+
+ '''Save the offset to be applied later,
+ we could apply to the UVs now and allign them to the bottom left hand area
+ of the UV coords like the box packer imagines they are
+ but, its quicker just to remember their offset and
+ apply the packing and offset in 1 pass '''
+ islandOffsetList.append((minx, miny))
+
+ # Add to boxList. use the island idx for the BOX id.
+ packBoxes.append([0, 0, w, h])
+ islandIdx+=1
+
+ # Now we have a list of boxes to pack that syncs
+ # with the islands.
+
+ #print '\tPacking UV Islands...'
#XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) )
-
- time1 = time.time()
- packWidth, packHeight = Geometry.BoxPack2D(packBoxes)
-
- # print 'Box Packing Time:', time.time() - time1
-
- #if len(pa ckedLs) != len(islandList):
- # raise "Error packed boxes differes from original length"
-
- #print '\tWriting Packed Data to faces'
+
+ time1 = time.time()
+ packWidth, packHeight = Geometry.BoxPack2D(packBoxes)
+
+ # print 'Box Packing Time:', time.time() - time1
+
+ #if len(pa ckedLs) != len(islandList):
+ # raise "Error packed boxes differes from original length"
+
+ #print '\tWriting Packed Data to faces'
#XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces')
-
- # Sort by ID, so there in sync again
- islandIdx = len(islandList)
- # Having these here avoids devide by 0
- if islandIdx:
-
- if USER_STRETCH_ASPECT:
- # Maximize to uv area?? Will write a normalize function.
- xfactor = 1.0 / packWidth
- yfactor = 1.0 / packHeight
- else:
- # Keep proportions.
- xfactor = yfactor = 1.0 / max(packWidth, packHeight)
-
- while islandIdx:
- islandIdx -=1
- # Write the packed values to the UV's
-
- xoffset = packBoxes[islandIdx][0] - islandOffsetList[islandIdx][0]
- yoffset = packBoxes[islandIdx][1] - islandOffsetList[islandIdx][1]
-
- for f in islandList[islandIdx]: # Offsetting the UV's so they fit in there packed box
- for uv in f.uv:
- uv.x= (uv.x+xoffset) * xfactor
- uv.y= (uv.y+yoffset) * yfactor
-
-
+
+ # Sort by ID, so there in sync again
+ islandIdx = len(islandList)
+ # Having these here avoids devide by 0
+ if islandIdx:
+
+ if USER_STRETCH_ASPECT:
+ # Maximize to uv area?? Will write a normalize function.
+ xfactor = 1.0 / packWidth
+ yfactor = 1.0 / packHeight
+ else:
+ # Keep proportions.
+ xfactor = yfactor = 1.0 / max(packWidth, packHeight)
+
+ while islandIdx:
+ islandIdx -=1
+ # Write the packed values to the UV's
+
+ xoffset = packBoxes[islandIdx][0] - islandOffsetList[islandIdx][0]
+ yoffset = packBoxes[islandIdx][1] - islandOffsetList[islandIdx][1]
+
+ for f in islandList[islandIdx]: # Offsetting the UV's so they fit in there packed box
+ for uv in f.uv:
+ uv.x= (uv.x+xoffset) * xfactor
+ uv.y= (uv.y+yoffset) * yfactor
+
+
def VectoMat(vec):
- a3 = vec.__copy__().normalize()
-
- up = Vector(0,0,1)
- if abs(a3.dot(up)) == 1.0:
- up = Vector(0,1,0)
-
- a1 = a3.cross(up).normalize()
- a2 = a3.cross(a1)
- return Matrix([a1[0], a1[1], a1[2]], [a2[0], a2[1], a2[2]], [a3[0], a3[1], a3[2]])
+ a3 = vec.__copy__().normalize()
+
+ up = Vector(0,0,1)
+ if abs(a3.dot(up)) == 1.0:
+ up = Vector(0,1,0)
+
+ a1 = a3.cross(up).normalize()
+ a2 = a3.cross(a1)
+ return Matrix([a1[0], a1[1], a1[2]], [a2[0], a2[1], a2[2]], [a3[0], a3[1], a3[2]])
class thickface(object):
- __slost__= 'v', 'uv', 'no', 'area', 'edge_keys'
- def __init__(self, face, uvface, mesh_verts):
- self.v = [mesh_verts[i] for i in face.verts]
- if len(self.v)==4:
- self.uv = uvface.uv1, uvface.uv2, uvface.uv3, uvface.uv4
- else:
- self.uv = uvface.uv1, uvface.uv2, uvface.uv3
-
- self.no = face.normal
- self.area = face.area
- self.edge_keys = face.edge_keys
+ __slost__= 'v', 'uv', 'no', 'area', 'edge_keys'
+ def __init__(self, face, uvface, mesh_verts):
+ self.v = [mesh_verts[i] for i in face.verts]
+ if len(self.v)==4:
+ self.uv = uvface.uv1, uvface.uv2, uvface.uv3, uvface.uv4
+ else:
+ self.uv = uvface.uv1, uvface.uv2, uvface.uv3
+
+ self.no = face.normal
+ self.area = face.area
+ self.edge_keys = face.edge_keys
global ob
ob = None
def main(context, island_margin, projection_limit):
- global USER_FILL_HOLES
- global USER_FILL_HOLES_QUALITY
- global USER_STRETCH_ASPECT
- global USER_ISLAND_MARGIN
-
-#XXX objects= bpy.data.scenes.active.objects
- objects = context.selected_editable_objects
-
-
- # we can will tag them later.
- obList = [ob for ob in objects if ob.type == 'MESH']
-
- # Face select object may not be selected.
-#XXX ob = objects.active
- ob= objects[0]
+ global USER_FILL_HOLES
+ global USER_FILL_HOLES_QUALITY
+ global USER_STRETCH_ASPECT
+ global USER_ISLAND_MARGIN
+
+#XXX objects= bpy.data.scenes.active.objects
+ objects = context.selected_editable_objects
+
+
+ # we can will tag them later.
+ obList = [ob for ob in objects if ob.type == 'MESH']
+
+ # Face select object may not be selected.
+#XXX ob = objects.active
+ ob= objects[0]
+
+ if ob and ob.selected == 0 and ob.type == 'MESH':
+ # Add to the list
+ obList =[ob]
+ del objects
+
+ if not obList:
+ raise('error, no selected mesh objects')
+
+ # Create the variables.
+ USER_PROJECTION_LIMIT = projection_limit
+ USER_ONLY_SELECTED_FACES = (1)
+ USER_SHARE_SPACE = (1) # Only for hole filling.
+ USER_STRETCH_ASPECT = (1) # Only for hole filling.
+ USER_ISLAND_MARGIN = island_margin # Only for hole filling.
+ USER_FILL_HOLES = (0)
+ USER_FILL_HOLES_QUALITY = (50) # Only for hole filling.
+ USER_VIEW_INIT = (0) # Only for hole filling.
+ USER_AREA_WEIGHT = (1) # Only for hole filling.
+
+ # Reuse variable
+ if len(obList) == 1:
+ ob = "Unwrap %i Selected Mesh"
+ else:
+ ob = "Unwrap %i Selected Meshes"
+
+ # HACK, loop until mouse is lifted.
+ '''
+ while Window.GetMouseButtons() != 0:
+ time.sleep(10)
+ '''
- if ob and ob.selected == 0 and ob.type == 'MESH':
- # Add to the list
- obList =[ob]
- del objects
-
- if not obList:
- raise('error, no selected mesh objects')
-
- # Create the variables.
- USER_PROJECTION_LIMIT = projection_limit
- USER_ONLY_SELECTED_FACES = (1)
- USER_SHARE_SPACE = (1) # Only for hole filling.
- USER_STRETCH_ASPECT = (1) # Only for hole filling.
- USER_ISLAND_MARGIN = island_margin # Only for hole filling.
- USER_FILL_HOLES = (0)
- USER_FILL_HOLES_QUALITY = (50) # Only for hole filling.
- USER_VIEW_INIT = (0) # Only for hole filling.
- USER_AREA_WEIGHT = (1) # Only for hole filling.
-
- # Reuse variable
- if len(obList) == 1:
- ob = "Unwrap %i Selected Mesh"
- else:
- ob = "Unwrap %i Selected Meshes"
-
- # HACK, loop until mouse is lifted.
- '''
- while Window.GetMouseButtons() != 0:
- time.sleep(10)
- '''
-
#XXX if not Draw.PupBlock(ob % len(obList), pup_block):
#XXX return
#XXX del ob
-
- # Convert from being button types
-
- USER_PROJECTION_LIMIT_CONVERTED = cos(USER_PROJECTION_LIMIT * DEG_TO_RAD)
- USER_PROJECTION_LIMIT_HALF_CONVERTED = cos((USER_PROJECTION_LIMIT/2) * DEG_TO_RAD)
-
-
- # Toggle Edit mode
- is_editmode = (context.active_object.mode == 'EDIT')
- if is_editmode:
- bpy.ops.object.mode_set(mode='OBJECT')
- # Assume face select mode! an annoying hack to toggle face select mode because Mesh dosent like faceSelectMode.
-
- if USER_SHARE_SPACE:
- # Sort by data name so we get consistant results
- obList.sort(key = lambda ob: ob.data.name)
- collected_islandList= []
-
-#XXX Window.WaitCursor(1)
-
- time1 = time.time()
-
- # Tag as False se we dont operate on teh same mesh twice.
-#XXX bpy.data.meshes.tag = False
- for me in bpy.data.meshes:
- me.tag = False
-
- for ob in obList:
- me = ob.data
-
- if me.tag or me.library:
- continue
-
- # Tag as used
- me.tag = True
-
- if len(me.uv_textures)==0: # Mesh has no UV Coords, dont bother.
- me.add_uv_texture()
-
- uv_layer = me.active_uv_texture.data
- me_verts = list(me.verts)
-
- if USER_ONLY_SELECTED_FACES:
- meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces) if f.selected]
- #else:
- # meshFaces = map(thickface, me.faces)
-
- if not meshFaces:
- continue
-
+ # Convert from being button types
+
+ USER_PROJECTION_LIMIT_CONVERTED = cos(USER_PROJECTION_LIMIT * DEG_TO_RAD)
+ USER_PROJECTION_LIMIT_HALF_CONVERTED = cos((USER_PROJECTION_LIMIT/2) * DEG_TO_RAD)
+
+
+ # Toggle Edit mode
+ is_editmode = (context.active_object.mode == 'EDIT')
+ if is_editmode:
+ bpy.ops.object.mode_set(mode='OBJECT')
+ # Assume face select mode! an annoying hack to toggle face select mode because Mesh dosent like faceSelectMode.
+
+ if USER_SHARE_SPACE:
+ # Sort by data name so we get consistant results
+ obList.sort(key = lambda ob: ob.data.name)
+ collected_islandList= []
+
+#XXX Window.WaitCursor(1)
+
+ time1 = time.time()
+
+ # Tag as False se we dont operate on teh same mesh twice.
+#XXX bpy.data.meshes.tag = False
+ for me in bpy.data.meshes:
+ me.tag = False
+
+
+ for ob in obList:
+ me = ob.data
+
+ if me.tag or me.library:
+ continue
+
+ # Tag as used
+ me.tag = True
+
+ if len(me.uv_textures)==0: # Mesh has no UV Coords, dont bother.
+ me.add_uv_texture()
+
+ uv_layer = me.active_uv_texture.data
+ me_verts = list(me.verts)
+
+ if USER_ONLY_SELECTED_FACES:
+ meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces) if f.selected]
+ #else:
+ # meshFaces = map(thickface, me.faces)
+
+ if not meshFaces:
+ continue
+
#XXX Window.DrawProgressBar(0.1, 'SmartProj UV Unwrapper, mapping "%s", %i faces.' % (me.name, len(meshFaces)))
-
- # =======
- # Generate a projection list from face normals, this is ment to be smart :)
-
- # make a list of face props that are in sync with meshFaces
- # Make a Face List that is sorted by area.
- # meshFaces = []
-
- # meshFaces.sort( lambda a, b: cmp(b.area , a.area) ) # Biggest first.
- meshFaces.sort( key = lambda a: -a.area )
-
- # remove all zero area faces
- while meshFaces and meshFaces[-1].area <= SMALL_NUM:
- # Set their UV's to 0,0
- for uv in meshFaces[-1].uv:
- uv.zero()
- meshFaces.pop()
-
- # Smallest first is slightly more efficient, but if the user cancels early then its better we work on the larger data.
-
- # Generate Projection Vecs
- # 0d is 1.0
- # 180 IS -0.59846
-
-
- # Initialize projectVecs
- if USER_VIEW_INIT:
- # Generate Projection
- projectVecs = [Vector(Window.GetViewVector()) * ob.matrixWorld.copy().invert().rotationPart()] # We add to this allong the way
- else:
- projectVecs = []
-
- newProjectVec = meshFaces[0].no
- newProjectMeshFaces = [] # Popping stuffs it up.
-
-
- # Predent that the most unique angke is ages away to start the loop off
- mostUniqueAngle = -1.0
-
- # This is popped
- tempMeshFaces = meshFaces[:]
-
-
-
- # This while only gathers projection vecs, faces are assigned later on.
- while 1:
- # If theres none there then start with the largest face
-
- # add all the faces that are close.
- for fIdx in range(len(tempMeshFaces)-1, -1, -1):
- # Use half the angle limit so we dont overweight faces towards this
- # normal and hog all the faces.
- if newProjectVec.dot(tempMeshFaces[fIdx].no) > USER_PROJECTION_LIMIT_HALF_CONVERTED:
- newProjectMeshFaces.append(tempMeshFaces.pop(fIdx))
-
- # Add the average of all these faces normals as a projectionVec
- averageVec = Vector(0,0,0)
- if USER_AREA_WEIGHT:
- for fprop in newProjectMeshFaces:
- averageVec += (fprop.no * fprop.area)
- else:
- for fprop in newProjectMeshFaces:
- averageVec += fprop.no
-
- if averageVec.x != 0 or averageVec.y != 0 or averageVec.z != 0: # Avoid NAN
- projectVecs.append(averageVec.normalize())
-
-
- # Get the next vec!
- # Pick the face thats most different to all existing angles :)
- mostUniqueAngle = 1.0 # 1.0 is 0d. no difference.
- mostUniqueIndex = 0 # dummy
-
- for fIdx in range(len(tempMeshFaces)-1, -1, -1):
- angleDifference = -1.0 # 180d difference.
-
- # Get the closest vec angle we are to.
- for p in projectVecs:
- temp_angle_diff= p.dot(tempMeshFaces[fIdx].no)
-
- if angleDifference < temp_angle_diff:
- angleDifference= temp_angle_diff
-
- if angleDifference < mostUniqueAngle:
- # We have a new most different angle
- mostUniqueIndex = fIdx
- mostUniqueAngle = angleDifference
-
- if mostUniqueAngle < USER_PROJECTION_LIMIT_CONVERTED:
- #print 'adding', mostUniqueAngle, USER_PROJECTION_LIMIT, len(newProjectMeshFaces)
- # Now weight the vector to all its faces, will give a more direct projection
- # if the face its self was not representive of the normal from surrounding faces.
-
- newProjectVec = tempMeshFaces[mostUniqueIndex].no
- newProjectMeshFaces = [tempMeshFaces.pop(mostUniqueIndex)]
-
-
- else:
- if len(projectVecs) >= 1: # Must have at least 2 projections
- break
-
-
- # If there are only zero area faces then its possible
- # there are no projectionVecs
- if not len(projectVecs):
- Draw.PupMenu('error, no projection vecs where generated, 0 area faces can cause this.')
- return
-
- faceProjectionGroupList =[[] for i in range(len(projectVecs)) ]
-
- # MAP and Arrange # We know there are 3 or 4 faces here
-
- for fIdx in range(len(meshFaces)-1, -1, -1):
- fvec = meshFaces[fIdx].no
- i = len(projectVecs)
-
- # Initialize first
- bestAng = fvec.dot(projectVecs[0])
- bestAngIdx = 0
-
- # Cycle through the remaining, first alredy done
- while i-1:
- i-=1
-
- newAng = fvec.dot(projectVecs[i])
- if newAng > bestAng: # Reverse logic for dotvecs
- bestAng = newAng
- bestAngIdx = i
-
- # Store the area for later use.
- faceProjectionGroupList[bestAngIdx].append(meshFaces[fIdx])
-
- # Cull faceProjectionGroupList,
-
-
- # Now faceProjectionGroupList is full of faces that face match the project Vecs list
- for i in range(len(projectVecs)):
- # Account for projectVecs having no faces.
- if not faceProjectionGroupList[i]:
- continue
-
- # Make a projection matrix from a unit length vector.
- MatProj = VectoMat(projectVecs[i])
-
- # Get the faces UV's from the projected vertex.
- for f in faceProjectionGroupList[i]:
- f_uv = f.uv
- for j, v in enumerate(f.v):
- # XXX - note, between Mathutils in 2.4 and 2.5 the order changed.
- f_uv[j][:] = (v.co * MatProj)[:2]
-
-
- if USER_SHARE_SPACE:
- # Should we collect and pack later?
- islandList = getUvIslands(faceProjectionGroupList, me)
- collected_islandList.extend(islandList)
-
- else:
- # Should we pack the islands for this 1 object?
- islandList = getUvIslands(faceProjectionGroupList, me)
- packIslands(islandList)
-
-
- # update the mesh here if we need to.
-
- # We want to pack all in 1 go, so pack now
- if USER_SHARE_SPACE:
+
+ # =======
+ # Generate a projection list from face normals, this is ment to be smart :)
+
+ # make a list of face props that are in sync with meshFaces
+ # Make a Face List that is sorted by area.
+ # meshFaces = []
+
+ # meshFaces.sort( lambda a, b: cmp(b.area , a.area) ) # Biggest first.
+ meshFaces.sort( key = lambda a: -a.area )
+
+ # remove all zero area faces
+ while meshFaces and meshFaces[-1].area <= SMALL_NUM:
+ # Set their UV's to 0,0
+ for uv in meshFaces[-1].uv:
+ uv.zero()
+ meshFaces.pop()
+
+ # Smallest first is slightly more efficient, but if the user cancels early then its better we work on the larger data.
+
+ # Generate Projection Vecs
+ # 0d is 1.0
+ # 180 IS -0.59846
+
+
+ # Initialize projectVecs
+ if USER_VIEW_INIT:
+ # Generate Projection
+ projectVecs = [Vector(Window.GetViewVector()) * ob.matrixWorld.copy().invert().rotationPart()] # We add to this allong the way
+ else:
+ projectVecs = []
+
+ newProjectVec = meshFaces[0].no
+ newProjectMeshFaces = [] # Popping stuffs it up.
+
+
+ # Predent that the most unique angke is ages away to start the loop off
+ mostUniqueAngle = -1.0
+
+ # This is popped
+ tempMeshFaces = meshFaces[:]
+
+
+
+ # This while only gathers projection vecs, faces are assigned later on.
+ while 1:
+ # If theres none there then start with the largest face
+
+ # add all the faces that are close.
+ for fIdx in range(len(tempMeshFaces)-1, -1, -1):
+ # Use half the angle limit so we dont overweight faces towards this
+ # normal and hog all the faces.
+ if newProjectVec.dot(tempMeshFaces[fIdx].no) > USER_PROJECTION_LIMIT_HALF_CONVERTED:
+ newProjectMeshFaces.append(tempMeshFaces.pop(fIdx))
+
+ # Add the average of all these faces normals as a projectionVec
+ averageVec = Vector(0,0,0)
+ if USER_AREA_WEIGHT:
+ for fprop in newProjectMeshFaces:
+ averageVec += (fprop.no * fprop.area)
+ else:
+ for fprop in newProjectMeshFaces:
+ averageVec += fprop.no
+
+ if averageVec.x != 0 or averageVec.y != 0 or averageVec.z != 0: # Avoid NAN
+ projectVecs.append(averageVec.normalize())
+
+
+ # Get the next vec!
+ # Pick the face thats most different to all existing angles :)
+ mostUniqueAngle = 1.0 # 1.0 is 0d. no difference.
+ mostUniqueIndex = 0 # dummy
+
+ for fIdx in range(len(tempMeshFaces)-1, -1, -1):
+ angleDifference = -1.0 # 180d difference.
+
+ # Get the closest vec angle we are to.
+ for p in projectVecs:
+ temp_angle_diff= p.dot(tempMeshFaces[fIdx].no)
+
+ if angleDifference < temp_angle_diff:
+ angleDifference= temp_angle_diff
+
+ if angleDifference < mostUniqueAngle:
+ # We have a new most different angle
+ mostUniqueIndex = fIdx
+ mostUniqueAngle = angleDifference
+
+ if mostUniqueAngle < USER_PROJECTION_LIMIT_CONVERTED:
+ #print 'adding', mostUniqueAngle, USER_PROJECTION_LIMIT, len(newProjectMeshFaces)
+ # Now weight the vector to all its faces, will give a more direct projection
+ # if the face its self was not representive of the normal from surrounding faces.
+
+ newProjectVec = tempMeshFaces[mostUniqueIndex].no
+ newProjectMeshFaces = [tempMeshFaces.pop(mostUniqueIndex)]
+
+
+ else:
+ if len(projectVecs) >= 1: # Must have at least 2 projections
+ break
+
+
+ # If there are only zero area faces then its possible
+ # there are no projectionVecs
+ if not len(projectVecs):
+ Draw.PupMenu('error, no projection vecs where generated, 0 area faces can cause this.')
+ return
+
+ faceProjectionGroupList =[[] for i in range(len(projectVecs)) ]
+
+ # MAP and Arrange # We know there are 3 or 4 faces here
+
+ for fIdx in range(len(meshFaces)-1, -1, -1):
+ fvec = meshFaces[fIdx].no
+ i = len(projectVecs)
+
+ # Initialize first
+ bestAng = fvec.dot(projectVecs[0])
+ bestAngIdx = 0
+
+ # Cycle through the remaining, first alredy done
+ while i-1:
+ i-=1
+
+ newAng = fvec.dot(projectVecs[i])
+ if newAng > bestAng: # Reverse logic for dotvecs
+ bestAng = newAng
+ bestAngIdx = i
+
+ # Store the area for later use.
+ faceProjectionGroupList[bestAngIdx].append(meshFaces[fIdx])
+
+ # Cull faceProjectionGroupList,
+
+
+ # Now faceProjectionGroupList is full of faces that face match the project Vecs list
+ for i in range(len(projectVecs)):
+ # Account for projectVecs having no faces.
+ if not faceProjectionGroupList[i]:
+ continue
+
+ # Make a projection matrix from a unit length vector.
+ MatProj = VectoMat(projectVecs[i])
+
+ # Get the faces UV's from the projected vertex.
+ for f in faceProjectionGroupList[i]:
+ f_uv = f.uv
+ for j, v in enumerate(f.v):
+ # XXX - note, between Mathutils in 2.4 and 2.5 the order changed.
+ f_uv[j][:] = (v.co * MatProj)[:2]
+
+
+ if USER_SHARE_SPACE:
+ # Should we collect and pack later?
+ islandList = getUvIslands(faceProjectionGroupList, me)
+ collected_islandList.extend(islandList)
+
+ else:
+ # Should we pack the islands for this 1 object?
+ islandList = getUvIslands(faceProjectionGroupList, me)
+ packIslands(islandList)
+
+
+ # update the mesh here if we need to.
+
+ # We want to pack all in 1 go, so pack now
+ if USER_SHARE_SPACE:
#XXX Window.DrawProgressBar(0.9, "Box Packing for all objects...")
- packIslands(collected_islandList)
-
- print("Smart Projection time: %.2f" % (time.time() - time1))
- # Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec." % (time.time() - time1))
-
- if is_editmode:
- bpy.ops.object.mode_set(mode='EDIT')
-
+ packIslands(collected_islandList)
+
+ print("Smart Projection time: %.2f" % (time.time() - time1))
+ # Window.DrawProgressBar(0.9, "Smart Projections done, time: %.2f sec." % (time.time() - time1))
+
+ if is_editmode:
+ bpy.ops.object.mode_set(mode='EDIT')
+
#XXX Window.DrawProgressBar(1.0, "")
#XXX Window.WaitCursor(0)
#XXX Window.RedrawAll()
"""
- pup_block = [\
- 'Projection',\
+ pup_block = [\
+ 'Projection',\
* ('Angle Limit:', USER_PROJECTION_LIMIT, 1, 89, ''),\
- ('Selected Faces Only', USER_ONLY_SELECTED_FACES, 'Use only selected faces from all selected meshes.'),\
- ('Init from view', USER_VIEW_INIT, 'The first projection will be from the view vector.'),\
- ('Area Weight', USER_AREA_WEIGHT, 'Weight projections vector by face area.'),\
- '',\
- '',\
- '',\
- 'UV Layout',\
- ('Share Tex Space', USER_SHARE_SPACE, 'Objects Share texture space, map all objects into 1 uvmap.'),\
- ('Stretch to bounds', USER_STRETCH_ASPECT, 'Stretch the final output to texture bounds.'),\
+ ('Selected Faces Only', USER_ONLY_SELECTED_FACES, 'Use only selected faces from all selected meshes.'),\
+ ('Init from view', USER_VIEW_INIT, 'The first projection will be from the view vector.'),\
+ ('Area Weight', USER_AREA_WEIGHT, 'Weight projections vector by face area.'),\
+ '',\
+ '',\
+ '',\
+ 'UV Layout',\
+ ('Share Tex Space', USER_SHARE_SPACE, 'Objects Share texture space, map all objects into 1 uvmap.'),\
+ ('Stretch to bounds', USER_STRETCH_ASPECT, 'Stretch the final output to texture bounds.'),\
* ('Island Margin:', USER_ISLAND_MARGIN, 0.0, 0.5, ''),\
- 'Fill in empty areas',\
- ('Fill Holes', USER_FILL_HOLES, 'Fill in empty areas reduced texture waistage (slow).'),\
- ('Fill Quality:', USER_FILL_HOLES_QUALITY, 1, 100, 'Depends on fill holes, how tightly to fill UV holes, (higher is slower)'),\
- ]
+ 'Fill in empty areas',\
+ ('Fill Holes', USER_FILL_HOLES, 'Fill in empty areas reduced texture waistage (slow).'),\
+ ('Fill Quality:', USER_FILL_HOLES_QUALITY, 1, 100, 'Depends on fill holes, how tightly to fill UV holes, (higher is slower)'),\
+ ]
"""
from bpy.props import *
class SmartProject(bpy.types.Operator):
- '''This script projection unwraps the selected faces of a mesh. it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces.'''
- bl_idname = "uv.smart_project"
- bl_label = "Smart UV Project"
+ '''This script projection unwraps the selected faces of a mesh. it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces.'''
+ bl_idname = "uv.smart_project"
+ bl_label = "Smart UV Project"
- bl_register = True
- bl_undo = True
+ bl_register = True
+ bl_undo = True
- angle_limit = FloatProperty(name="Angle Limit",
- description="lower for more projection groups, higher for less distortion.",
- default=66.0, min=1.0, max=89.0)
+ angle_limit = FloatProperty(name="Angle Limit",
+ description="lower for more projection groups, higher for less distortion.",
+ default=66.0, min=1.0, max=89.0)
- island_margin = FloatProperty(name="Island Margin",
- description="Margin to reduce bleed from adjacent islands.",
- default=0.0, min=0.0, max=1.0)
+ island_margin = FloatProperty(name="Island Margin",
+ description="Margin to reduce bleed from adjacent islands.",
+ default=0.0, min=0.0, max=1.0)
- def poll(self, context):
- return context.active_object != None
+ def poll(self, context):
+ return context.active_object != None
- def execute(self, context):
- main(context, self.island_margin, self.angle_limit)
- return ('FINISHED',)
+ def execute(self, context):
+ main(context, self.properties.island_margin, self.properties.angle_limit)
+ return ('FINISHED',)
bpy.ops.add(SmartProject)
# Add to a menu
import dynamic_menu
-menu_func = (lambda self, context: self.layout.itemO(SmartProject.bl_idname,
- text="Smart Project"))
+menu_func = (lambda self, context: self.layout.operator(SmartProject.bl_idname,
+ text="Smart Project"))
menu_item = dynamic_menu.add(bpy.types.VIEW3D_MT_uv_map, menu_func)
if __name__ == '__main__':
- bpy.ops.uv.smart_project()
+ bpy.ops.uv.smart_project()
diff --git a/release/scripts/op/vertexpaint_dirt.py b/release/scripts/op/vertexpaint_dirt.py
index 04398dfa8ce..585a2231e21 100644
--- a/release/scripts/op/vertexpaint_dirt.py
+++ b/release/scripts/op/vertexpaint_dirt.py
@@ -166,7 +166,7 @@ class VertexPaintDirt(bpy.types.Operator):
t = time.time()
- applyVertexDirt(me, self.blur_iterations, self.blur_strength, math.radians(self.dirt_angle), math.radians(self.clean_angle), self.dirt_only)
+ applyVertexDirt(me, self.properties.blur_iterations, self.properties.blur_strength, math.radians(self.properties.dirt_angle), math.radians(self.properties.clean_angle), self.properties.dirt_only)
print('Dirt calculated in %.6f' % (time.time()-t))
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py
index e65002ee0c0..c5fc18964bf 100644
--- a/release/scripts/op/wm.py
+++ b/release/scripts/op/wm.py
@@ -4,12 +4,12 @@
# 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.
@@ -19,6 +19,7 @@
#
import bpy
+import os
from bpy.props import *
@@ -32,6 +33,7 @@ class MESH_OT_delete_edgeloop(bpy.types.Operator):
bpy.ops.tfm.edge_slide(value=1.0)
bpy.ops.mesh.select_more()
bpy.ops.mesh.remove_doubles()
+
return ('FINISHED',)
rna_path_prop = StringProperty(name="Context Attributes",
@@ -60,10 +62,9 @@ def context_path_validate(context, path):
def execute_context_assign(self, context):
- if context_path_validate(context, self.path) == NullPathMember:
+ if context_path_validate(context, self.properties.path) == NullPathMember:
return ('PASS_THROUGH',)
-
- exec("context.%s=self.value" % self.path)
+ exec("context.%s=self.properties.value" % self.properties.path)
return ('FINISHED',)
@@ -92,7 +93,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
class WM_OT_context_set_float(bpy.types.Operator): # same as enum
'''Set a context value.'''
- bl_idname = "wm.context_set_int"
+ bl_idname = "wm.context_set_float"
bl_label = "Context Set"
path = rna_path_prop
@@ -135,10 +136,10 @@ class WM_OT_context_toggle(bpy.types.Operator):
def execute(self, context):
- if context_path_validate(context, self.path) == NullPathMember:
+ if context_path_validate(context, self.properties.path) == NullPathMember:
return ('PASS_THROUGH',)
- exec("context.%s=not (context.%s)" % (self.path, self.path))
+ exec("context.%s=not (context.%s)" % (self.properties.path, self.properties.path))
return ('FINISHED',)
@@ -156,11 +157,11 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
def execute(self, context):
- if context_path_validate(context, self.path) == NullPathMember:
+ if context_path_validate(context, self.properties.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
- (self.path, self.value_1, self.value_2, self.path, self.value_2))
+ (self.properties.path, self.properties.value_1, self.properties.value_2, self.properties.path, self.properties.value_2))
return ('FINISHED',)
@@ -175,23 +176,23 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
def execute(self, context):
- value = context_path_validate(context, self.path)
+ value = context_path_validate(context, self.properties.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
- self.value = value
- if self.reverse:
- self.value -= 1
+ self.properties.value = value
+ if self.properties.reverse:
+ self.properties.value -= 1
else:
- self.value += 1
+ self.properties.value += 1
execute_context_assign(self, context)
- if self.value != eval("context.%s" % self.path):
+ if self.properties.value != eval("context.%s" % self.properties.path):
# relies on rna clamping int's out of the range
- if self.reverse:
- self.value = (1 << 32)
+ if self.properties.reverse:
+ self.properties.value = (1 << 32)
else:
- self.value = - (1 << 32)
+ self.properties.value = - (1 << 32)
execute_context_assign(self, context)
return ('FINISHED',)
@@ -207,14 +208,14 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
def execute(self, context):
- value = context_path_validate(context, self.path)
+ value = context_path_validate(context, self.properties.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
orig_value = value
# Have to get rna enum values
- rna_struct_str, rna_prop_str = self.path.rsplit('.', 1)
+ rna_struct_str, rna_prop_str = self.properties.path.rsplit('.', 1)
i = rna_prop_str.find('[')
# just incse we get "context.foo.bar[0]"
@@ -232,7 +233,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
orig_index = enums.index(orig_value)
# Have the info we need, advance to the next item
- if self.reverse:
+ if self.properties.reverse:
if orig_index == 0:
advance_enum = enums[-1]
else:
@@ -244,13 +245,13 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
advance_enum = enums[orig_index + 1]
# set the new value
- exec("context.%s=advance_enum" % self.path)
+ exec("context.%s=advance_enum" % self.properties.path)
return ('FINISHED',)
doc_id = StringProperty(name="Doc ID",
- description="ID for the documentation", maxlen=1024, default="")
+ description="", maxlen=1024, default="", hidden=True)
-doc_new = StringProperty(name="Doc New",
+doc_new = StringProperty(name="Edit Description",
description="", maxlen=1024, default="")
@@ -271,7 +272,7 @@ class WM_OT_doc_view(bpy.types.Operator):
return '.'.join([class_obj.identifier for class_obj in ls])
def execute(self, context):
- id_split = self.doc_id.split('.')
+ id_split = self.properties.doc_id.split('.')
if len(id_split) == 1: # rna, class
url = '%s/bpy.types.%s-class.html' % (self._prefix, id_split[0])
elif len(id_split) == 2: # rna, class.prop
@@ -317,9 +318,9 @@ class WM_OT_doc_edit(bpy.types.Operator):
def execute(self, context):
- class_name, class_prop = self.doc_id.split('.')
+ class_name, class_prop = self.properties.doc_id.split('.')
- if not self.doc_new:
+ if not self.properties.doc_new:
return ('RUNNING_MODAL',)
# check if this is an operator
@@ -332,25 +333,25 @@ class WM_OT_doc_edit(bpy.types.Operator):
if op_class:
rna = op_class.bl_rna
doc_orig = rna.description
- if doc_orig == self.doc_new:
+ if doc_orig == self.properties.doc_new:
return ('RUNNING_MODAL',)
- print("op - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
- upload["title"] = 'OPERATOR %s:%s' % (self.doc_id, doc_orig)
- upload["description"] = self.doc_new
+ print("op - old:'%s' -> new:'%s'" % (doc_orig, self.properties.doc_new))
+ upload["title"] = 'OPERATOR %s:%s' % (self.properties.doc_id, doc_orig)
+ upload["description"] = self.properties.doc_new
self._send_xmlrpc(upload)
else:
rna = getattr(bpy.types, class_name).bl_rna
doc_orig = rna.properties[class_prop].description
- if doc_orig == self.doc_new:
+ if doc_orig == self.properties.doc_new:
return ('RUNNING_MODAL',)
- print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
- upload["title"] = 'RNA %s:%s' % (self.doc_id, doc_orig)
+ print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.properties.doc_new))
+ upload["title"] = 'RNA %s:%s' % (self.properties.doc_id, doc_orig)
- upload["description"] = self.doc_new
+ upload["description"] = self.properties.doc_new
self._send_xmlrpc(upload)
@@ -362,6 +363,37 @@ class WM_OT_doc_edit(bpy.types.Operator):
return ('RUNNING_MODAL',)
+class WM_OT_reload_scripts(bpy.types.Operator):
+ '''Load online reference docs'''
+ bl_idname = "wm.reload_scripts"
+ bl_label = "Reload Scripts"
+
+ def execute(self, context):
+ MOD = type(bpy)
+ import sys
+ bpy.load_scripts(True)
+ '''
+ prefix = bpy.base_path
+ items = list(sys.modules.items())
+ items.sort()
+ items.reverse()
+ for mod_name, mod in items:
+ mod_file = getattr(mod, "__file__", "")
+ if mod_file.startswith(prefix) and "__init__" not in mod_file:
+ print(mod_file)
+ reload(mod)
+ """
+ for submod_name in dir(mod):
+ submod = getattr(mod, submod_name)
+ if isinstance(submod, MOD):
+ reload(submod)
+ """
+ else:
+ print("Ignoring:", mod, mod_file)
+ '''
+ return ('FINISHED',)
+
+
bpy.ops.add(MESH_OT_delete_edgeloop)
bpy.ops.add(WM_OT_context_set_boolean)
@@ -376,3 +408,11 @@ bpy.ops.add(WM_OT_context_cycle_int)
bpy.ops.add(WM_OT_doc_view)
bpy.ops.add(WM_OT_doc_edit)
+
+bpy.ops.add(WM_OT_reload_scripts)
+
+# experemental!
+import rna_prop_ui
+bpy.ops.add(rna_prop_ui.WM_OT_properties_edit)
+bpy.ops.add(rna_prop_ui.WM_OT_properties_add)
+bpy.ops.add(rna_prop_ui.WM_OT_properties_remove)
diff --git a/release/scripts/presets/cloth/cotton.py b/release/scripts/presets/cloth/cotton.py
new file mode 100644
index 00000000000..7fe8b890b38
--- /dev/null
+++ b/release/scripts/presets/cloth/cotton.py
@@ -0,0 +1,6 @@
+bpy.context.cloth.settings.quality = 5
+bpy.context.cloth.settings.mass = 0.300
+bpy.context.cloth.settings.structural_stiffness = 15.000
+bpy.context.cloth.settings.bending_stiffness = 0.500
+bpy.context.cloth.settings.spring_damping = 5.000
+bpy.context.cloth.settings.air_damping = 1.000
diff --git a/release/scripts/presets/cloth/denim.py b/release/scripts/presets/cloth/denim.py
new file mode 100644
index 00000000000..4cad384a014
--- /dev/null
+++ b/release/scripts/presets/cloth/denim.py
@@ -0,0 +1,6 @@
+bpy.context.cloth.settings.quality = 12
+bpy.context.cloth.settings.mass = 1
+bpy.context.cloth.settings.structural_stiffness = 40
+bpy.context.cloth.settings.bending_stiffness = 10
+bpy.context.cloth.settings.spring_damping = 25
+bpy.context.cloth.settings.air_damping = 1
diff --git a/release/scripts/presets/cloth/leather.py b/release/scripts/presets/cloth/leather.py
new file mode 100644
index 00000000000..11176c7e814
--- /dev/null
+++ b/release/scripts/presets/cloth/leather.py
@@ -0,0 +1,6 @@
+bpy.context.cloth.settings.quality = 15
+bpy.context.cloth.settings.mass = 0.4
+bpy.context.cloth.settings.structural_stiffness = 80
+bpy.context.cloth.settings.bending_stiffness = 150
+bpy.context.cloth.settings.spring_damping = 25
+bpy.context.cloth.settings.air_damping = 1
diff --git a/release/scripts/presets/cloth/rubber.py b/release/scripts/presets/cloth/rubber.py
new file mode 100644
index 00000000000..101c11b141a
--- /dev/null
+++ b/release/scripts/presets/cloth/rubber.py
@@ -0,0 +1,6 @@
+bpy.context.active_object.modifiers['Cloth'].settings.quality = 7
+bpy.context.active_object.modifiers['Cloth'].settings.mass = 3
+bpy.context.active_object.modifiers['Cloth'].settings.structural_stiffness = 15
+bpy.context.active_object.modifiers['Cloth'].settings.bending_stiffness = 25
+bpy.context.active_object.modifiers['Cloth'].settings.spring_damping = 25
+bpy.context.active_object.modifiers['Cloth'].settings.air_damping = 1
diff --git a/release/scripts/presets/cloth/silk.py b/release/scripts/presets/cloth/silk.py
new file mode 100644
index 00000000000..a0dea5f1fd3
--- /dev/null
+++ b/release/scripts/presets/cloth/silk.py
@@ -0,0 +1,6 @@
+bpy.context.cloth.settings.quality = 5
+bpy.context.cloth.settings.mass = 0.150
+bpy.context.cloth.settings.structural_stiffness = 5
+bpy.context.cloth.settings.bending_stiffness = 0.05
+bpy.context.cloth.settings.spring_damping = 0
+bpy.context.cloth.settings.air_damping = 1
diff --git a/release/scripts/presets/render/HDTV_1080p.py b/release/scripts/presets/render/HDTV_1080p.py
new file mode 100644
index 00000000000..a0297a200f3
--- /dev/null
+++ b/release/scripts/presets/render/HDTV_1080p.py
@@ -0,0 +1,7 @@
+bpy.context.scene.render_data.resolution_x = 1920
+bpy.context.scene.render_data.resolution_y = 1080
+bpy.context.scene.render_data.resolution_percentage = 100
+bpy.context.scene.render_data.pixel_aspect_x = 1
+bpy.context.scene.render_data.pixel_aspect_y = 1
+bpy.context.scene.render_data.fps = 24
+bpy.context.scene.render_data.fps_base = 1
\ No newline at end of file
diff --git a/release/scripts/presets/render/HDTV_720p.py b/release/scripts/presets/render/HDTV_720p.py
new file mode 100644
index 00000000000..4d34a928eb3
--- /dev/null
+++ b/release/scripts/presets/render/HDTV_720p.py
@@ -0,0 +1,7 @@
+bpy.context.scene.render_data.resolution_x = 1280
+bpy.context.scene.render_data.resolution_y = 720
+bpy.context.scene.render_data.resolution_percentage = 100
+bpy.context.scene.render_data.pixel_aspect_x = 1
+bpy.context.scene.render_data.pixel_aspect_y = 1
+bpy.context.scene.render_data.fps = 24
+bpy.context.scene.render_data.fps_base = 1
\ No newline at end of file
diff --git a/release/scripts/presets/render/TV_NTSC.py b/release/scripts/presets/render/TV_NTSC.py
new file mode 100644
index 00000000000..c6bc7518fac
--- /dev/null
+++ b/release/scripts/presets/render/TV_NTSC.py
@@ -0,0 +1,7 @@
+bpy.context.scene.render_data.resolution_x = 720
+bpy.context.scene.render_data.resolution_y = 480
+bpy.context.scene.render_data.resolution_percentage = 100
+bpy.context.scene.render_data.pixel_aspect_x = 10
+bpy.context.scene.render_data.pixel_aspect_y = 11
+bpy.context.scene.render_data.fps = 30
+bpy.context.scene.render_data.fps_base = 1.001
diff --git a/release/scripts/presets/render/TV_PAL.py b/release/scripts/presets/render/TV_PAL.py
new file mode 100644
index 00000000000..7044070fb0c
--- /dev/null
+++ b/release/scripts/presets/render/TV_PAL.py
@@ -0,0 +1,7 @@
+bpy.context.scene.render_data.resolution_x = 720
+bpy.context.scene.render_data.resolution_y = 576
+bpy.context.scene.render_data.resolution_percentage = 100
+bpy.context.scene.render_data.pixel_aspect_x = 54
+bpy.context.scene.render_data.pixel_aspect_y = 51
+bpy.context.scene.render_data.fps = 25
+bpy.context.scene.render_data.fps_base = 1
\ No newline at end of file
diff --git a/release/scripts/presets/render/TV_PAL_16_colon_9.py b/release/scripts/presets/render/TV_PAL_16_colon_9.py
new file mode 100644
index 00000000000..756d34c8af3
--- /dev/null
+++ b/release/scripts/presets/render/TV_PAL_16_colon_9.py
@@ -0,0 +1,7 @@
+bpy.context.scene.render_data.resolution_x = 720
+bpy.context.scene.render_data.resolution_y = 576
+bpy.context.scene.render_data.resolution_percentage = 100
+bpy.context.scene.render_data.pixel_aspect_x = 64
+bpy.context.scene.render_data.pixel_aspect_y = 45
+bpy.context.scene.render_data.fps = 25
+bpy.context.scene.render_data.fps_base = 1
\ No newline at end of file
diff --git a/release/scripts/presets/sss/apple.py b/release/scripts/presets/sss/apple.py
new file mode 100644
index 00000000000..474769cd36f
--- /dev/null
+++ b/release/scripts/presets/sss/apple.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 11.605, 3.884, 1.754
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.430, 0.210, 0.168
diff --git a/release/scripts/presets/sss/chicken.py b/release/scripts/presets/sss/chicken.py
new file mode 100644
index 00000000000..6253de09376
--- /dev/null
+++ b/release/scripts/presets/sss/chicken.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 9.436, 3.348, 1.790
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.439, 0.216, 0.141
diff --git a/release/scripts/presets/sss/cream.py b/release/scripts/presets/sss/cream.py
new file mode 100644
index 00000000000..f0a5292b85c
--- /dev/null
+++ b/release/scripts/presets/sss/cream.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 15.028, 4.664, 2.541
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.987, 0.943, 0.827
diff --git a/release/scripts/presets/sss/ketchup.py b/release/scripts/presets/sss/ketchup.py
new file mode 100644
index 00000000000..caece1ea7ca
--- /dev/null
+++ b/release/scripts/presets/sss/ketchup.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 4.762, 0.575, 0.394
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.222, 0.008, 0.002
diff --git a/release/scripts/presets/sss/marble.py b/release/scripts/presets/sss/marble.py
new file mode 100644
index 00000000000..ea894f69800
--- /dev/null
+++ b/release/scripts/presets/sss/marble.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 8.509, 5.566, 3.951
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.925, 0.905, 0.884
diff --git a/release/scripts/presets/sss/potato.py b/release/scripts/presets/sss/potato.py
new file mode 100644
index 00000000000..89407dff427
--- /dev/null
+++ b/release/scripts/presets/sss/potato.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 14.266, 7.228, 2.036
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.855, 0.740, 0.292
diff --git a/release/scripts/presets/sss/skim_milk.py b/release/scripts/presets/sss/skim_milk.py
new file mode 100644
index 00000000000..2e5b19d4f53
--- /dev/null
+++ b/release/scripts/presets/sss/skim_milk.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 18.424, 10.443, 3.502
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.889, 0.888, 0.796
diff --git a/release/scripts/presets/sss/skin1.py b/release/scripts/presets/sss/skin1.py
new file mode 100644
index 00000000000..42fb1fac43a
--- /dev/null
+++ b/release/scripts/presets/sss/skin1.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 3.673, 1.367, 0.683
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.574, 0.313, 0.174
diff --git a/release/scripts/presets/sss/skin2.py b/release/scripts/presets/sss/skin2.py
new file mode 100644
index 00000000000..52b649ecd8f
--- /dev/null
+++ b/release/scripts/presets/sss/skin2.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 4.821, 1.694, 1.090
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.749, 0.571, 0.467
diff --git a/release/scripts/presets/sss/whole_milk.py b/release/scripts/presets/sss/whole_milk.py
new file mode 100644
index 00000000000..4cb6ccf3dcf
--- /dev/null
+++ b/release/scripts/presets/sss/whole_milk.py
@@ -0,0 +1,2 @@
+bpy.context.active_object.active_material.subsurface_scattering.radius = 10.899, 6.575, 2.508
+bpy.context.active_object.active_material.subsurface_scattering.color = 0.947, 0.931, 0.852
diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py
index 37d354d0e6b..0d1bc7fa29d 100644
--- a/release/scripts/templates/gamelogic.py
+++ b/release/scripts/templates/gamelogic.py
@@ -1,21 +1,3 @@
-# ##### 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 #####
-
# This script must be assigned to a python controller
# where it can access the object that owns it and the sensors/actuators that it connects to.
@@ -42,23 +24,23 @@ def main():
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
- print 'Logic info for KX_GameObject', own.name
+ print('Logic info for KX_GameObject', own.name)
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
- print ' sensor:', sens.name,
+ print(' sensor:', sens.name, end=' ')
if sens.positive:
- print '(true)'
+ print('(true)')
input = True
else:
- print '(false)'
+ print('(false)')
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
- print ' actuator:', actu.name
+ print(' actuator:', actu.name)
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
@@ -76,9 +58,9 @@ def main():
# Loop through all other objects in the scene
sce = GameLogic.getCurrentScene()
- print 'Scene Objects:', sce.name
+ print('Scene Objects:', sce.name)
for ob in sce.objects:
- print ' ', ob.name, ob.worldPosition
+ print(' ', ob.name, ob.worldPosition)
# Example where collision objects are checked for their properties
@@ -90,7 +72,7 @@ def main():
if ob.has_key('life'):
own['life'] += ob['life']
ob['life'] = 0
- print own['life']
+ print(own['life'])
"""
main()
diff --git a/release/scripts/templates/gamelogic_basic.py b/release/scripts/templates/gamelogic_basic.py
index 0accb57ccc2..5e7d19672fe 100644
--- a/release/scripts/templates/gamelogic_basic.py
+++ b/release/scripts/templates/gamelogic_basic.py
@@ -1,20 +1,3 @@
-# ##### 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 #####
def main():
diff --git a/release/scripts/templates/gamelogic_module.py b/release/scripts/templates/gamelogic_module.py
index 8cb4fd7ca8d..5a61a3592dc 100644
--- a/release/scripts/templates/gamelogic_module.py
+++ b/release/scripts/templates/gamelogic_module.py
@@ -1,21 +1,3 @@
-# ##### 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 #####
-
# This module can be accessed by a python controller with
# its execution method set to 'Module'
# * Set the module string to "gamelogic_module.main" (without quotes)
diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py
index 1ed45f3e211..5e8a2f33cb7 100644
--- a/release/scripts/templates/operator.py
+++ b/release/scripts/templates/operator.py
@@ -1,20 +1,3 @@
-# ##### 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 #####
import bpy
@@ -45,7 +28,7 @@ class ExportSomeData(bpy.types.Operator):
#if not self.is_property_set("path"):
# raise Exception("filename not set")
- write_some_data(self.path, context, self.use_setting)
+ write_some_data(self.properties.path, context, self.properties.use_setting)
return ('FINISHED',)
@@ -68,7 +51,7 @@ bpy.ops.add(ExportSomeData)
# Only needed if you want to add into a dynamic menu
import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("export.some_data", text="Example Exporter...")
+menu_func = lambda self, context: self.layout.operator("export.some_data", text="Example Exporter...")
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
# Use for running this script directly
diff --git a/release/scripts/templates/operator_simple.py b/release/scripts/templates/operator_simple.py
index 438df083d4d..030ed85f01f 100644
--- a/release/scripts/templates/operator_simple.py
+++ b/release/scripts/templates/operator_simple.py
@@ -1,20 +1,3 @@
-# ##### 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 #####
def main(context):
for ob in context.scene.objects:
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py
index f45f7ab6f60..1024ddc7836 100644
--- a/release/scripts/ui/properties_data_armature.py
+++ b/release/scripts/ui/properties_data_armature.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -39,15 +41,18 @@ class DATA_PT_context_arm(DataButtonsPanel):
ob = context.object
arm = context.armature
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif arm:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif arm:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ layout.template_ID(ob, "data")
class DATA_PT_skeleton(DataButtonsPanel):
@@ -56,26 +61,26 @@ class DATA_PT_skeleton(DataButtonsPanel):
def draw(self, context):
layout = self.layout
- ob = context.object
arm = context.armature
- space = context.space_data
+ wide_ui = context.region.width > narrowui
- layout.itemR(arm, "pose_position", expand=True)
+ layout.prop(arm, "pose_position", expand=True)
split = layout.split()
col = split.column()
- col.itemL(text="Layers:")
- col.itemR(arm, "layer", text="")
- col.itemL(text="Protected Layers:")
- col.itemR(arm, "layer_protection", text="")
+ col.label(text="Layers:")
+ col.prop(arm, "layer", text="")
+ col.label(text="Protected Layers:")
+ col.prop(arm, "layer_protection", text="")
- col = split.column()
- col.itemL(text="Deform:")
- col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
- col.itemR(arm, "deform_envelope", text="Envelopes")
- col.itemR(arm, "deform_quaternion", text="Quaternion")
- col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Deform:")
+ col.prop(arm, "deform_vertexgroups", text="Vertex Groups")
+ col.prop(arm, "deform_envelope", text="Envelopes")
+ col.prop(arm, "deform_quaternion", text="Quaternion")
+ col.prop(arm, "deform_bbone_rest", text="B-Bones Rest")
class DATA_PT_display(DataButtonsPanel):
@@ -85,15 +90,24 @@ class DATA_PT_display(DataButtonsPanel):
layout = self.layout
arm = context.armature
+ wide_ui = context.region.width > narrowui
- layout.row().itemR(arm, "drawtype", expand=True)
+ if wide_ui:
+ layout.row().prop(arm, "drawtype", expand=True)
+ else:
+ layout.row().prop(arm, "drawtype", text="")
- flow = layout.column_flow()
- flow.itemR(arm, "draw_names", text="Names")
- flow.itemR(arm, "draw_axes", text="Axes")
- flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
- flow.itemR(arm, "draw_group_colors", text="Colors")
- flow.itemR(arm, "delay_deform", text="Delay Refresh")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(arm, "draw_names", text="Names")
+ col.prop(arm, "draw_axes", text="Axes")
+ col.prop(arm, "draw_custom_bone_shapes", text="Shapes")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(arm, "draw_group_colors", text="Colors")
+ col.prop(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
@@ -107,34 +121,39 @@ class DATA_PT_bone_groups(DataButtonsPanel):
ob = context.object
pose = ob.pose
+ wide_ui = context.region.width > narrowui
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
col = row.column(align=True)
- col.active = (ob.proxy == None)
- col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
- col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
+ col.active = (ob.proxy is None)
+ col.operator("pose.group_add", icon='ICON_ZOOMIN', text="")
+ col.operator("pose.group_remove", icon='ICON_ZOOMOUT', text="")
group = pose.active_bone_group
if group:
col = layout.column()
- col.active = (ob.proxy == None)
- col.itemR(group, "name")
+ col.active = (ob.proxy is None)
+ col.prop(group, "name")
- split = layout.split(0.5)
- split.active = (ob.proxy == None)
- split.itemR(group, "color_set")
+ split = layout.split()
+ split.active = (ob.proxy is None)
+
+ col = split.column()
+ col.prop(group, "color_set")
if group.color_set:
- split.template_triColorSet(group, "colors")
+ if wide_ui:
+ col = split.column()
+ col.template_triColorSet(group, "colors")
row = layout.row(align=True)
- row.active = (ob.proxy == None)
+ row.active = (ob.proxy is None)
- row.itemO("pose.group_assign", text="Assign")
- row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
- #row.itemO("object.bone_group_select", text="Select")
- #row.itemO("object.bone_group_deselect", text="Deselect")
+ row.operator("pose.group_assign", text="Assign")
+ row.operator("pose.group_remove", text="Remove") #row.operator("pose.bone_group_remove_from", text="Remove")
+ #row.operator("object.bone_group_select", text="Select")
+ #row.operator("object.bone_group_deselect", text="Deselect")
class DATA_PT_paths(DataButtonsPanel):
@@ -144,34 +163,44 @@ class DATA_PT_paths(DataButtonsPanel):
layout = self.layout
arm = context.armature
+ wide_ui = context.region.width > narrowui
- layout.itemR(arm, "paths_type", expand=True)
+ if wide_ui:
+ layout.prop(arm, "paths_type", expand=True)
+ else:
+ layout.prop(arm, "paths_type", text="")
split = layout.split()
col = split.column()
sub = col.column(align=True)
if (arm.paths_type == 'CURRENT_FRAME'):
- sub.itemR(arm, "path_before_current", text="Before")
- sub.itemR(arm, "path_after_current", text="After")
+ sub.prop(arm, "path_before_current", text="Before")
+ sub.prop(arm, "path_after_current", text="After")
elif (arm.paths_type == 'RANGE'):
- sub.itemR(arm, "path_start_frame", text="Start")
- sub.itemR(arm, "path_end_frame", text="End")
+ sub.prop(arm, "path_start_frame", text="Start")
+ sub.prop(arm, "path_end_frame", text="End")
- sub.itemR(arm, "path_size", text="Step")
- col.row().itemR(arm, "paths_location", expand=True)
+ sub.prop(arm, "path_size", text="Step")
+ col.row().prop(arm, "paths_location", expand=True)
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Display:")
+ col.prop(arm, "paths_show_frame_numbers", text="Frame Numbers")
+ col.prop(arm, "paths_highlight_keyframes", text="Keyframes")
+ col.prop(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
+
+ layout.separator()
+
+ split = layout.split()
col = split.column()
- col.itemL(text="Display:")
- col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
- col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
- col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
+ col.operator("pose.paths_calculate", text="Calculate Paths")
- layout.itemS()
-
- row = layout.row()
- row.itemO("pose.paths_calculate", text="Calculate Paths")
- row.itemO("pose.paths_clear", text="Clear Paths")
+ if wide_ui:
+ col = split.column()
+ col.operator("pose.paths_clear", text="Clear Paths")
class DATA_PT_ghost(DataButtonsPanel):
@@ -181,8 +210,12 @@ class DATA_PT_ghost(DataButtonsPanel):
layout = self.layout
arm = context.armature
+ wide_ui = context.region.width > narrowui
- layout.itemR(arm, "ghost_type", expand=True)
+ if wide_ui:
+ layout.prop(arm, "ghost_type", expand=True)
+ else:
+ layout.prop(arm, "ghost_type", text="")
split = layout.split()
@@ -190,16 +223,17 @@ class DATA_PT_ghost(DataButtonsPanel):
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
- sub.itemR(arm, "ghost_start_frame", text="Start")
- sub.itemR(arm, "ghost_end_frame", text="End")
- sub.itemR(arm, "ghost_size", text="Step")
+ sub.prop(arm, "ghost_start_frame", text="Start")
+ sub.prop(arm, "ghost_end_frame", text="End")
+ sub.prop(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
- sub.itemR(arm, "ghost_step", text="Range")
- sub.itemR(arm, "ghost_size", text="Step")
+ sub.prop(arm, "ghost_step", text="Range")
+ sub.prop(arm, "ghost_size", text="Step")
- col = split.column()
- col.itemL(text="Display:")
- col.itemR(arm, "ghost_only_selected", text="Selected Only")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Display:")
+ col.prop(arm, "ghost_only_selected", text="Selected Only")
bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py
index d1dd1163899..4a10ff80a32 100644
--- a/release/scripts/ui/properties_data_bone.py
+++ b/release/scripts/ui/properties_data_bone.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class BoneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -41,8 +43,8 @@ class BONE_PT_context_bone(BoneButtonsPanel):
bone = context.edit_bone
row = layout.row()
- row.itemL(text="", icon='ICON_BONE_DATA')
- row.itemR(bone, "name", text="")
+ row.label(text="", icon='ICON_BONE_DATA')
+ row.prop(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
@@ -53,42 +55,65 @@ class BONE_PT_transform(BoneButtonsPanel):
ob = context.object
bone = context.bone
+ wide_ui = context.region.width > narrowui
+
if not bone:
bone = context.edit_bone
+ if wide_ui:
+ row = layout.row()
+ row.column().prop(bone, "head")
+ row.column().prop(bone, "tail")
- row = layout.row()
- row.column().itemR(bone, "head")
- row.column().itemR(bone, "tail")
-
- col = row.column()
- sub = col.column(align=True)
- sub.itemL(text="Roll:")
- sub.itemR(bone, "roll", text="")
- sub.itemL()
- sub.itemR(bone, "locked")
+ col = row.column()
+ sub = col.column(align=True)
+ sub.label(text="Roll:")
+ sub.prop(bone, "roll", text="")
+ sub.label()
+ sub.prop(bone, "locked")
+ else:
+ col = layout.column()
+ col.prop(bone, "head")
+ col.prop(bone, "tail")
+ col.prop(bone, "roll")
+ col.prop(bone, "locked")
else:
- pchan = ob.pose.pose_channels[context.bone.name]
+ pchan = ob.pose.bones[context.bone.name]
- row = layout.row()
- col = row.column()
- col.itemR(pchan, "location")
- col.active = not (bone.parent and bone.connected)
+ if wide_ui:
+ row = layout.row()
+ col = row.column()
+ col.prop(pchan, "location")
+ col.active = not (bone.parent and bone.connected)
- col = row.column()
- if pchan.rotation_mode == 'QUATERNION':
- col.itemR(pchan, "rotation_quaternion", text="Rotation")
- elif pchan.rotation_mode == 'AXIS_ANGLE':
- #col.itemL(text="Rotation")
- #col.itemR(pchan, "rotation_angle", text="Angle")
- #col.itemR(pchan, "rotation_axis", text="Axis")
- col.itemR(pchan, "rotation_axis_angle", text="Rotation")
+ col = row.column()
+ if pchan.rotation_mode == 'QUATERNION':
+ col.prop(pchan, "rotation_quaternion", text="Rotation")
+ elif pchan.rotation_mode == 'AXIS_ANGLE':
+ #col.label(text="Rotation")
+ #col.prop(pchan, "rotation_angle", text="Angle")
+ #col.prop(pchan, "rotation_axis", text="Axis")
+ col.prop(pchan, "rotation_axis_angle", text="Rotation")
+ else:
+ col.prop(pchan, "rotation_euler", text="Rotation")
+
+ row.column().prop(pchan, "scale")
+
+ layout.prop(pchan, "rotation_mode")
else:
- col.itemR(pchan, "rotation_euler", text="Rotation")
-
- row.column().itemR(pchan, "scale")
-
- layout.itemR(pchan, "rotation_mode")
+ col = layout.column()
+ sub = col.column()
+ sub.active = not (bone.parent and bone.connected)
+ sub.prop(pchan, "location")
+ col.label(text="Rotation:")
+ col.prop(pchan, "rotation_mode", text="")
+ if pchan.rotation_mode == 'QUATERNION':
+ col.prop(pchan, "rotation_quaternion", text="")
+ elif pchan.rotation_mode == 'AXIS_ANGLE':
+ col.prop(pchan, "rotation_axis_angle", text="")
+ else:
+ col.prop(pchan, "rotation_euler", text="")
+ col.prop(pchan, "scale")
class BONE_PT_transform_locks(BoneButtonsPanel):
@@ -103,23 +128,23 @@ class BONE_PT_transform_locks(BoneButtonsPanel):
ob = context.object
bone = context.bone
- pchan = ob.pose.pose_channels[context.bone.name]
+ pchan = ob.pose.bones[context.bone.name]
row = layout.row()
col = row.column()
- col.itemR(pchan, "lock_location")
+ col.prop(pchan, "lock_location")
col.active = not (bone.parent and bone.connected)
col = row.column()
if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
- col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
+ col.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
if pchan.lock_rotations_4d:
- col.itemR(pchan, "lock_rotation_w", text="W")
- col.itemR(pchan, "lock_rotation", text="")
+ col.prop(pchan, "lock_rotation_w", text="W")
+ col.prop(pchan, "lock_rotation", text="")
else:
- col.itemR(pchan, "lock_rotation", text="Rotation")
+ col.prop(pchan, "lock_rotation", text="Rotation")
- row.column().itemR(pchan, "lock_scale")
+ row.column().prop(pchan, "lock_scale")
class BONE_PT_relations(BoneButtonsPanel):
@@ -131,37 +156,42 @@ class BONE_PT_relations(BoneButtonsPanel):
ob = context.object
bone = context.bone
arm = context.armature
+ wide_ui = context.region.width > narrowui
if not bone:
bone = context.edit_bone
pchan = None
else:
- pchan = ob.pose.pose_channels[context.bone.name]
+ pchan = ob.pose.bones[context.bone.name]
split = layout.split()
col = split.column()
- col.itemL(text="Layers:")
- col.itemR(bone, "layer", text="")
+ col.label(text="Layers:")
+ col.prop(bone, "layer", text="")
- col.itemS()
+ col.separator()
if ob and pchan:
- col.itemL(text="Bone Group:")
- col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
+ col.label(text="Bone Group:")
+ col.prop_object(pchan, "bone_group", ob.pose, "bone_groups", text="")
- col = split.column()
- col.itemL(text="Parent:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Parent:")
if context.bone:
- col.itemR(bone, "parent", text="")
+ col.prop(bone, "parent", text="")
else:
- col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
+ col.prop_object(bone, "parent", arm, "edit_bones", text="")
sub = col.column()
- sub.active = bone.parent != None
- sub.itemR(bone, "connected")
- sub.itemR(bone, "hinge", text="Inherit Rotation")
- sub.itemR(bone, "inherit_scale", text="Inherit Scale")
+ sub.active = (bone.parent is not None)
+ sub.prop(bone, "connected")
+ sub.prop(bone, "hinge", text="Inherit Rotation")
+ sub.prop(bone, "inherit_scale", text="Inherit Scale")
+ sub = col.column()
+ sub.active = (not bone.parent or not bone.connected)
+ sub.prop(bone, "local_location", text="Local Location")
class BONE_PT_display(BoneButtonsPanel):
@@ -175,27 +205,26 @@ class BONE_PT_display(BoneButtonsPanel):
ob = context.object
bone = context.bone
- arm = context.armature
+ wide_ui = context.region.width > narrowui
if not bone:
bone = context.edit_bone
pchan = None
else:
- pchan = ob.pose.pose_channels[context.bone.name]
+ pchan = ob.pose.bones[context.bone.name]
if ob and pchan:
split = layout.split()
col = split.column()
+ col.prop(bone, "draw_wire", text="Wireframe")
+ col.prop(bone, "hidden", text="Hide")
- col.itemR(bone, "draw_wire", text="Wireframe")
- col.itemR(bone, "hidden", text="Hide")
-
- col = split.column()
-
- col.itemL(text="Custom Shape:")
- col.itemR(pchan, "custom_shape", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Custom Shape:")
+ col.prop(pchan, "custom_shape", text="")
class BONE_PT_deform(BoneButtonsPanel):
@@ -208,12 +237,13 @@ class BONE_PT_deform(BoneButtonsPanel):
if not bone:
bone = context.edit_bone
- self.layout.itemR(bone, "deform", text="")
+ self.layout.prop(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
+ wide_ui = context.region.width > narrowui
if not bone:
bone = context.edit_bone
@@ -223,28 +253,45 @@ class BONE_PT_deform(BoneButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Envelope:")
+ col.label(text="Envelope:")
sub = col.column(align=True)
- sub.itemR(bone, "envelope_distance", text="Distance")
- sub.itemR(bone, "envelope_weight", text="Weight")
- col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
+ sub.prop(bone, "envelope_distance", text="Distance")
+ sub.prop(bone, "envelope_weight", text="Weight")
+ col.prop(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
sub = col.column(align=True)
- sub.itemL(text="Radius:")
- sub.itemR(bone, "head_radius", text="Head")
- sub.itemR(bone, "tail_radius", text="Tail")
+ sub.label(text="Radius:")
+ sub.prop(bone, "head_radius", text="Head")
+ sub.prop(bone, "tail_radius", text="Tail")
- col = split.column()
- col.itemL(text="Curved Bones:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Curved Bones:")
sub = col.column(align=True)
- sub.itemR(bone, "bbone_segments", text="Segments")
- sub.itemR(bone, "bbone_in", text="Ease In")
- sub.itemR(bone, "bbone_out", text="Ease Out")
+ sub.prop(bone, "bbone_segments", text="Segments")
+ sub.prop(bone, "bbone_in", text="Ease In")
+ sub.prop(bone, "bbone_out", text="Ease Out")
- col.itemL(text="Offset:")
- col.itemR(bone, "cyclic_offset")
+ col.label(text="Offset:")
+ col.prop(bone, "cyclic_offset")
+
+
+class BONE_PT_properties(BoneButtonsPanel):
+ bl_label = "Properties"
+ bl_default_closed = True
+
+ def draw(self, context):
+ import rna_prop_ui
+ # reload(rna_prop_ui)
+ obj = context.object
+ if obj and obj.mode == 'POSE':
+ item = "active_pose_bone"
+ else:
+ item = "active_bone"
+
+ rna_prop_ui.draw(self.layout, context, item)
bpy.types.register(BONE_PT_context_bone)
bpy.types.register(BONE_PT_transform)
@@ -252,3 +299,4 @@ bpy.types.register(BONE_PT_transform_locks)
bpy.types.register(BONE_PT_relations)
bpy.types.register(BONE_PT_display)
bpy.types.register(BONE_PT_deform)
+bpy.types.register(BONE_PT_properties)
diff --git a/release/scripts/ui/properties_data_camera.py b/release/scripts/ui/properties_data_camera.py
index eefd2432186..e8cba6be7df 100644
--- a/release/scripts/ui/properties_data_camera.py
+++ b/release/scripts/ui/properties_data_camera.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -39,15 +41,21 @@ class DATA_PT_context_camera(DataButtonsPanel):
ob = context.object
cam = context.camera
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif cam:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif cam:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "data")
+ elif cam:
+ layout.template_ID(space, "pin_id")
class DATA_PT_camera(DataButtonsPanel):
@@ -57,39 +65,53 @@ class DATA_PT_camera(DataButtonsPanel):
layout = self.layout
cam = context.camera
+ wide_ui = context.region.width > narrowui
- layout.itemR(cam, "type", expand=True)
+ if wide_ui:
+ layout.prop(cam, "type", expand=True)
+ else:
+ layout.prop(cam, "type", text="")
- row = layout.row()
+ split = layout.split()
+
+ col = split.column()
if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS':
- row.itemR(cam, "lens", text="Angle")
+ col.prop(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES':
- row.itemR(cam, "angle")
- row.itemR(cam, "lens_unit", text="")
+ col.prop(cam, "angle")
+ if wide_ui:
+ col = split.column()
+ col.prop(cam, "lens_unit", text="")
elif cam.type == 'ORTHO':
- row.itemR(cam, "ortho_scale")
+ col.prop(cam, "ortho_scale")
- layout.itemR(cam, "panorama")
+ layout.prop(cam, "panorama")
split = layout.split()
col = split.column(align=True)
- col.itemL(text="Shift:")
- col.itemR(cam, "shift_x", text="X")
- col.itemR(cam, "shift_y", text="Y")
+ col.label(text="Shift:")
+ col.prop(cam, "shift_x", text="X")
+ col.prop(cam, "shift_y", text="Y")
- col = split.column(align=True)
- col.itemL(text="Clipping:")
- col.itemR(cam, "clip_start", text="Start")
- col.itemR(cam, "clip_end", text="End")
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Clipping:")
+ col.prop(cam, "clip_start", text="Start")
+ col.prop(cam, "clip_end", text="End")
- layout.itemL(text="Depth of Field:")
+ layout.label(text="Depth of Field:")
- row = layout.row()
- row.itemR(cam, "dof_object", text="")
- row.itemR(cam, "dof_distance", text="Distance")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(cam, "dof_object", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
@@ -99,22 +121,24 @@ class DATA_PT_camera_display(DataButtonsPanel):
layout = self.layout
cam = context.camera
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(cam, "show_limits", text="Limits")
- col.itemR(cam, "show_mist", text="Mist")
- col.itemR(cam, "show_title_safe", text="Title Safe")
- col.itemR(cam, "show_name", text="Name")
+ col.prop(cam, "show_limits", text="Limits")
+ col.prop(cam, "show_mist", text="Mist")
+ col.prop(cam, "show_title_safe", text="Title Safe")
+ col.prop(cam, "show_name", text="Name")
- col = split.column()
- col.itemR(cam, "draw_size", text="Size")
- col.itemS()
- col.itemR(cam, "show_passepartout", text="Passepartout")
+ if wide_ui:
+ col = split.column()
+ col.prop(cam, "draw_size", text="Size")
+ col.separator()
+ col.prop(cam, "show_passepartout", text="Passepartout")
sub = col.column()
sub.active = cam.show_passepartout
- sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
+ sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py
index e2987e0a05c..9a7961cfa33 100644
--- a/release/scripts/ui/properties_data_curve.py
+++ b/release/scripts/ui/properties_data_curve.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -26,7 +28,7 @@ class DataButtonsPanel(bpy.types.Panel):
bl_context = "data"
def poll(self, context):
- return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
+ return (context.object and context.object.type in ('CURVE', 'SURFACE', 'TEXT') and context.curve)
class DataButtonsPanelCurve(DataButtonsPanel):
@@ -54,15 +56,20 @@ class DATA_PT_context_curve(DataButtonsPanel):
ob = context.object
curve = context.curve
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif curve:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif curve:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ layout.template_ID(ob, "data")
class DATA_PT_shape_curve(DataButtonsPanel):
@@ -73,49 +80,49 @@ class DATA_PT_shape_curve(DataButtonsPanel):
ob = context.object
curve = context.curve
- space = context.space_data
+ wide_ui = context.region.width > narrowui
is_surf = (ob.type == 'SURFACE')
+ is_curve = (ob.type == 'CURVE')
+ is_text = (ob.type == 'TEXT')
- if not is_surf:
+ if is_curve:
row = layout.row()
- row.itemR(curve, "dimensions", expand=True)
+ row.prop(curve, "dimensions", expand=True)
split = layout.split()
col = split.column()
-
- if not is_surf:
- sub = col.column()
- sub.active = (curve.dimensions == '2D')
- sub.itemL(text="Caps:")
- row = sub.row()
- row.itemR(curve, "front")
- row.itemR(curve, "back")
-
- col.itemL(text="Textures:")
-# col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
-
- col = split.column()
- col.itemL(text="Resolution:")
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub.prop(curve, "resolution_u", text="Preview U")
+ sub.prop(curve, "render_resolution_u", text="Render U")
+ if is_curve:
+ col.label(text="Twisting:")
+ col.prop(curve, "twist_mode", text="")
+ col.prop(curve, "twist_smooth", text="Smooth")
+ if is_text:
+ col.label(text="Display:")
+ col.prop(curve, "fast", text="Fast Editing")
+
+ if wide_ui:
+ col = split.column()
if is_surf:
sub = col.column(align=True)
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_v", text="Render V")
+ sub.label(text="")
+ sub.prop(curve, "resolution_v", text="Preview V")
+ sub.prop(curve, "render_resolution_v", text="Render V")
- # XXX - put somewhere nicer.
- row = layout.row()
- row.itemR(curve, "twist_mode")
- row.itemR(curve, "twist_smooth") # XXX - may not be kept
+ if is_curve or is_text:
+ sub = col.column()
+ sub.active = (curve.dimensions == '2D')
+ sub.label(text="Caps:")
+ sub.prop(curve, "front")
+ sub.prop(curve, "back")
-# col.itemL(text="Display:")
-# col.itemL(text="HANDLES")
-# col.itemL(text="NORMALS")
-# col.itemR(curve, "vertex_normal_flip")
+ col.label(text="Textures:")
+# col.prop(curve, "uv_orco")
+ col.prop(curve, "auto_texspace")
class DATA_PT_geometry_curve(DataButtonsPanel):
@@ -125,22 +132,24 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
layout = self.layout
curve = context.curve
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Modification:")
- col.itemR(curve, "width")
- col.itemR(curve, "extrude")
- col.itemL(text="Taper Object:")
- col.itemR(curve, "taper_object", text="")
+ col.label(text="Modification:")
+ col.prop(curve, "width")
+ col.prop(curve, "extrude")
+ col.label(text="Taper Object:")
+ col.prop(curve, "taper_object", text="")
- col = split.column()
- col.itemL(text="Bevel:")
- col.itemR(curve, "bevel_depth", text="Depth")
- col.itemR(curve, "bevel_resolution", text="Resolution")
- col.itemL(text="Bevel Object:")
- col.itemR(curve, "bevel_object", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Bevel:")
+ col.prop(curve, "bevel_depth", text="Depth")
+ col.prop(curve, "bevel_resolution", text="Resolution")
+ col.label(text="Bevel Object:")
+ col.prop(curve, "bevel_object", text="")
class DATA_PT_pathanim(DataButtonsPanelCurve):
@@ -149,25 +158,32 @@ class DATA_PT_pathanim(DataButtonsPanelCurve):
def draw_header(self, context):
curve = context.curve
- self.layout.itemR(curve, "use_path", text="")
+ self.layout.prop(curve, "use_path", text="")
def draw(self, context):
layout = self.layout
curve = context.curve
+ wide_ui = context.region.width > narrowui
layout.active = curve.use_path
+ row = layout.row()
+ layout.prop(curve, "path_length", text="Frames")
+
+ if wide_ui:
+ row.label()
+
split = layout.split()
col = split.column()
- col.itemR(curve, "path_length", text="Frames")
- col.itemR(curve, "use_path_follow")
+ col.prop(curve, "use_path_follow")
+ col.prop(curve, "use_stretch")
- col = split.column()
- col.itemR(curve, "use_stretch")
- col.itemR(curve, "use_radius")
- col.itemR(curve, "use_time_offset", text="Offset Children")
+ if wide_ui:
+ col = split.column()
+ col.prop(curve, "use_radius")
+ col.prop(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(DataButtonsPanelActive):
@@ -188,63 +204,177 @@ class DATA_PT_active_spline(DataButtonsPanelActive):
# These settings are below but its easier to have
# poly's set aside since they use so few settings
col = split.column()
- col.itemL(text="Cyclic:")
- col.itemR(act_spline, "smooth")
+ col.label(text="Cyclic:")
+ col.prop(act_spline, "smooth")
col = split.column()
- col.itemR(act_spline, "cyclic_u", text="U")
+ col.prop(act_spline, "cyclic_u", text="U")
else:
col = split.column()
- col.itemL(text="Cyclic:")
+ col.label(text="Cyclic:")
if act_spline.type == 'NURBS':
- col.itemL(text="Bezier:")
- col.itemL(text="Endpoint:")
- col.itemL(text="Order:")
+ col.label(text="Bezier:")
+ col.label(text="Endpoint:")
+ col.label(text="Order:")
- col.itemL(text="Resolution:")
+ col.label(text="Resolution:")
col = split.column()
- col.itemR(act_spline, "cyclic_u", text="U")
+ col.prop(act_spline, "cyclic_u", text="U")
if act_spline.type == 'NURBS':
sub = col.column()
# sub.active = (not act_spline.cyclic_u)
- sub.itemR(act_spline, "bezier_u", text="U")
- sub.itemR(act_spline, "endpoint_u", text="U")
+ sub.prop(act_spline, "bezier_u", text="U")
+ sub.prop(act_spline, "endpoint_u", text="U")
sub = col.column()
- sub.itemR(act_spline, "order_u", text="U")
- col.itemR(act_spline, "resolution_u", text="U")
+ sub.prop(act_spline, "order_u", text="U")
+ col.prop(act_spline, "resolution_u", text="U")
if is_surf:
col = split.column()
- col.itemR(act_spline, "cyclic_v", text="V")
+ col.prop(act_spline, "cyclic_v", text="V")
# its a surface, assume its a nurb.
sub = col.column()
sub.active = (not act_spline.cyclic_v)
- sub.itemR(act_spline, "bezier_v", text="V")
- sub.itemR(act_spline, "endpoint_v", text="V")
+ sub.prop(act_spline, "bezier_v", text="V")
+ sub.prop(act_spline, "endpoint_v", text="V")
sub = col.column()
- sub.itemR(act_spline, "order_v", text="V")
- sub.itemR(act_spline, "resolution_v", text="V")
-
+ sub.prop(act_spline, "order_v", text="V")
+ sub.prop(act_spline, "resolution_v", text="V")
if not is_surf:
split = layout.split()
col = split.column()
col.active = (curve.dimensions == '3D')
- col.itemL(text="Interpolation:")
- col.itemR(act_spline, "tilt_interpolation", text="Tilt")
- col.itemR(act_spline, "radius_interpolation", text="Radius")
+ col.label(text="Interpolation:")
+ col.prop(act_spline, "tilt_interpolation", text="Tilt")
+ col.prop(act_spline, "radius_interpolation", text="Radius")
- split = layout.split()
+ layout.prop(act_spline, "smooth")
+
+
+class DATA_PT_font(DataButtonsPanel):
+ bl_label = "Font"
+
+ def poll(self, context):
+ return (context.object and context.object.type == 'TEXT' and context.curve)
+
+ def draw(self, context):
+ layout = self.layout
+
+ text = context.curve
+ char = context.curve.edit_format
+ wide_ui = context.region.width > narrowui
+
+ if wide_ui:
+ layout.prop(text, "font")
+ else:
+ layout.prop(text, "font", text="")
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(text, "text_size", text="Size")
+ if wide_ui:
col = split.column()
- col.itemR(act_spline, "smooth")
+ col.prop(text, "shear")
+
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Object Font:")
+ col.prop(text, "family", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Text on Curve:")
+ col.prop(text, "text_on_curve", text="")
+
+ split = layout.split()
+
+ col = split.column(align=True)
+ col.label(text="Underline:")
+ col.prop(text, "ul_position", text="Position")
+ col.prop(text, "ul_height", text="Thickness")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Character:")
+ col.prop(char, "bold")
+ col.prop(char, "italic")
+ col.prop(char, "underline")
+# col.prop(char, "style")
+# col.prop(char, "wrap")
+
+
+class DATA_PT_paragraph(DataButtonsPanel):
+ bl_label = "Paragraph"
+
+ def poll(self, context):
+ return (context.object and context.object.type == 'TEXT' and context.curve)
+
+ def draw(self, context):
+ layout = self.layout
+
+ text = context.curve
+ wide_ui = context.region.width > narrowui
+
+ layout.label(text="Align:")
+ if wide_ui:
+ layout.prop(text, "spacemode", expand=True)
+ else:
+ layout.prop(text, "spacemode", text="")
+
+ split = layout.split()
+
+ col = split.column(align=True)
+ col.label(text="Spacing:")
+ col.prop(text, "spacing", text="Character")
+ col.prop(text, "word_spacing", text="Word")
+ col.prop(text, "line_dist", text="Line")
+
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Offset:")
+ col.prop(text, "offset_x", text="X")
+ col.prop(text, "offset_y", text="Y")
+
+
+class DATA_PT_textboxes(DataButtonsPanel):
+ bl_label = "Text Boxes"
+
+ def poll(self, context):
+ return (context.object and context.object.type == 'TEXT' and context.curve)
+
+ def draw(self, context):
+ layout = self.layout
+
+ text = context.curve
+ wide_ui = context.region.width > narrowui
+
+ for box in text.textboxes:
+ split = layout.box().split()
+
+ col = split.column(align=True)
+ col.label(text="Dimensions:")
+ col.prop(box, "width", text="Width")
+ col.prop(box, "height", text="Height")
+
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Offset:")
+ col.prop(box, "x", text="X")
+ col.prop(box, "y", text="Y")
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
bpy.types.register(DATA_PT_active_spline)
+bpy.types.register(DATA_PT_font)
+bpy.types.register(DATA_PT_paragraph)
+bpy.types.register(DATA_PT_textboxes)
diff --git a/release/scripts/ui/properties_data_empty.py b/release/scripts/ui/properties_data_empty.py
index 3f6c7523b3e..9f304d2dc1b 100644
--- a/release/scripts/ui/properties_data_empty.py
+++ b/release/scripts/ui/properties_data_empty.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -36,8 +38,13 @@ class DATA_PT_empty(DataButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
- layout.itemR(ob, "empty_draw_type", text="Display")
- layout.itemR(ob, "empty_draw_size", text="Size")
+ if wide_ui:
+ layout.prop(ob, "empty_draw_type", text="Display")
+ else:
+ layout.prop(ob, "empty_draw_type", text="")
+
+ layout.prop(ob, "empty_draw_size", text="Size")
bpy.types.register(DATA_PT_empty)
diff --git a/release/scripts/ui/properties_data_lamp.py b/release/scripts/ui/properties_data_lamp.py
index c7ad5b1c895..d5025983ff3 100644
--- a/release/scripts/ui/properties_data_lamp.py
+++ b/release/scripts/ui/properties_data_lamp.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -46,15 +48,21 @@ class DATA_PT_context_lamp(DataButtonsPanel):
ob = context.object
lamp = context.lamp
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif lamp:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif lamp:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "data")
+ elif lamp:
+ layout.template_ID(space, "pin_id")
class DATA_PT_lamp(DataButtonsPanel):
@@ -64,38 +72,43 @@ class DATA_PT_lamp(DataButtonsPanel):
layout = self.layout
lamp = context.lamp
+ wide_ui = context.region.width > narrowui
- layout.itemR(lamp, "type", expand=True)
+ if wide_ui:
+ layout.prop(lamp, "type", expand=True)
+ else:
+ layout.prop(lamp, "type", text="")
split = layout.split()
col = split.column()
sub = col.column()
- sub.itemR(lamp, "color", text="")
- sub.itemR(lamp, "energy")
+ sub.prop(lamp, "color", text="")
+ sub.prop(lamp, "energy")
if lamp.type in ('POINT', 'SPOT'):
- sub.itemL(text="Falloff:")
- sub.itemR(lamp, "falloff_type", text="")
- sub.itemR(lamp, "distance")
+ sub.label(text="Falloff:")
+ sub.prop(lamp, "falloff_type", text="")
+ sub.prop(lamp, "distance")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
- col.itemL(text="Attenuation Factors:")
+ col.label(text="Attenuation Factors:")
sub = col.column(align=True)
- sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
- sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
+ sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
+ sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
- col.itemR(lamp, "sphere")
+ col.prop(lamp, "sphere")
if lamp.type == 'AREA':
- col.itemR(lamp, "distance")
- col.itemR(lamp, "gamma")
+ col.prop(lamp, "distance")
+ col.prop(lamp, "gamma")
- col = split.column()
- col.itemR(lamp, "negative")
- col.itemR(lamp, "layer", text="This Layer Only")
- col.itemR(lamp, "specular")
- col.itemR(lamp, "diffuse")
+ if wide_ui:
+ col = split.column()
+ col.prop(lamp, "negative")
+ col.prop(lamp, "layer", text="This Layer Only")
+ col.prop(lamp, "specular")
+ col.prop(lamp, "diffuse")
class DATA_PT_sunsky(DataButtonsPanel):
@@ -109,58 +122,61 @@ class DATA_PT_sunsky(DataButtonsPanel):
layout = self.layout
lamp = context.lamp.sky
+ wide_ui = context.region.width > narrowui
- layout.itemR(lamp, "sky")
+ layout.prop(lamp, "sky")
row = layout.row()
row.active = lamp.sky or lamp.atmosphere
- row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
+ row.prop(lamp, "atmosphere_turbidity", text="Turbidity")
split = layout.split()
col = split.column()
col.active = lamp.sky
- col.itemL(text="Blending:")
+ col.label(text="Blending:")
sub = col.column()
- sub.itemR(lamp, "sky_blend_type", text="")
- sub.itemR(lamp, "sky_blend", text="Factor")
+ sub.prop(lamp, "sky_blend_type", text="")
+ sub.prop(lamp, "sky_blend", text="Factor")
- col.itemL(text="Color Space:")
+ col.label(text="Color Space:")
sub = col.column()
- sub.row().itemR(lamp, "sky_color_space", expand=True)
- sub.itemR(lamp, "sky_exposure", text="Exposure")
+ sub.row().prop(lamp, "sky_color_space", expand=True)
+ sub.prop(lamp, "sky_exposure", text="Exposure")
- col = split.column()
+ if wide_ui:
+ col = split.column()
col.active = lamp.sky
- col.itemL(text="Horizon:")
+ col.label(text="Horizon:")
sub = col.column()
- sub.itemR(lamp, "horizon_brightness", text="Brightness")
- sub.itemR(lamp, "spread", text="Spread")
+ sub.prop(lamp, "horizon_brightness", text="Brightness")
+ sub.prop(lamp, "spread", text="Spread")
- col.itemL(text="Sun:")
+ col.label(text="Sun:")
sub = col.column()
- sub.itemR(lamp, "sun_brightness", text="Brightness")
- sub.itemR(lamp, "sun_size", text="Size")
- sub.itemR(lamp, "backscattered_light", slider=True, text="Back Light")
+ sub.prop(lamp, "sun_brightness", text="Brightness")
+ sub.prop(lamp, "sun_size", text="Size")
+ sub.prop(lamp, "backscattered_light", slider=True, text="Back Light")
- layout.itemS()
+ layout.separator()
- layout.itemR(lamp, "atmosphere")
+ layout.prop(lamp, "atmosphere")
split = layout.split()
col = split.column()
col.active = lamp.atmosphere
- col.itemL(text="Intensity:")
- col.itemR(lamp, "sun_intensity", text="Sun")
- col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
+ col.label(text="Intensity:")
+ col.prop(lamp, "sun_intensity", text="Sun")
+ col.prop(lamp, "atmosphere_distance_factor", text="Distance")
- col = split.column()
+ if wide_ui:
+ col = split.column()
col.active = lamp.atmosphere
- col.itemL(text="Scattering:")
+ col.label(text="Scattering:")
sub = col.column(align=True)
- sub.itemR(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
- sub.itemR(lamp, "atmosphere_extinction", slider=True, text="Extinction")
+ sub.prop(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
+ sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
class DATA_PT_shadow(DataButtonsPanel):
@@ -174,92 +190,116 @@ class DATA_PT_shadow(DataButtonsPanel):
layout = self.layout
lamp = context.lamp
+ wide_ui = context.region.width > narrowui
- layout.itemR(lamp, "shadow_method", expand=True)
+ if wide_ui:
+ layout.prop(lamp, "shadow_method", expand=True)
+ else:
+ layout.prop(lamp, "shadow_method", text="")
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
col = split.column()
- col.itemR(lamp, "shadow_color", text="")
+ col.prop(lamp, "shadow_color", text="")
- col = split.column()
- col.itemR(lamp, "shadow_layer", text="This Layer Only")
- col.itemR(lamp, "only_shadow")
+ if wide_ui:
+ col = split.column()
+ col.prop(lamp, "shadow_layer", text="This Layer Only")
+ col.prop(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
col = layout.column()
- col.itemL(text="Sampling:")
- col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
+ col.label(text="Sampling:")
+ if wide_ui:
+ col.row().prop(lamp, "shadow_ray_sampling_method", expand=True)
+ else:
+ col.prop(lamp, "shadow_ray_sampling_method", text="")
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
col = split.column()
- col.itemR(lamp, "shadow_soft_size", text="Soft Size")
+ col.prop(lamp, "shadow_soft_size", text="Soft Size")
- col.itemR(lamp, "shadow_ray_samples", text="Samples")
+ col.prop(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
- col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
- col = split.column()
+ col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
+ if wide_ui:
+ col = split.column()
elif lamp.type == 'AREA':
split = layout.split()
col = split.column()
- sub = split.column(align=True)
+
if lamp.shape == 'SQUARE':
- col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
+ col.prop(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
- col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
- col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
+ col.prop(lamp, "shadow_ray_samples_x", text="Samples X")
+ col.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
- col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+ col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
+ if wide_ui:
+ col = split.column()
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
- sub.itemR(lamp, "umbra")
- sub.itemR(lamp, "dither")
- sub.itemR(lamp, "jitter")
+ if wide_ui:
+ col = split.column()
+ col.prop(lamp, "umbra")
+ col.prop(lamp, "dither")
+ col.prop(lamp, "jitter")
+ else:
+ if wide_ui:
+ col = split.column()
+
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
- col.itemL(text="Buffer Type:")
- col.row().itemR(lamp, "shadow_buffer_type", expand=True)
+ col.label(text="Buffer Type:")
+ if wide_ui:
+ col.row().prop(lamp, "shadow_buffer_type", expand=True)
+ else:
+ col.row().prop(lamp, "shadow_buffer_type", text="")
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
split = layout.split()
col = split.column()
- col.itemL(text="Filter Type:")
- col.itemR(lamp, "shadow_filter_type", text="")
+ col.label(text="Filter Type:")
+ col.prop(lamp, "shadow_filter_type", text="")
sub = col.column(align=True)
- sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
- sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
+ sub.prop(lamp, "shadow_buffer_soft", text="Soft")
+ sub.prop(lamp, "shadow_buffer_bias", text="Bias")
- col = split.column()
- col.itemL(text="Sample Buffers:")
- col.itemR(lamp, "shadow_sample_buffers", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Sample Buffers:")
+ col.prop(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True)
- sub.itemR(lamp, "shadow_buffer_size", text="Size")
- sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
+ sub.prop(lamp, "shadow_buffer_size", text="Size")
+ sub.prop(lamp, "shadow_buffer_samples", text="Samples")
if lamp.shadow_buffer_type == 'DEEP':
- col.itemR(lamp, "compression_threshold")
+ col.prop(lamp, "compression_threshold")
elif lamp.shadow_buffer_type == 'IRREGULAR':
- layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
+ layout.prop(lamp, "shadow_buffer_bias", text="Bias")
- row = layout.row()
- row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
- sub = row.row()
+ split = layout.split()
+
+ col = split.column()
+ col.prop(lamp, "auto_clip_start", text="Autoclip Start")
+ sub = col.column()
sub.active = not lamp.auto_clip_start
- sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
+ sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
- row = layout.row()
- row.itemR(lamp, "auto_clip_end", text="Autoclip End")
- sub = row.row()
+ if wide_ui:
+ col = split.column()
+ col.prop(lamp, "auto_clip_end", text="Autoclip End")
+ sub = col.column()
sub.active = not lamp.auto_clip_end
- sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
+ sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_area(DataButtonsPanel):
@@ -277,14 +317,14 @@ class DATA_PT_area(DataButtonsPanel):
split = layout.split()
col = split.column()
- col.row().itemR(lamp, "shape", expand=True)
+ col.row().prop(lamp, "shape", expand=True)
sub = col.column(align=True)
if (lamp.shape == 'SQUARE'):
- sub.itemR(lamp, "size")
+ sub.prop(lamp, "size")
elif (lamp.shape == 'RECTANGLE'):
- sub.itemR(lamp, "size", text="Size X")
- sub.itemR(lamp, "size_y", text="Size Y")
+ sub.prop(lamp, "size", text="Size X")
+ sub.prop(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel):
@@ -298,22 +338,26 @@ class DATA_PT_spot(DataButtonsPanel):
layout = self.layout
lamp = context.lamp
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
sub = col.column()
- sub.itemR(lamp, "spot_size", text="Size")
- sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
- col.itemR(lamp, "square")
+ sub.prop(lamp, "spot_size", text="Size")
+ sub.prop(lamp, "spot_blend", text="Blend", slider=True)
+ col.prop(lamp, "square")
- col = split.column()
- col.itemR(lamp, "halo")
+ if wide_ui:
+ col = split.column()
+ else:
+ col.separator()
+ col.prop(lamp, "halo")
sub = col.column(align=True)
sub.active = lamp.halo
- sub.itemR(lamp, "halo_intensity", text="Intensity")
+ sub.prop(lamp, "halo_intensity", text="Intensity")
if lamp.shadow_method == 'BUFFER_SHADOW':
- sub.itemR(lamp, "halo_step", text="Step")
+ sub.prop(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel):
diff --git a/release/scripts/ui/properties_data_lattice.py b/release/scripts/ui/properties_data_lattice.py
index 3a18a09670a..640f625a7de 100644
--- a/release/scripts/ui/properties_data_lattice.py
+++ b/release/scripts/ui/properties_data_lattice.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -39,15 +41,21 @@ class DATA_PT_context_lattice(DataButtonsPanel):
ob = context.object
lat = context.lattice
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif lat:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif lat:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "data")
+ elif lat:
+ layout.template_ID(space, "pin_id")
class DATA_PT_lattice(DataButtonsPanel):
@@ -57,22 +65,30 @@ class DATA_PT_lattice(DataButtonsPanel):
layout = self.layout
lat = context.lattice
+ wide_ui = context.region.width > narrowui
- row = layout.row()
- row.itemR(lat, "points_u")
- row.itemR(lat, "interpolation_type_u", expand=True)
+ split = layout.split()
+ col = split.column()
+ col.prop(lat, "points_u")
+ if wide_ui:
+ col = split.column()
+ col.prop(lat, "interpolation_type_u", text="")
- row = layout.row()
- row.itemR(lat, "points_v")
- row.itemR(lat, "interpolation_type_v", expand=True)
+ split = layout.split()
+ col = split.column()
+ col.prop(lat, "points_v")
+ if wide_ui:
+ col = split.column()
+ col.prop(lat, "interpolation_type_v", text="")
- row = layout.row()
- row.itemR(lat, "points_w")
- row.itemR(lat, "interpolation_type_w", expand=True)
+ split = layout.split()
+ col = split.column()
+ col.prop(lat, "points_w")
+ if wide_ui:
+ col = split.column()
+ col.prop(lat, "interpolation_type_w", text="")
- row = layout.row()
- row.itemO("lattice.make_regular")
- row.itemR(lat, "outside")
+ layout.prop(lat, "outside")
bpy.types.register(DATA_PT_context_lattice)
bpy.types.register(DATA_PT_lattice)
diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py
index 49e26a2e8c2..46866a89671 100644
--- a/release/scripts/ui/properties_data_mesh.py
+++ b/release/scripts/ui/properties_data_mesh.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -39,15 +41,21 @@ class DATA_PT_context_mesh(DataButtonsPanel):
ob = context.object
mesh = context.mesh
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif mesh:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif mesh:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "data")
+ elif mesh:
+ layout.template_ID(space, "pin_id")
class DATA_PT_normals(DataButtonsPanel):
@@ -57,18 +65,22 @@ class DATA_PT_normals(DataButtonsPanel):
layout = self.layout
mesh = context.mesh
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(mesh, "autosmooth")
+ col.prop(mesh, "autosmooth")
sub = col.column()
sub.active = mesh.autosmooth
- sub.itemR(mesh, "autosmooth_angle", text="Angle")
+ sub.prop(mesh, "autosmooth_angle", text="Angle")
- col = split.column()
- col.itemR(mesh, "vertex_normal_flip")
- col.itemR(mesh, "double_sided")
+ if wide_ui:
+ col = split.column()
+ else:
+ col.separator()
+ col.prop(mesh, "vertex_normal_flip")
+ col.prop(mesh, "double_sided")
class DATA_PT_settings(DataButtonsPanel):
@@ -79,10 +91,7 @@ class DATA_PT_settings(DataButtonsPanel):
mesh = context.mesh
- split = layout.split()
-
- col = split.column()
- col.itemR(mesh, "texture_mesh")
+ layout.prop(mesh, "texture_mesh")
class DATA_PT_vertex_groups(DataButtonsPanel):
@@ -105,29 +114,29 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
col = row.column(align=True)
- col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
- col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
+ col.operator("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
- col.itemO("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
+ col.operator("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
if ob.data.users > 1:
- col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
+ col.operator("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
if group:
row = layout.row()
- row.itemR(group, "name")
+ row.prop(group, "name")
if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
row = layout.row()
sub = row.row(align=True)
- sub.itemO("object.vertex_group_assign", text="Assign")
- sub.itemO("object.vertex_group_remove_from", text="Remove")
+ sub.operator("object.vertex_group_assign", text="Assign")
+ sub.operator("object.vertex_group_remove_from", text="Remove")
sub = row.row(align=True)
- sub.itemO("object.vertex_group_select", text="Select")
- sub.itemO("object.vertex_group_deselect", text="Deselect")
+ sub.operator("object.vertex_group_select", text="Select")
+ sub.operator("object.vertex_group_deselect", text="Deselect")
- layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
+ layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(DataButtonsPanel):
@@ -142,11 +151,12 @@ class DATA_PT_shape_keys(DataButtonsPanel):
ob = context.object
key = ob.data.shape_keys
kb = ob.active_shape_key
+ wide_ui = context.region.width > narrowui
enable_edit = ob.mode != 'EDIT'
enable_edit_value = False
- if ob.shape_key_lock == False:
+ if ob.shape_key_lock is False:
if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
enable_edit_value = True
@@ -160,69 +170,76 @@ class DATA_PT_shape_keys(DataButtonsPanel):
col = row.column()
sub = col.column(align=True)
- sub.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
- sub.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
+ sub.operator("object.shape_key_add", icon='ICON_ZOOMIN', text="")
+ sub.operator("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
if kb:
- col.itemS()
+ col.separator()
sub = col.column(align=True)
- sub.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
- sub.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
+ sub.operator("object.shape_key_move", icon='ICON_TRIA_UP', text="").type = 'UP'
+ sub.operator("object.shape_key_move", icon='ICON_TRIA_DOWN', text="").type = 'DOWN'
split = layout.split(percentage=0.4)
row = split.row()
row.enabled = enable_edit
- row.itemR(key, "relative")
+ if wide_ui:
+ row.prop(key, "relative")
row = split.row()
row.alignment = 'RIGHT'
+ if not wide_ui:
+ layout.prop(key, "relative")
+ row = layout.row()
+
+
sub = row.row(align=True)
subsub = sub.row(align=True)
subsub.active = enable_edit_value
if ob.shape_key_lock:
- subsub.itemR(ob, "shape_key_lock", icon='ICON_PINNED', text="")
+ subsub.prop(ob, "shape_key_lock", icon='ICON_PINNED', text="")
else:
- subsub.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
+ subsub.prop(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
if kb.mute:
- subsub.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
+ subsub.prop(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
else:
- subsub.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
- sub.itemR(ob, "shape_key_edit_mode", text="")
+ subsub.prop(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
+ sub.prop(ob, "shape_key_edit_mode", text="")
sub = row.row(align=True)
- sub.itemO("object.shape_key_mirror", icon='ICON_ARROW_LEFTRIGHT', text="")
- sub.itemO("object.shape_key_clear", icon='ICON_X', text="")
+ sub.operator("object.shape_key_mirror", icon='ICON_ARROW_LEFTRIGHT', text="")
+ sub.operator("object.shape_key_clear", icon='ICON_X', text="")
row = layout.row()
- row.itemR(kb, "name")
+ row.prop(kb, "name")
if key.relative:
if ob.active_shape_key_index != 0:
row = layout.row()
row.active = enable_edit_value
- row.itemR(kb, "value")
+ row.prop(kb, "value")
split = layout.split()
col = split.column(align=True)
col.active = enable_edit_value
- col.itemL(text="Range:")
- col.itemR(kb, "slider_min", text="Min")
- col.itemR(kb, "slider_max", text="Max")
+ col.label(text="Range:")
+ col.prop(kb, "slider_min", text="Min")
+ col.prop(kb, "slider_max", text="Max")
- col = split.column(align=True)
+ if wide_ui:
+ col = split.column(align=True)
col.active = enable_edit_value
- col.itemL(text="Blend:")
- col.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
- col.item_pointerR(kb, "relative_key", key, "keys", text="")
+ col.label(text="Blend:")
+ col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="")
+ col.prop_object(kb, "relative_key", key, "keys", text="")
else:
row = layout.row()
row.active = enable_edit_value
- row.itemR(key, "slurph")
+ row.prop(key, "slurph")
class DATA_PT_uv_texture(DataButtonsPanel):
@@ -239,12 +256,12 @@ class DATA_PT_uv_texture(DataButtonsPanel):
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
- col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
+ col.operator("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_uv_texture
if lay:
- layout.itemR(lay, "name")
+ layout.prop(lay, "name")
class DATA_PT_vertex_colors(DataButtonsPanel):
@@ -261,12 +278,12 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
- col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
- col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
+ col.operator("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_vertex_color
if lay:
- layout.itemR(lay, "name")
+ layout.prop(lay, "name")
bpy.types.register(DATA_PT_context_mesh)
bpy.types.register(DATA_PT_normals)
diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py
index 45330acd8e4..e36bdc991e1 100644
--- a/release/scripts/ui/properties_data_metaball.py
+++ b/release/scripts/ui/properties_data_metaball.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -39,15 +41,21 @@ class DATA_PT_context_metaball(DataButtonsPanel):
ob = context.object
mball = context.meta_ball
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif mball:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.separator()
+ elif mball:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "data")
+ elif mball:
+ layout.template_ID(space, "pin_id")
class DATA_PT_metaball(DataButtonsPanel):
@@ -57,21 +65,26 @@ class DATA_PT_metaball(DataButtonsPanel):
layout = self.layout
mball = context.meta_ball
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.itemR(mball, "wire_size", text="View")
- sub.itemR(mball, "render_size", text="Render")
+ sub.prop(mball, "wire_size", text="View")
+ sub.prop(mball, "render_size", text="Render")
- col = split.column()
- col.itemL(text="Settings:")
- col.itemR(mball, "threshold", text="Threshold")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Settings:")
+ col.prop(mball, "threshold", text="Threshold")
- layout.itemL(text="Update:")
- layout.itemR(mball, "flag", expand=True)
+ layout.label(text="Update:")
+ if wide_ui:
+ layout.prop(mball, "flag", expand=True)
+ else:
+ layout.prop(mball, "flag", text="")
class DATA_PT_metaball_element(DataButtonsPanel):
@@ -84,46 +97,38 @@ class DATA_PT_metaball_element(DataButtonsPanel):
layout = self.layout
metaelem = context.meta_ball.active_element
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.3)
- split.itemL(text="Type:")
- split.itemR(metaelem, "type", text="")
+ if wide_ui:
+ layout.prop(metaelem, "type")
+ else:
+ layout.prop(metaelem, "type", text="")
split = layout.split()
- col = split.column()
- col.itemL(text="Settings:")
- col.itemR(metaelem, "stiffness", text="Stiffness")
- col.itemR(metaelem, "negative", text="Negative")
- col.itemR(metaelem, "hide", text="Hide")
+ col = split.column(align=True)
+ col.label(text="Settings:")
+ col.prop(metaelem, "stiffness", text="Stiffness")
+ col.prop(metaelem, "negative", text="Negative")
+ col.prop(metaelem, "hide", text="Hide")
- if metaelem.type == 'BALL':
+ if wide_ui:
col = split.column(align=True)
- elif metaelem.type == 'CUBE':
- col = split.column(align=True)
- col.itemL(text="Size:")
- col.itemR(metaelem, "size_x", text="X")
- col.itemR(metaelem, "size_y", text="Y")
- col.itemR(metaelem, "size_z", text="Z")
+ if metaelem.type in ('CUBE', 'ELLIPSOID'):
+ col.label(text="Size:")
+ col.prop(metaelem, "size_x", text="X")
+ col.prop(metaelem, "size_y", text="Y")
+ col.prop(metaelem, "size_z", text="Z")
elif metaelem.type == 'TUBE':
- col = split.column(align=True)
- col.itemL(text="Size:")
- col.itemR(metaelem, "size_x", text="X")
+ col.label(text="Size:")
+ col.prop(metaelem, "size_x", text="X")
elif metaelem.type == 'PLANE':
- col = split.column(align=True)
- col.itemL(text="Size:")
- col.itemR(metaelem, "size_x", text="X")
- col.itemR(metaelem, "size_y", text="Y")
-
- elif metaelem.type == 'ELLIPSOID':
- col = split.column(align=True)
- col.itemL(text="Size:")
- col.itemR(metaelem, "size_x", text="X")
- col.itemR(metaelem, "size_y", text="Y")
- col.itemR(metaelem, "size_z", text="Z")
+ col.label(text="Size:")
+ col.prop(metaelem, "size_x", text="X")
+ col.prop(metaelem, "size_y", text="Y")
bpy.types.register(DATA_PT_context_metaball)
bpy.types.register(DATA_PT_metaball)
diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py
index 410fbadec09..c43dbd9c90a 100644
--- a/release/scripts/ui/properties_data_modifier.py
+++ b/release/scripts/ui/properties_data_modifier.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -33,437 +35,658 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
row = layout.row()
- row.item_menu_enumO("object.modifier_add", "type")
- row.itemL()
+ row.operator_menu_enum("object.modifier_add", "type")
+ if wide_ui:
+ row.label()
for md in ob.modifiers:
box = layout.template_modifier(md)
if box:
# match enum type to our functions, avoids a lookup table.
- getattr(self, md.type)(box, ob, md)
+ getattr(self, md.type)(box, ob, md, wide_ui)
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
- def ARMATURE(self, layout, ob, md):
- layout.itemR(md, "object")
+ def ARMATURE(self, layout, ob, md, wide_ui):
+ split = layout.split()
- split = layout.split(percentage=0.5)
- split.itemL(text="Vertex Group:")
- sub = split.split(percentage=0.7)
- sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
- subsub = sub.row()
- subsub.active = md.vertex_group
- subsub.itemR(md, "invert")
+ col = split.column()
+ col.label(text="Object:")
+ col.prop(md, "object", text="")
- layout.itemS()
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group::")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+ sub = col.column()
+ sub.active = bool(md.vertex_group)
+ sub.prop(md, "invert")
split = layout.split()
col = split.column()
- col.itemL(text="Bind To:")
- col.itemR(md, "use_vertex_groups", text="Vertex Groups")
- col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
+ col.label(text="Bind To:")
+ col.prop(md, "use_vertex_groups", text="Vertex Groups")
+ col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Deformation:")
+ col.prop(md, "quaternion")
+ col.prop(md, "multi_modifier")
+
+ def ARRAY(self, layout, ob, md, wide_ui):
+ if wide_ui:
+ layout.prop(md, "fit_type")
+ else:
+ layout.prop(md, "fit_type", text="")
- col = split.column()
- col.itemL(text="Deformation:")
- col.itemR(md, "quaternion")
- col.itemR(md, "multi_modifier")
- def ARRAY(self, layout, ob, md):
- layout.itemR(md, "fit_type")
if md.fit_type == 'FIXED_COUNT':
- layout.itemR(md, "count")
+ layout.prop(md, "count")
elif md.fit_type == 'FIT_LENGTH':
- layout.itemR(md, "length")
+ layout.prop(md, "length")
elif md.fit_type == 'FIT_CURVE':
- layout.itemR(md, "curve")
+ layout.prop(md, "curve")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemR(md, "constant_offset")
+ col.prop(md, "constant_offset")
sub = col.column()
sub.active = md.constant_offset
- sub.itemR(md, "constant_offset_displacement", text="")
+ sub.prop(md, "constant_offset_displacement", text="")
- col.itemS()
+ col.separator()
- col.itemR(md, "merge_adjacent_vertices", text="Merge")
+ col.prop(md, "merge_adjacent_vertices", text="Merge")
sub = col.column()
sub.active = md.merge_adjacent_vertices
- sub.itemR(md, "merge_end_vertices", text="First Last")
- sub.itemR(md, "merge_distance", text="Distance")
+ sub.prop(md, "merge_end_vertices", text="First Last")
+ sub.prop(md, "merge_distance", text="Distance")
- col = split.column()
- col.itemR(md, "relative_offset")
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "relative_offset")
sub = col.column()
sub.active = md.relative_offset
- sub.itemR(md, "relative_offset_displacement", text="")
+ sub.prop(md, "relative_offset_displacement", text="")
- col.itemS()
+ col.separator()
- col.itemR(md, "add_offset_object")
+ col.prop(md, "add_offset_object")
sub = col.column()
sub.active = md.add_offset_object
- sub.itemR(md, "offset_object", text="")
+ sub.prop(md, "offset_object", text="")
- layout.itemS()
+ layout.separator()
col = layout.column()
- col.itemR(md, "start_cap")
- col.itemR(md, "end_cap")
+ col.prop(md, "start_cap")
+ col.prop(md, "end_cap")
- def BEVEL(self, layout, ob, md):
- row = layout.row()
- row.itemR(md, "width")
- row.itemR(md, "only_vertices")
-
- layout.itemL(text="Limit Method:")
- layout.row().itemR(md, "limit_method", expand=True)
- if md.limit_method == 'ANGLE':
- layout.itemR(md, "angle")
- elif md.limit_method == 'WEIGHT':
- layout.row().itemR(md, "edge_weight_method", expand=True)
-
- def BOOLEAN(self, layout, ob, md):
- layout.itemR(md, "operation")
- layout.itemR(md, "object")
-
- def BUILD(self, layout, ob, md):
+ def BEVEL(self, layout, ob, md, wide_ui):
split = layout.split()
col = split.column()
- col.itemR(md, "start")
- col.itemR(md, "length")
+ col.prop(md, "width")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "only_vertices")
+
+ layout.label(text="Limit Method:")
+ layout.row().prop(md, "limit_method", expand=True)
+ if md.limit_method == 'ANGLE':
+ layout.prop(md, "angle")
+ elif md.limit_method == 'WEIGHT':
+ layout.row().prop(md, "edge_weight_method", expand=True)
+
+ def BOOLEAN(self, layout, ob, md, wide_ui):
+ split = layout.split()
col = split.column()
- col.itemR(md, "randomize")
+ col.label(text="Operation:")
+ col.prop(md, "operation", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Object:")
+ col.prop(md, "object", text="")
+
+ def BUILD(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.prop(md, "start")
+ col.prop(md, "length")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "randomize")
sub = col.column()
sub.active = md.randomize
- sub.itemR(md, "seed")
+ sub.prop(md, "seed")
- def CAST(self, layout, ob, md):
- layout.itemR(md, "cast_type")
- layout.itemR(md, "object")
- if md.object:
- layout.itemR(md, "use_transform")
+ def CAST(self, layout, ob, md, wide_ui):
+ split = layout.split(percentage=0.25)
- flow = layout.column_flow()
- flow.itemR(md, "x")
- flow.itemR(md, "y")
- flow.itemR(md, "z")
- flow.itemR(md, "factor")
- flow.itemR(md, "radius")
- flow.itemR(md, "size")
+ if wide_ui:
+ split.label(text="Cast Type:")
+ split.prop(md, "cast_type", text="")
+ else:
+ layout.prop(md, "cast_type", text="")
- layout.itemR(md, "from_radius")
+ split = layout.split(percentage=0.25)
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+ col = split.column()
+ col.prop(md, "x")
+ col.prop(md, "y")
+ col.prop(md, "z")
- def CLOTH(self, layout, ob, md):
- layout.itemL(text="See Cloth panel.")
+ col = split.column()
+ col.prop(md, "factor")
+ col.prop(md, "radius")
+ col.prop(md, "size")
+ col.prop(md, "from_radius")
- def COLLISION(self, layout, ob, md):
- layout.itemL(text="See Collision panel.")
-
- def CURVE(self, layout, ob, md):
- layout.itemR(md, "object")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "deform_axis")
-
- def DECIMATE(self, layout, ob, md):
- layout.itemR(md, "ratio")
- layout.itemR(md, "face_count")
-
- def DISPLACE(self, layout, ob, md):
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "texture")
- layout.itemR(md, "midlevel")
- layout.itemR(md, "strength")
- layout.itemR(md, "direction")
- layout.itemR(md, "texture_coordinates")
- if md.texture_coordinates == 'OBJECT':
- layout.itemR(md, "texture_coordinate_object", text="Object")
- elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
-
- def EDGE_SPLIT(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.itemR(md, "use_edge_angle", text="Edge Angle")
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Control Object:")
+ col.prop(md, "object", text="")
+ if md.object:
+ col.prop(md, "use_transform")
+
+ def CLOTH(self, layout, ob, md, wide_ui):
+ layout.label(text="See Cloth panel.")
+
+ def COLLISION(self, layout, ob, md, wide_ui):
+ layout.label(text="See Collision panel.")
+
+ def CURVE(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Object:")
+ col.prop(md, "object", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+ layout.label(text="Deformation Axis:")
+ layout.row().prop(md, "deform_axis", expand=True)
+
+ def DECIMATE(self, layout, ob, md, wide_ui):
+ layout.prop(md, "ratio")
+ layout.prop(md, "face_count")
+
+ def DISPLACE(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Texture:")
+ col.prop(md, "texture", text="")
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Direction:")
+ col.prop(md, "direction", text="")
+ col.label(text="Texture Coordinates:")
+ col.prop(md, "texture_coordinates", text="")
+ if md.texture_coordinates == 'OBJECT':
+ layout.prop(md, "texture_coordinate_object", text="Object")
+ elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
+ layout.prop_object(md, "uv_layer", ob.data, "uv_textures")
+
+ layout.separator()
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(md, "midlevel")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "strength")
+
+ def EDGE_SPLIT(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.prop(md, "use_edge_angle", text="Edge Angle")
sub = col.column()
sub.active = md.use_edge_angle
- sub.itemR(md, "split_angle")
+ sub.prop(md, "split_angle")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "use_sharp", text="Sharp Edges")
+
+ def EXPLODE(self, layout, ob, md, wide_ui):
+ split = layout.split()
col = split.column()
- col.itemR(md, "use_sharp", text="Sharp Edges")
+ col.label(text="Vertex group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+ sub = col.column()
+ sub.active = bool(md.vertex_group)
+ sub.prop(md, "protect")
- def EXPLODE(self, layout, ob, md):
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "protect")
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "split_edges")
+ col.prop(md, "unborn")
+ col.prop(md, "alive")
+ col.prop(md, "dead")
- flow = layout.column_flow(2)
- flow.itemR(md, "split_edges")
- flow.itemR(md, "unborn")
- flow.itemR(md, "alive")
- flow.itemR(md, "dead")
+ layout.operator("object.explode_refresh", text="Refresh")
- layout.itemO("object.explode_refresh", text="Refresh")
+ def FLUID_SIMULATION(self, layout, ob, md, wide_ui):
+ layout.label(text="See Fluid panel.")
- def FLUID_SIMULATION(self, layout, ob, md):
- layout.itemL(text="See Fluid panel.")
+ def HOOK(self, layout, ob, md, wide_ui):
+ split = layout.split()
- def HOOK(self, layout, ob, md):
- col = layout.column()
- col.itemR(md, "object")
+ col = split.column()
+ col.label(text="Object:")
+ col.prop(md, "object", text="")
if md.object and md.object.type == 'ARMATURE':
- layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
+ col.label(text="Bone:")
+ col.prop_object(md, "subtarget", md.object.data, "bones", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+ layout.separator()
split = layout.split()
- split.itemR(md, "falloff")
- split.itemR(md, "force", slider=True)
- layout.itemS()
-
- row = layout.row()
- row.itemO("object.hook_reset", text="Reset")
- row.itemO("object.hook_recenter", text="Recenter")
+ col = split.column()
+ col.prop(md, "falloff")
+ col.prop(md, "force", slider=True)
+ if wide_ui:
+ col = split.column()
+ else:
+ col.separator()
+ col.operator("object.hook_reset", text="Reset")
+ col.operator("object.hook_recenter", text="Recenter")
if ob.mode == 'EDIT':
+ layout.separator()
row = layout.row()
- row.itemO("object.hook_select", text="Select")
- row.itemO("object.hook_assign", text="Assign")
+ row.operator("object.hook_select", text="Select")
+ row.operator("object.hook_assign", text="Assign")
- def LATTICE(self, layout, ob, md):
- layout.itemR(md, "object")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+ def LATTICE(self, layout, ob, md, wide_ui):
+ split = layout.split()
- def MASK(self, layout, ob, md):
- layout.itemR(md, "mode")
+ col = split.column()
+ col.label(text="Object:")
+ col.prop(md, "object", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+
+ def MASK(self, layout, ob, md, wide_ui):
+ split = layout.split()
+
+ col = split.column()
+ col.label(text="Mode:")
+ col.prop(md, "mode", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
if md.mode == 'ARMATURE':
- layout.itemR(md, "armature")
+ col.prop(md, "armature", text="")
elif md.mode == 'VERTEX_GROUP':
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "inverse")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
- def MESH_DEFORM(self, layout, ob, md):
- layout.itemR(md, "object")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "invert")
+ sub = col.column()
+ sub.active = bool(md.vertex_group)
+ sub.prop(md, "invert")
- layout.itemS()
+ def MESH_DEFORM(self, layout, ob, md, wide_ui):
+ split = layout.split()
+ col = split.column()
+ sub = col.column()
+ sub.label(text="Object:")
+ sub.prop(md, "object", text="")
+ sub.prop(md, "mode", text="")
+ sub.active = not md.is_bound
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+
+ sub = col.column()
+ sub.active = bool(md.vertex_group)
+ sub.prop(md, "invert")
+
+ layout.separator()
if md.is_bound:
- layout.itemO("object.meshdeform_bind", text="Unbind")
+ layout.operator("object.meshdeform_bind", text="Unbind")
else:
- layout.itemO("object.meshdeform_bind", text="Bind")
- row = layout.row()
- row.itemR(md, "precision")
- row.itemR(md, "dynamic")
+ layout.operator("object.meshdeform_bind", text="Bind")
+
+ if md.mode == 'VOLUME':
+ split = layout.split()
+
+ col = split.column()
+ col.prop(md, "precision")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "dynamic")
+
+ def MIRROR(self, layout, ob, md, wide_ui):
+ layout.prop(md, "merge_limit")
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ else:
+ split = layout.split(percentage=0.4)
+
+ col = split.column()
+ col.label(text="Axis:")
+ col.prop(md, "x")
+ col.prop(md, "y")
+ col.prop(md, "z")
+
+ if wide_ui:
+ col = split.column()
+ else:
+ subsplit = layout.split()
+ col = subsplit.column()
+ col.label(text="Options:")
+ col.prop(md, "clip", text="Clipping")
+ col.prop(md, "mirror_vertex_groups", text="Vertex Groups")
+
+ col = split.column()
+ col.label(text="Textures:")
+ col.prop(md, "mirror_u", text="U")
+ col.prop(md, "mirror_v", text="V")
+
+ col = layout.column()
+ col.label(text="Mirror Object:")
+ col.prop(md, "mirror_object", text="")
+
+ def MULTIRES(self, layout, ob, md, wide_ui):
+ if wide_ui:
+ layout.row().prop(md, "subdivision_type", expand=True)
+ else:
+ layout.row().prop(md, "subdivision_type", text="")
+ layout.prop(md, "level")
- def MIRROR(self, layout, ob, md):
- layout.itemR(md, "merge_limit")
split = layout.split()
col = split.column()
- col.itemR(md, "x")
- col.itemR(md, "y")
- col.itemR(md, "z")
+ col.operator("object.multires_subdivide", text="Subdivide")
+
+ if wide_ui:
+ col = split.column()
+ col.operator("object.multires_higher_levels_delete", text="Delete Higher")
+
+ def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui):
+ layout.prop(md, "object")
+ layout.prop(md, "particle_system_number", text="Particle System")
+
+ split = layout.split()
+ col = split.column()
+ col.label(text="Create From:")
+ col.prop(md, "normal")
+ col.prop(md, "children")
+ col.prop(md, "size")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Show Particles When:")
+ col.prop(md, "alive")
+ col.prop(md, "unborn")
+ col.prop(md, "dead")
+
+ layout.separator()
+
+ layout.prop(md, "path", text="Create Along Paths")
+
+ split = layout.split()
+ split.active = md.path
+ col = split.column()
+ col.row().prop(md, "axis", expand=True)
+ col.prop(md, "keep_shape")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "position", slider=True)
+ col.prop(md, "random_position", text="Random", slider=True)
+
+ def PARTICLE_SYSTEM(self, layout, ob, md, wide_ui):
+ layout.label(text="See Particle panel.")
+
+ def SHRINKWRAP(self, layout, ob, md, wide_ui):
+ split = layout.split()
+ col = split.column()
+ col.label(text="Target:")
+ col.prop(md, "target", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+
+ split = layout.split()
col = split.column()
- col.itemL(text="Textures:")
- col.itemR(md, "mirror_u")
- col.itemR(md, "mirror_v")
+ col.prop(md, "offset")
+ col.prop(md, "subsurf_levels")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Mode:")
+ col.prop(md, "mode", text="")
+
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ else:
+ split = layout.split(percentage=0.35)
col = split.column()
- col.itemR(md, "clip", text="Do Clipping")
- col.itemR(md, "mirror_vertex_groups", text="Vertex Group")
- layout.itemR(md, "mirror_object")
-
- def MULTIRES(self, layout, ob, md):
- layout.itemR(md, "subdivision_type")
-
- row = layout.row()
- row.itemO("object.multires_subdivide", text="Subdivide")
- row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
-
- layout.itemR(md, "level")
-
- def PARTICLE_INSTANCE(self, layout, ob, md):
- layout.itemR(md, "object")
- layout.itemR(md, "particle_system_number")
-
- flow = layout.column_flow()
- flow.itemR(md, "normal")
- flow.itemR(md, "children")
- flow.itemR(md, "size")
- flow.itemR(md, "path")
- if md.path:
- flow.itemR(md, "keep_shape")
- flow.itemR(md, "unborn")
- flow.itemR(md, "alive")
- flow.itemR(md, "dead")
- flow.itemL(md, "")
- if md.path:
- flow.itemR(md, "axis", text="")
-
- if md.path:
- row = layout.row()
- row.itemR(md, "position", slider=True)
- row.itemR(md, "random_position", text="Random", slider=True)
-
- def PARTICLE_SYSTEM(self, layout, ob, md):
- layout.itemL(text="See Particle panel.")
-
- def SHRINKWRAP(self, layout, ob, md):
- layout.itemR(md, "target")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "offset")
- layout.itemR(md, "subsurf_levels")
- layout.itemR(md, "mode")
if md.mode == 'PROJECT':
- layout.itemR(md, "subsurf_levels")
- layout.itemR(md, "auxiliary_target")
+ col.label(text="Axis:")
+ col.prop(md, "x")
+ col.prop(md, "y")
+ col.prop(md, "z")
- row = layout.row()
- row.itemR(md, "x")
- row.itemR(md, "y")
- row.itemR(md, "z")
+ col = split.column()
+ col.label(text="Direction:")
+ col.prop(md, "negative")
+ col.prop(md, "positive")
+
+ if wide_ui:
+ col = split.column()
+ else:
+ subsplit = layout.split()
+ col = subsplit.column()
+ col.label(text="Cull Faces:")
+ col.prop(md, "cull_front_faces", text="Front")
+ col.prop(md, "cull_back_faces", text="Back")
+
+ layout.label(text="Auxiliary Target:")
+ layout.prop(md, "auxiliary_target", text="")
- flow = layout.column_flow()
- flow.itemR(md, "negative")
- flow.itemR(md, "positive")
- flow.itemR(md, "cull_front_faces")
- flow.itemR(md, "cull_back_faces")
elif md.mode == 'NEAREST_SURFACEPOINT':
- layout.itemR(md, "keep_above_surface")
+ layout.prop(md, "keep_above_surface")
- def SIMPLE_DEFORM(self, layout, ob, md):
- layout.itemR(md, "mode")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "origin")
- layout.itemR(md, "relative")
- layout.itemR(md, "factor")
- layout.itemR(md, "limits")
- if md.mode in ('TAPER', 'STRETCH'):
- layout.itemR(md, "lock_x_axis")
- layout.itemR(md, "lock_y_axis")
-
- def SMOKE(self, layout, ob, md):
- layout.itemL(text="See Smoke panel.")
-
- def SMOOTH(self, layout, ob, md):
+ def SIMPLE_DEFORM(self, layout, ob, md, wide_ui):
split = layout.split()
col = split.column()
- col.itemR(md, "x")
- col.itemR(md, "y")
- col.itemR(md, "z")
+ col.label(text="Mode:")
+ col.prop(md, "mode", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
+
+ split = layout.split()
col = split.column()
- col.itemR(md, "factor")
- col.itemR(md, "repeat")
+ col.label(text="Origin:")
+ col.prop(md, "origin", text="")
+ sub = col.column()
+ sub.active = (md.origin != "")
+ sub.prop(md, "relative")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Deform:")
+ col.prop(md, "factor")
+ col.prop(md, "limits", slider=True)
+ if md.mode in ('TAPER', 'STRETCH'):
+ col.prop(md, "lock_x_axis")
+ col.prop(md, "lock_y_axis")
- def SOFT_BODY(self, layout, ob, md):
- layout.itemL(text="See Soft Body panel.")
+ def SMOKE(self, layout, ob, md, wide_ui):
+ layout.label(text="See Smoke panel.")
- def SUBSURF(self, layout, ob, md):
- layout.row().itemR(md, "subdivision_type", expand=True)
+ def SMOOTH(self, layout, ob, md, wide_ui):
+ split = layout.split(percentage=0.25)
- flow = layout.column_flow()
- flow.itemR(md, "levels", text="Preview")
- flow.itemR(md, "render_levels", text="Render")
- flow.itemR(md, "optimal_draw", text="Optimal Display")
- flow.itemR(md, "subsurf_uv")
+ col = split.column()
+ col.label(text="Axis:")
+ col.prop(md, "x")
+ col.prop(md, "y")
+ col.prop(md, "z")
- def SURFACE(self, layout, ob, md):
- layout.itemL(text="See Fields panel.")
+ col = split.column()
+ col.prop(md, "factor")
+ col.prop(md, "repeat")
+ col.label(text="Vertex Group:")
+ col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
- def UV_PROJECT(self, layout, ob, md):
+ def SOFT_BODY(self, layout, ob, md, wide_ui):
+ layout.label(text="See Soft Body panel.")
+
+ def SUBSURF(self, layout, ob, md, wide_ui):
+ if wide_ui:
+ layout.row().prop(md, "subdivision_type", expand=True)
+ else:
+ layout.row().prop(md, "subdivision_type", text="")
+
+ split = layout.split()
+ col = split.column()
+ col.label(text="Subdivisions:")
+ col.prop(md, "levels", text="View")
+ col.prop(md, "render_levels", text="Render")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Options:")
+ col.prop(md, "optimal_draw", text="Optimal Display")
+ col.prop(md, "subsurf_uv")
+
+ def SURFACE(self, layout, ob, md, wide_ui):
+ layout.label(text="See Fields panel.")
+
+ def UV_PROJECT(self, layout, ob, md, wide_ui):
if ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
- layout.itemR(md, "image")
- layout.itemR(md, "override_image")
+ split = layout.split()
+ col = split.column()
+ col.label(text="UV Layer:")
+ col.prop_object(md, "uv_layer", ob.data, "uv_textures", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Image:")
+ col.prop(md, "image", text="")
split = layout.split()
-
col = split.column()
- col.itemL(text="Aspect Ratio:")
-
- sub = col.column(align=True)
- sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
- sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
-
- col = split.column()
- col.itemL(text="Projectors:")
-
- sub = col.column(align=True)
- sub.itemR(md, "num_projectors", text="Number")
+ col.prop(md, "override_image")
+ col.prop(md, "num_projectors", text="Projectors")
for proj in md.projectors:
- sub.itemR(proj, "object", text="")
+ col.prop(proj, "object", text="")
- def WAVE(self, layout, ob, md):
+ if wide_ui:
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="Aspect Ratio:")
+ sub.prop(md, "horizontal_aspect_ratio", text="Horizontal")
+ sub.prop(md, "vertical_aspect_ratio", text="Vertical")
+
+ def WAVE(self, layout, ob, md, wide_ui):
split = layout.split()
col = split.column()
- col.itemL(text="Motion:")
- col.itemR(md, "x")
- col.itemR(md, "y")
- col.itemR(md, "cyclic")
+ col.label(text="Motion:")
+ col.prop(md, "x")
+ col.prop(md, "y")
+ col.prop(md, "cyclic")
- col = split.column()
- col.itemR(md, "normals")
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "normals")
sub = col.column()
sub.active = md.normals
- sub.itemR(md, "x_normal", text="X")
- sub.itemR(md, "y_normal", text="Y")
- sub.itemR(md, "z_normal", text="Z")
+ sub.prop(md, "x_normal", text="X")
+ sub.prop(md, "y_normal", text="Y")
+ sub.prop(md, "z_normal", text="Z")
split = layout.split()
col = split.column()
- col.itemL(text="Time:")
+ col.label(text="Time:")
sub = col.column(align=True)
- sub.itemR(md, "time_offset", text="Offset")
- sub.itemR(md, "lifetime", text="Life")
- col.itemR(md, "damping_time", text="Damping")
+ sub.prop(md, "time_offset", text="Offset")
+ sub.prop(md, "lifetime", text="Life")
+ col.prop(md, "damping_time", text="Damping")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Position:")
+ sub = col.column(align=True)
+ sub.prop(md, "start_position_x", text="X")
+ sub.prop(md, "start_position_y", text="Y")
+ col.prop(md, "falloff_radius", text="Falloff")
+
+ layout.separator()
+
+ layout.prop(md, "start_position_object")
+ layout.prop_object(md, "vertex_group", ob, "vertex_groups")
+ layout.prop(md, "texture")
+ layout.prop(md, "texture_coordinates")
+ if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
+ layout.prop_object(md, "uv_layer", ob.data, "uv_textures")
+ elif md.texture_coordinates == 'OBJECT':
+ layout.prop(md, "texture_coordinates_object")
+
+ layout.separator()
+
+ split = layout.split()
col = split.column()
- col.itemL(text="Position:")
- sub = col.column(align=True)
- sub.itemR(md, "start_position_x", text="X")
- sub.itemR(md, "start_position_y", text="Y")
- col.itemR(md, "falloff_radius", text="Falloff")
+ col.prop(md, "speed", slider=True)
+ col.prop(md, "height", slider=True)
- layout.itemS()
-
- layout.itemR(md, "start_position_object")
- layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
- layout.itemR(md, "texture")
- layout.itemR(md, "texture_coordinates")
- if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
- layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
- elif md.texture_coordinates == 'OBJECT':
- layout.itemR(md, "texture_coordinates_object")
-
- layout.itemS()
-
- flow = layout.column_flow()
- flow.itemR(md, "speed", slider=True)
- flow.itemR(md, "height", slider=True)
- flow.itemR(md, "width", slider=True)
- flow.itemR(md, "narrowness", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(md, "width", slider=True)
+ col.prop(md, "narrowness", slider=True)
bpy.types.register(DATA_PT_modifiers)
diff --git a/release/scripts/ui/properties_data_text.py b/release/scripts/ui/properties_data_text.py
deleted file mode 100644
index b622264569f..00000000000
--- a/release/scripts/ui/properties_data_text.py
+++ /dev/null
@@ -1,205 +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 #####
-
-#
-import bpy
-
-
-class DataButtonsPanel(bpy.types.Panel):
- bl_space_type = 'PROPERTIES'
- bl_region_type = 'WINDOW'
- bl_context = "data"
-
- def poll(self, context):
- return (context.object and context.object.type == 'TEXT' and context.curve)
-
-
-class DATA_PT_context_text(DataButtonsPanel):
- bl_label = ""
- bl_show_header = False
-
- def draw(self, context):
- layout = self.layout
-
- ob = context.object
- curve = context.curve
- space = context.space_data
-
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif curve:
- split.template_ID(space, "pin_id")
- split.itemS()
-
-
-class DATA_PT_shape_text(DataButtonsPanel):
- bl_label = "Shape Text"
-
- def draw(self, context):
- layout = self.layout
-
- ob = context.object
- curve = context.curve
- space = context.space_data
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Caps:")
- row = col.row()
- row .itemR(curve, "front")
- row .itemR(curve, "back")
- # col = split.column()
- col.itemL(text="Textures:")
- col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
-
- col = split.column()
- col.itemL(text="Resolution:")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview")
- sub.itemR(curve, "render_resolution_u", text="Render")
-
- # resolution_v is not used for text
-
- sub = col.column(align=True)
- col.itemL(text="Display:")
- col.itemR(curve, "fast", text="Fast Editing")
-
-
-class DATA_PT_geometry_text(DataButtonsPanel):
- bl_label = "Geometry"
-
- def draw(self, context):
- layout = self.layout
-
- curve = context.curve
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Modification:")
- col.itemR(curve, "width")
- col.itemR(curve, "extrude")
- col.itemL(text="Taper Object:")
- col.itemR(curve, "taper_object", text="")
-
- col = split.column()
- col.itemL(text="Bevel:")
- col.itemR(curve, "bevel_depth", text="Depth")
- col.itemR(curve, "bevel_resolution", text="Resolution")
- col.itemL(text="Bevel Object:")
- col.itemR(curve, "bevel_object", text="")
-
-
-class DATA_PT_font(DataButtonsPanel):
- bl_label = "Font"
-
- def draw(self, context):
- layout = self.layout
-
- text = context.curve
- char = context.curve.edit_format
-
- layout.itemR(text, "font")
-
- row = layout.row()
- row.itemR(text, "text_size", text="Size")
- row.itemR(text, "shear")
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Object Font:")
- col.itemR(text, "family", text="")
-
- col = split.column()
- col.itemL(text="Text on Curve:")
- col.itemR(text, "text_on_curve", text="")
-
- split = layout.split()
-
- col = split.column()
- col.itemL(text="Character:")
- col.itemR(char, "bold")
- col.itemR(char, "italic")
- col.itemR(char, "underline")
-# col.itemR(char, "style")
-# col.itemR(char, "wrap")
-
- col = split.column(align=True)
- col.itemL(text="Underline:")
- col.itemR(text, "ul_position", text="Position")
- col.itemR(text, "ul_height", text="Thickness")
-
-
-class DATA_PT_paragraph(DataButtonsPanel):
- bl_label = "Paragraph"
-
- def draw(self, context):
- layout = self.layout
-
- text = context.curve
-
- layout.itemL(text="Align:")
- layout.itemR(text, "spacemode", expand=True)
-
- split = layout.split()
-
- col = split.column(align=True)
- col.itemL(text="Spacing:")
- col.itemR(text, "spacing", text="Character")
- col.itemR(text, "word_spacing", text="Word")
- col.itemR(text, "line_dist", text="Line")
-
- col = split.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(text, "offset_x", text="X")
- col.itemR(text, "offset_y", text="Y")
-
-
-class DATA_PT_textboxes(DataButtonsPanel):
- bl_label = "Text Boxes"
-
- def draw(self, context):
- layout = self.layout
-
- text = context.curve
-
- for box in text.textboxes:
- split = layout.box().split()
-
- col = split.column(align=True)
- col.itemL(text="Dimensions:")
- col.itemR(box, "width", text="Width")
- col.itemR(box, "height", text="Height")
-
- col = split.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(box, "x", text="X")
- col.itemR(box, "y", text="Y")
-
-bpy.types.register(DATA_PT_context_text)
-bpy.types.register(DATA_PT_shape_text)
-bpy.types.register(DATA_PT_geometry_text)
-bpy.types.register(DATA_PT_font)
-bpy.types.register(DATA_PT_paragraph)
-bpy.types.register(DATA_PT_textboxes)
diff --git a/release/scripts/ui/properties_game.py b/release/scripts/ui/properties_game.py
index b445585507d..293c4786c7f 100644
--- a/release/scripts/ui/properties_game.py
+++ b/release/scripts/ui/properties_game.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class PhysicsButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -40,115 +42,123 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
ob = context.active_object
game = ob.game
soft = ob.game.soft_body
+ wide_ui = context.region.width > narrowui
- layout.itemR(game, "physics_type")
- layout.itemS()
+ if wide_ui:
+ layout.prop(game, "physics_type")
+ else:
+ layout.prop(game, "physics_type", text="")
+ layout.separator()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
split = layout.split()
col = split.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible") # out of place but useful
- col = split.column()
- col.itemR(game, "material_physics")
- col.itemR(game, "rotate_from_normal")
- col.itemR(game, "no_sleeping")
+ if wide_ui:
+ col = split.column()
+ col.prop(game, "material_physics")
+ col.prop(game, "rotate_from_normal")
+ col.prop(game, "no_sleeping")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Attributes:")
- col.itemR(game, "mass")
- col.itemR(game, "radius")
- col.itemR(game, "form_factor")
+ col.label(text="Attributes:")
+ col.prop(game, "mass")
+ col.prop(game, "radius")
+ col.prop(game, "form_factor")
- col = split.column()
+ if wide_ui:
+ col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
- sub.itemR(game, "anisotropic_friction")
+ sub.prop(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
- subsub.itemR(game, "friction_coefficients", text="", slider=True)
+ subsub.prop(game, "friction_coefficients", text="", slider=True)
split = layout.split()
col = split.column()
- col.itemL(text="Velocity:")
+ col.label(text="Velocity:")
sub = col.column(align=True)
- sub.itemR(game, "minimum_velocity", text="Minimum")
- sub.itemR(game, "maximum_velocity", text="Maximum")
+ sub.prop(game, "minimum_velocity", text="Minimum")
+ sub.prop(game, "maximum_velocity", text="Maximum")
- col = split.column()
- col.itemL(text="Damping:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Damping:")
sub = col.column(align=True)
- sub.itemR(game, "damping", text="Translation", slider=True)
- sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
+ sub.prop(game, "damping", text="Translation", slider=True)
+ sub.prop(game, "rotation_damping", text="Rotation", slider=True)
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Lock Translation:")
- col.itemR(game, "lock_x_axis", text="X")
- col.itemR(game, "lock_y_axis", text="Y")
- col.itemR(game, "lock_z_axis", text="Z")
+ col.label(text="Lock Translation:")
+ col.prop(game, "lock_x_axis", text="X")
+ col.prop(game, "lock_y_axis", text="Y")
+ col.prop(game, "lock_z_axis", text="Z")
col = split.column()
- col.itemL(text="Lock Rotation:")
- col.itemR(game, "lock_x_rot_axis", text="X")
- col.itemR(game, "lock_y_rot_axis", text="Y")
- col.itemR(game, "lock_z_rot_axis", text="Z")
+ col.label(text="Lock Rotation:")
+ col.prop(game, "lock_x_rot_axis", text="X")
+ col.prop(game, "lock_y_rot_axis", text="Y")
+ col.prop(game, "lock_z_rot_axis", text="Z")
elif game.physics_type == 'SOFT_BODY':
col = layout.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible")
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Attributes:")
- col.itemR(game, "mass")
- col.itemR(soft, "welding")
- col.itemR(soft, "position_iterations")
- col.itemR(soft, "linstiff", slider=True)
- col.itemR(soft, "dynamic_friction", slider=True)
- col.itemR(soft, "margin", slider=True)
- col.itemR(soft, "bending_const", text="Bending Constraints")
+ col.label(text="Attributes:")
+ col.prop(game, "mass")
+ col.prop(soft, "welding")
+ col.prop(soft, "position_iterations")
+ col.prop(soft, "linstiff", slider=True)
+ col.prop(soft, "dynamic_friction", slider=True)
+ col.prop(soft, "margin", slider=True)
+ col.prop(soft, "bending_const", text="Bending Constraints")
- col = split.column()
- col.itemR(soft, "shape_match")
+ if wide_ui:
+ col = split.column()
+ col.prop(soft, "shape_match")
sub = col.column()
sub.active = soft.shape_match
- sub.itemR(soft, "threshold", slider=True)
+ sub.prop(soft, "threshold", slider=True)
- col.itemS()
+ col.separator()
- col.itemL(text="Cluster Collision:")
- col.itemR(soft, "cluster_rigid_to_softbody")
- col.itemR(soft, "cluster_soft_to_softbody")
+ col.label(text="Cluster Collision:")
+ col.prop(soft, "cluster_rigid_to_softbody")
+ col.prop(soft, "cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
- sub.itemR(soft, "cluster_iterations", text="Iterations")
+ sub.prop(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
col = layout.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible")
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible")
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
- layout.itemR(ob, "restrict_render", text="Invisible")
+ layout.prop(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
@@ -162,19 +172,29 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
def draw_header(self, context):
game = context.active_object.game
- self.layout.itemR(game, "use_collision_bounds", text="")
+ self.layout.prop(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
+ wide_ui = context.region.width > narrowui
layout.active = game.use_collision_bounds
- layout.itemR(game, "collision_bounds", text="Bounds")
+ if wide_ui:
+ layout.prop(game, "collision_bounds", text="Bounds")
+ else:
+ layout.prop(game, "collision_bounds", text="")
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(game, "collision_margin", text="Margin", slider=True)
+
+ if wide_ui:
+ col = split.column()
+ col.prop(game, "collision_compound", text="Compound")
- row = layout.row()
- row.itemR(game, "collision_compound", text="Compound")
- row.itemR(game, "collision_margin", text="Margin", slider=True)
bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
@@ -197,8 +217,8 @@ class RENDER_PT_game(RenderButtonsPanel):
layout = self.layout
row = layout.row()
- row.itemO("view3d.game_start", text="Start")
- row.itemL()
+ row.operator("view3d.game_start", text="Start")
+ row.label()
class RENDER_PT_game_player(RenderButtonsPanel):
@@ -208,29 +228,34 @@ class RENDER_PT_game_player(RenderButtonsPanel):
layout = self.layout
gs = context.scene.game_data
+ wide_ui = context.region.width > narrowui
- layout.itemR(gs, "fullscreen")
+ layout.prop(gs, "fullscreen")
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.itemR(gs, "resolution_x", slider=False, text="X")
- sub.itemR(gs, "resolution_y", slider=False, text="Y")
+ sub.prop(gs, "resolution_x", slider=False, text="X")
+ sub.prop(gs, "resolution_y", slider=False, text="Y")
- col = split.column()
- col.itemL(text="Quality:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Quality:")
sub = col.column(align=True)
- sub.itemR(gs, "depth", text="Bit Depth", slider=False)
- sub.itemR(gs, "frequency", text="FPS", slider=False)
+ sub.prop(gs, "depth", text="Bit Depth", slider=False)
+ sub.prop(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
- col.itemL(text="Framing:")
- col.row().itemR(gs, "framing_type", expand=True)
+ col.label(text="Framing:")
+ if wide_ui:
+ col.row().prop(gs, "framing_type", expand=True)
+ else:
+ col.prop(gs, "framing_type", text="")
if gs.framing_type == 'LETTERBOX':
- col.itemR(gs, "framing_color", text="")
+ col.prop(gs, "framing_color", text="")
class RENDER_PT_game_stereo(RenderButtonsPanel):
@@ -241,19 +266,23 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
gs = context.scene.game_data
stereo_mode = gs.stereo
+ wide_ui = context.region.width > narrowui
# stereo options:
- layout.itemR(gs, "stereo", expand=True)
+ layout.prop(gs, "stereo", expand=True)
# stereo:
if stereo_mode == 'STEREO':
- layout.itemR(gs, "stereo_mode")
- layout.itemL(text="To do: Focal Length")
- layout.itemL(text="To do: Eye Separation")
+ layout.prop(gs, "stereo_mode")
+ # layout.label(text="To do: Focal Length") # to be done after 2.5alpha0 is out
+ # layout.label(text="To do: Eye Separation") # to be done after 2.5alpha0 is out
# dome:
elif stereo_mode == 'DOME':
- layout.itemR(gs, "dome_mode", text="Dome Type")
+ if wide_ui:
+ layout.prop(gs, "dome_mode", text="Dome Type")
+ else:
+ layout.prop(gs, "dome_mode", text="")
dome_type = gs.dome_mode
@@ -264,23 +293,29 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
dome_type == 'TRUNCATED_FRONT':
col = split.column()
- col.itemR(gs, "dome_angle", slider=True)
- col.itemR(gs, "dome_tilt")
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ col.prop(gs, "dome_angle", slider=True)
- col = split.column()
- col.itemR(gs, "dome_tesselation", text="Tesselation")
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(gs, "dome_tesselation", text="Tesselation")
+ col.prop(gs, "dome_tilt")
elif dome_type == 'PANORAM_SPH':
col = split.column()
- col.itemR(gs, "dome_tesselation", text="Tesselation")
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(gs, "dome_tesselation", text="Tesselation")
else: # cube map
col = split.column()
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ if wide_ui:
+ col = split.column()
- layout.itemR(gs, "dome_text")
+ layout.prop(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel):
@@ -290,20 +325,25 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
layout = self.layout
gs = context.scene.game_data
- layout.itemR(gs, "material_mode", expand=True)
+ wide_ui = context.region.width > narrowui
+
+ if wide_ui:
+ layout.prop(gs, "material_mode", expand=True)
+ else:
+ layout.prop(gs, "material_mode", text="")
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
- col.itemR(gs, "glsl_lights", text="Lights")
- col.itemR(gs, "glsl_shaders", text="Shaders")
- col.itemR(gs, "glsl_shadows", text="Shadows")
+ col.prop(gs, "glsl_lights", text="Lights")
+ col.prop(gs, "glsl_shaders", text="Shaders")
+ col.prop(gs, "glsl_shadows", text="Shadows")
col = split.column()
- col.itemR(gs, "glsl_ramps", text="Ramps")
- col.itemR(gs, "glsl_nodes", text="Nodes")
- col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
+ col.prop(gs, "glsl_ramps", text="Ramps")
+ col.prop(gs, "glsl_nodes", text="Nodes")
+ col.prop(gs, "glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel):
@@ -313,20 +353,22 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
layout = self.layout
gs = context.scene.game_data
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Show:")
- col.itemR(gs, "show_debug_properties", text="Debug Properties")
- col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
- col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
- col.itemR(gs, "deprecation_warnings")
+ col.label(text="Show:")
+ col.prop(gs, "show_debug_properties", text="Debug Properties")
+ col.prop(gs, "show_framerate_profile", text="Framerate and Profile")
+ col.prop(gs, "show_physics_visualization", text="Physics Visualization")
+ col.prop(gs, "deprecation_warnings")
- col = split.column()
- col.itemL(text="Render:")
- col.itemR(gs, "all_frames")
- col.itemR(gs, "display_lists")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Render:")
+ col.prop(gs, "all_frames")
+ col.prop(gs, "display_lists")
class RENDER_PT_game_sound(RenderButtonsPanel):
@@ -336,10 +378,14 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
layout = self.layout
scene = context.scene
+ wide_ui = context.region.width > narrowui
- layout.itemR(scene, "distance_model")
- layout.itemR(scene, "speed_of_sound", text="Speed")
- layout.itemR(scene, "doppler_factor")
+ if wide_ui:
+ layout.prop(scene, "distance_model")
+ else:
+ layout.prop(scene, "distance_model", text="")
+ layout.prop(scene, "speed_of_sound", text="Speed")
+ layout.prop(scene, "doppler_factor")
bpy.types.register(RENDER_PT_game)
bpy.types.register(RENDER_PT_game_player)
@@ -373,13 +419,19 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
scene = context.scene
world = context.world
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if scene:
- split.template_ID(scene, "world", new="world.new")
- elif world:
- split.template_ID(space, "pin_id")
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if scene:
+ split.template_ID(scene, "world", new="world.new")
+ elif world:
+ split.template_ID(space, "pin_id")
+ else:
+ if scene:
+ layout.template_ID(scene, "world", new="world.new")
+ elif world:
+ layout.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel):
@@ -389,17 +441,41 @@ class WORLD_PT_game_world(WorldButtonsPanel):
layout = self.layout
world = context.world
+ wide_ui = context.region.width > narrowui
- row = layout.row()
- row.column().itemR(world, "horizon_color")
- row.column().itemR(world, "ambient_color")
+ split = layout.split()
- layout.itemR(world.mist, "enabled", text="Mist")
+ col = split.column()
+ col.prop(world, "horizon_color")
- row = layout.column_flow()
- row.active = world.mist.enabled
- row.itemR(world.mist, "start")
- row.itemR(world.mist, "depth")
+ if wide_ui:
+ col = split.column()
+ col.prop(world, "ambient_color")
+
+
+class WORLD_PT_game_mist(WorldButtonsPanel):
+ bl_label = "Mist"
+
+ def draw_header(self, context):
+ world = context.world
+
+ self.layout.prop(world.mist, "enabled", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ world = context.world
+ wide_ui = context.region.width > narrowui
+
+ layout.active = world.mist.enabled
+ split = layout.split()
+
+ col = split.column()
+ col.prop(world.mist, "start")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(world.mist, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel):
@@ -409,41 +485,44 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
layout = self.layout
gs = context.scene.game_data
+ wide_ui = context.region.width > narrowui
- layout.itemR(gs, "physics_engine")
+ layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE':
- layout.itemR(gs, "physics_gravity", text="Gravity")
+ layout.prop(gs, "physics_gravity", text="Gravity")
split = layout.split()
col = split.column()
- col.itemL(text="Physics Steps:")
+ col.label(text="Physics Steps:")
sub = col.column(align=True)
- sub.itemR(gs, "physics_step_max", text="Max")
- sub.itemR(gs, "physics_step_sub", text="Substeps")
- col.itemR(gs, "fps", text="FPS")
+ sub.prop(gs, "physics_step_max", text="Max")
+ sub.prop(gs, "physics_step_sub", text="Substeps")
+ col.prop(gs, "fps", text="FPS")
- col = split.column()
- col.itemL(text="Logic Steps:")
- col.itemR(gs, "logic_step_max", text="Max")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
col = layout.column()
- col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+ col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
- sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
+ sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
else:
split = layout.split()
col = split.column()
- col.itemL(text="Physics Steps:")
- col.itemR(gs, "fps", text="FPS")
+ col.label(text="Physics Steps:")
+ col.prop(gs, "fps", text="FPS")
col = split.column()
- col.itemL(text="Logic Steps:")
- col.itemR(gs, "logic_step_max", text="Max")
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
bpy.types.register(WORLD_PT_game_context_world)
bpy.types.register(WORLD_PT_game_world)
+bpy.types.register(WORLD_PT_game_mist)
bpy.types.register(WORLD_PT_game_physics)
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py
index 67d9cea0934..eb2a73d1790 100644
--- a/release/scripts/ui/properties_material.py
+++ b/release/scripts/ui/properties_material.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
@@ -33,6 +35,13 @@ def active_node_mat(mat):
return None
+class MATERIAL_MT_sss_presets(bpy.types.Menu):
+ bl_label = "SSS Presets"
+ preset_subdir = "sss"
+ preset_operator = "script.python_file_run"
+ draw = bpy.types.Menu.draw_preset
+
+
class MaterialButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -72,6 +81,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
ob = context.object
slot = context.material_slot
space = context.space_data
+ wide_ui = context.region.width > narrowui
if ob:
row = layout.row()
@@ -79,31 +89,40 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
- col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
- col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
- col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
+ col.operator("object.material_slot_add", icon='ICON_ZOOMIN', text="")
+ col.operator("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("object.material_slot_copy", icon='ICON_COPY_ID', text="")
if ob.mode == 'EDIT':
row = layout.row(align=True)
- row.itemO("object.material_slot_assign", text="Assign")
- row.itemO("object.material_slot_select", text="Select")
- row.itemO("object.material_slot_deselect", text="Deselect")
+ row.operator("object.material_slot_assign", text="Assign")
+ row.operator("object.material_slot_select", text="Select")
+ row.operator("object.material_slot_deselect", text="Deselect")
- split = layout.split(percentage=0.65)
+ if wide_ui:
+ split = layout.split(percentage=0.65)
- if ob:
- split.template_ID(ob, "active_material", new="material.new")
- row = split.row()
- if slot:
- row.itemR(slot, "link", text="")
- else:
- row.itemL()
- elif mat:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if ob:
+ split.template_ID(ob, "active_material", new="material.new")
+ row = split.row()
+ if slot:
+ row.prop(slot, "link", text="")
+ else:
+ row.label()
+ elif mat:
+ split.template_ID(space, "pin_id")
+ split.separator()
+ else:
+ if ob:
+ layout.template_ID(ob, "active_material", new="material.new")
+ elif mat:
+ layout.template_ID(space, "pin_id")
if mat:
- layout.itemR(mat, "type", expand=True)
+ if wide_ui:
+ layout.prop(mat, "type", expand=True)
+ else:
+ layout.prop(mat, "type", text="")
class MATERIAL_PT_shading(MaterialButtonsPanel):
@@ -119,6 +138,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
layout = self.layout
mat = active_node_mat(context.material)
+ wide_ui = context.region.width > narrowui
if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
@@ -126,20 +146,21 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
col = split.column()
sub = col.column()
sub.active = not mat.shadeless
- sub.itemR(mat, "emit")
- sub.itemR(mat, "ambient")
+ sub.prop(mat, "emit")
+ sub.prop(mat, "ambient")
sub = col.column()
- sub.itemR(mat, "translucency")
+ sub.prop(mat, "translucency")
- col = split.column()
- col.itemR(mat, "shadeless")
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "shadeless")
sub = col.column()
sub.active = not mat.shadeless
- sub.itemR(mat, "tangent_shading")
- sub.itemR(mat, "cubic")
+ sub.prop(mat, "tangent_shading")
+ sub.prop(mat, "cubic")
elif mat.type == 'HALO':
- layout.itemR(mat, "alpha")
+ layout.prop(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
@@ -157,35 +178,38 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
mat = context.material # dont use node material
tan = mat.strand
+ wide_ui = context.region.width > narrowui
split = layout.split()
- col = split.column(align=True)
- col.itemL(text="Size:")
- col.itemR(tan, "root_size", text="Root")
- col.itemR(tan, "tip_size", text="Tip")
- col.itemR(tan, "min_size", text="Minimum")
- col.itemR(tan, "blender_units")
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="Size:")
+ sub.prop(tan, "root_size", text="Root")
+ sub.prop(tan, "tip_size", text="Tip")
+ sub.prop(tan, "min_size", text="Minimum")
+ sub.prop(tan, "blender_units")
sub = col.column()
sub.active = (not mat.shadeless)
- sub.itemR(tan, "tangent_shading")
- col.itemR(tan, "shape")
+ sub.prop(tan, "tangent_shading")
+ col.prop(tan, "shape")
- col = split.column()
- col.itemL(text="Shading:")
- col.itemR(tan, "width_fade")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Shading:")
+ col.prop(tan, "width_fade")
ob = context.object
if ob and ob.type == 'MESH':
- col.item_pointerR(tan, "uv_layer", ob.data, "uv_textures", text="")
+ col.prop_object(tan, "uv_layer", ob.data, "uv_textures", text="")
else:
- col.itemR(tan, "uv_layer", text="")
- col.itemS()
+ col.prop(tan, "uv_layer", text="")
+ col.separator()
sub = col.column()
sub.active = (not mat.shadeless)
- sub.itemR(tan, "surface_diffuse")
+ sub.prop(tan, "surface_diffuse")
sub = col.column()
sub.active = tan.surface_diffuse
- sub.itemR(tan, "blend_distance", text="Distance")
+ sub.prop(tan, "blend_distance", text="Distance")
class MATERIAL_PT_physics(MaterialButtonsPanel):
@@ -196,18 +220,20 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
layout = self.layout
phys = context.material.physics # dont use node material
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(phys, "distance")
- col.itemR(phys, "friction")
- col.itemR(phys, "align_to_normal")
+ col.prop(phys, "distance")
+ col.prop(phys, "friction")
+ col.prop(phys, "align_to_normal")
- col = split.column()
- col.itemR(phys, "force", slider=True)
- col.itemR(phys, "elasticity", slider=True)
- col.itemR(phys, "damp", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(phys, "force", slider=True)
+ col.prop(phys, "elasticity", slider=True)
+ col.prop(phys, "damp", slider=True)
class MATERIAL_PT_options(MaterialButtonsPanel):
@@ -223,34 +249,36 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
layout = self.layout
mat = active_node_mat(context.material)
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(mat, "traceable")
- col.itemR(mat, "full_oversampling")
- col.itemR(mat, "sky")
- col.itemR(mat, "exclude_mist")
- col.itemR(mat, "invert_z")
+ col.prop(mat, "traceable")
+ col.prop(mat, "full_oversampling")
+ col.prop(mat, "sky")
+ col.prop(mat, "exclude_mist")
+ col.prop(mat, "invert_z")
sub = col.row()
- sub.itemR(mat, "z_offset")
+ sub.prop(mat, "z_offset")
sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
sub = col.column(align=True)
- sub.itemL(text="Light Group:")
- sub.itemR(mat, "light_group", text="")
+ sub.label(text="Light Group:")
+ sub.prop(mat, "light_group", text="")
row = sub.row()
- row.active = mat.light_group
- row.itemR(mat, "light_group_exclusive", text="Exclusive")
+ row.active = bool(mat.light_group)
+ row.prop(mat, "light_group_exclusive", text="Exclusive")
- col = split.column()
- col.itemR(mat, "face_texture")
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "face_texture")
sub = col.column()
sub.active = mat.face_texture
- sub.itemR(mat, "face_texture_alpha")
- col.itemS()
- col.itemR(mat, "vertex_color_paint")
- col.itemR(mat, "vertex_color_light")
- col.itemR(mat, "object_color")
+ sub.prop(mat, "face_texture_alpha")
+ col.separator()
+ col.prop(mat, "vertex_color_paint")
+ col.prop(mat, "vertex_color_light")
+ col.prop(mat, "object_color")
class MATERIAL_PT_shadow(MaterialButtonsPanel):
@@ -267,25 +295,27 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
layout = self.layout
mat = active_node_mat(context.material)
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(mat, "shadows", text="Receive")
- col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
- col.itemR(mat, "only_shadow", text="Shadows Only")
- col.itemR(mat, "cast_shadows_only", text="Cast Only")
- col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
+ col.prop(mat, "shadows", text="Receive")
+ col.prop(mat, "receive_transparent_shadows", text="Receive Transparent")
+ col.prop(mat, "only_shadow", text="Shadows Only")
+ col.prop(mat, "cast_shadows_only", text="Cast Only")
+ col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
- col = split.column()
- col.itemR(mat, "cast_buffer_shadows")
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "cast_buffer_shadows")
sub = col.column()
sub.active = mat.cast_buffer_shadows
- sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
- col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
+ sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
+ col.prop(mat, "ray_shadow_bias", text="Auto Ray Bias")
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
- sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
+ sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
@@ -301,48 +331,62 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
layout = self.layout
mat = active_node_mat(context.material)
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(mat, "diffuse_color", text="")
+ col.prop(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.shadeless)
- sub.itemR(mat, "diffuse_intensity", text="Intensity")
+ sub.prop(mat, "diffuse_intensity", text="Intensity")
- col = split.column()
+ if wide_ui:
+ col = split.column()
col.active = (not mat.shadeless)
- col.itemR(mat, "diffuse_shader", text="")
- col.itemR(mat, "use_diffuse_ramp", text="Ramp")
+ col.prop(mat, "diffuse_shader", text="")
+ col.prop(mat, "use_diffuse_ramp", text="Ramp")
col = layout.column()
col.active = (not mat.shadeless)
if mat.diffuse_shader == 'OREN_NAYAR':
- col.itemR(mat, "roughness")
+ col.prop(mat, "roughness")
elif mat.diffuse_shader == 'MINNAERT':
- col.itemR(mat, "darkness")
+ col.prop(mat, "darkness")
elif mat.diffuse_shader == 'TOON':
- row = col.row()
- row.itemR(mat, "diffuse_toon_size", text="Size")
- row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
+ split = col.split()
+
+ col = split.column()
+ col.prop(mat, "diffuse_toon_size", text="Size")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
- row = col.row()
- row.itemR(mat, "diffuse_fresnel", text="Fresnel")
- row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
+ split = col.split()
+
+ col = split.column()
+ col.prop(mat, "diffuse_fresnel", text="Fresnel")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
- layout.itemS()
+ layout.separator()
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
- layout.itemS()
+ layout.separator()
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(mat, "diffuse_ramp_input", text="Input")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "diffuse_ramp_blend", text="Blend")
row = layout.row()
- split = row.split(percentage=0.3)
- split.itemL(text="Input:")
- split.itemR(mat, "diffuse_ramp_input", text="")
- split = row.split(percentage=0.3)
- split.itemL(text="Blend:")
- split.itemR(mat, "diffuse_ramp_blend", text="")
- row = layout.row()
- row.itemR(mat, "diffuse_ramp_factor", text="Factor")
+ row.prop(mat, "diffuse_ramp_factor", text="Factor")
class MATERIAL_PT_specular(MaterialButtonsPanel):
@@ -358,46 +402,60 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
layout = self.layout
mat = active_node_mat(context.material)
+ wide_ui = context.region.width > narrowui
layout.active = (not mat.shadeless)
split = layout.split()
col = split.column()
- col.itemR(mat, "specular_color", text="")
- col.itemR(mat, "specular_intensity", text="Intensity")
+ col.prop(mat, "specular_color", text="")
+ col.prop(mat, "specular_intensity", text="Intensity")
- col = split.column()
- col.itemR(mat, "specular_shader", text="")
- col.itemR(mat, "use_specular_ramp", text="Ramp")
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "specular_shader", text="")
+ col.prop(mat, "use_specular_ramp", text="Ramp")
col = layout.column()
if mat.specular_shader in ('COOKTORR', 'PHONG'):
- col.itemR(mat, "specular_hardness", text="Hardness")
+ col.prop(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN':
- row = col.row()
- row.itemR(mat, "specular_hardness", text="Hardness")
- row.itemR(mat, "specular_ior", text="IOR")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(mat, "specular_hardness", text="Hardness")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
- col.itemR(mat, "specular_slope", text="Slope")
+ col.prop(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON':
- row = col.row()
- row.itemR(mat, "specular_toon_size", text="Size")
- row.itemR(mat, "specular_toon_smooth", text="Smooth")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(mat, "specular_toon_size", text="Size")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
- layout.itemS()
+ layout.separator()
layout.template_color_ramp(mat, "specular_ramp", expand=True)
- layout.itemS()
+ layout.separator()
+ split = layout.split()
+
+ col = split.column()
+ col.prop(mat, "specular_ramp_input", text="Input")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(mat, "specular_ramp_blend", text="Blend")
+
row = layout.row()
- split = row.split(percentage=0.3)
- split.itemL(text="Input:")
- split.itemR(mat, "specular_ramp_input", text="")
- split = row.split(percentage=0.3)
- split.itemL(text="Blend:")
- split.itemR(mat, "specular_ramp_blend", text="")
- row = layout.row()
- row.itemR(mat, "specular_ramp_factor", text="Factor")
+ row.prop(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_sss(MaterialButtonsPanel):
@@ -415,35 +473,41 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
sss = mat.subsurface_scattering
self.layout.active = (not mat.shadeless)
- self.layout.itemR(sss, "enabled", text="")
+ self.layout.prop(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
+ wide_ui = context.region.width > narrowui
- layout.active = sss.enabled
+ layout.active = (sss.enabled) and (not mat.shadeless)
+
+ row = layout.row().split()
+ sub = row.row(align=True).split(percentage=0.75)
+ sub.menu("MATERIAL_MT_sss_presets", text="Presets")
+ sub.operator("material.sss_preset_add", text="Add")
split = layout.split()
- split.active = (not mat.shadeless)
col = split.column()
- col.itemR(sss, "ior")
- col.itemR(sss, "scale")
- col.itemR(sss, "color", text="")
- col.itemR(sss, "radius", text="RGB Radius")
+ col.prop(sss, "ior")
+ col.prop(sss, "scale")
+ col.prop(sss, "color", text="")
+ col.prop(sss, "radius", text="RGB Radius")
- col = split.column()
+ if wide_ui:
+ col = split.column()
sub = col.column(align=True)
- sub.itemL(text="Blend:")
- sub.itemR(sss, "color_factor", text="Color")
- sub.itemR(sss, "texture_factor", text="Texture")
- sub.itemL(text="Scattering Weight:")
- sub.itemR(sss, "front")
- sub.itemR(sss, "back")
- col.itemS()
- col.itemR(sss, "error_tolerance", text="Error")
+ sub.label(text="Blend:")
+ sub.prop(sss, "color_factor", text="Color")
+ sub.prop(sss, "texture_factor", text="Texture")
+ sub.label(text="Scattering Weight:")
+ sub.prop(sss, "front")
+ sub.prop(sss, "back")
+ col.separator()
+ col.prop(sss, "error_tolerance", text="Error")
class MATERIAL_PT_mirror(MaterialButtonsPanel):
@@ -459,47 +523,50 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
def draw_header(self, context):
raym = active_node_mat(context.material).raytrace_mirror
- self.layout.itemR(raym, "enabled", text="")
+ self.layout.prop(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
+ wide_ui = context.region.width > narrowui
layout.active = raym.enabled
split = layout.split()
col = split.column()
- col.itemR(raym, "reflect_factor")
- col.itemR(mat, "mirror_color", text="")
+ col.prop(raym, "reflect_factor")
+ col.prop(mat, "mirror_color", text="")
- col = split.column()
- col.itemR(raym, "fresnel")
+ if wide_ui:
+ col = split.column()
+ col.prop(raym, "fresnel")
sub = col.column()
sub.active = raym.fresnel > 0
- sub.itemR(raym, "fresnel_factor", text="Blend")
+ sub.prop(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
- col.itemS()
- col.itemR(raym, "distance", text="Max Dist")
- col.itemR(raym, "depth")
- col.itemS()
+ col.separator()
+ col.prop(raym, "distance", text="Max Dist")
+ col.prop(raym, "depth")
+ col.separator()
sub = col.split(percentage=0.4)
- sub.itemL(text="Fade To:")
- sub.itemR(raym, "fade_to", text="")
+ sub.label(text="Fade To:")
+ sub.prop(raym, "fade_to", text="")
- col = split.column()
- col.itemL(text="Gloss:")
- col.itemR(raym, "gloss_factor", text="Amount")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Gloss:")
+ col.prop(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = raym.gloss_factor < 1.0
- sub.itemR(raym, "gloss_threshold", text="Threshold")
- sub.itemR(raym, "gloss_samples", text="Samples")
- sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
+ sub.prop(raym, "gloss_threshold", text="Threshold")
+ sub.prop(raym, "gloss_samples", text="Samples")
+ sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_transp(MaterialButtonsPanel):
@@ -515,52 +582,58 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
def draw_header(self, context):
mat = active_node_mat(context.material)
- self.layout.itemR(mat, "transparency", text="")
+ self.layout.prop(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
+ wide_ui = context.region.width > narrowui
row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
- row.itemR(mat, "transparency_method", expand=True)
+ if wide_ui:
+ row.prop(mat, "transparency_method", expand=True)
+ else:
+ row.prop(mat, "transparency_method", text="")
split = layout.split()
col = split.column()
- col.itemR(mat, "alpha")
+ col.prop(mat, "alpha")
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
- row.itemR(mat, "specular_alpha", text="Specular")
+ row.prop(mat, "specular_alpha", text="Specular")
- col = split.column()
+ if wide_ui:
+ col = split.column()
col.active = (not mat.shadeless)
- col.itemR(rayt, "fresnel")
+ col.prop(rayt, "fresnel")
sub = col.column()
sub.active = rayt.fresnel > 0
- sub.itemR(rayt, "fresnel_factor", text="Blend")
+ sub.prop(rayt, "fresnel_factor", text="Blend")
if mat.transparency_method == 'RAYTRACE':
- layout.itemS()
+ layout.separator()
split = layout.split()
split.active = mat.transparency
col = split.column()
- col.itemR(rayt, "ior")
- col.itemR(rayt, "filter")
- col.itemR(rayt, "falloff")
- col.itemR(rayt, "limit")
- col.itemR(rayt, "depth")
+ col.prop(rayt, "ior")
+ col.prop(rayt, "filter")
+ col.prop(rayt, "falloff")
+ col.prop(rayt, "limit")
+ col.prop(rayt, "depth")
- col = split.column()
- col.itemL(text="Gloss:")
- col.itemR(rayt, "gloss_factor", text="Amount")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Gloss:")
+ col.prop(rayt, "gloss_factor", text="Amount")
sub = col.column()
sub.active = rayt.gloss_factor < 1.0
- sub.itemR(rayt, "gloss_threshold", text="Threshold")
- sub.itemR(rayt, "gloss_samples", text="Samples")
+ sub.prop(rayt, "gloss_threshold", text="Threshold")
+ sub.prop(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_halo(MaterialButtonsPanel):
@@ -577,38 +650,40 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
mat = context.material # dont use node material
halo = mat.halo
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(mat, "diffuse_color", text="")
- col.itemR(halo, "size")
- col.itemR(halo, "hardness")
- col.itemR(halo, "add")
- col.itemL(text="Options:")
- col.itemR(halo, "texture")
- col.itemR(halo, "vertex_normal")
- col.itemR(halo, "xalpha")
- col.itemR(halo, "shaded")
- col.itemR(halo, "soft")
+ col.prop(mat, "diffuse_color", text="")
+ col.prop(halo, "size")
+ col.prop(halo, "hardness")
+ col.prop(halo, "add")
+ col.label(text="Options:")
+ col.prop(halo, "texture")
+ col.prop(halo, "vertex_normal")
+ col.prop(halo, "xalpha")
+ col.prop(halo, "shaded")
+ col.prop(halo, "soft")
- col = split.column()
- col.itemR(halo, "ring")
+ if wide_ui:
+ col = split.column()
+ col.prop(halo, "ring")
sub = col.column()
sub.active = halo.ring
- sub.itemR(halo, "rings")
- sub.itemR(mat, "mirror_color", text="")
- col.itemS()
- col.itemR(halo, "lines")
+ sub.prop(halo, "rings")
+ sub.prop(mat, "mirror_color", text="")
+ col.separator()
+ col.prop(halo, "lines")
sub = col.column()
sub.active = halo.lines
- sub.itemR(halo, "line_number", text="Lines")
- sub.itemR(mat, "specular_color", text="")
- col.itemS()
- col.itemR(halo, "star")
+ sub.prop(halo, "line_number", text="Lines")
+ sub.prop(mat, "specular_color", text="")
+ col.separator()
+ col.prop(halo, "star")
sub = col.column()
sub.active = halo.star
- sub.itemR(halo, "star_tips")
+ sub.prop(halo, "star_tips")
class MATERIAL_PT_flare(MaterialButtonsPanel):
@@ -623,25 +698,27 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
def draw_header(self, context):
halo = context.material.halo
- self.layout.itemR(halo, "flare_mode", text="")
+ self.layout.prop(halo, "flare_mode", text="")
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
halo = mat.halo
+ wide_ui = context.region.width > narrowui
layout.active = halo.flare_mode
split = layout.split()
col = split.column()
- col.itemR(halo, "flare_size", text="Size")
- col.itemR(halo, "flare_boost", text="Boost")
- col.itemR(halo, "flare_seed", text="Seed")
- col = split.column()
- col.itemR(halo, "flares_sub", text="Subflares")
- col.itemR(halo, "flare_subsize", text="Subsize")
+ col.prop(halo, "flare_size", text="Size")
+ col.prop(halo, "flare_boost", text="Boost")
+ col.prop(halo, "flare_seed", text="Seed")
+ if wide_ui:
+ col = split.column()
+ col.prop(halo, "flares_sub", text="Subflares")
+ col.prop(halo, "flare_subsize", text="Subsize")
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
@@ -679,11 +756,15 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
layout = self.layout
vol = context.material.volume # dont use node material
+ wide_ui = context.region.width > narrowui
split = layout.split()
- row = split.row()
- row.itemR(vol, "density")
- row.itemR(vol, "density_scale")
+ col = split.column()
+ col.prop(vol, "density")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(vol, "density_scale")
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
@@ -695,21 +776,23 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
layout = self.layout
vol = context.material.volume # dont use node material
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(vol, "scattering")
- col.itemR(vol, "asymmetry")
- col.itemR(vol, "transmission_color")
+ col.prop(vol, "scattering")
+ col.prop(vol, "asymmetry")
+ col.prop(vol, "transmission_color")
- col = split.column()
+ if wide_ui:
+ col = split.column()
sub = col.column(align=True)
- sub.itemR(vol, "emission")
- sub.itemR(vol, "emission_color", text="")
+ sub.prop(vol, "emission")
+ sub.prop(vol, "emission_color", text="")
sub = col.column(align=True)
- sub.itemR(vol, "reflection")
- sub.itemR(vol, "reflection_color", text="")
+ sub.prop(vol, "reflection")
+ sub.prop(vol, "reflection_color", text="")
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
@@ -721,31 +804,33 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
layout = self.layout
vol = context.material.volume # dont use node material
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(vol, "lighting_mode", text="")
+ col.prop(vol, "lighting_mode", text="")
- col = split.column()
+ if wide_ui:
+ col = split.column()
if vol.lighting_mode == 'SHADED':
- col.itemR(vol, "external_shadows")
- col.itemR(vol, "light_cache")
+ col.prop(vol, "external_shadows")
+ col.prop(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
- sub.itemR(vol, "cache_resolution")
+ sub.prop(vol, "cache_resolution")
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
sub = col.column()
sub.enabled = True
sub.active = False
- sub.itemR(vol, "light_cache")
- col.itemR(vol, "cache_resolution")
+ sub.prop(vol, "light_cache")
+ col.prop(vol, "cache_resolution")
sub = col.column(align=True)
- sub.itemR(vol, "ms_diffusion")
- sub.itemR(vol, "ms_spread")
- sub.itemR(vol, "ms_intensity")
+ sub.prop(vol, "ms_diffusion")
+ sub.prop(vol, "ms_spread")
+ sub.prop(vol, "ms_intensity")
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
@@ -756,8 +841,12 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
layout = self.layout
mat = context.material # dont use node material
+ wide_ui = context.region.width > narrowui
- layout.itemR(mat, "transparency_method", expand=True)
+ if wide_ui:
+ layout.prop(mat, "transparency_method", expand=True)
+ else:
+ layout.prop(mat, "transparency_method", text="")
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
@@ -769,18 +858,22 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
layout = self.layout
vol = context.material.volume # dont use node material
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Step Calculation:")
- col.itemR(vol, "step_calculation", text="")
+ col.label(text="Step Calculation:")
+ col.prop(vol, "step_calculation", text="")
col = col.column(align=True)
- col.itemR(vol, "step_size")
+ col.prop(vol, "step_size")
- col = split.column()
- col.itemL()
- col.itemR(vol, "depth_cutoff")
+ if wide_ui:
+ col = split.column()
+ col.label()
+ col.prop(vol, "depth_cutoff")
+
+bpy.types.register(MATERIAL_MT_sss_presets)
bpy.types.register(MATERIAL_PT_volume_density)
bpy.types.register(MATERIAL_PT_volume_shading)
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index f6f1cf0e03c..c7c1ce24d59 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class ObjectButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -36,8 +38,8 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
ob = context.object
row = layout.row()
- row.itemL(text="", icon='ICON_OBJECT_DATA')
- row.itemR(ob, "name", text="")
+ row.label(text="", icon='ICON_OBJECT_DATA')
+ row.prop(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
@@ -47,23 +49,37 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
- row = layout.row()
+ if wide_ui:
+ row = layout.row()
- row.column().itemR(ob, "location")
- if ob.rotation_mode == 'QUATERNION':
- row.column().itemR(ob, "rotation_quaternion", text="Rotation")
- elif ob.rotation_mode == 'AXIS_ANGLE':
- #row.column().itemL(text="Rotation")
- #row.column().itemR(pchan, "rotation_angle", text="Angle")
- #row.column().itemR(pchan, "rotation_axis", text="Axis")
- row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
+ row.column().prop(ob, "location")
+ if ob.rotation_mode == 'QUATERNION':
+ row.column().prop(ob, "rotation_quaternion", text="Rotation")
+ elif ob.rotation_mode == 'AXIS_ANGLE':
+ #row.column().label(text="Rotation")
+ #row.column().prop(pchan, "rotation_angle", text="Angle")
+ #row.column().prop(pchan, "rotation_axis", text="Axis")
+ row.column().prop(ob, "rotation_axis_angle", text="Rotation")
+ else:
+ row.column().prop(ob, "rotation_euler", text="Rotation")
+
+ row.column().prop(ob, "scale")
+
+ layout.prop(ob, "rotation_mode")
else:
- row.column().itemR(ob, "rotation_euler", text="Rotation")
-
- row.column().itemR(ob, "scale")
-
- layout.itemR(ob, "rotation_mode")
+ col = layout.column()
+ col.prop(ob, "location")
+ col.label(text="Rotation:")
+ col.prop(ob, "rotation_mode", text="")
+ if ob.rotation_mode == 'QUATERNION':
+ col.prop(ob, "rotation_quaternion", text="")
+ elif ob.rotation_mode == 'AXIS_ANGLE':
+ col.prop(ob, "rotation_axis_angle", text="")
+ else:
+ col.prop(ob, "rotation_euler", text="")
+ col.prop(ob, "scale")
class OBJECT_PT_transform_locks(ObjectButtonsPanel):
@@ -74,22 +90,23 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ # wide_ui = context.region.width > narrowui
row = layout.row()
col = row.column()
- col.itemR(ob, "lock_location", text="Location")
+ col.prop(ob, "lock_location", text="Location")
col = row.column()
if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
- col.itemR(ob, "lock_rotations_4d", text="Rotation")
+ col.prop(ob, "lock_rotations_4d", text="Rotation")
if ob.lock_rotations_4d:
- col.itemR(ob, "lock_rotation_w", text="W")
- col.itemR(ob, "lock_rotation", text="")
+ col.prop(ob, "lock_rotation_w", text="W")
+ col.prop(ob, "lock_rotation", text="")
else:
- col.itemR(ob, "lock_rotation", text="Rotation")
+ col.prop(ob, "lock_rotation", text="Rotation")
- row.column().itemR(ob, "lock_scale", text="Scale")
+ row.column().prop(ob, "lock_scale", text="Scale")
class OBJECT_PT_relations(ObjectButtonsPanel):
@@ -99,26 +116,26 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(ob, "layers")
- col.itemS()
- col.itemR(ob, "pass_index")
+ col.prop(ob, "layers")
+ col.separator()
+ col.prop(ob, "pass_index")
- col = split.column()
- col.itemL(text="Parent:")
- col.itemR(ob, "parent", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Parent:")
+ col.prop(ob, "parent", text="")
sub = col.column()
- split = sub.split(percentage=0.3)
- split.itemL(text="Type:")
- split.itemR(ob, "parent_type", text="")
+ sub.prop(ob, "parent_type", text="")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
- sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
- sub.active = parent != None
+ sub.prop_object(ob, "parent_bone", parent.data, "bones", text="")
+ sub.active = (parent is not None)
class OBJECT_PT_groups(ObjectButtonsPanel):
@@ -128,10 +145,14 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
- split = layout.split()
- split.item_menu_enumO("object.group_add", "group", text="Add to Group")
- split.itemL()
+ if wide_ui:
+ split = layout.split()
+ split.operator_menu_enum("object.group_add", "group", text="Add to Group")
+ split.label()
+ else:
+ layout.operator_menu_enum("object.group_add", "group", text="Add to Group")
for group in bpy.data.groups:
if ob.name in group.objects:
@@ -140,12 +161,17 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
col.set_context_pointer("group", group)
row = col.box().row()
- row.itemR(group, "name", text="")
- row.itemO("object.group_remove", text="", icon='VICON_X')
+ row.prop(group, "name", text="")
+ row.operator("object.group_remove", text="", icon='ICON_X')
split = col.box().split()
- split.column().itemR(group, "layer", text="Dupli")
- split.column().itemR(group, "dupli_offset", text="")
+
+ col = split.column()
+ col.prop(group, "layer", text="Dupli")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(group, "dupli_offset", text="")
class OBJECT_PT_display(ObjectButtonsPanel):
@@ -155,24 +181,32 @@ class OBJECT_PT_display(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(ob, "max_draw_type", text="Type")
- col = split.column()
+ col.prop(ob, "max_draw_type", text="Type")
+
+ if wide_ui:
+ col = split.column()
row = col.row()
- row.itemR(ob, "draw_bounds", text="Bounds")
+ row.prop(ob, "draw_bounds", text="Bounds")
sub = row.row()
sub.active = ob.draw_bounds
- sub.itemR(ob, "draw_bounds_type", text="")
+ sub.prop(ob, "draw_bounds_type", text="")
- flow = layout.column_flow()
- flow.itemR(ob, "draw_name", text="Name")
- flow.itemR(ob, "draw_axis", text="Axis")
- flow.itemR(ob, "draw_wire", text="Wire")
- flow.itemR(ob, "draw_texture_space", text="Texture Space")
- flow.itemR(ob, "x_ray", text="X-Ray")
- flow.itemR(ob, "draw_transparent", text="Transparency")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(ob, "draw_name", text="Name")
+ col.prop(ob, "draw_axis", text="Axis")
+ col.prop(ob, "draw_wire", text="Wire")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(ob, "draw_texture_space", text="Texture Space")
+ col.prop(ob, "x_ray", text="X-Ray")
+ col.prop(ob, "draw_transparent", text="Transparency")
class OBJECT_PT_duplication(ObjectButtonsPanel):
@@ -182,32 +216,45 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
- layout.itemR(ob, "dupli_type", expand=True)
+ if wide_ui:
+ layout.prop(ob, "dupli_type", expand=True)
+ else:
+ layout.prop(ob, "dupli_type", text="")
if ob.dupli_type == 'FRAMES':
split = layout.split()
col = split.column(align=True)
- col.itemR(ob, "dupli_frames_start", text="Start")
- col.itemR(ob, "dupli_frames_end", text="End")
+ col.prop(ob, "dupli_frames_start", text="Start")
+ col.prop(ob, "dupli_frames_end", text="End")
- col = split.column(align=True)
- col.itemR(ob, "dupli_frames_on", text="On")
- col.itemR(ob, "dupli_frames_off", text="Off")
+ if wide_ui:
+ col = split.column(align=True)
+ col.prop(ob, "dupli_frames_on", text="On")
+ col.prop(ob, "dupli_frames_off", text="Off")
- layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
+ layout.prop(ob, "dupli_frames_no_speed", text="No Speed")
elif ob.dupli_type == 'VERTS':
- layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
+ layout.prop(ob, "dupli_verts_rotation", text="Rotation")
elif ob.dupli_type == 'FACES':
- row = layout.row()
- row.itemR(ob, "dupli_faces_scale", text="Scale")
- row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(ob, "dupli_faces_scale", text="Scale")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
elif ob.dupli_type == 'GROUP':
- layout.itemR(ob, "dupli_group", text="Group")
+ if wide_ui:
+ layout.prop(ob, "dupli_group", text="Group")
+ else:
+ layout.prop(ob, "dupli_group", text="")
class OBJECT_PT_animation(ObjectButtonsPanel):
@@ -217,31 +264,44 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Time Offset:")
- col.itemR(ob, "time_offset_edit", text="Edit")
+ col.label(text="Time Offset:")
+ col.prop(ob, "time_offset_edit", text="Edit")
row = col.row()
- row.itemR(ob, "time_offset_particle", text="Particle")
+ row.prop(ob, "time_offset_particle", text="Particle")
row.active = len(ob.particle_systems) != 0
row = col.row()
- row.itemR(ob, "time_offset_parent", text="Parent")
- row.active = ob.parent != None
+ row.prop(ob, "time_offset_parent", text="Parent")
+ row.active = (ob.parent is not None)
row = col.row()
- row.itemR(ob, "slow_parent")
- row.active = ob.parent != None
- col.itemR(ob, "time_offset", text="Offset")
+ row.prop(ob, "slow_parent")
+ row.active = (ob.parent is not None)
+ col.prop(ob, "time_offset", text="Offset")
- col = split.column()
- col.itemL(text="Track:")
- col.itemR(ob, "track", text="")
- col.itemR(ob, "track_axis", text="Axis")
- col.itemR(ob, "up_axis", text="Up Axis")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Track:")
+ col.prop(ob, "track", text="")
+ col.prop(ob, "track_axis", text="Axis")
+ col.prop(ob, "up_axis", text="Up Axis")
row = col.row()
- row.itemR(ob, "track_override_parent", text="Override Parent")
- row.active = ob.parent != None
+ row.prop(ob, "track_override_parent", text="Override Parent")
+ row.active = (ob.parent is not None)
+
+
+class OBJECT_PT_properties(ObjectButtonsPanel):
+ bl_label = "Properties"
+ bl_default_closed = True
+
+ def draw(self, context):
+ import rna_prop_ui
+ # reload(rna_prop_ui)
+
+ rna_prop_ui.draw(self.layout, context, "object")
bpy.types.register(OBJECT_PT_context_object)
bpy.types.register(OBJECT_PT_transform)
@@ -251,3 +311,4 @@ bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
bpy.types.register(OBJECT_PT_animation)
+bpy.types.register(OBJECT_PT_properties)
diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py
index c662706743c..d6552585191 100644
--- a/release/scripts/ui/properties_object_constraint.py
+++ b/release/scripts/ui/properties_object_constraint.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class ConstraintButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -29,585 +31,688 @@ class ConstraintButtonsPanel(bpy.types.Panel):
layout = self.layout
box = layout.template_constraint(con)
+ wide_ui = context.region.width > narrowui
if box:
# match enum type to our functions, avoids a lookup table.
- getattr(self, con.type)(context, box, con)
+ getattr(self, con.type)(context, box, con, wide_ui)
# show/key buttons here are most likely obsolete now, with
# keyframing functionality being part of every button
if con.type not in ('RIGID_BODY_JOINT', 'SPLINE_IK', 'NULL'):
- box.itemR(con, "influence")
+ box.prop(con, "influence")
- def space_template(self, layout, con, target=True, owner=True):
+ def space_template(self, layout, con, wide_ui, target=True, owner=True):
if target or owner:
- row = layout.row()
- row.itemL(text="Convert:")
+ split = layout.split(percentage=0.2)
+
+ if wide_ui:
+ split.label(text="Space:")
+ row = split.row()
+ else:
+ row = layout.row()
+
if target:
- row.itemR(con, "target_space", text="")
-
- if target and owner:
- row.itemL(icon='ICON_ARROW_LEFTRIGHT')
+ row.prop(con, "target_space", text="")
+ if wide_ui:
+ if target and owner:
+ row.label(icon='ICON_ARROW_LEFTRIGHT')
+ else:
+ row = layout.row()
if owner:
- row.itemR(con, "owner_space", text="")
+ row.prop(con, "owner_space", text="")
- def target_template(self, layout, con, subtargets=True):
- layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
+ def target_template(self, layout, con, wide_ui, subtargets=True):
+ if wide_ui:
+ layout.prop(con, "target") # XXX limiting settings for only 'curves' or some type of object
+ else:
+ layout.prop(con, "target", text="")
if con.target and subtargets:
if con.target.type == 'ARMATURE':
- layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
+ if wide_ui:
+ layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone")
+ else:
+ layout.prop_object(con, "subtarget", con.target.data, "bones", text="")
- if con.type == 'COPY_LOCATION':
+ if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO'):
row = layout.row()
- row.itemL(text="Head/Tail:")
- row.itemR(con, "head_tail", text="")
+ row.label(text="Head/Tail:")
+ row.prop(con, "head_tail", text="")
elif con.target.type in ('MESH', 'LATTICE'):
- layout.item_pointerR(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
+ layout.prop_object(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
- def ik_template(self, layout, con):
+ def ik_template(self, layout, con, wide_ui):
# only used for iTaSC
- layout.itemR(con, "pole_target")
+ layout.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
- layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
+ layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
- row.itemL()
- row.itemR(con, "pole_angle")
+ row.label()
+ row.prop(con, "pole_angle")
split = layout.split(percentage=0.33)
col = split.column()
- col.itemR(con, "tail")
- col.itemR(con, "stretch")
+ col.prop(con, "tail")
+ col.prop(con, "stretch")
col = split.column()
- col.itemR(con, "chain_length")
- col.itemR(con, "targetless")
+ col.prop(con, "chain_length")
+ col.prop(con, "targetless")
- def CHILD_OF(self, context, layout, con):
- self.target_template(layout, con)
+ def CHILD_OF(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
split = layout.split()
col = split.column()
- col.itemL(text="Location:")
- col.itemR(con, "locationx", text="X")
- col.itemR(con, "locationy", text="Y")
- col.itemR(con, "locationz", text="Z")
+ col.label(text="Location:")
+ col.prop(con, "use_location_x", text="X")
+ col.prop(con, "use_location_y", text="Y")
+ col.prop(con, "use_location_z", text="Z")
col = split.column()
- col.itemL(text="Rotation:")
- col.itemR(con, "rotationx", text="X")
- col.itemR(con, "rotationy", text="Y")
- col.itemR(con, "rotationz", text="Z")
+ col.label(text="Rotation:")
+ col.prop(con, "use_rotation_x", text="X")
+ col.prop(con, "use_rotation_y", text="Y")
+ col.prop(con, "use_rotation_z", text="Z")
col = split.column()
- col.itemL(text="Scale:")
- col.itemR(con, "sizex", text="X")
- col.itemR(con, "sizey", text="Y")
- col.itemR(con, "sizez", text="Z")
+ col.label(text="Scale:")
+ col.prop(con, "use_scale_x", text="X")
+ col.prop(con, "use_scale_y", text="Y")
+ col.prop(con, "use_scale_z", text="Z")
+
+ split = layout.split()
+
+ col = split.column()
+ col.operator("constraint.childof_set_inverse")
+
+ if wide_ui:
+ col = split.column()
+ col.operator("constraint.childof_clear_inverse")
+
+ def TRACK_TO(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
row = layout.row()
- row.itemO("constraint.childof_set_inverse")
- row.itemO("constraint.childof_clear_inverse")
+ if wide_ui:
+ row.label(text="To:")
+ row.prop(con, "track", expand=True)
- def TRACK_TO(self, context, layout, con):
- self.target_template(layout, con)
+ split = layout.split()
- row = layout.row()
- row.itemL(text="To:")
- row.itemR(con, "track", expand=True)
+ col = split.column()
+ col.prop(con, "up", text="Up")
- row = layout.row()
- #row.itemR(con, "up", text="Up", expand=True) # XXX: up and expand don't play nice together
- row.itemR(con, "up", text="Up")
- row.itemR(con, "target_z")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "target_z")
- self.space_template(layout, con)
+ self.space_template(layout, con, wide_ui)
- def IK(self, context, layout, con):
+ def IK(self, context, layout, con, wide_ui):
if context.object.pose.ik_solver == "ITASC":
- layout.itemR(con, "ik_type")
- getattr(self, 'IK_' + con.ik_type)(context, layout, con)
+ layout.prop(con, "ik_type")
+ getattr(self, 'IK_' + con.ik_type)(context, layout, con, wide_ui)
else:
# Legacy IK constraint
- self.target_template(layout, con)
- layout.itemR(con, "pole_target")
-
+ self.target_template(layout, con, wide_ui)
+ if wide_ui:
+ layout.prop(con, "pole_target")
+ else:
+ layout.prop(con, "pole_target", text="")
if con.pole_target and con.pole_target.type == 'ARMATURE':
- layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
+ if wide_ui:
+ layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
+ else:
+ layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="")
if con.pole_target:
row = layout.row()
- row.itemL()
- row.itemR(con, "pole_angle")
+ row.prop(con, "pole_angle")
+ if wide_ui:
+ row.label()
split = layout.split()
col = split.column()
- col.itemR(con, "tail")
- col.itemR(con, "stretch")
+ col.prop(con, "iterations")
+ col.prop(con, "chain_length")
- col = split.column()
- col.itemR(con, "iterations")
- col.itemR(con, "chain_length")
-
- split = layout.split()
- col = split.column()
- col.itemL()
- col.itemR(con, "targetless")
- col.itemR(con, "rotation")
-
- col = split.column()
- col.itemL(text="Weight:")
- col.itemR(con, "weight", text="Position", slider=True)
+ col.label(text="Weight:")
+ col.prop(con, "weight", text="Position", slider=True)
sub = col.column()
- sub.active = con.rotation
- sub.itemR(con, "orient_weight", text="Rotation", slider=True)
+ sub.active = con.use_rotation
+ sub.prop(con, "orient_weight", text="Rotation", slider=True)
- def IK_COPY_POSE(self, context, layout, con):
- self.target_template(layout, con)
- self.ik_template(layout, con)
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_tail")
+ col.prop(con, "use_stretch")
+ col.separator()
+ col.prop(con, "use_target")
+ col.prop(con, "use_rotation")
+
+ def IK_COPY_POSE(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
+ self.ik_template(layout, con, wide_ui)
row = layout.row()
- row.itemL(text="Axis Ref:")
- row.itemR(con, "axis_reference", expand=True)
+ row.label(text="Axis Ref:")
+ row.prop(con, "axis_reference", expand=True)
split = layout.split(percentage=0.33)
- split.row().itemR(con, "position")
+ split.row().prop(con, "position")
row = split.row()
- row.itemR(con, "weight", text="Weight", slider=True)
+ row.prop(con, "weight", text="Weight", slider=True)
row.active = con.position
split = layout.split(percentage=0.33)
row = split.row()
- row.itemL(text="Lock:")
+ row.label(text="Lock:")
row = split.row()
- row.itemR(con, "pos_lock_x", text="X")
- row.itemR(con, "pos_lock_y", text="Y")
- row.itemR(con, "pos_lock_z", text="Z")
- split.active = con.position
+ row.prop(con, "pos_lock_x", text="X")
+ row.prop(con, "pos_lock_y", text="Y")
+ row.prop(con, "pos_lock_z", text="Z")
+ split.active = con.use_position
split = layout.split(percentage=0.33)
- split.row().itemR(con, "rotation")
+ split.row().prop(con, "rotation")
row = split.row()
- row.itemR(con, "orient_weight", text="Weight", slider=True)
- row.active = con.rotation
+ row.prop(con, "orient_weight", text="Weight", slider=True)
+ row.active = con.use_rotation
split = layout.split(percentage=0.33)
row = split.row()
- row.itemL(text="Lock:")
+ row.label(text="Lock:")
row = split.row()
- row.itemR(con, "rot_lock_x", text="X")
- row.itemR(con, "rot_lock_y", text="Y")
- row.itemR(con, "rot_lock_z", text="Z")
- split.active = con.rotation
+ row.prop(con, "rot_lock_x", text="X")
+ row.prop(con, "rot_lock_y", text="Y")
+ row.prop(con, "rot_lock_z", text="Z")
+ split.active = con.use_rotation
- def IK_DISTANCE(self, context, layout, con):
- self.target_template(layout, con)
- self.ik_template(layout, con)
+ def IK_DISTANCE(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
+ self.ik_template(layout, con, wide_ui)
- layout.itemR(con, "limit_mode")
+ layout.prop(con, "limit_mode")
row = layout.row()
- row.itemR(con, "weight", text="Weight", slider=True)
- row.itemR(con, "distance", text="Distance", slider=True)
+ row.prop(con, "weight", text="Weight", slider=True)
+ row.prop(con, "distance", text="Distance", slider=True)
- def FOLLOW_PATH(self, context, layout, con):
- self.target_template(layout, con)
+ def FOLLOW_PATH(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
split = layout.split()
col = split.column()
- col.itemR(con, "use_curve_follow")
- col.itemR(con, "use_curve_radius")
+ col.prop(con, "use_curve_follow")
+ col.prop(con, "use_curve_radius")
- col = split.column()
- col.itemR(con, "use_fixed_position")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_fixed_position")
if con.use_fixed_position:
- col.itemR(con, "offset_factor", text="Offset")
+ col.prop(con, "offset_factor", text="Offset")
else:
- col.itemR(con, "offset")
+ col.prop(con, "offset")
row = layout.row()
- row.itemL(text="Forward:")
- row.itemR(con, "forward", expand=True)
+ if wide_ui:
+ row.label(text="Forward:")
+ row.prop(con, "forward", expand=True)
row = layout.row()
- row.itemR(con, "up", text="Up")
- row.itemL()
+ row.prop(con, "up", text="Up")
+ if wide_ui:
+ row.label()
- def LIMIT_ROTATION(self, context, layout, con):
+ def LIMIT_ROTATION(self, context, layout, con, wide_ui):
split = layout.split()
- col = split.column()
- col.itemR(con, "use_limit_x")
+ col = split.column(align=True)
+ col.prop(con, "use_limit_x")
sub = col.column()
sub.active = con.use_limit_x
- sub.itemR(con, "minimum_x", text="Min")
- sub.itemR(con, "maximum_x", text="Max")
+ sub.prop(con, "minimum_x", text="Min")
+ sub.prop(con, "maximum_x", text="Max")
- col = split.column()
- col.itemR(con, "use_limit_y")
+ if wide_ui:
+ col = split.column(align=True)
+ col.prop(con, "use_limit_y")
sub = col.column()
sub.active = con.use_limit_y
- sub.itemR(con, "minimum_y", text="Min")
- sub.itemR(con, "maximum_y", text="Max")
+ sub.prop(con, "minimum_y", text="Min")
+ sub.prop(con, "maximum_y", text="Max")
- col = split.column()
- col.itemR(con, "use_limit_z")
+ if wide_ui:
+ col = split.column(align=True)
+ col.prop(con, "use_limit_z")
sub = col.column()
sub.active = con.use_limit_z
- sub.itemR(con, "minimum_z", text="Min")
- sub.itemR(con, "maximum_z", text="Max")
+ sub.prop(con, "minimum_z", text="Min")
+ sub.prop(con, "maximum_z", text="Max")
row = layout.row()
- row.itemR(con, "limit_transform")
- row.itemL()
+ row.prop(con, "limit_transform")
+ if wide_ui:
+ row.label()
row = layout.row()
- row.itemL(text="Convert:")
- row.itemR(con, "owner_space", text="")
+ if wide_ui:
+ row.label(text="Convert:")
+ row.prop(con, "owner_space", text="")
- def LIMIT_LOCATION(self, context, layout, con):
+ def LIMIT_LOCATION(self, context, layout, con, wide_ui):
split = layout.split()
col = split.column()
- col.itemR(con, "use_minimum_x")
+ col.prop(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
- sub.itemR(con, "minimum_x", text="")
- col.itemR(con, "use_maximum_x")
+ sub.prop(con, "minimum_x", text="")
+ col.prop(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
- sub.itemR(con, "maximum_x", text="")
+ sub.prop(con, "maximum_x", text="")
- col = split.column()
- col.itemR(con, "use_minimum_y")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
- sub.itemR(con, "minimum_y", text="")
- col.itemR(con, "use_maximum_y")
+ sub.prop(con, "minimum_y", text="")
+ col.prop(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
- sub.itemR(con, "maximum_y", text="")
+ sub.prop(con, "maximum_y", text="")
- col = split.column()
- col.itemR(con, "use_minimum_z")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
- sub.itemR(con, "minimum_z", text="")
- col.itemR(con, "use_maximum_z")
+ sub.prop(con, "minimum_z", text="")
+ col.prop(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
- sub.itemR(con, "maximum_z", text="")
+ sub.prop(con, "maximum_z", text="")
row = layout.row()
- row.itemR(con, "limit_transform")
- row.itemL()
+ row.prop(con, "limit_transform")
+ if wide_ui:
+ row.label()
row = layout.row()
- row.itemL(text="Convert:")
- row.itemR(con, "owner_space", text="")
+ if wide_ui:
+ row.label(text="Convert:")
+ row.prop(con, "owner_space", text="")
- def LIMIT_SCALE(self, context, layout, con):
+ def LIMIT_SCALE(self, context, layout, con, wide_ui):
split = layout.split()
col = split.column()
- col.itemR(con, "use_minimum_x")
+ col.prop(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
- sub.itemR(con, "minimum_x", text="")
- col.itemR(con, "use_maximum_x")
+ sub.prop(con, "minimum_x", text="")
+ col.prop(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
- sub.itemR(con, "maximum_x", text="")
+ sub.prop(con, "maximum_x", text="")
- col = split.column()
- col.itemR(con, "use_minimum_y")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
- sub.itemR(con, "minimum_y", text="")
- col.itemR(con, "use_maximum_y")
+ sub.prop(con, "minimum_y", text="")
+ col.prop(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
- sub.itemR(con, "maximum_y", text="")
+ sub.prop(con, "maximum_y", text="")
- col = split.column()
- col.itemR(con, "use_minimum_z")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
- sub.itemR(con, "minimum_z", text="")
- col.itemR(con, "use_maximum_z")
+ sub.prop(con, "minimum_z", text="")
+ col.prop(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
- sub.itemR(con, "maximum_z", text="")
+ sub.prop(con, "maximum_z", text="")
row = layout.row()
- row.itemR(con, "limit_transform")
- row.itemL()
+ row.prop(con, "limit_transform")
+ if wide_ui:
+ row.label()
row = layout.row()
- row.itemL(text="Convert:")
- row.itemR(con, "owner_space", text="")
+ if wide_ui:
+ row.label(text="Convert:")
+ row.prop(con, "owner_space", text="")
- def COPY_ROTATION(self, context, layout, con):
- self.target_template(layout, con)
+ def COPY_ROTATION(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
split = layout.split()
col = split.column()
- col.itemR(con, "rotate_like_x", text="X")
+ col.prop(con, "use_x", text="X")
sub = col.column()
- sub.active = con.rotate_like_x
- sub.itemR(con, "invert_x", text="Invert")
+ sub.active = con.use_x
+ sub.prop(con, "invert_x", text="Invert")
col = split.column()
- col.itemR(con, "rotate_like_y", text="Y")
+ col.prop(con, "use_y", text="Y")
sub = col.column()
- sub.active = con.rotate_like_y
- sub.itemR(con, "invert_y", text="Invert")
+ sub.active = con.use_y
+ sub.prop(con, "invert_y", text="Invert")
col = split.column()
- col.itemR(con, "rotate_like_z", text="Z")
+ col.prop(con, "use_z", text="Z")
sub = col.column()
- sub.active = con.rotate_like_z
- sub.itemR(con, "invert_z", text="Invert")
+ sub.active = con.use_z
+ sub.prop(con, "invert_z", text="Invert")
- layout.itemR(con, "offset")
+ layout.prop(con, "use_offset")
- self.space_template(layout, con)
+ self.space_template(layout, con, wide_ui)
- def COPY_LOCATION(self, context, layout, con):
- self.target_template(layout, con)
+ def COPY_LOCATION(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
split = layout.split()
col = split.column()
- col.itemR(con, "locate_like_x", text="X")
+ col.prop(con, "use_x", text="X")
sub = col.column()
- sub.active = con.locate_like_x
- sub.itemR(con, "invert_x", text="Invert")
+ sub.active = con.use_x
+ sub.prop(con, "invert_x", text="Invert")
col = split.column()
- col.itemR(con, "locate_like_y", text="Y")
+ col.prop(con, "use_y", text="Y")
sub = col.column()
- sub.active = con.locate_like_y
- sub.itemR(con, "invert_y", text="Invert")
+ sub.active = con.use_y
+ sub.prop(con, "invert_y", text="Invert")
col = split.column()
- col.itemR(con, "locate_like_z", text="Z")
+ col.prop(con, "use_z", text="Z")
sub = col.column()
- sub.active = con.locate_like_z
- sub.itemR(con, "invert_z", text="Invert")
+ sub.active = con.use_z
+ sub.prop(con, "invert_z", text="Invert")
- layout.itemR(con, "offset")
+ layout.prop(con, "use_offset")
- self.space_template(layout, con)
+ self.space_template(layout, con, wide_ui)
- def COPY_SCALE(self, context, layout, con):
- self.target_template(layout, con)
+ def COPY_SCALE(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
row = layout.row(align=True)
- row.itemR(con, "size_like_x", text="X")
- row.itemR(con, "size_like_y", text="Y")
- row.itemR(con, "size_like_z", text="Z")
+ row.prop(con, "use_x", text="X")
+ row.prop(con, "use_y", text="Y")
+ row.prop(con, "use_z", text="Z")
- layout.itemR(con, "offset")
+ layout.prop(con, "use_offset")
- self.space_template(layout, con)
+ self.space_template(layout, con, wide_ui)
#def SCRIPT(self, context, layout, con):
- def ACTION(self, context, layout, con):
- self.target_template(layout, con)
+ def ACTION(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
- layout.itemR(con, "action")
- layout.itemR(con, "transform_channel")
+ if wide_ui:
+ layout.prop(con, "action")
+ else:
+ layout.prop(con, "action", text="")
+
+ if wide_ui:
+ layout.prop(con, "transform_channel")
+ else:
+ layout.prop(con, "transform_channel", text="")
split = layout.split()
col = split.column(align=True)
- col.itemR(con, "start_frame", text="Start")
- col.itemR(con, "end_frame", text="End")
+ col.label(text="Action Length:")
+ col.prop(con, "start_frame", text="Start")
+ col.prop(con, "end_frame", text="End")
- col = split.column(align=True)
- col.itemR(con, "minimum", text="Min")
- col.itemR(con, "maximum", text="Max")
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Target Range:")
+ col.prop(con, "minimum", text="Min")
+ col.prop(con, "maximum", text="Max")
row = layout.row()
- row.itemL(text="Convert:")
- row.itemR(con, "target_space", text="")
+ if wide_ui:
+ row.label(text="Convert:")
+ row.prop(con, "target_space", text="")
- def LOCKED_TRACK(self, context, layout, con):
- self.target_template(layout, con)
+ def LOCKED_TRACK(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
row = layout.row()
- row.itemL(text="To:")
- row.itemR(con, "track", expand=True)
+ if wide_ui:
+ row.label(text="To:")
+ row.prop(con, "track", expand=True)
row = layout.row()
- row.itemL(text="Lock:")
- row.itemR(con, "locked", expand=True)
+ if wide_ui:
+ row.label(text="Lock:")
+ row.prop(con, "locked", expand=True)
- def LIMIT_DISTANCE(self, context, layout, con):
- self.target_template(layout, con)
+ def LIMIT_DISTANCE(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
col = layout.column(align=True)
- col.itemR(con, "distance")
- col.itemO("constraint.limitdistance_reset")
+ col.prop(con, "distance")
+ col.operator("constraint.limitdistance_reset")
row = layout.row()
- row.itemL(text="Clamp Region:")
- row.itemR(con, "limit_mode", text="")
+ row.label(text="Clamp Region:")
+ row.prop(con, "limit_mode", text="")
- def STRETCH_TO(self, context, layout, con):
- self.target_template(layout, con)
+ def STRETCH_TO(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
- row = layout.row()
- row.itemR(con, "original_length", text="Rest Length")
- row.itemO("constraint.stretchto_reset", text="Reset")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(con, "original_length", text="Rest Length")
+
+ if wide_ui:
+ col = split.column()
+ col.operator("constraint.stretchto_reset", text="Reset")
col = layout.column()
- col.itemR(con, "bulge", text="Volume Variation")
+ col.prop(con, "bulge", text="Volume Variation")
row = layout.row()
- row.itemL(text="Volume:")
- row.itemR(con, "volume", expand=True)
- row.itemL(text="Plane:")
- row.itemR(con, "keep_axis", expand=True)
+ if wide_ui:
+ row.label(text="Volume:")
+ row.prop(con, "volume", expand=True)
+ if not wide_ui:
+ row = layout.row()
+ row.label(text="Plane:")
+ row.prop(con, "keep_axis", expand=True)
- def FLOOR(self, context, layout, con):
- self.target_template(layout, con)
+ def FLOOR(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(con, "sticky")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "use_rotation")
+
+ layout.prop(con, "offset")
row = layout.row()
- row.itemR(con, "sticky")
- row.itemR(con, "use_rotation")
+ if wide_ui:
+ row.label(text="Min/Max:")
+ row.prop(con, "floor_location", expand=True)
- layout.itemR(con, "offset")
+ def RIGID_BODY_JOINT(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
- row = layout.row()
- row.itemL(text="Min/Max:")
- row.itemR(con, "floor_location", expand=True)
+ if wide_ui:
+ layout.prop(con, "pivot_type")
+ else:
+ layout.prop(con, "pivot_type", text="")
+ if wide_ui:
+ layout.prop(con, "child")
+ else:
+ layout.prop(con, "child", text="")
- def RIGID_BODY_JOINT(self, context, layout, con):
- self.target_template(layout, con)
+ split = layout.split()
- layout.itemR(con, "pivot_type")
- layout.itemR(con, "child")
+ col = split.column()
+ col.prop(con, "disable_linked_collision", text="No Collision")
- row = layout.row()
- row.itemR(con, "disable_linked_collision", text="No Collision")
- row.itemR(con, "draw_pivot", text="Display Pivot")
+ if wide_ui:
+ col = split.column()
+ col.prop(con, "draw_pivot", text="Display Pivot")
split = layout.split()
col = split.column(align=True)
- col.itemL(text="Pivot:")
- col.itemR(con, "pivot_x", text="X")
- col.itemR(con, "pivot_y", text="Y")
- col.itemR(con, "pivot_z", text="Z")
+ col.label(text="Pivot:")
+ col.prop(con, "pivot_x", text="X")
+ col.prop(con, "pivot_y", text="Y")
+ col.prop(con, "pivot_z", text="Z")
- col = split.column(align=True)
- col.itemL(text="Axis:")
- col.itemR(con, "axis_x", text="X")
- col.itemR(con, "axis_y", text="Y")
- col.itemR(con, "axis_z", text="Z")
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Axis:")
+ col.prop(con, "axis_x", text="X")
+ col.prop(con, "axis_y", text="Y")
+ col.prop(con, "axis_z", text="Z")
#Missing: Limit arrays (not wrapped in RNA yet)
- def CLAMP_TO(self, context, layout, con):
- self.target_template(layout, con)
+ def CLAMP_TO(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
row = layout.row()
- row.itemL(text="Main Axis:")
- row.itemR(con, "main_axis", expand=True)
+ if wide_ui:
+ row.label(text="Main Axis:")
+ row.prop(con, "main_axis", expand=True)
row = layout.row()
- row.itemR(con, "cyclic")
+ row.prop(con, "cyclic")
- def TRANSFORM(self, context, layout, con):
- self.target_template(layout, con)
+ def TRANSFORM(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
- layout.itemR(con, "extrapolate_motion", text="Extrapolate")
+ layout.prop(con, "extrapolate_motion", text="Extrapolate")
+
+ col = layout.column()
+ col.row().label(text="Source:")
+ col.row().prop(con, "map_from", expand=True)
+
+ split = layout.split()
+
+ sub = split.column(align=True)
+ sub.label(text="X:")
+ sub.prop(con, "from_min_x", text="Min")
+ sub.prop(con, "from_max_x", text="Max")
+
+ if wide_ui:
+ sub = split.column(align=True)
+ sub.label(text="Y:")
+ sub.prop(con, "from_min_y", text="Min")
+ sub.prop(con, "from_max_y", text="Max")
+
+ if wide_ui:
+ sub = split.column(align=True)
+ sub.label(text="Z:")
+ sub.prop(con, "from_min_z", text="Min")
+ sub.prop(con, "from_max_z", text="Max")
split = layout.split()
col = split.column()
- col.itemL(text="Source:")
- col.row().itemR(con, "map_from", expand=True)
-
- sub = col.row(align=True)
- sub.itemL(text="X:")
- sub.itemR(con, "from_min_x", text="")
- sub.itemR(con, "from_max_x", text="")
-
- sub = col.row(align=True)
- sub.itemL(text="Y:")
- sub.itemR(con, "from_min_y", text="")
- sub.itemR(con, "from_max_y", text="")
-
- sub = col.row(align=True)
- sub.itemL(text="Z:")
- sub.itemR(con, "from_min_z", text="")
- sub.itemR(con, "from_max_z", text="")
+ col.label(text="Destination:")
+ col.row().prop(con, "map_to", expand=True)
split = layout.split()
col = split.column()
- col.itemL(text="Destination:")
- col.row().itemR(con, "map_to", expand=True)
+ col.label(text="X:")
+ col.row().prop(con, "map_to_x_from", expand=True)
- sub = col.row(align=True)
- sub.itemR(con, "map_to_x_from", text="")
- sub.itemR(con, "to_min_x", text="")
- sub.itemR(con, "to_max_x", text="")
+ sub = col.column(align=True)
+ sub.prop(con, "to_min_x", text="Min")
+ sub.prop(con, "to_max_x", text="Max")
- sub = col.row(align=True)
- sub.itemR(con, "map_to_y_from", text="")
- sub.itemR(con, "to_min_y", text="")
- sub.itemR(con, "to_max_y", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Y:")
+ col.row().prop(con, "map_to_y_from", expand=True)
- sub = col.row(align=True)
- sub.itemR(con, "map_to_z_from", text="")
- sub.itemR(con, "to_min_z", text="")
- sub.itemR(con, "to_max_z", text="")
+ sub = col.column(align=True)
+ sub.prop(con, "to_min_y", text="Min")
+ sub.prop(con, "to_max_y", text="Max")
- self.space_template(layout, con)
+ if wide_ui:
+ col = split.column()
+ col.label(text="Z:")
+ col.row().prop(con, "map_to_z_from", expand=True)
- def SHRINKWRAP(self, context, layout, con):
- self.target_template(layout, con)
+ sub = col.column(align=True)
+ sub.prop(con, "to_min_z", text="Min")
+ sub.prop(con, "to_max_z", text="Max")
- layout.itemR(con, "distance")
- layout.itemR(con, "shrinkwrap_type")
+ self.space_template(layout, con, wide_ui)
+
+ def SHRINKWRAP(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
+
+ layout.prop(con, "distance")
+ layout.prop(con, "shrinkwrap_type")
if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)
- row.itemR(con, "axis_x")
- row.itemR(con, "axis_y")
- row.itemR(con, "axis_z")
+ row.prop(con, "use_x")
+ row.prop(con, "use_y")
+ row.prop(con, "use_z")
- def DAMPED_TRACK(self, context, layout, con):
- self.target_template(layout, con)
+ def DAMPED_TRACK(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
row = layout.row()
- row.itemL(text="To:")
- row.itemR(con, "track", expand=True)
+ if wide_ui:
+ row.label(text="To:")
+ row.prop(con, "track", expand=True)
- def SPLINE_IK(self, context, layout, con):
- self.target_template(layout, con)
+ def SPLINE_IK(self, context, layout, con, wide_ui):
+ self.target_template(layout, con, wide_ui)
col = layout.column()
- col.itemL(text="Spline Fitting:")
- col.itemR(con, "chain_length")
- col.itemR(con, "even_divisions")
- #col.itemR(con, "affect_root") # XXX: this is not that useful yet
+ col.label(text="Spline Fitting:")
+ col.prop(con, "chain_length")
+ col.prop(con, "even_divisions")
+ col.prop(con, "chain_offset")
col = layout.column()
- col.itemL(text="Chain Scaling:")
- col.itemR(con, "keep_max_length")
- col.itemR(con, "xz_scaling_mode")
+ col.label(text="Chain Scaling:")
+ col.prop(con, "y_stretch")
+ if wide_ui:
+ col.prop(con, "xz_scaling_mode")
+ else:
+ col.prop(con, "xz_scaling_mode", text="")
+ col.prop(con, "use_curve_radius")
class OBJECT_PT_constraints(ConstraintButtonsPanel):
@@ -620,10 +725,12 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
+ wide_ui = context.region.width > narrowui
row = layout.row()
- row.item_menu_enumO("object.constraint_add", "type")
- row.itemL()
+ row.operator_menu_enum("object.constraint_add", "type")
+ if wide_ui:
+ row.label()
for con in ob.constraints:
self.draw_constraint(context, con)
@@ -639,7 +746,7 @@ class BONE_PT_inverse_kinematics(ConstraintButtonsPanel):
bone = context.bone
if ob and bone:
- pchan = ob.pose.pose_channels[bone.name]
+ pchan = ob.pose.bones[bone.name]
return pchan.has_ik
return False
@@ -649,67 +756,84 @@ class BONE_PT_inverse_kinematics(ConstraintButtonsPanel):
ob = context.object
bone = context.bone
- pchan = ob.pose.pose_channels[bone.name]
+ pchan = ob.pose.bones[bone.name]
+ wide_ui = context.region.width > narrowui
row = layout.row()
- row.itemR(ob.pose, "ik_solver")
+ row.prop(ob.pose, "ik_solver")
split = layout.split(percentage=0.25)
- split.itemR(pchan, "ik_dof_x", text="X")
+ split.prop(pchan, "ik_dof_x", text="X")
row = split.row()
- row.itemR(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
+ row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.ik_dof_x
- split = layout.split(percentage=0.25)
- row = split.row()
- row.itemR(pchan, "ik_limit_x", text="Limit")
- row.active = pchan.ik_dof_x
- row = split.row(align=True)
- row.itemR(pchan, "ik_min_x", text="")
- row.itemR(pchan, "ik_max_x", text="")
- row.active = pchan.ik_dof_x and pchan.ik_limit_x
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_x", text="Limit")
+ sub.active = pchan.ik_dof_x
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_x", text="")
+ sub.prop(pchan, "ik_max_x", text="")
+ sub.active = pchan.ik_dof_x and pchan.ik_limit_x
split = layout.split(percentage=0.25)
- split.itemR(pchan, "ik_dof_y", text="Y")
+ split.prop(pchan, "ik_dof_y", text="Y")
row = split.row()
- row.itemR(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
+ row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.ik_dof_y
- split = layout.split(percentage=0.25)
- row = split.row()
- row.itemR(pchan, "ik_limit_y", text="Limit")
- row.active = pchan.ik_dof_y
- row = split.row(align=True)
- row.itemR(pchan, "ik_min_y", text="")
- row.itemR(pchan, "ik_max_y", text="")
- row.active = pchan.ik_dof_y and pchan.ik_limit_y
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_y", text="Limit")
+ sub.active = pchan.ik_dof_y
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_y", text="")
+ sub.prop(pchan, "ik_max_y", text="")
+ sub.active = pchan.ik_dof_y and pchan.ik_limit_y
split = layout.split(percentage=0.25)
- split.itemR(pchan, "ik_dof_z", text="Z")
- row = split.row()
- row.itemR(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
- row.active = pchan.ik_dof_z
+ split.prop(pchan, "ik_dof_z", text="Z")
+ sub = split.row()
+ sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
+ sub.active = pchan.ik_dof_z
- split = layout.split(percentage=0.25)
- row = split.row()
- row.itemR(pchan, "ik_limit_z", text="Limit")
- row.active = pchan.ik_dof_z
- row = split.row(align=True)
- row.itemR(pchan, "ik_min_z", text="")
- row.itemR(pchan, "ik_max_z", text="")
- row.active = pchan.ik_dof_z and pchan.ik_limit_z
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_z", text="Limit")
+ sub.active = pchan.ik_dof_z
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_z", text="")
+ sub.prop(pchan, "ik_max_z", text="")
+ sub.active = pchan.ik_dof_z and pchan.ik_limit_z
split = layout.split()
- split.itemR(pchan, "ik_stretch", text="Stretch", slider=True)
- split.itemL()
+ split.prop(pchan, "ik_stretch", text="Stretch", slider=True)
+ if wide_ui:
+ split.label()
if ob.pose.ik_solver == 'ITASC':
- row = layout.row()
- row.itemR(pchan, "ik_rot_control", text="Control Rotation")
- row.itemR(pchan, "ik_rot_weight", text="Weight", slider=True)
+ split = layout.split()
+ col = split.column()
+ col.prop(pchan, "ik_rot_control", text="Control Rotation")
+ if wide_ui:
+ col = split.column()
+ col.prop(pchan, "ik_rot_weight", text="Weight", slider=True)
# not supported yet
#row = layout.row()
- #row.itemR(pchan, "ik_lin_control", text="Joint Size")
- #row.itemR(pchan, "ik_lin_weight", text="Weight", slider=True)
+ #row.prop(pchan, "ik_lin_control", text="Joint Size")
+ #row.prop(pchan, "ik_lin_weight", text="Weight", slider=True)
class BONE_PT_iksolver_itasc(ConstraintButtonsPanel):
@@ -722,7 +846,7 @@ class BONE_PT_iksolver_itasc(ConstraintButtonsPanel):
bone = context.bone
if ob and bone:
- pchan = ob.pose.pose_channels[bone.name]
+ pchan = ob.pose.bones[bone.name]
return pchan.has_ik and ob.pose.ik_solver == 'ITASC' and ob.pose.ik_param
return False
@@ -732,35 +856,41 @@ class BONE_PT_iksolver_itasc(ConstraintButtonsPanel):
ob = context.object
itasc = ob.pose.ik_param
+ wide_ui = context.region.width > narrowui
- layout.itemR(itasc, "mode", expand=True)
+ layout.prop(itasc, "mode", expand=True)
simulation = itasc.mode == 'SIMULATION'
if simulation:
- layout.itemL(text="Reiteration:")
- layout.itemR(itasc, "reiteration", expand=True)
+ layout.label(text="Reiteration:")
+ layout.prop(itasc, "reiteration", expand=True)
+
+ split = layout.split()
+ split.active = not simulation or itasc.reiteration != 'NEVER'
+ col = split.column()
+ col.prop(itasc, "precision")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(itasc, "num_iter")
- flow = layout.column_flow()
- flow.itemR(itasc, "precision", text="Prec")
- flow.itemR(itasc, "num_iter", text="Iter")
- flow.active = not simulation or itasc.reiteration != 'NEVER'
if simulation:
- layout.itemR(itasc, "auto_step")
+ layout.prop(itasc, "auto_step")
row = layout.row()
if itasc.auto_step:
- row.itemR(itasc, "min_step", text="Min")
- row.itemR(itasc, "max_step", text="Max")
+ row.prop(itasc, "min_step", text="Min")
+ row.prop(itasc, "max_step", text="Max")
else:
- row.itemR(itasc, "num_step")
+ row.prop(itasc, "num_step")
- layout.itemR(itasc, "solver")
+ layout.prop(itasc, "solver")
if simulation:
- layout.itemR(itasc, "feedback")
- layout.itemR(itasc, "max_velocity")
+ layout.prop(itasc, "feedback")
+ layout.prop(itasc, "max_velocity")
if itasc.solver == 'DLS':
row = layout.row()
- row.itemR(itasc, "dampmax", text="Damp", slider=True)
- row.itemR(itasc, "dampeps", text="Eps", slider=True)
+ row.prop(itasc, "dampmax", text="Damp", slider=True)
+ row.prop(itasc, "dampeps", text="Eps", slider=True)
class BONE_PT_constraints(ConstraintButtonsPanel):
@@ -775,11 +905,13 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
layout = self.layout
ob = context.object
- pchan = ob.pose.pose_channels[context.bone.name]
+ pchan = ob.pose.bones[context.bone.name]
+ wide_ui = context.region.width > narrowui
row = layout.row()
- row.item_menu_enumO("pose.constraint_add", "type")
- row.itemL()
+ row.operator_menu_enum("pose.constraint_add", "type")
+ if wide_ui:
+ row.label()
for con in pchan.constraints:
self.draw_constraint(context, con)
diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py
index e9cc541c807..d95455f7c10 100644
--- a/release/scripts/ui/properties_particle.py
+++ b/release/scripts/ui/properties_particle.py
@@ -26,14 +26,14 @@ from properties_physics_common import basic_force_field_falloff_ui
def particle_panel_enabled(context, psys):
- return psys.point_cache.baked == False and psys.edited == False and (not context.particle_system_editable)
+ return (psys.point_cache.baked is False) and (not psys.edited) and (not context.particle_system_editable)
def particle_panel_poll(context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
@@ -66,68 +66,68 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
col = row.column(align=True)
- col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="")
- col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("object.particle_system_add", icon='ICON_ZOOMIN', text="")
+ col.operator("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
if psys and not psys.settings:
split = layout.split(percentage=0.32)
col = split.column()
- col.itemL(text="Name:")
- col.itemL(text="Settings:")
+ col.label(text="Name:")
+ col.label(text="Settings:")
col = split.column()
- col.itemR(psys, "name", text="")
+ col.prop(psys, "name", text="")
col.template_ID(psys, "settings", new="particle.new")
elif psys:
part = psys.settings
split = layout.split(percentage=0.32)
col = split.column()
- col.itemL(text="Name:")
+ col.label(text="Name:")
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
- col.itemL(text="Settings:")
- col.itemL(text="Type:")
+ col.label(text="Settings:")
+ col.label(text="Type:")
col = split.column()
- col.itemR(psys, "name", text="")
+ col.prop(psys, "name", text="")
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
col.template_ID(psys, "settings", new="particle.new")
#row = layout.row()
- #row.itemL(text="Viewport")
- #row.itemL(text="Render")
+ #row.label(text="Viewport")
+ #row.label(text="Render")
if part:
if part.type not in ('EMITTER', 'REACTOR', 'HAIR'):
- layout.itemL(text="No settings for fluid particles")
+ layout.label(text="No settings for fluid particles")
return
row = col.row()
row.enabled = particle_panel_enabled(context, psys)
- row.itemR(part, "type", text="")
- row.itemR(psys, "seed")
+ row.prop(part, "type", text="")
+ row.prop(psys, "seed")
split = layout.split(percentage=0.65)
if part.type == 'HAIR':
- if psys.edited == True:
- split.itemO("particle.edited_clear", text="Free Edit")
+ if psys.edited:
+ split.operator("particle.edited_clear", text="Free Edit")
else:
- split.itemL(text="")
+ split.label(text="")
row = split.row()
row.enabled = particle_panel_enabled(context, psys)
- row.itemR(part, "hair_step")
- if psys.edited == True:
+ row.prop(part, "hair_step")
+ if psys.edited:
if psys.global_hair:
- layout.itemO("particle.connect_hair")
- layout.itemL(text="Hair is disconnected.")
+ layout.operator("particle.connect_hair")
+ layout.label(text="Hair is disconnected.")
else:
- layout.itemO("particle.disconnect_hair")
- layout.itemL(text="")
+ layout.operator("particle.disconnect_hair")
+ layout.label(text="")
elif part.type == 'REACTOR':
split.enabled = particle_panel_enabled(context, psys)
- split.itemR(psys, "reactor_target_object")
- split.itemR(psys, "reactor_target_particle_system", text="Particle System")
+ split.prop(psys, "reactor_target_object")
+ split.prop(psys, "reactor_target_particle_system", text="Particle System")
class PARTICLE_PT_emission(ParticleButtonsPanel):
@@ -149,39 +149,39 @@ class PARTICLE_PT_emission(ParticleButtonsPanel):
row = layout.row()
row.active = part.distribution != 'GRID'
- row.itemR(part, "amount")
+ row.prop(part, "amount")
if part.type != 'HAIR':
split = layout.split()
col = split.column(align=True)
- col.itemR(part, "start")
- col.itemR(part, "end")
+ col.prop(part, "start")
+ col.prop(part, "end")
col = split.column(align=True)
- col.itemR(part, "lifetime")
- col.itemR(part, "random_lifetime", slider=True)
+ col.prop(part, "lifetime")
+ col.prop(part, "random_lifetime", slider=True)
- layout.row().itemL(text="Emit From:")
+ layout.row().label(text="Emit From:")
row = layout.row()
- row.itemR(part, "emit_from", expand=True)
+ row.prop(part, "emit_from", expand=True)
row = layout.row()
- row.itemR(part, "trand")
+ row.prop(part, "trand")
if part.distribution != 'GRID':
- row.itemR(part, "even_distribution")
+ row.prop(part, "even_distribution")
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
row = layout.row()
- row.itemR(part, "distribution", expand=True)
+ row.prop(part, "distribution", expand=True)
row = layout.row()
if part.distribution == 'JIT':
- row.itemR(part, "userjit", text="Particles/Face")
- row.itemR(part, "jitter_factor", text="Jittering Amount", slider=True)
+ row.prop(part, "userjit", text="Particles/Face")
+ row.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
elif part.distribution == 'GRID':
- row.itemR(part, "grid_resolution")
+ row.prop(part, "grid_resolution")
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
@@ -190,9 +190,9 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
def poll(self, context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
return psys.settings.type == 'HAIR'
@@ -200,15 +200,15 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
#cloth = context.cloth.collision_settings
#self.layout.active = cloth_panel_enabled(context.cloth)
- #self.layout.itemR(cloth, "enable_collision", text="")
+ #self.layout.prop(cloth, "enable_collision", text="")
psys = context.particle_system
- self.layout.itemR(psys, "hair_dynamics", text="")
+ self.layout.prop(psys, "hair_dynamics", text="")
def draw(self, context):
layout = self.layout
psys = context.particle_system
- part = psys.settings
+ #part = psys.settings
cloth = psys.cloth.settings
layout.enabled = psys.hair_dynamics
@@ -216,22 +216,22 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Material:")
+ col.label(text="Material:")
sub = col.column(align=True)
- sub.itemR(cloth, "pin_stiffness", text="Stiffness")
- sub.itemR(cloth, "mass")
- sub.itemR(cloth, "bending_stiffness", text="Bending")
- sub.itemR(cloth, "internal_friction", slider="True")
+ sub.prop(cloth, "pin_stiffness", text="Stiffness")
+ sub.prop(cloth, "mass")
+ sub.prop(cloth, "bending_stiffness", text="Bending")
+ sub.prop(cloth, "internal_friction", slider=True)
col = split.column()
- col.itemL(text="Damping:")
+ col.label(text="Damping:")
sub = col.column(align=True)
- sub.itemR(cloth, "spring_damping", text="Spring")
- sub.itemR(cloth, "air_damping", text="Air")
+ sub.prop(cloth, "spring_damping", text="Spring")
+ sub.prop(cloth, "air_damping", text="Air")
- col.itemL(text="Quality:")
- col.itemR(cloth, "quality", text="Steps", slider=True)
+ col.label(text="Quality:")
+ col.prop(cloth, "quality", text="Steps", slider=True)
class PARTICLE_PT_cache(ParticleButtonsPanel):
@@ -240,9 +240,9 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
def poll(self, context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
phystype = psys.settings.physics_type
if phystype == 'NO' or phystype == 'KEYED':
@@ -250,11 +250,10 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
def draw(self, context):
- layout = self.layout
psys = context.particle_system
- point_cache_ui(self, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
+ point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
class PARTICLE_PT_velocity(ParticleButtonsPanel):
@@ -278,29 +277,29 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel):
split = layout.split()
sub = split.column()
- sub.itemL(text="Emitter Geometry:")
- sub.itemR(part, "normal_factor")
+ sub.label(text="Emitter Geometry:")
+ sub.prop(part, "normal_factor")
subsub = sub.column(align=True)
- subsub.itemR(part, "tangent_factor")
- subsub.itemR(part, "tangent_phase", slider=True)
+ subsub.prop(part, "tangent_factor")
+ subsub.prop(part, "tangent_phase", slider=True)
sub = split.column()
- sub.itemL(text="Emitter Object")
- sub.itemR(part, "object_aligned_factor", text="")
+ sub.label(text="Emitter Object")
+ sub.prop(part, "object_aligned_factor", text="")
- layout.row().itemL(text="Other:")
+ layout.row().label(text="Other:")
split = layout.split()
sub = split.column()
if part.emit_from == 'PARTICLE':
- sub.itemR(part, "particle_factor")
+ sub.prop(part, "particle_factor")
else:
- sub.itemR(part, "object_factor", slider=True)
+ sub.prop(part, "object_factor", slider=True)
sub = split.column()
- sub.itemR(part, "random_factor")
+ sub.prop(part, "random_factor")
#if part.type=='REACTOR':
- # sub.itemR(part, "reactor_factor")
- # sub.itemR(part, "reaction_shape", slider=True)
+ # sub.prop(part, "reactor_factor")
+ # sub.prop(part, "reaction_shape", slider=True)
class PARTICLE_PT_rotation(ParticleButtonsPanel):
@@ -322,25 +321,25 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel):
layout.enabled = particle_panel_enabled(context, psys)
split = layout.split()
- split.itemL(text="Initial Rotation:")
- split.itemR(part, "rotation_dynamic")
+ split.label(text="Initial Rotation:")
+ split.prop(part, "rotation_dynamic")
split = layout.split()
sub = split.column(align=True)
- sub.itemR(part, "rotation_mode", text="")
- sub.itemR(part, "random_rotation_factor", slider=True, text="Random")
+ sub.prop(part, "rotation_mode", text="")
+ sub.prop(part, "random_rotation_factor", slider=True, text="Random")
sub = split.column(align=True)
- sub.itemR(part, "phase_factor", slider=True)
- sub.itemR(part, "random_phase_factor", text="Random", slider=True)
+ sub.prop(part, "phase_factor", slider=True)
+ sub.prop(part, "random_phase_factor", text="Random", slider=True)
- layout.row().itemL(text="Angular Velocity:")
- layout.row().itemR(part, "angular_velocity_mode", expand=True)
+ layout.row().label(text="Angular Velocity:")
+ layout.row().prop(part, "angular_velocity_mode", expand=True)
split = layout.split()
sub = split.column()
- sub.itemR(part, "angular_velocity_factor", text="")
+ sub.prop(part, "angular_velocity_factor", text="")
class PARTICLE_PT_physics(ParticleButtonsPanel):
@@ -361,29 +360,29 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
layout.enabled = particle_panel_enabled(context, psys)
row = layout.row()
- row.itemR(part, "physics_type", expand=True)
+ row.prop(part, "physics_type", expand=True)
if part.physics_type != 'NO':
row = layout.row()
col = row.column(align=True)
- col.itemR(part, "particle_size")
- col.itemR(part, "random_size", slider=True)
+ col.prop(part, "particle_size")
+ col.prop(part, "random_size", slider=True)
col = row.column(align=True)
- col.itemR(part, "mass")
- col.itemR(part, "sizemass", text="Multiply mass with size")
+ col.prop(part, "mass")
+ col.prop(part, "sizemass", text="Multiply mass with size")
if part.physics_type == 'NEWTON':
split = layout.split()
sub = split.column()
- sub.itemL(text="Forces:")
- sub.itemR(part, "brownian_factor")
- sub.itemR(part, "drag_factor", slider=True)
- sub.itemR(part, "damp_factor", slider=True)
+ sub.label(text="Forces:")
+ sub.prop(part, "brownian_factor")
+ sub.prop(part, "drag_factor", slider=True)
+ sub.prop(part, "damp_factor", slider=True)
sub = split.column()
- sub.itemR(part, "size_deflect")
- sub.itemR(part, "die_on_collision")
- sub.itemR(part, "integrator")
- sub.itemR(part, "time_tweak")
+ sub.prop(part, "size_deflect")
+ sub.prop(part, "die_on_collision")
+ sub.prop(part, "integrator")
+ sub.prop(part, "time_tweak")
elif part.physics_type == 'KEYED':
split = layout.split()
@@ -392,61 +391,61 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
row = layout.row()
col = row.column()
col.active = not psys.keyed_timing
- col.itemR(part, "keyed_loops", text="Loops")
- row.itemR(psys, "keyed_timing", text="Use Timing")
+ col.prop(part, "keyed_loops", text="Loops")
+ row.prop(psys, "keyed_timing", text="Use Timing")
- layout.itemL(text="Keys:")
+ layout.label(text="Keys:")
elif part.physics_type == 'BOIDS':
boids = part.boids
row = layout.row()
- row.itemR(boids, "allow_flight")
- row.itemR(boids, "allow_land")
- row.itemR(boids, "allow_climb")
+ row.prop(boids, "allow_flight")
+ row.prop(boids, "allow_land")
+ row.prop(boids, "allow_climb")
split = layout.split()
sub = split.column()
col = sub.column(align=True)
col.active = boids.allow_flight
- col.itemR(boids, "air_max_speed")
- col.itemR(boids, "air_min_speed", slider="True")
- col.itemR(boids, "air_max_acc", slider="True")
- col.itemR(boids, "air_max_ave", slider="True")
- col.itemR(boids, "air_personal_space")
+ col.prop(boids, "air_max_speed")
+ col.prop(boids, "air_min_speed", slider=True)
+ col.prop(boids, "air_max_acc", slider=True)
+ col.prop(boids, "air_max_ave", slider=True)
+ col.prop(boids, "air_personal_space")
row = col.row()
row.active = (boids.allow_land or boids.allow_climb) and boids.allow_flight
- row.itemR(boids, "landing_smoothness")
+ row.prop(boids, "landing_smoothness")
sub = split.column()
col = sub.column(align=True)
col.active = boids.allow_land or boids.allow_climb
- col.itemR(boids, "land_max_speed")
- col.itemR(boids, "land_jump_speed")
- col.itemR(boids, "land_max_acc", slider="True")
- col.itemR(boids, "land_max_ave", slider="True")
- col.itemR(boids, "land_personal_space")
- col.itemR(boids, "land_stick_force")
+ col.prop(boids, "land_max_speed")
+ col.prop(boids, "land_jump_speed")
+ col.prop(boids, "land_max_acc", slider=True)
+ col.prop(boids, "land_max_ave", slider=True)
+ col.prop(boids, "land_personal_space")
+ col.prop(boids, "land_stick_force")
row = layout.row()
col = row.column(align=True)
- col.itemL(text="Battle:")
- col.itemR(boids, "health")
- col.itemR(boids, "strength")
- col.itemR(boids, "aggression")
- col.itemR(boids, "accuracy")
- col.itemR(boids, "range")
+ col.label(text="Battle:")
+ col.prop(boids, "health")
+ col.prop(boids, "strength")
+ col.prop(boids, "aggression")
+ col.prop(boids, "accuracy")
+ col.prop(boids, "range")
col = row.column()
- col.itemL(text="Misc:")
- col.itemR(boids, "banking", slider=True)
- col.itemR(boids, "height", slider=True)
+ col.label(text="Misc:")
+ col.prop(boids, "banking", slider=True)
+ col.prop(boids, "height", slider=True)
if part.physics_type == 'KEYED' or part.physics_type == 'BOIDS':
if part.physics_type == 'BOIDS':
- layout.itemL(text="Relations:")
+ layout.label(text="Relations:")
row = layout.row()
row.template_list(psys, "targets", psys, "active_particle_target_index")
@@ -454,12 +453,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
- subsub.itemO("particle.new_target", icon='ICON_ZOOMIN', text="")
- subsub.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="")
+ subsub.operator("particle.new_target", icon='ICON_ZOOMIN', text="")
+ subsub.operator("particle.target_remove", icon='ICON_ZOOMOUT', text="")
sub = col.row()
subsub = sub.column(align=True)
- subsub.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="")
- subsub.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
+ subsub.operator("particle.target_move_up", icon='VICON_MOVE_UP', text="")
+ subsub.operator("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
key = psys.active_particle_target
if key:
@@ -468,20 +467,20 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
col = row.column()
#doesn't work yet
#col.red_alert = key.valid
- col.itemR(key, "object", text="")
- col.itemR(key, "system", text="System")
+ col.prop(key, "object", text="")
+ col.prop(key, "system", text="System")
col = row.column()
col.active = psys.keyed_timing
- col.itemR(key, "time")
- col.itemR(key, "duration")
+ col.prop(key, "time")
+ col.prop(key, "duration")
else:
sub = row.row()
#doesn't work yet
- #subrow.red_alert = key.valid
- sub.itemR(key, "object", text="")
- sub.itemR(key, "system", text="System")
+ #sub.red_alert = key.valid
+ sub.prop(key, "object", text="")
+ sub.prop(key, "system", text="System")
- layout.itemR(key, "mode", expand=True)
+ layout.prop(key, "mode", expand=True)
class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
@@ -489,9 +488,9 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
def poll(self, context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
if psys.point_cache.external:
return False
@@ -508,23 +507,23 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
#row = layout.row()
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
#col = row.row()
- #subrow = col.row(align=True)
- #subrow.itemO("boid.state_add", icon='ICON_ZOOMIN', text="")
- #subrow.itemO("boid.state_del", icon='ICON_ZOOMOUT', text="")
- #subrow = row.row(align=True)
- #subrow.itemO("boid.state_move_up", icon='VICON_MOVE_UP', text="")
- #subrow.itemO("boid.state_move_down", icon='VICON_MOVE_DOWN', text="")
+ #sub = col.row(align=True)
+ #sub.operator("boid.state_add", icon='ICON_ZOOMIN', text="")
+ #sub.operator("boid.state_del", icon='ICON_ZOOMOUT', text="")
+ #sub = row.row(align=True)
+ #sub.operator("boid.state_move_up", icon='VICON_MOVE_UP', text="")
+ #sub.operator("boid.state_move_down", icon='VICON_MOVE_DOWN', text="")
state = boids.active_boid_state
- #layout.itemR(state, "name", text="State name")
+ #layout.prop(state, "name", text="State name")
row = layout.row()
- row.itemR(state, "ruleset_type")
+ row.prop(state, "ruleset_type")
if state.ruleset_type == 'FUZZY':
- row.itemR(state, "rule_fuzziness", slider=True)
+ row.prop(state, "rule_fuzziness", slider=True)
else:
- row.itemL(text="")
+ row.label(text="")
row = layout.row()
row.template_list(state, "rules", state, "active_boid_rule_index")
@@ -532,54 +531,54 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
- subsub.item_menu_enumO("boid.rule_add", "type", icon='ICON_ZOOMIN', text="")
- subsub.itemO("boid.rule_del", icon='ICON_ZOOMOUT', text="")
+ subsub.operator_menu_enum("boid.rule_add", "type", icon='ICON_ZOOMIN', text="")
+ subsub.operator("boid.rule_del", icon='ICON_ZOOMOUT', text="")
sub = col.row()
- subcol = sub.column(align=True)
- subsub.itemO("boid.rule_move_up", icon='VICON_MOVE_UP', text="")
- subsub.itemO("boid.rule_move_down", icon='VICON_MOVE_DOWN', text="")
+ subsub = sub.column(align=True)
+ subsub.operator("boid.rule_move_up", icon='VICON_MOVE_UP', text="")
+ subsub.operator("boid.rule_move_down", icon='VICON_MOVE_DOWN', text="")
rule = state.active_boid_rule
if rule:
row = layout.row()
- row.itemR(rule, "name", text="")
+ row.prop(rule, "name", text="")
#somebody make nice icons for boids here please! -jahka
- row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="")
- row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
+ row.prop(rule, "in_air", icon='VICON_MOVE_UP', text="")
+ row.prop(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
row = layout.row()
if rule.type == 'GOAL':
- row.itemR(rule, "object")
+ row.prop(rule, "object")
row = layout.row()
- row.itemR(rule, "predict")
+ row.prop(rule, "predict")
elif rule.type == 'AVOID':
- row.itemR(rule, "object")
+ row.prop(rule, "object")
row = layout.row()
- row.itemR(rule, "predict")
- row.itemR(rule, "fear_factor")
+ row.prop(rule, "predict")
+ row.prop(rule, "fear_factor")
elif rule.type == 'FOLLOW_PATH':
- row.itemL(text="Not yet functional.")
+ row.label(text="Not yet functional.")
elif rule.type == 'AVOID_COLLISION':
- row.itemR(rule, "boids")
- row.itemR(rule, "deflectors")
- row.itemR(rule, "look_ahead")
+ row.prop(rule, "boids")
+ row.prop(rule, "deflectors")
+ row.prop(rule, "look_ahead")
elif rule.type == 'FOLLOW_LEADER':
- row.itemR(rule, "object", text="")
- row.itemR(rule, "distance")
+ row.prop(rule, "object", text="")
+ row.prop(rule, "distance")
row = layout.row()
- row.itemR(rule, "line")
- subrow = row.row()
- subrow.active = rule.line
- subrow.itemR(rule, "queue_size")
+ row.prop(rule, "line")
+ sub = row.row()
+ sub.active = rule.line
+ sub.prop(rule, "queue_size")
elif rule.type == 'AVERAGE_SPEED':
- row.itemR(rule, "speed", slider=True)
- row.itemR(rule, "wander", slider=True)
- row.itemR(rule, "level", slider=True)
+ row.prop(rule, "speed", slider=True)
+ row.prop(rule, "wander", slider=True)
+ row.prop(rule, "level", slider=True)
elif rule.type == 'FIGHT':
- row.itemR(rule, "distance")
- row.itemR(rule, "flee_distance")
+ row.prop(rule, "distance")
+ row.prop(rule, "flee_distance")
class PARTICLE_PT_render(ParticleButtonsPanel):
@@ -587,9 +586,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
def poll(self, context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
return True
@@ -600,90 +599,90 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
part = psys.settings
row = layout.row()
- row.itemR(part, "material")
- row.itemR(psys, "parent")
+ row.prop(part, "material")
+ row.prop(psys, "parent")
split = layout.split()
sub = split.column()
- sub.itemR(part, "emitter")
- sub.itemR(part, "parent")
+ sub.prop(part, "emitter")
+ sub.prop(part, "parent")
sub = split.column()
- sub.itemR(part, "unborn")
- sub.itemR(part, "died")
+ sub.prop(part, "unborn")
+ sub.prop(part, "died")
row = layout.row()
- row.itemR(part, "ren_as", expand=True)
+ row.prop(part, "ren_as", expand=True)
split = layout.split()
sub = split.column()
if part.ren_as == 'LINE':
- sub.itemR(part, "line_length_tail")
- sub.itemR(part, "line_length_head")
+ sub.prop(part, "line_length_tail")
+ sub.prop(part, "line_length_head")
sub = split.column()
- sub.itemR(part, "velocity_length")
+ sub.prop(part, "velocity_length")
elif part.ren_as == 'PATH':
- if part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked == False:
+ if part.type != 'HAIR' and part.physics_type != 'KEYED' and (psys.point_cache.baked is False):
box = layout.box()
- box.itemL(text="Baked or keyed particles needed for correct rendering.")
+ box.label(text="Baked or keyed particles needed for correct rendering.")
return
- sub.itemR(part, "render_strand")
+ sub.prop(part, "render_strand")
subsub = sub.column()
- subsub.active = part.render_strand == False
- subsub.itemR(part, "render_adaptive")
+ subsub.active = (part.render_strand is False)
+ subsub.prop(part, "render_adaptive")
subsub = sub.column()
subsub.active = part.render_adaptive or part.render_strand == True
- subsub.itemR(part, "adaptive_angle")
+ subsub.prop(part, "adaptive_angle")
subsub = sub.column()
- subsub.active = part.render_adaptive == True and part.render_strand == False
- subsub.itemR(part, "adaptive_pix")
- sub.itemR(part, "hair_bspline")
- sub.itemR(part, "render_step", text="Steps")
+ subsub.active = (part.render_adaptive is True and part.render_strand is False)
+ subsub.prop(part, "adaptive_pix")
+ sub.prop(part, "hair_bspline")
+ sub.prop(part, "render_step", text="Steps")
sub = split.column()
- sub.itemL(text="Timing:")
- sub.itemR(part, "abs_path_time")
- sub.itemR(part, "path_start", text="Start", slider=not part.abs_path_time)
- sub.itemR(part, "path_end", text="End", slider=not part.abs_path_time)
- sub.itemR(part, "random_length", text="Random", slider=True)
+ sub.label(text="Timing:")
+ sub.prop(part, "abs_path_time")
+ sub.prop(part, "path_start", text="Start", slider=not part.abs_path_time)
+ sub.prop(part, "path_end", text="End", slider=not part.abs_path_time)
+ sub.prop(part, "random_length", text="Random", slider=True)
row = layout.row()
col = row.column()
if part.type == 'HAIR' and part.render_strand == True and part.child_type == 'FACES':
- layout.itemR(part, "enable_simplify")
+ layout.prop(part, "enable_simplify")
if part.enable_simplify == True:
row = layout.row()
- row.itemR(part, "simplify_refsize")
- row.itemR(part, "simplify_rate")
- row.itemR(part, "simplify_transition")
+ row.prop(part, "simplify_refsize")
+ row.prop(part, "simplify_rate")
+ row.prop(part, "simplify_transition")
row = layout.row()
- row.itemR(part, "viewport")
+ row.prop(part, "viewport")
sub = row.row()
sub.active = part.viewport == True
- sub.itemR(part, "simplify_viewport")
+ sub.prop(part, "simplify_viewport")
elif part.ren_as == 'OBJECT':
- sub.itemR(part, "dupli_object")
- sub.itemR(part, "use_global_dupli")
+ sub.prop(part, "dupli_object")
+ sub.prop(part, "use_global_dupli")
elif part.ren_as == 'GROUP':
- sub.itemR(part, "dupli_group")
+ sub.prop(part, "dupli_group")
split = layout.split()
sub = split.column()
- sub.itemR(part, "whole_group")
+ sub.prop(part, "whole_group")
subsub = sub.column()
- subsub.active = part.whole_group == False
- subsub.itemR(part, "use_group_count")
+ subsub.active = (part.whole_group is False)
+ subsub.prop(part, "use_group_count")
sub = split.column()
subsub = sub.column()
- subsub.active = part.whole_group == False
- subsub.itemR(part, "use_global_dupli")
- subsub.itemR(part, "rand_group")
+ subsub.active = (part.whole_group is False)
+ subsub.prop(part, "use_global_dupli")
+ subsub.prop(part, "rand_group")
if part.use_group_count and not part.whole_group:
row = layout.row()
@@ -692,61 +691,61 @@ class PARTICLE_PT_render(ParticleButtonsPanel):
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
- subsub.itemO("particle.dupliob_copy", icon='ICON_ZOOMIN', text="")
- subsub.itemO("particle.dupliob_remove", icon='ICON_ZOOMOUT', text="")
- subsub.itemO("particle.dupliob_move_up", icon='VICON_MOVE_UP', text="")
- subsub.itemO("particle.dupliob_move_down", icon='VICON_MOVE_DOWN', text="")
+ subsub.operator("particle.dupliob_copy", icon='ICON_ZOOMIN', text="")
+ subsub.operator("particle.dupliob_remove", icon='ICON_ZOOMOUT', text="")
+ subsub.operator("particle.dupliob_move_up", icon='VICON_MOVE_UP', text="")
+ subsub.operator("particle.dupliob_move_down", icon='VICON_MOVE_DOWN', text="")
weight = part.active_dupliweight
if weight:
row = layout.row()
- row.itemR(weight, "count")
+ row.prop(weight, "count")
elif part.ren_as == 'BILLBOARD':
- sub.itemL(text="Align:")
+ sub.label(text="Align:")
row = layout.row()
- row.itemR(part, "billboard_align", expand=True)
- row.itemR(part, "billboard_lock", text="Lock")
+ row.prop(part, "billboard_align", expand=True)
+ row.prop(part, "billboard_lock", text="Lock")
row = layout.row()
- row.itemR(part, "billboard_object")
+ row.prop(part, "billboard_object")
row = layout.row()
col = row.column(align=True)
- col.itemL(text="Tilt:")
- col.itemR(part, "billboard_tilt", text="Angle", slider=True)
- col.itemR(part, "billboard_random_tilt", slider=True)
+ col.label(text="Tilt:")
+ col.prop(part, "billboard_tilt", text="Angle", slider=True)
+ col.prop(part, "billboard_random_tilt", slider=True)
col = row.column()
- col.itemR(part, "billboard_offset")
+ col.prop(part, "billboard_offset")
row = layout.row()
- row.itemR(psys, "billboard_normal_uv")
+ row.prop(psys, "billboard_normal_uv")
row = layout.row()
- row.itemR(psys, "billboard_time_index_uv")
+ row.prop(psys, "billboard_time_index_uv")
row = layout.row()
- row.itemL(text="Split uv's:")
- row.itemR(part, "billboard_uv_split", text="Number of splits")
+ row.label(text="Split uv's:")
+ row.prop(part, "billboard_uv_split", text="Number of splits")
row = layout.row()
- row.itemR(psys, "billboard_split_uv")
+ row.prop(psys, "billboard_split_uv")
row = layout.row()
- row.itemL(text="Animate:")
- row.itemR(part, "billboard_animation", expand=True)
- row.itemL(text="Offset:")
- row.itemR(part, "billboard_split_offset", expand=True)
+ row.label(text="Animate:")
+ row.prop(part, "billboard_animation", expand=True)
+ row.label(text="Offset:")
+ row.prop(part, "billboard_split_offset", expand=True)
if part.ren_as == 'HALO' or part.ren_as == 'LINE' or part.ren_as == 'BILLBOARD':
row = layout.row()
col = row.column()
- col.itemR(part, "trail_count")
+ col.prop(part, "trail_count")
if part.trail_count > 1:
- col.itemR(part, "abs_path_time", text="Length in frames")
+ col.prop(part, "abs_path_time", text="Length in frames")
col = row.column()
- col.itemR(part, "path_end", text="Length", slider=not part.abs_path_time)
- col.itemR(part, "random_length", text="Random", slider=True)
+ col.prop(part, "path_end", text="Length", slider=not part.abs_path_time)
+ col.prop(part, "random_length", text="Random", slider=True)
else:
col = row.column()
- col.itemL(text="")
+ col.label(text="")
class PARTICLE_PT_draw(ParticleButtonsPanel):
@@ -755,9 +754,9 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
def poll(self, context):
psys = context.particle_system
- if psys == None:
+ if psys is None:
return False
- if psys.settings == None:
+ if psys.settings is None:
return False
return True
@@ -768,43 +767,43 @@ class PARTICLE_PT_draw(ParticleButtonsPanel):
part = psys.settings
row = layout.row()
- row.itemR(part, "draw_as", expand=True)
+ row.prop(part, "draw_as", expand=True)
if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'):
return
path = (part.ren_as == 'PATH' and part.draw_as == 'RENDER') or part.draw_as == 'PATH'
- if path and part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked == False:
+ if path and part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked is False:
box = layout.box()
- box.itemL(text="Baked or keyed particles needed for correct drawing.")
+ box.label(text="Baked or keyed particles needed for correct drawing.")
return
row = layout.row()
- row.itemR(part, "display", slider=True)
+ row.prop(part, "display", slider=True)
if part.draw_as != 'RENDER' or part.ren_as == 'HALO':
- row.itemR(part, "draw_size")
+ row.prop(part, "draw_size")
else:
- row.itemL(text="")
+ row.label(text="")
row = layout.row()
col = row.column()
- col.itemR(part, "show_size")
- col.itemR(part, "velocity")
- col.itemR(part, "num")
+ col.prop(part, "show_size")
+ col.prop(part, "velocity")
+ col.prop(part, "num")
if part.physics_type == 'BOIDS':
- col.itemR(part, "draw_health")
+ col.prop(part, "draw_health")
col = row.column()
- col.itemR(part, "material_color", text="Use material color")
+ col.prop(part, "material_color", text="Use material color")
if (path):
- col.itemR(part, "draw_step")
+ col.prop(part, "draw_step")
else:
sub = col.column()
- sub.active = part.material_color == False
- #sub.itemL(text="color")
- #sub.itemL(text="Override material color")
+ sub.active = (part.material_color is False)
+ #sub.label(text="color")
+ #sub.label(text="Override material color")
class PARTICLE_PT_children(ParticleButtonsPanel):
@@ -817,7 +816,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel):
psys = context.particle_system
part = psys.settings
- layout.row().itemR(part, "child_type", expand=True)
+ layout.row().prop(part, "child_type", expand=True)
if part.child_type == 'NONE':
return
@@ -825,63 +824,63 @@ class PARTICLE_PT_children(ParticleButtonsPanel):
row = layout.row()
col = row.column(align=True)
- col.itemR(part, "child_nbr", text="Display")
- col.itemR(part, "rendered_child_nbr", text="Render")
+ col.prop(part, "child_nbr", text="Display")
+ col.prop(part, "rendered_child_nbr", text="Render")
col = row.column(align=True)
if part.child_type == 'FACES':
- col.itemR(part, "virtual_parents", slider=True)
+ col.prop(part, "virtual_parents", slider=True)
else:
- col.itemR(part, "child_radius", text="Radius")
- col.itemR(part, "child_roundness", text="Roundness", slider=True)
+ col.prop(part, "child_radius", text="Radius")
+ col.prop(part, "child_roundness", text="Roundness", slider=True)
col = row.column(align=True)
- col.itemR(part, "child_size", text="Size")
- col.itemR(part, "child_random_size", text="Random")
+ col.prop(part, "child_size", text="Size")
+ col.prop(part, "child_random_size", text="Random")
- layout.row().itemL(text="Effects:")
+ layout.row().label(text="Effects:")
row = layout.row()
col = row.column(align=True)
- col.itemR(part, "clump_factor", slider=True)
- col.itemR(part, "clumppow", slider=True)
+ col.prop(part, "clump_factor", slider=True)
+ col.prop(part, "clumppow", slider=True)
col = row.column(align=True)
- col.itemR(part, "rough_endpoint")
- col.itemR(part, "rough_end_shape")
+ col.prop(part, "rough_endpoint")
+ col.prop(part, "rough_end_shape")
row = layout.row()
col = row.column(align=True)
- col.itemR(part, "rough1")
- col.itemR(part, "rough1_size")
+ col.prop(part, "rough1")
+ col.prop(part, "rough1_size")
col = row.column(align=True)
- col.itemR(part, "rough2")
- col.itemR(part, "rough2_size")
- col.itemR(part, "rough2_thres", slider=True)
+ col.prop(part, "rough2")
+ col.prop(part, "rough2_size")
+ col.prop(part, "rough2_thres", slider=True)
row = layout.row()
col = row.column(align=True)
- col.itemR(part, "child_length", slider=True)
- col.itemR(part, "child_length_thres", slider=True)
+ col.prop(part, "child_length", slider=True)
+ col.prop(part, "child_length_thres", slider=True)
col = row.column(align=True)
- col.itemL(text="Space reserved for")
- col.itemL(text="hair parting controls")
+ col.label(text="Space reserved for")
+ col.label(text="hair parting controls")
- layout.row().itemL(text="Kink:")
- layout.row().itemR(part, "kink", expand=True)
+ layout.row().label(text="Kink:")
+ layout.row().prop(part, "kink", expand=True)
split = layout.split()
col = split.column()
- col.itemR(part, "kink_amplitude")
- col.itemR(part, "kink_frequency")
+ col.prop(part, "kink_amplitude")
+ col.prop(part, "kink_frequency")
col = split.column()
- col.itemR(part, "kink_shape", slider=True)
+ col.prop(part, "kink_shape", slider=True)
class PARTICLE_PT_field_weights(ParticleButtonsPanel):
@@ -890,10 +889,10 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel):
def draw(self, context):
part = context.particle_system.settings
- effector_weights_ui(self, part.effector_weights)
+ effector_weights_ui(self, context, part.effector_weights)
if part.type == 'HAIR':
- self.layout.itemR(part.effector_weights, "do_growing_hair")
+ self.layout.prop(part.effector_weights, "do_growing_hair")
class PARTICLE_PT_force_fields(ParticleButtonsPanel):
@@ -905,22 +904,22 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel):
part = context.particle_system.settings
- layout.itemR(part, "self_effect")
+ layout.prop(part, "self_effect")
split = layout.split(percentage=0.2)
- split.itemL(text="Type 1:")
- split.itemR(part.force_field_1, "type", text="")
- basic_force_field_settings_ui(self, part.force_field_1)
- basic_force_field_falloff_ui(self, part.force_field_1)
+ split.label(text="Type 1:")
+ split.prop(part.force_field_1, "type", text="")
+ basic_force_field_settings_ui(self, context, part.force_field_1)
+ basic_force_field_falloff_ui(self, context, part.force_field_1)
if part.force_field_1.type != 'NONE':
- layout.itemL(text="")
+ layout.label(text="")
split = layout.split(percentage=0.2)
- split.itemL(text="Type 2:")
- split.itemR(part.force_field_2, "type", text="")
- basic_force_field_settings_ui(self, part.force_field_2)
- basic_force_field_falloff_ui(self, part.force_field_2)
+ split.label(text="Type 2:")
+ split.prop(part.force_field_2, "type", text="")
+ basic_force_field_settings_ui(self, context, part.force_field_2)
+ basic_force_field_falloff_ui(self, context, part.force_field_2)
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
@@ -932,62 +931,62 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
ob = context.object
psys = context.particle_system
- part = psys.settings
+ # part = psys.settings
- # layout.itemL(text="Nothing here yet.")
+ # layout.label(text="Nothing here yet.")
row = layout.row()
- row.itemL(text="Vertex Group")
- row.itemL(text="Negate")
+ row.label(text="Vertex Group")
+ row.label(text="Negate")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
- row.itemR(psys, "vertex_group_density_negate", text="")
+ row.prop_object(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
+ row.prop(psys, "vertex_group_density_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
- row.itemR(psys, "vertex_group_velocity_negate", text="")
+ row.prop_object(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
+ row.prop(psys, "vertex_group_velocity_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
- row.itemR(psys, "vertex_group_length_negate", text="")
+ row.prop_object(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
+ row.prop(psys, "vertex_group_length_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
- row.itemR(psys, "vertex_group_clump_negate", text="")
+ row.prop_object(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
+ row.prop(psys, "vertex_group_clump_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
- row.itemR(psys, "vertex_group_kink_negate", text="")
+ row.prop_object(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
+ row.prop(psys, "vertex_group_kink_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1")
- row.itemR(psys, "vertex_group_roughness1_negate", text="")
+ row.prop_object(psys, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1")
+ row.prop(psys, "vertex_group_roughness1_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2")
- row.itemR(psys, "vertex_group_roughness2_negate", text="")
+ row.prop_object(psys, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2")
+ row.prop(psys, "vertex_group_roughness2_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
- row.itemR(psys, "vertex_group_roughness_end_negate", text="")
+ row.prop_object(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
+ row.prop(psys, "vertex_group_roughness_end_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
- row.itemR(psys, "vertex_group_size_negate", text="")
+ row.prop_object(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
+ row.prop(psys, "vertex_group_size_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
- row.itemR(psys, "vertex_group_tangent_negate", text="")
+ row.prop_object(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
+ row.prop(psys, "vertex_group_tangent_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
- row.itemR(psys, "vertex_group_rotation_negate", text="")
+ row.prop_object(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
+ row.prop(psys, "vertex_group_rotation_negate", text="")
row = layout.row()
- row.item_pointerR(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
- row.itemR(psys, "vertex_group_field_negate", text="")
+ row.prop_object(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
+ row.prop(psys, "vertex_group_field_negate", text="")
bpy.types.register(PARTICLE_PT_particles)
bpy.types.register(PARTICLE_PT_hair_dynamics)
diff --git a/release/scripts/ui/properties_physics_cloth.py b/release/scripts/ui/properties_physics_cloth.py
index 255b7038b99..0829b533c81 100644
--- a/release/scripts/ui/properties_physics_cloth.py
+++ b/release/scripts/ui/properties_physics_cloth.py
@@ -19,12 +19,25 @@
#
import bpy
+narrowui = 180
+
+
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
def cloth_panel_enabled(md):
- return md.point_cache.baked == False
+ return md.point_cache.baked is False
+
+
+class CLOTH_MT_presets(bpy.types.Menu):
+ '''
+ Creates the menu items by scanning scripts/templates
+ '''
+ bl_label = "Cloth Presets"
+ preset_subdir = "cloth"
+ preset_operator = "script.python_file_run"
+ draw = bpy.types.Menu.draw_preset
class PhysicButtonsPanel(bpy.types.Panel):
@@ -46,6 +59,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
md = context.cloth
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -53,15 +67,18 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
- split.itemO("object.modifier_remove", text="Remove")
+ split.operator("object.modifier_remove", text="Remove")
row = split.row(align=True)
- row.itemR(md, "render", text="")
- row.itemR(md, "realtime", text="")
+ row.prop(md, "render", text="")
+ row.prop(md, "realtime", text="")
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
- split.itemL()
+ split.operator("object.modifier_add", text="Add").type = 'CLOTH'
+ if wide_ui:
+ split.column()
+
+ split.operator_context = 'INVOKE_DEFAULT'
if md:
cloth = md.settings
@@ -72,40 +89,44 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
col = split.column()
- col.itemL(text="Quality:")
- col.itemR(cloth, "quality", text="Steps", slider=True)
+ col.label(text="Presets:")
+ sub = col.row(align=True).split(percentage=0.75)
+ sub.menu("CLOTH_MT_presets", text="Presets")
+ sub.operator("cloth.preset_add", text="Add")
- col.itemL(text="Material:")
- sub = col.column(align=True)
- sub.itemR(cloth, "mass")
- sub.itemR(cloth, "structural_stiffness", text="Structural")
- sub.itemR(cloth, "bending_stiffness", text="Bending")
+ col.label(text="Quality:")
+ col.prop(cloth, "quality", text="Steps", slider=True)
- col = split.column()
+ col.label(text="Material:")
+ col.prop(cloth, "mass")
+ col.prop(cloth, "structural_stiffness", text="Structural")
+ col.prop(cloth, "bending_stiffness", text="Bending")
- col.itemL(text="Presets:")
- col.itemL(text="TODO!")
+ if wide_ui:
+ col = split.column()
- col.itemL(text="Damping:")
- sub = col.column(align=True)
- sub.itemR(cloth, "spring_damping", text="Spring")
- sub.itemR(cloth, "air_damping", text="Air")
+ col.label(text="Damping:")
+ col.prop(cloth, "spring_damping", text="Spring")
+ col.prop(cloth, "air_damping", text="Air")
- col.itemR(cloth, "pin_cloth", text="Pin")
- sub = col.column(align=True)
+ col.prop(cloth, "pin_cloth", text="Pinning")
+ sub = col.column()
sub.active = cloth.pin_cloth
- sub.itemR(cloth, "pin_stiffness", text="Stiffness")
- sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
+ sub.prop_object(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
+ sub.prop(cloth, "pin_stiffness", text="Stiffness")
+
+ col.label(text="Pre roll:")
+ col.prop(cloth, "pre_roll", text="Frame")
# Disabled for now
"""
if cloth.mass_vertex_group:
- layout.itemL(text="Goal:")
+ layout.label(text="Goal:")
col = layout.column_flow()
- col.itemR(cloth, "goal_default", text="Default")
- col.itemR(cloth, "goal_spring", text="Stiffness")
- col.itemR(cloth, "goal_friction", text="Friction")
+ col.prop(cloth, "goal_default", text="Default")
+ col.prop(cloth, "goal_spring", text="Stiffness")
+ col.prop(cloth, "goal_friction", text="Friction")
"""
@@ -118,7 +139,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
def draw(self, context):
md = context.cloth
- point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
+ point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
@@ -132,29 +153,31 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
cloth = context.cloth.collision_settings
self.layout.active = cloth_panel_enabled(context.cloth)
- self.layout.itemR(cloth, "enable_collision", text="")
+ self.layout.prop(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
cloth = context.cloth.collision_settings
md = context.cloth
+ wide_ui = context.region.width > narrowui
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
- col.itemR(cloth, "collision_quality", slider=True, text="Quality")
- col.itemR(cloth, "min_distance", slider=True, text="Distance")
- col.itemR(cloth, "friction")
+ col.prop(cloth, "collision_quality", slider=True, text="Quality")
+ col.prop(cloth, "min_distance", slider=True, text="Distance")
+ col.prop(cloth, "friction")
- col = split.column()
- col.itemR(cloth, "enable_self_collision", text="Self Collision")
+ if wide_ui:
+ col = split.column()
+ col.prop(cloth, "enable_self_collision", text="Self Collision")
sub = col.column()
sub.active = cloth.enable_self_collision
- sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
- sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
+ sub.prop(cloth, "self_collision_quality", slider=True, text="Quality")
+ sub.prop(cloth, "self_min_distance", slider=True, text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
@@ -168,7 +191,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
cloth = context.cloth.settings
self.layout.active = cloth_panel_enabled(context.cloth)
- self.layout.itemR(cloth, "stiffness_scaling", text="")
+ self.layout.prop(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
@@ -176,22 +199,22 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
md = context.cloth
ob = context.object
cloth = context.cloth.settings
+ wide_ui = context.region.width > narrowui
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
- col.itemL(text="Structural Stiffness:")
- sub = col.column(align=True)
- sub.itemR(cloth, "structural_stiffness_max", text="Max")
- sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
+ col.label(text="Structural Stiffness:")
+ col.prop_object(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
+ col.prop(cloth, "structural_stiffness_max", text="Max")
- col = split.column()
- col.itemL(text="Bending Stiffness:")
- sub = col.column(align=True)
- sub.itemR(cloth, "bending_stiffness_max", text="Max")
- sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Bending Stiffness:")
+ col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
+ col.prop(cloth, "bending_stiffness_max", text="Max")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
@@ -203,7 +226,9 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
def draw(self, context):
cloth = context.cloth.settings
- effector_weights_ui(self, cloth.effector_weights)
+ effector_weights_ui(self, context, cloth.effector_weights)
+
+bpy.types.register(CLOTH_MT_presets)
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py
index 187db9940f9..7c1d71302ec 100644
--- a/release/scripts/ui/properties_physics_common.py
+++ b/release/scripts/ui/properties_physics_common.py
@@ -17,104 +17,122 @@
# ##### END GPL LICENSE BLOCK #####
#
-import bpy
+
+narrowui = 180
-def point_cache_ui(self, cache, enabled, particles, smoke):
+def point_cache_ui(self, context, cache, enabled, particles, smoke):
layout = self.layout
+
+ wide_ui = context.region.width > narrowui
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2)
col = row.column(align=True)
- col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
- col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("ptcache.add", icon='ICON_ZOOMIN', text="")
+ col.operator("ptcache.remove", icon='ICON_ZOOMOUT', text="")
row = layout.row()
- row.itemL(text="File Name:")
+ row.label(text="File Name:")
if particles:
- row.itemR(cache, "external")
+ row.prop(cache, "external")
if cache.external:
split = layout.split(percentage=0.80)
- split.itemR(cache, "name", text="")
- split.itemR(cache, "index", text="")
+ split.prop(cache, "name", text="")
+ split.prop(cache, "index", text="")
- layout.itemL(text="File Path:")
- layout.itemR(cache, "filepath", text="")
+ layout.label(text="File Path:")
+ layout.prop(cache, "filepath", text="")
- layout.itemL(text=cache.info)
+ layout.label(text=cache.info)
else:
- layout.itemR(cache, "name", text="")
+ layout.prop(cache, "name", text="")
if not particles:
row = layout.row()
row.enabled = enabled
- row.itemR(cache, "start_frame")
- row.itemR(cache, "end_frame")
+ row.prop(cache, "start_frame")
+ row.prop(cache, "end_frame")
row = layout.row()
if cache.baked == True:
- row.itemO("ptcache.free_bake", text="Free Bake")
+ row.operator("ptcache.free_bake", text="Free Bake")
else:
- row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
+ row.operator("ptcache.bake", text="Bake").bake = True
sub = row.row()
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
- sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
+ sub.operator("ptcache.bake", "bake", False, text="Calculate to Current Frame")
row = layout.row()
row.enabled = enabled
- row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
+ row.operator("ptcache.bake_from_cache", text="Current Cache to Bake")
if not smoke:
- row.itemR(cache, "step")
+ row.prop(cache, "step")
if not smoke:
row = layout.row()
sub = row.row()
sub.enabled = enabled
- sub.itemR(cache, "quick_cache")
- row.itemR(cache, "disk_cache")
+ sub.prop(cache, "quick_cache")
+ row.prop(cache, "disk_cache")
- layout.itemL(text=cache.info)
+ layout.label(text=cache.info)
- layout.itemS()
+ layout.separator()
row = layout.row()
- row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
- row.itemO("ptcache.free_bake_all", text="Free All Bakes")
- layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
+ row.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
+ row.operator("ptcache.free_bake_all", text="Free All Bakes")
+ layout.operator("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
-def effector_weights_ui(self, weights):
- layout = self.layout
-
- layout.itemR(weights, "group")
-
- split = layout.split()
- split.itemR(weights, "gravity", slider=True)
- split.itemR(weights, "all", slider=True)
-
- layout.itemS()
-
- flow = layout.column_flow()
- flow.itemR(weights, "force", slider=True)
- flow.itemR(weights, "vortex", slider=True)
- flow.itemR(weights, "magnetic", slider=True)
- flow.itemR(weights, "wind", slider=True)
- flow.itemR(weights, "curveguide", slider=True)
- flow.itemR(weights, "texture", slider=True)
- flow.itemR(weights, "harmonic", slider=True)
- flow.itemR(weights, "charge", slider=True)
- flow.itemR(weights, "lennardjones", slider=True)
- flow.itemR(weights, "turbulence", slider=True)
- flow.itemR(weights, "drag", slider=True)
- flow.itemR(weights, "boid", slider=True)
-
-
-def basic_force_field_settings_ui(self, field):
+def effector_weights_ui(self, context, weights):
layout = self.layout
+
+ wide_ui = context.region.width > narrowui
+
+ layout.prop(weights, "group")
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(weights, "gravity", slider=True)
+
+ if wide_ui:
+ col = split.column()
+ col.prop(weights, "all", slider=True)
+
+ layout.separator()
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(weights, "force", slider=True)
+ col.prop(weights, "vortex", slider=True)
+ col.prop(weights, "magnetic", slider=True)
+ col.prop(weights, "wind", slider=True)
+ col.prop(weights, "curveguide", slider=True)
+ col.prop(weights, "texture", slider=True)
+
+ if wide_ui:
+ col = split.column()
+ col.prop(weights, "harmonic", slider=True)
+ col.prop(weights, "charge", slider=True)
+ col.prop(weights, "lennardjones", slider=True)
+ col.prop(weights, "turbulence", slider=True)
+ col.prop(weights, "drag", slider=True)
+ col.prop(weights, "boid", slider=True)
+
+
+def basic_force_field_settings_ui(self, context, field):
+ layout = self.layout
+
+ wide_ui = context.region.width > narrowui
+
split = layout.split()
if not field or field.type == 'NONE':
@@ -123,59 +141,69 @@ def basic_force_field_settings_ui(self, field):
col = split.column()
if field.type == 'DRAG':
- col.itemR(field, "linear_drag", text="Linear")
+ col.prop(field, "linear_drag", text="Linear")
else:
- col.itemR(field, "strength")
+ col.prop(field, "strength")
if field.type == 'TURBULENCE':
- col.itemR(field, "size")
- col.itemR(field, "flow")
+ col.prop(field, "size")
+ col.prop(field, "flow")
elif field.type == 'HARMONIC':
- col.itemR(field, "harmonic_damping", text="Damping")
+ col.prop(field, "harmonic_damping", text="Damping")
elif field.type == 'VORTEX' and field.shape != 'POINT':
- col.itemR(field, "inflow")
+ col.prop(field, "inflow")
elif field.type == 'DRAG':
- col.itemR(field, "quadratic_drag", text="Quadratic")
+ col.prop(field, "quadratic_drag", text="Quadratic")
else:
- col.itemR(field, "flow")
+ col.prop(field, "flow")
- col = split.column()
- col.itemR(field, "noise")
- col.itemR(field, "seed")
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "noise")
+ col.prop(field, "seed")
if field.type == 'TURBULENCE':
- col.itemR(field, "global_coordinates", text="Global")
+ col.prop(field, "global_coordinates", text="Global")
split = layout.split()
col = split.column()
- col.itemL(text="Effect point:")
- col.itemR(field, "do_location")
- col.itemR(field, "do_rotation")
+ col.label(text="Effect point:")
+ col.prop(field, "do_location")
+ col.prop(field, "do_rotation")
- sub = split.column()
- sub.itemL(text="Collision:")
- sub.itemR(field, "do_absorption")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Collision:")
+ col.prop(field, "do_absorption")
-def basic_force_field_falloff_ui(self, field):
+def basic_force_field_falloff_ui(self, context, field):
layout = self.layout
+
+ wide_ui = context.region.width > narrowui
+
+ # XXX: This doesn't update for some reason.
+ #if wide_ui:
+ # split = layout.split()
+ #else:
split = layout.split(percentage=0.35)
if not field or field.type == 'NONE':
return
col = split.column()
- col.itemR(field, "z_direction", text="")
- col.itemR(field, "use_min_distance", text="Use Minimum")
- col.itemR(field, "use_max_distance", text="Use Maximum")
+ col.prop(field, "z_direction", text="")
+ col.prop(field, "use_min_distance", text="Use Minimum")
+ col.prop(field, "use_max_distance", text="Use Maximum")
- col = split.column()
- col.itemR(field, "falloff_power", text="Power")
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "falloff_power", text="Power")
sub = col.column()
sub.active = field.use_min_distance
- sub.itemR(field, "minimum_distance", text="Distance")
+ sub.prop(field, "minimum_distance", text="Distance")
sub = col.column()
sub.active = field.use_max_distance
- sub.itemR(field, "maximum_distance", text="Distance")
+ sub.prop(field, "maximum_distance", text="Distance")
diff --git a/release/scripts/ui/properties_physics_field.py b/release/scripts/ui/properties_physics_field.py
index 3e2630e38f5..c2f1703a912 100644
--- a/release/scripts/ui/properties_physics_field.py
+++ b/release/scripts/ui/properties_physics_field.py
@@ -19,6 +19,9 @@
#
import bpy
+narrowui = 180
+
+
from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui
@@ -41,16 +44,23 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
ob = context.object
field = ob.field
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.2)
- split.itemL(text="Type:")
- split.itemR(field, "type", text="")
+ if wide_ui:
+ split = layout.split(percentage=0.2)
+ split.label(text="Type:")
+ else:
+ split = layout.split()
+
+ split.prop(field, "type", text="")
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
- split = layout.split(percentage=0.2)
- #split = layout.row()
- split.itemL(text="Shape:")
- split.itemR(field, "shape", text="")
+ if wide_ui:
+ split = layout.split(percentage=0.2)
+ split.label(text="Shape:")
+ else:
+ split = layout.split()
+ split.prop(field, "shape", text="")
split = layout.split()
@@ -58,95 +68,104 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
return # nothing to draw
elif field.type == 'GUIDE':
col = split.column()
- col.itemR(field, "guide_minimum")
- col.itemR(field, "guide_free")
- col.itemR(field, "falloff_power")
- col.itemR(field, "guide_path_add")
+ col.prop(field, "guide_minimum")
+ col.prop(field, "guide_free")
+ col.prop(field, "falloff_power")
+ col.prop(field, "guide_path_add")
- col = split.column()
- col.itemL(text="Clumping:")
- col.itemR(field, "guide_clump_amount")
- col.itemR(field, "guide_clump_shape")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Clumping:")
+ col.prop(field, "guide_clump_amount")
+ col.prop(field, "guide_clump_shape")
row = layout.row()
- row.itemR(field, "use_max_distance")
+ row.prop(field, "use_max_distance")
sub = row.row()
sub.active = field.use_max_distance
- sub.itemR(field, "maximum_distance")
+ sub.prop(field, "maximum_distance")
- layout.itemS()
+ layout.separator()
- layout.itemR(field, "guide_kink_type")
+ layout.prop(field, "guide_kink_type")
if (field.guide_kink_type != 'NONE'):
- layout.itemR(field, "guide_kink_axis")
+ layout.prop(field, "guide_kink_axis")
- flow = layout.column_flow()
- flow.itemR(field, "guide_kink_frequency")
- flow.itemR(field, "guide_kink_shape")
- flow.itemR(field, "guide_kink_amplitude")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(field, "guide_kink_frequency")
+ col.prop(field, "guide_kink_shape")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "guide_kink_amplitude")
elif field.type == 'TEXTURE':
col = split.column()
- col.itemR(field, "strength")
- col.itemR(field, "texture", text="")
- col.itemR(field, "texture_mode", text="")
- col.itemR(field, "texture_nabla")
+ col.prop(field, "strength")
+ col.prop(field, "texture", text="")
+ col.prop(field, "texture_mode", text="")
+ col.prop(field, "texture_nabla")
- col = split.column()
- col.itemR(field, "use_coordinates")
- col.itemR(field, "root_coordinates")
- col.itemR(field, "force_2d")
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "use_coordinates")
+ col.prop(field, "root_coordinates")
+ col.prop(field, "force_2d")
else:
- basic_force_field_settings_ui(self, field)
+ basic_force_field_settings_ui(self, context, field)
if field.type not in ('NONE', 'GUIDE'):
- layout.itemL(text="Falloff:")
- layout.itemR(field, "falloff_type", expand=True)
+ layout.label(text="Falloff:")
+ layout.prop(field, "falloff_type", expand=True)
- basic_force_field_falloff_ui(self, field)
+ basic_force_field_falloff_ui(self, context, field)
if field.falloff_type == 'CONE':
- layout.itemS()
+ layout.separator()
split = layout.split(percentage=0.35)
col = split.column()
- col.itemL(text="Angular:")
- col.itemR(field, "use_radial_min", text="Use Minimum")
- col.itemR(field, "use_radial_max", text="Use Maximum")
+ col.label(text="Angular:")
+ col.prop(field, "use_radial_min", text="Use Minimum")
+ col.prop(field, "use_radial_max", text="Use Maximum")
- col = split.column()
- col.itemR(field, "radial_falloff", text="Power")
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
- sub.itemR(field, "radial_minimum", text="Angle")
+ sub.prop(field, "radial_minimum", text="Angle")
sub = col.column()
sub.active = field.use_radial_max
- sub.itemR(field, "radial_maximum", text="Angle")
+ sub.prop(field, "radial_maximum", text="Angle")
elif field.falloff_type == 'TUBE':
- layout.itemS()
+ layout.separator()
split = layout.split(percentage=0.35)
col = split.column()
- col.itemL(text="Radial:")
- col.itemR(field, "use_radial_min", text="Use Minimum")
- col.itemR(field, "use_radial_max", text="Use Maximum")
+ col.label(text="Radial:")
+ col.prop(field, "use_radial_min", text="Use Minimum")
+ col.prop(field, "use_radial_max", text="Use Maximum")
- col = split.column()
- col.itemR(field, "radial_falloff", text="Power")
+ if wide_ui:
+ col = split.column()
+ col.prop(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
- sub.itemR(field, "radial_minimum", text="Distance")
+ sub.prop(field, "radial_minimum", text="Distance")
sub = col.column()
sub.active = field.use_radial_max
- sub.itemR(field, "radial_maximum", text="Distance")
+ sub.prop(field, "radial_maximum", text="Distance")
class PHYSICS_PT_collision(PhysicButtonsPanel):
@@ -162,6 +181,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
layout = self.layout
md = context.collision
+ wide_ui = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -169,19 +189,21 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
- split.itemO("object.modifier_remove", text="Remove")
- col = split.column()
+ split.operator("object.modifier_remove", text="Remove")
+ if wide_ui:
+ col = split.column()
#row = split.row(align=True)
- #row.itemR(md, "render", text="")
- #row.itemR(md, "realtime", text="")
+ #row.prop(md, "render", text="")
+ #row.prop(md, "realtime", text="")
coll = md.settings
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
- split.itemL()
+ split.operator("object.modifier_add", text="Add").type = 'COLLISION'
+ if wide_ui:
+ split.label()
coll = None
@@ -193,30 +215,31 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Particle:")
- col.itemR(settings, "permeability", slider=True)
- col.itemL(text="Particle Damping:")
+ col.label(text="Particle:")
+ col.prop(settings, "permeability", slider=True)
+ col.prop(settings, "kill_particles")
+ col.label(text="Particle Damping:")
sub = col.column(align=True)
- sub.itemR(settings, "damping_factor", text="Factor", slider=True)
- sub.itemR(settings, "random_damping", text="Random", slider=True)
+ sub.prop(settings, "damping_factor", text="Factor", slider=True)
+ sub.prop(settings, "random_damping", text="Random", slider=True)
- col.itemL(text="Soft Body and Cloth:")
+ col.label(text="Particle Friction:")
sub = col.column(align=True)
- sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
- sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
+ sub.prop(settings, "friction_factor", text="Factor", slider=True)
+ sub.prop(settings, "random_friction", text="Random", slider=True)
- layout.itemL(text="Force Fields:")
- layout.itemR(settings, "absorption", text="Absorption")
-
- col = split.column()
- col.itemL(text="")
- col.itemR(settings, "kill_particles")
- col.itemL(text="Particle Friction:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Soft Body and Cloth:")
sub = col.column(align=True)
- sub.itemR(settings, "friction_factor", text="Factor", slider=True)
- sub.itemR(settings, "random_friction", text="Random", slider=True)
- col.itemL(text="Soft Body Damping:")
- col.itemR(settings, "damping", text="Factor", slider=True)
+ sub.prop(settings, "outer_thickness", text="Outer", slider=True)
+ sub.prop(settings, "inner_thickness", text="Inner", slider=True)
+
+ col.label(text="Soft Body Damping:")
+ col.prop(settings, "damping", text="Factor", slider=True)
+
+ col.label(text="Force Fields:")
+ col.prop(settings, "absorption", text="Absorption")
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)
diff --git a/release/scripts/ui/properties_physics_fluid.py b/release/scripts/ui/properties_physics_fluid.py
index 47a5546c205..a126002c211 100644
--- a/release/scripts/ui/properties_physics_fluid.py
+++ b/release/scripts/ui/properties_physics_fluid.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -38,7 +40,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
layout = self.layout
md = context.fluid
- ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -46,147 +48,164 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
- split.itemO("object.modifier_remove", text="Remove")
+ split.operator("object.modifier_remove", text="Remove")
row = split.row(align=True)
- row.itemR(md, "render", text="")
- row.itemR(md, "realtime", text="")
+ row.prop(md, "render", text="")
+ row.prop(md, "realtime", text="")
fluid = md.settings
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
- split.itemL()
+ split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION'
+ if wide_ui:
+ split.label()
fluid = None
if fluid:
- layout.itemR(fluid, "type")
+ if wide_ui:
+ layout.prop(fluid, "type")
+ else:
+ layout.prop(fluid, "type", text="")
if fluid.type == 'DOMAIN':
- layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
+ layout.operator("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
- col.itemR(fluid, "resolution", text="Final")
- col.itemL(text="Render Display:")
- col.itemR(fluid, "render_display_mode", text="")
- col.itemL(text="Time:")
- sub = col.column(align=True)
- sub.itemR(fluid, "start_time", text="Start")
- sub.itemR(fluid, "end_time", text="End")
+ col.label(text="Resolution:")
+ col.prop(fluid, "resolution", text="Final")
+ col.label(text="Render Display:")
+ col.prop(fluid, "render_display_mode", text="")
+
+ if wide_ui:
+ col = split.column()
+ col.label(text="Required Memory: " + fluid.memory_estimate)
+ col.prop(fluid, "preview_resolution", text="Preview")
+ col.label(text="Viewport Display:")
+ col.prop(fluid, "viewport_display_mode", text="")
+
+ split = layout.split()
col = split.column()
- col.itemL(text="Required Memory: " + fluid.memory_estimate)
- col.itemR(fluid, "preview_resolution", text="Preview")
- col.itemL(text="Viewport Display:")
- col.itemR(fluid, "viewport_display_mode", text="")
- col.itemL()
- col.itemR(fluid, "generate_speed_vectors")
- col.itemR(fluid, "reverse_frames")
+ col.label(text="Time:")
+ sub = col.column(align=True)
+ sub.prop(fluid, "start_time", text="Start")
+ sub.prop(fluid, "end_time", text="End")
- layout.itemR(fluid, "path", text="")
+ if wide_ui:
+ col = split.column()
+ col.label()
+ col.prop(fluid, "generate_speed_vectors")
+ col.prop(fluid, "reverse_frames")
+
+ layout.prop(fluid, "path", text="")
elif fluid.type == 'FLUID':
split = layout.split()
col = split.column()
- col.itemL(text="Volume Initialization:")
- col.itemR(fluid, "volume_initialization", text="")
- col.itemR(fluid, "export_animated_mesh")
+ col.label(text="Volume Initialization:")
+ col.prop(fluid, "volume_initialization", text="")
+ col.prop(fluid, "export_animated_mesh")
- col = split.column()
- col.itemL(text="Initial Velocity:")
- col.itemR(fluid, "initial_velocity", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Initial Velocity:")
+ col.prop(fluid, "initial_velocity", text="")
elif fluid.type == 'OBSTACLE':
split = layout.split()
col = split.column()
- col.itemL(text="Volume Initialization:")
- col.itemR(fluid, "volume_initialization", text="")
- col.itemR(fluid, "export_animated_mesh")
+ col.label(text="Volume Initialization:")
+ col.prop(fluid, "volume_initialization", text="")
+ col.prop(fluid, "export_animated_mesh")
- col = split.column()
- col.itemL(text="Slip Type:")
- col.itemR(fluid, "slip_type", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Slip Type:")
+ col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
+ col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
- col.itemL(text="Impact:")
- col.itemR(fluid, "impact_factor", text="Factor")
+ col.label(text="Impact:")
+ col.prop(fluid, "impact_factor", text="Factor")
elif fluid.type == 'INFLOW':
split = layout.split()
col = split.column()
- col.itemL(text="Volume Initialization:")
- col.itemR(fluid, "volume_initialization", text="")
- col.itemR(fluid, "export_animated_mesh")
- col.itemR(fluid, "local_coordinates")
+ col.label(text="Volume Initialization:")
+ col.prop(fluid, "volume_initialization", text="")
+ col.prop(fluid, "export_animated_mesh")
+ col.prop(fluid, "local_coordinates")
- col = split.column()
- col.itemL(text="Inflow Velocity:")
- col.itemR(fluid, "inflow_velocity", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Inflow Velocity:")
+ col.prop(fluid, "inflow_velocity", text="")
elif fluid.type == 'OUTFLOW':
split = layout.split()
col = split.column()
- col.itemL(text="Volume Initialization:")
- col.itemR(fluid, "volume_initialization", text="")
- col.itemR(fluid, "export_animated_mesh")
+ col.label(text="Volume Initialization:")
+ col.prop(fluid, "volume_initialization", text="")
+ col.prop(fluid, "export_animated_mesh")
- split.column()
+ if wide_ui:
+ split.column()
elif fluid.type == 'PARTICLE':
- split = layout.split(percentage=0.5)
+ split = layout.split()
col = split.column()
- col.itemL(text="Influence:")
- col.itemR(fluid, "particle_influence", text="Size")
- col.itemR(fluid, "alpha_influence", text="Alpha")
+ col.label(text="Influence:")
+ col.prop(fluid, "particle_influence", text="Size")
+ col.prop(fluid, "alpha_influence", text="Alpha")
- col = split.column()
- col.itemL(text="Type:")
- col.itemR(fluid, "drops")
- col.itemR(fluid, "floats")
- col = split.column()
- col.itemL()
- col.itemR(fluid, "tracer")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Type:")
+ col.prop(fluid, "drops")
+ col.prop(fluid, "floats")
+ col.prop(fluid, "tracer")
- layout.itemR(fluid, "path", text="")
+ layout.prop(fluid, "path", text="")
elif fluid.type == 'CONTROL':
split = layout.split()
col = split.column()
- col.itemL(text="")
- col.itemR(fluid, "quality", slider=True)
- col.itemR(fluid, "reverse_frames")
+ col.label(text="")
+ col.prop(fluid, "quality", slider=True)
+ col.prop(fluid, "reverse_frames")
- col = split.column()
- col.itemL(text="Time:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Time:")
sub = col.column(align=True)
- sub.itemR(fluid, "start_time", text="Start")
- sub.itemR(fluid, "end_time", text="End")
+ sub.prop(fluid, "start_time", text="Start")
+ sub.prop(fluid, "end_time", text="End")
split = layout.split()
col = split.column()
- col.itemL(text="Attraction Force:")
+ col.label(text="Attraction Force:")
sub = col.column(align=True)
- sub.itemR(fluid, "attraction_strength", text="Strength")
- sub.itemR(fluid, "attraction_radius", text="Radius")
+ sub.prop(fluid, "attraction_strength", text="Strength")
+ sub.prop(fluid, "attraction_radius", text="Radius")
- col = split.column()
- col.itemL(text="Velocity Force:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Velocity Force:")
sub = col.column(align=True)
- sub.itemR(fluid, "velocity_strength", text="Strength")
- sub.itemR(fluid, "velocity_radius", text="Radius")
+ sub.prop(fluid, "velocity_strength", text="Strength")
+ sub.prop(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
@@ -201,31 +220,29 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Gravity:")
- col.itemR(fluid, "gravity", text="")
- col.itemL(text="Real World Size:")
- col.itemR(fluid, "real_world_size", text="Metres")
+ col.label(text="Gravity:")
+ col.prop(fluid, "gravity", text="")
+ col.label(text="Real World Size:")
+ col.prop(fluid, "real_world_size", text="Metres")
- col = split.column()
- col.itemL(text="Viscosity Presets:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Viscosity Presets:")
sub = col.column(align=True)
- sub.itemR(fluid, "viscosity_preset", text="")
+ sub.prop(fluid, "viscosity_preset", text="")
if fluid.viscosity_preset == 'MANUAL':
- sub.itemR(fluid, "viscosity_base", text="Base")
- sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
- else:
- sub.itemL()
- sub.itemL()
+ sub.prop(fluid, "viscosity_base", text="Base")
+ sub.prop(fluid, "viscosity_exponent", text="Exponent", slider=True)
- col.itemL(text="Optimization:")
- sub = col.column(align=True)
- sub.itemR(fluid, "grid_levels", slider=True)
- sub.itemR(fluid, "compressibility", slider=True)
+ col.label(text="Optimization:")
+ col.prop(fluid, "grid_levels", slider=True)
+ col.prop(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
@@ -240,21 +257,21 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
layout = self.layout
fluid = context.fluid.settings
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Slip Type:")
- sub = col.column(align=True)
- sub.itemR(fluid, "slip_type", text="")
+ col.label(text="Slip Type:")
+ col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
+ col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
- col = split.column()
- col.itemL(text="Surface:")
- sub = col.column(align=True)
- sub.itemR(fluid, "surface_smoothing", text="Smoothing")
- sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Surface:")
+ col.prop(fluid, "surface_smoothing", text="Smoothing")
+ col.prop(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
@@ -271,8 +288,8 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
fluid = context.fluid.settings
col = layout.column(align=True)
- col.itemR(fluid, "tracer_particles")
- col.itemR(fluid, "generate_particles")
+ col.prop(fluid, "tracer_particles")
+ col.prop(fluid, "generate_particles")
bpy.types.register(PHYSICS_PT_fluid)
bpy.types.register(PHYSICS_PT_domain_gravity)
diff --git a/release/scripts/ui/properties_physics_smoke.py b/release/scripts/ui/properties_physics_smoke.py
index 3b9b6fdf2b1..b390b32cadc 100644
--- a/release/scripts/ui/properties_physics_smoke.py
+++ b/release/scripts/ui/properties_physics_smoke.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
@@ -43,6 +45,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
md = context.smoke
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
@@ -50,19 +53,23 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
- split.itemO("object.modifier_remove", text="Remove")
+ split.operator("object.modifier_remove", text="Remove")
row = split.row(align=True)
- row.itemR(md, "render", text="")
- row.itemR(md, "realtime", text="")
+ row.prop(md, "render", text="")
+ row.prop(md, "realtime", text="")
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
- split.itemL()
+ split.operator("object.modifier_add", text="Add").type = 'SMOKE'
+ if wide_ui:
+ split.label()
if md:
- layout.itemR(md, "smoke_type", expand=True)
+ if wide_ui:
+ layout.prop(md, "smoke_type", expand=True)
+ else:
+ layout.prop(md, "smoke_type", text="")
if md.smoke_type == 'TYPE_DOMAIN':
@@ -71,18 +78,19 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
- col.itemR(domain, "maxres", text="Divisions")
+ col.label(text="Resolution:")
+ col.prop(domain, "maxres", text="Divisions")
- col = split.column()
- col.itemL(text="Behavior:")
- col.itemR(domain, "alpha")
- col.itemR(domain, "beta")
- col.itemR(domain, "dissolve_smoke", text="Dissolve")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Behavior:")
+ col.prop(domain, "alpha")
+ col.prop(domain, "beta")
+ col.prop(domain, "dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.dissolve_smoke
- sub.itemR(domain, "dissolve_speed", text="Time")
- sub.itemR(domain, "dissolve_smoke_log", text="Slow")
+ sub.prop(domain, "dissolve_speed", text="Time")
+ sub.prop(domain, "dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'TYPE_FLOW':
@@ -91,20 +99,22 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(flow, "outflow")
- col.itemL(text="Particle System:")
- col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
+ col.prop(flow, "outflow")
+ col.label(text="Particle System:")
+ col.prop_object(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow:
- col = split.column()
+ if wide_ui:
+ col = split.column()
else:
- col = split.column()
- col.itemL(text="Behavior:")
- col.itemR(flow, "temperature")
- col.itemR(flow, "density")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Behavior:")
+ col.prop(flow, "temperature")
+ col.prop(flow, "density")
#elif md.smoke_type == 'TYPE_COLL':
- # layout.itemS()
+ # layout.separator()
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
@@ -119,19 +129,21 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
layout = self.layout
group = context.smoke.domain_settings
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Flow Group:")
- col.itemR(group, "fluid_group", text="")
+ col.label(text="Flow Group:")
+ col.prop(group, "fluid_group", text="")
- #col.itemL(text="Effector Group:")
- #col.itemR(group, "eff_group", text="")
+ #col.label(text="Effector Group:")
+ #col.prop(group, "eff_group", text="")
- col = split.column()
- col.itemL(text="Collision Group:")
- col.itemR(group, "coll_group", text="")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Collision Group:")
+ col.prop(group, "coll_group", text="")
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
@@ -143,12 +155,10 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
- layout = self.layout
-
md = context.smoke.domain_settings
cache = md.point_cache_low
- point_cache_ui(self, cache, cache.baked == False, 0, 1)
+ point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
@@ -162,24 +172,26 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
def draw_header(self, context):
high = context.smoke.domain_settings
- self.layout.itemR(high, "highres", text="")
+ self.layout.prop(high, "highres", text="")
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
- col.itemR(md, "amplify", text="Divisions")
+ col.label(text="Resolution:")
+ col.prop(md, "amplify", text="Divisions")
+ col.prop(md, "viewhighres")
- col = split.column()
- col.itemL(text="Noise Method:")
- col.row().itemR(md, "noise_type", text="")
- col.itemR(md, "strength")
- col.itemR(md, "viewhighres")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Noise Method:")
+ col.row().prop(md, "noise_type", text="")
+ col.prop(md, "strength")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
@@ -191,12 +203,10 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
def draw(self, context):
- layout = self.layout
-
md = context.smoke.domain_settings
cache = md.point_cache_high
- point_cache_ui(self, cache, cache.baked == False, 0, 1)
+ point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
@@ -209,7 +219,7 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
def draw(self, context):
domain = context.smoke.domain_settings
- effector_weights_ui(self, domain.effector_weights)
+ effector_weights_ui(self, context, domain.effector_weights)
bpy.types.register(PHYSICS_PT_smoke)
bpy.types.register(PHYSICS_PT_smoke_field_weights)
diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py
index f43d903d0c7..60b9c08ee58 100644
--- a/release/scripts/ui/properties_physics_softbody.py
+++ b/release/scripts/ui/properties_physics_softbody.py
@@ -19,13 +19,15 @@
#
import bpy
+narrowui = 180
+
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
def softbody_panel_enabled(md):
- return md.point_cache.baked == False
+ return (md.point_cache.baked is False)
class PhysicButtonsPanel(bpy.types.Panel):
@@ -47,22 +49,24 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
md = context.soft_body
ob = context.object
+ wide_ui = context.region.width > narrowui
split = layout.split()
- split.operator_context = "EXEC_DEFAULT"
+ split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
- split.itemO("object.modifier_remove", text="Remove")
+ split.operator("object.modifier_remove", text="Remove")
row = split.row(align=True)
- row.itemR(md, "render", text="")
- row.itemR(md, "realtime", text="")
+ row.prop(md, "render", text="")
+ row.prop(md, "realtime", text="")
else:
# add modifier
- split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
- split.itemL("")
+ split.operator("object.modifier_add", text="Add").type = 'SOFT_BODY'
+ if wide_ui:
+ split.column()
if md:
softbody = md.settings
@@ -72,14 +76,15 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
split.enabled = softbody_panel_enabled(md)
col = split.column()
- col.itemL(text="Object:")
- col.itemR(softbody, "friction")
- col.itemR(softbody, "mass")
- col.item_pointerR(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:")
+ col.label(text="Object:")
+ col.prop(softbody, "friction")
+ col.prop(softbody, "mass")
+ col.prop_object(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:")
- col = split.column()
- col.itemL(text="Simulation:")
- col.itemR(softbody, "speed")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Simulation:")
+ col.prop(softbody, "speed")
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
@@ -91,7 +96,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
def draw(self, context):
md = context.soft_body
- point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
+ point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 0, 0)
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
@@ -105,7 +110,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "use_goal", text="")
+ self.layout.prop(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
@@ -113,6 +118,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
md = context.soft_body
softbody = md.settings
ob = context.object
+ wide_ui = context.region.width > narrowui
layout.active = softbody.use_goal and softbody_panel_enabled(md)
@@ -122,18 +128,19 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Goal Strengths:")
- col.itemR(softbody, "goal_default", text="Default")
+ col.label(text="Goal Strengths:")
+ col.prop(softbody, "goal_default", text="Default")
sub = col.column(align=True)
- sub.itemR(softbody, "goal_min", text="Minimum")
- sub.itemR(softbody, "goal_max", text="Maximum")
+ sub.prop(softbody, "goal_min", text="Minimum")
+ sub.prop(softbody, "goal_max", text="Maximum")
- col = split.column()
- col.itemL(text="Goal Settings:")
- col.itemR(softbody, "goal_spring", text="Stiffness")
- col.itemR(softbody, "goal_friction", text="Damping")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Goal Settings:")
+ col.prop(softbody, "goal_spring", text="Stiffness")
+ col.prop(softbody, "goal_friction", text="Damping")
- layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
+ layout.prop_object(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
@@ -147,7 +154,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "use_edges", text="")
+ self.layout.prop(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
@@ -155,35 +162,37 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
md = context.soft_body
softbody = md.settings
ob = context.object
+ wide_ui = context.region.width > narrowui
layout.active = softbody.use_edges and softbody_panel_enabled(md)
split = layout.split()
col = split.column()
- col.itemL(text="Springs:")
- col.itemR(softbody, "pull")
- col.itemR(softbody, "push")
- col.itemR(softbody, "damp")
- col.itemR(softbody, "plastic")
- col.itemR(softbody, "bending")
- col.itemR(softbody, "spring_length", text="Length")
- col.item_pointerR(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:")
+ col.label(text="Springs:")
+ col.prop(softbody, "pull")
+ col.prop(softbody, "push")
+ col.prop(softbody, "damp")
+ col.prop(softbody, "plastic")
+ col.prop(softbody, "bending")
+ col.prop(softbody, "spring_length", text="Length")
+ col.prop_object(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:")
- col = split.column()
- col.itemR(softbody, "stiff_quads")
+ if wide_ui:
+ col = split.column()
+ col.prop(softbody, "stiff_quads")
sub = col.column()
sub.active = softbody.stiff_quads
- sub.itemR(softbody, "shear")
+ sub.prop(softbody, "shear")
- col.itemR(softbody, "new_aero", text="Aero")
+ col.prop(softbody, "new_aero", text="Aero")
sub = col.column()
sub.enabled = softbody.new_aero
- sub.itemR(softbody, "aero", text="Factor")
+ sub.prop(softbody, "aero", text="Factor")
- col.itemL(text="Collision:")
- col.itemR(softbody, "edge_collision", text="Edge")
- col.itemR(softbody, "face_collision", text="Face")
+ col.label(text="Collision:")
+ col.prop(softbody, "edge_collision", text="Edge")
+ col.prop(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
@@ -197,25 +206,28 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
- self.layout.itemR(softbody, "self_collision", text="")
+ self.layout.prop(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
- ob = context.object
+ wide_ui = context.region.width > narrowui
layout.active = softbody.self_collision and softbody_panel_enabled(md)
- layout.itemL(text="Collision Type:")
- layout.itemR(softbody, "collision_type", expand=True)
+ layout.label(text="Collision Type:")
+ if wide_ui:
+ layout.prop(softbody, "collision_type", expand=True)
+ else:
+ layout.prop(softbody, "collision_type", text="")
col = layout.column(align=True)
- col.itemL(text="Ball:")
- col.itemR(softbody, "ball_size", text="Size")
- col.itemR(softbody, "ball_stiff", text="Stiffness")
- col.itemR(softbody, "ball_damp", text="Dampening")
+ col.label(text="Ball:")
+ col.prop(softbody, "ball_size", text="Size")
+ col.prop(softbody, "ball_stiff", text="Stiffness")
+ col.prop(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
@@ -230,7 +242,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
md = context.soft_body
softbody = md.settings
- ob = context.object
+ wide_ui = context.region.width > narrowui
layout.active = softbody_panel_enabled(md)
@@ -238,19 +250,20 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
split = layout.split()
col = split.column(align=True)
- col.itemL(text="Step Size:")
- col.itemR(softbody, "minstep")
- col.itemR(softbody, "maxstep")
- col.itemR(softbody, "auto_step", text="Auto-Step")
+ col.label(text="Step Size:")
+ col.prop(softbody, "minstep")
+ col.prop(softbody, "maxstep")
+ col.prop(softbody, "auto_step", text="Auto-Step")
- col = split.column()
- col.itemR(softbody, "error_limit")
- col.itemL(text="Helpers:")
- col.itemR(softbody, "choke")
- col.itemR(softbody, "fuzzy")
+ if wide_ui:
+ col = split.column()
+ col.prop(softbody, "error_limit")
+ col.label(text="Helpers:")
+ col.prop(softbody, "choke")
+ col.prop(softbody, "fuzzy")
- layout.itemL(text="Diagnostics:")
- layout.itemR(softbody, "diagnose")
+ layout.label(text="Diagnostics:")
+ layout.prop(softbody, "diagnose")
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
@@ -263,7 +276,8 @@ class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
def draw(self, context):
md = context.soft_body
softbody = md.settings
- effector_weights_ui(self, softbody.effector_weights)
+
+ effector_weights_ui(self, context, softbody.effector_weights)
bpy.types.register(PHYSICS_PT_softbody)
bpy.types.register(PHYSICS_PT_softbody_cache)
diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py
index ddc0b552634..913ff98976c 100644
--- a/release/scripts/ui/properties_render.py
+++ b/release/scripts/ui/properties_render.py
@@ -19,6 +19,15 @@
#
import bpy
+narrowui = 180
+
+
+class RENDER_MT_presets(bpy.types.Menu):
+ bl_label = "Render Presets"
+ preset_subdir = "render"
+ preset_operator = "script.python_file_run"
+ draw = bpy.types.Menu.draw_preset
+
class RenderButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -28,7 +37,7 @@ class RenderButtonsPanel(bpy.types.Panel):
def poll(self, context):
rd = context.scene.render_data
- return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
+ return (context.scene and rd.use_game_engine is False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_render(RenderButtonsPanel):
@@ -39,12 +48,18 @@ class RENDER_PT_render(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
- row = layout.row()
- row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
- row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
+ split = layout.split()
- layout.itemR(rd, "display_mode", text="Display")
+ col = split.column()
+ col.operator("screen.render", text="Image", icon='ICON_RENDER_STILL')
+
+ if wide_ui:
+ col = split.column()
+ col.operator("screen.render", text="Animation", icon='ICON_RENDER_ANIMATION').animation = True
+
+ layout.prop(rd, "display_mode", text="Display")
class RENDER_PT_layers(RenderButtonsPanel):
@@ -57,116 +72,119 @@ class RENDER_PT_layers(RenderButtonsPanel):
scene = context.scene
rd = scene.render_data
+ wide_ui = context.region.width > narrowui
row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
- col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
- col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
+ col.operator("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
rl = rd.layers[rd.active_layer_index]
if rl:
- layout.itemR(rl, "name")
+ layout.prop(rl, "name")
split = layout.split()
col = split.column()
- col.itemR(scene, "visible_layers", text="Scene")
- col = split.column()
- col.itemR(rl, "visible_layers", text="Layer")
+ col.prop(scene, "visible_layers", text="Scene")
+ if wide_ui:
+ col = split.column()
+ col.prop(rl, "visible_layers", text="Layer")
- layout.itemR(rl, "light_override", text="Light")
- layout.itemR(rl, "material_override", text="Material")
+ layout.prop(rl, "light_override", text="Light")
+ layout.prop(rl, "material_override", text="Material")
- layout.itemS()
- layout.itemL(text="Include:")
+ layout.separator()
+ layout.label(text="Include:")
split = layout.split()
col = split.column()
- col.itemR(rl, "zmask")
+ col.prop(rl, "zmask")
row = col.row()
- row.itemR(rl, "zmask_negate", text="Negate")
+ row.prop(rl, "zmask_negate", text="Negate")
row.active = rl.zmask
- col.itemR(rl, "all_z")
+ col.prop(rl, "all_z")
col = split.column()
- col.itemR(rl, "solid")
- col.itemR(rl, "halo")
- col.itemR(rl, "ztransp")
- col.itemR(rl, "sky")
+ col.prop(rl, "solid")
+ col.prop(rl, "halo")
+ col.prop(rl, "ztransp")
+ col.prop(rl, "sky")
col = split.column()
- col.itemR(rl, "edge")
- col.itemR(rl, "strand")
- col.itemR(rl, "freestyle")
+ col.prop(rl, "edge")
+ col.prop(rl, "strand")
+ col.prop(rl, "freestyle")
if rl.zmask:
split = layout.split()
- split.itemL(text="Zmask Layers:")
- split.column().itemR(rl, "zmask_layers", text="")
+ split.label(text="Zmask Layers:")
+ split.column().prop(rl, "zmask_layers", text="")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Passes:")
- col.itemR(rl, "pass_combined")
- col.itemR(rl, "pass_z")
- col.itemR(rl, "pass_vector")
- col.itemR(rl, "pass_normal")
- col.itemR(rl, "pass_uv")
- col.itemR(rl, "pass_mist")
- col.itemR(rl, "pass_object_index")
+ col.label(text="Passes:")
+ col.prop(rl, "pass_combined")
+ col.prop(rl, "pass_z")
+ col.prop(rl, "pass_vector")
+ col.prop(rl, "pass_normal")
+ col.prop(rl, "pass_uv")
+ col.prop(rl, "pass_mist")
+ col.prop(rl, "pass_object_index")
- col = split.column()
- col.itemL()
- col.itemR(rl, "pass_color")
- col.itemR(rl, "pass_diffuse")
+ if wide_ui:
+ col = split.column()
+ col.label()
+ col.prop(rl, "pass_color")
+ col.prop(rl, "pass_diffuse")
row = col.row()
- row.itemR(rl, "pass_specular")
- row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
+ row.prop(rl, "pass_specular")
+ row.prop(rl, "pass_specular_exclude", text="", icon='ICON_X')
row = col.row()
- row.itemR(rl, "pass_shadow")
- row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
+ row.prop(rl, "pass_shadow")
+ row.prop(rl, "pass_shadow_exclude", text="", icon='ICON_X')
row = col.row()
- row.itemR(rl, "pass_ao")
- row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
+ row.prop(rl, "pass_ao")
+ row.prop(rl, "pass_ao_exclude", text="", icon='ICON_X')
row = col.row()
- row.itemR(rl, "pass_reflection")
- row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
+ row.prop(rl, "pass_reflection")
+ row.prop(rl, "pass_reflection_exclude", text="", icon='ICON_X')
row = col.row()
- row.itemR(rl, "pass_refraction")
- row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
+ row.prop(rl, "pass_refraction")
+ row.prop(rl, "pass_refraction_exclude", text="", icon='ICON_X')
if rl.freestyle:
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Freestyle:")
+ col.label(text="Freestyle:")
freestyle = rl.freestyle_settings
- col.itemR(freestyle, "sphere_radius", text="Sphere Radius")
- col.itemR(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
- col.itemR(freestyle, "suggestive_contours", text="Suggestive Contours")
- col.itemR(freestyle, "dkr_epsilon", text="Dkr Epsilon")
+ col.prop(freestyle, "sphere_radius", text="Sphere Radius")
+ col.prop(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
+ col.prop(freestyle, "suggestive_contours", text="Suggestive Contours")
+ col.prop(freestyle, "dkr_epsilon", text="Dkr Epsilon")
- col.itemO("scene.freestyle_module_add", text="Add Style Module")
+ col.operator("scene.freestyle_module_add", text="Add Style Module")
for i, module in enumerate(freestyle.modules):
box = layout.box()
box.set_context_pointer("freestyle_module", module)
row = box.row(align=True)
- row.itemR(module, "is_displayed", text="")
- row.itemR(module, "module_path", text="")
- row.itemO("scene.freestyle_module_remove", icon='ICON_X', text="")
- props = row.itemO("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="", properties=True)
+ row.prop(module, "is_displayed", text="")
+ row.prop(module, "module_path", text="")
+ row.operator("scene.freestyle_module_remove", icon='ICON_X', text="")
+ props = row.operator("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="")
props.active = (i > 0)
- props = row.itemO("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="", properties=True)
+ props = row.operator("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="")
props.active = (i < len(freestyle.modules) - 1)
@@ -178,19 +196,21 @@ class RENDER_PT_shading(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(rd, "render_textures", text="Textures")
- col.itemR(rd, "render_shadows", text="Shadows")
- col.itemR(rd, "render_sss", text="Subsurface Scattering")
- col.itemR(rd, "render_envmaps", text="Environment Map")
+ col.prop(rd, "render_textures", text="Textures")
+ col.prop(rd, "render_shadows", text="Shadows")
+ col.prop(rd, "render_sss", text="Subsurface Scattering")
+ col.prop(rd, "render_envmaps", text="Environment Map")
- col = split.column()
- col.itemR(rd, "render_raytracing", text="Ray Tracing")
- col.itemR(rd, "color_management")
- col.itemR(rd, "alpha_mode", text="Alpha")
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "render_raytracing", text="Ray Tracing")
+ col.prop(rd, "color_management")
+ col.prop(rd, "alpha_mode", text="Alpha")
class RENDER_PT_performance(RenderButtonsPanel):
@@ -202,36 +222,39 @@ class RENDER_PT_performance(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
split = layout.split()
- col = split.column(align=True)
- col.itemL(text="Threads:")
- col.row().itemR(rd, "threads_mode", expand=True)
+ col = split.column()
+ col.label(text="Threads:")
+ col.row().prop(rd, "threads_mode", expand=True)
sub = col.column()
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
- sub.itemR(rd, "threads")
- col.itemL(text="Tiles:")
- col.itemR(rd, "parts_x", text="X")
- col.itemR(rd, "parts_y", text="Y")
+ sub.prop(rd, "threads")
+ sub = col.column(align=True)
+ sub.label(text="Tiles:")
+ sub.prop(rd, "parts_x", text="X")
+ sub.prop(rd, "parts_y", text="Y")
- col = split.column()
- col.itemL(text="Memory:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Memory:")
sub = col.column()
- sub.itemR(rd, "save_buffers")
+ sub.prop(rd, "save_buffers")
sub.enabled = not rd.full_sample
sub = col.column()
sub.active = rd.use_compositing
- sub.itemR(rd, "free_image_textures")
+ sub.prop(rd, "free_image_textures")
sub = col.column()
sub.active = rd.render_raytracing
- sub.itemL(text="Acceleration structure:")
- sub.itemR(rd, "raytrace_structure", text="")
+ sub.label(text="Acceleration structure:")
+ sub.prop(rd, "raytrace_structure", text="")
if rd.raytrace_structure == 'OCTREE':
- sub.itemR(rd, "octree_resolution", text="Resolution")
+ sub.prop(rd, "octree_resolution", text="Resolution")
else:
- sub.itemR(rd, "use_instances", text="Instances")
- sub.itemR(rd, "use_local_coords", text="Local Coordinates")
+ sub.prop(rd, "use_instances", text="Instances")
+ sub.prop(rd, "use_local_coords", text="Local Coordinates")
class RENDER_PT_post_processing(RenderButtonsPanel):
@@ -243,39 +266,45 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemR(rd, "use_compositing")
- col.itemR(rd, "use_sequencer")
+ col.prop(rd, "use_compositing")
+ col.prop(rd, "use_sequencer")
- col = split.column()
- col.itemR(rd, "dither_intensity", text="Dither", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "dither_intensity", text="Dither", slider=True)
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemR(rd, "fields", text="Fields")
+ col.prop(rd, "fields", text="Fields")
sub = col.column()
sub.active = rd.fields
- sub.row().itemR(rd, "field_order", expand=True)
- sub.itemR(rd, "fields_still", text="Still")
+ sub.row().prop(rd, "field_order", expand=True)
+ sub.prop(rd, "fields_still", text="Still")
- col = split.column()
- col.itemR(rd, "edge")
+
+ if wide_ui:
+ col = split.column()
+ else:
+ col.separator()
+ col.prop(rd, "edge")
sub = col.column()
sub.active = rd.edge
- sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
- sub.itemR(rd, "edge_color", text="")
+ sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
+ sub.prop(rd, "edge_color", text="")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemR(rd, "freestyle", text="Freestyle")
+ col.prop(rd, "freestyle", text="Freestyle")
class RENDER_PT_output(RenderButtonsPanel):
@@ -286,61 +315,74 @@ class RENDER_PT_output(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
- layout.itemR(rd, "output_path", text="")
+ layout.prop(rd, "output_path", text="")
split = layout.split()
col = split.column()
- col.itemR(rd, "file_format", text="")
- col.row().itemR(rd, "color_mode", text="Color", expand=True)
+ col.prop(rd, "file_format", text="")
+ col.row().prop(rd, "color_mode", text="Color", expand=True)
- col = split.column()
- col.itemR(rd, "file_extensions")
- col.itemR(rd, "use_overwrite")
- col.itemR(rd, "use_placeholder")
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "file_extensions")
+ col.prop(rd, "use_overwrite")
+ col.prop(rd, "use_placeholder")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
- split.itemR(rd, "quality", slider=True)
+ split.prop(rd, "quality", slider=True)
elif rd.file_format == 'OPENEXR':
split = layout.split()
col = split.column()
- col.itemL(text="Codec:")
- col.itemR(rd, "exr_codec", text="")
+ col.label(text="Codec:")
+ col.prop(rd, "exr_codec", text="")
- subsplit = split.split()
- col = subsplit.column()
- col.itemR(rd, "exr_half")
- col.itemR(rd, "exr_zbuf")
- col = subsplit.column()
- col.itemR(rd, "exr_preview")
+ if wide_ui:
+ subsplit = split.split()
+ col = subsplit.column()
+ col.prop(rd, "exr_half")
+ col.prop(rd, "exr_zbuf")
+
+ if wide_ui:
+ col = subsplit.column()
+ col.prop(rd, "exr_preview")
elif rd.file_format == 'JPEG2000':
split = layout.split()
col = split.column()
- col.itemL(text="Depth:")
- col.row().itemR(rd, "jpeg2k_depth", expand=True)
+ col.label(text="Depth:")
+ col.row().prop(rd, "jpeg2k_depth", expand=True)
- col = split.column()
- col.itemR(rd, "jpeg2k_preset", text="")
- col.itemR(rd, "jpeg2k_ycc")
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "jpeg2k_preset", text="")
+ col.prop(rd, "jpeg2k_ycc")
elif rd.file_format in ('CINEON', 'DPX'):
split = layout.split()
col = split.column()
- col.itemR(rd, "cineon_log", text="Convert to Log")
+ col.prop(rd, "cineon_log", text="Convert to Log")
- col = split.column(align=True)
+ if wide_ui:
+ col = split.column(align=True)
col.active = rd.cineon_log
- col.itemR(rd, "cineon_black", text="Black")
- col.itemR(rd, "cineon_white", text="White")
- col.itemR(rd, "cineon_gamma", text="Gamma")
+ col.prop(rd, "cineon_black", text="Black")
+ col.prop(rd, "cineon_white", text="White")
+ col.prop(rd, "cineon_gamma", text="Gamma")
elif rd.file_format == 'TIFF':
split = layout.split()
- split.itemR(rd, "tiff_bit")
+ split.prop(rd, "tiff_bit")
+
+ elif rd.file_format == 'QUICKTIME_QTKIT':
+ split = layout.split()
+ col = split.column()
+ col.prop(rd, "quicktime_codec_type")
+ col.prop(rd, "quicktime_codec_spatial_quality", text="Quality")
class RENDER_PT_encoding(RenderButtonsPanel):
@@ -356,44 +398,61 @@ class RENDER_PT_encoding(RenderButtonsPanel):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
split = layout.split()
- split.itemR(rd, "ffmpeg_format")
+ col = split.column()
+ col.prop(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
- split.itemR(rd, "ffmpeg_codec")
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "ffmpeg_codec")
else:
- split.itemL()
+ if wide_ui:
+ split.label()
split = layout.split()
col = split.column()
- col.itemR(rd, "ffmpeg_video_bitrate")
- col.itemL(text="Rate:")
- col.itemR(rd, "ffmpeg_minrate", text="Minimum")
- col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
- col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
-
- col = split.column()
- col.itemR(rd, "ffmpeg_gopsize")
- col.itemR(rd, "ffmpeg_autosplit")
- col.itemL(text="Mux:")
- col.itemR(rd, "ffmpeg_muxrate", text="Rate")
- col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
-
- row = layout.row()
- row.itemL(text="Audio:")
- row = layout.row()
- row.itemR(rd, "ffmpeg_audio_codec")
+ col.prop(rd, "ffmpeg_video_bitrate")
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "ffmpeg_gopsize")
split = layout.split()
col = split.column()
- col.itemR(rd, "ffmpeg_audio_bitrate")
- col.itemR(rd, "ffmpeg_audio_mixrate")
+ col.label(text="Rate:")
+ col.prop(rd, "ffmpeg_minrate", text="Minimum")
+ col.prop(rd, "ffmpeg_maxrate", text="Maximum")
+ col.prop(rd, "ffmpeg_buffersize", text="Buffer")
+
+ if wide_ui:
+ col = split.column()
+
+ col.prop(rd, "ffmpeg_autosplit")
+ col.label(text="Mux:")
+ col.prop(rd, "ffmpeg_muxrate", text="Rate")
+ col.prop(rd, "ffmpeg_packetsize", text="Packet Size")
+
+ # Audio:
+ layout.prop(rd, "ffmpeg_multiplex_audio", text="Audio")
+
+ sub = layout.column()
+ sub.active = rd.ffmpeg_multiplex_audio
+ sub.prop(rd, "ffmpeg_audio_codec", text="Codec")
+ sub.separator()
+
+ split = sub.split()
+
col = split.column()
- col.itemR(rd, "ffmpeg_multiplex_audio")
- col.itemR(rd, "ffmpeg_audio_volume")
+ col.prop(rd, "ffmpeg_audio_bitrate")
+ col.prop(rd, "ffmpeg_audio_mixrate")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "ffmpeg_audio_volume", slider=True)
class RENDER_PT_antialiasing(RenderButtonsPanel):
@@ -403,24 +462,25 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
def draw_header(self, context):
rd = context.scene.render_data
- self.layout.itemR(rd, "antialiasing", text="")
+ self.layout.prop(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
-
+ wide_ui = context.region.width > narrowui
layout.active = rd.antialiasing
split = layout.split()
col = split.column()
- col.row().itemR(rd, "antialiasing_samples", expand=True)
- col.itemR(rd, "full_sample")
+ col.row().prop(rd, "antialiasing_samples", expand=True)
+ col.prop(rd, "full_sample")
- col = split.column()
- col.itemR(rd, "pixel_filter", text="")
- col.itemR(rd, "filter_size", text="Size", slider=True)
+ if wide_ui:
+ col = split.column()
+ col.prop(rd, "pixel_filter", text="")
+ col.prop(rd, "filter_size", text="Size")
class RENDER_PT_dimensions(RenderButtonsPanel):
@@ -432,35 +492,43 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
scene = context.scene
rd = scene.render_data
+ wide_ui = context.region.width > narrowui
+
+ row = layout.row().split()
+ sub = row.row(align=True).split(percentage=0.75)
+ sub.menu("RENDER_MT_presets", text="Presets")
+ sub.operator("render.preset_add", text="Add")
split = layout.split()
col = split.column()
sub = col.column(align=True)
- sub.itemL(text="Resolution:")
- sub.itemR(rd, "resolution_x", text="X")
- sub.itemR(rd, "resolution_y", text="Y")
- sub.itemR(rd, "resolution_percentage", text="")
+ sub.label(text="Resolution:")
+ sub.prop(rd, "resolution_x", text="X")
+ sub.prop(rd, "resolution_y", text="Y")
+ sub.prop(rd, "resolution_percentage", text="")
- sub.itemL(text="Aspect Ratio:")
- sub.itemR(rd, "pixel_aspect_x", text="X")
- sub.itemR(rd, "pixel_aspect_y", text="Y")
+ sub.label(text="Aspect Ratio:")
+ sub.prop(rd, "pixel_aspect_x", text="X")
+ sub.prop(rd, "pixel_aspect_y", text="Y")
row = col.row()
- row.itemR(rd, "use_border", text="Border")
- rowsub = row.row()
- rowsub.active = rd.use_border
- rowsub.itemR(rd, "crop_to_border", text="Crop")
+ row.prop(rd, "use_border", text="Border")
+ sub = row.row()
+ sub.active = rd.use_border
+ sub.prop(rd, "crop_to_border", text="Crop")
- col = split.column(align=True)
- col.itemL(text="Frame Range:")
- col.itemR(scene, "start_frame", text="Start")
- col.itemR(scene, "end_frame", text="End")
- col.itemR(scene, "frame_step", text="Step")
+ if wide_ui:
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="Frame Range:")
+ sub.prop(scene, "start_frame", text="Start")
+ sub.prop(scene, "end_frame", text="End")
+ sub.prop(scene, "frame_step", text="Step")
- col.itemL(text="Frame Rate:")
- col.itemR(rd, "fps")
- col.itemR(rd, "fps_base", text="/")
+ sub.label(text="Frame Rate:")
+ sub.prop(rd, "fps")
+ sub.prop(rd, "fps_base", text="/")
class RENDER_PT_stamp(RenderButtonsPanel):
@@ -471,39 +539,45 @@ class RENDER_PT_stamp(RenderButtonsPanel):
def draw_header(self, context):
rd = context.scene.render_data
- self.layout.itemR(rd, "render_stamp", text="")
+ self.layout.prop(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
+ wide_ui = context.region.width > narrowui
layout.active = rd.render_stamp
split = layout.split()
col = split.column()
- col.itemR(rd, "stamp_time", text="Time")
- col.itemR(rd, "stamp_date", text="Date")
- col.itemR(rd, "stamp_render_time", text="RenderTime")
- col.itemR(rd, "stamp_frame", text="Frame")
- col.itemR(rd, "stamp_scene", text="Scene")
- col.itemR(rd, "stamp_camera", text="Camera")
- col.itemR(rd, "stamp_filename", text="Filename")
- col.itemR(rd, "stamp_marker", text="Marker")
- col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
+ col.prop(rd, "stamp_time", text="Time")
+ col.prop(rd, "stamp_date", text="Date")
+ col.prop(rd, "stamp_render_time", text="RenderTime")
+ col.prop(rd, "stamp_frame", text="Frame")
+ col.prop(rd, "stamp_scene", text="Scene")
+ col.prop(rd, "stamp_camera", text="Camera")
+ col.prop(rd, "stamp_filename", text="Filename")
+ col.prop(rd, "stamp_marker", text="Marker")
+ col.prop(rd, "stamp_sequence_strip", text="Seq. Strip")
- col = split.column()
+ if wide_ui:
+ col = split.column()
col.active = rd.render_stamp
- col.itemR(rd, "stamp_foreground", slider=True)
- col.itemR(rd, "stamp_background", slider=True)
- col.itemR(rd, "stamp_font_size", text="Font Size")
+ col.prop(rd, "stamp_foreground", slider=True)
+ col.prop(rd, "stamp_background", slider=True)
+ col.separator()
+ col.prop(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
- row.itemR(rd, "stamp_note", text="Note")
+ row.prop(rd, "stamp_note", text="Note")
sub = row.row()
sub.active = rd.stamp_note
- sub.itemR(rd, "stamp_note_text", text="")
+ sub.prop(rd, "stamp_note_text", text="")
+
+
+bpy.types.register(RENDER_MT_presets)
bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_layers)
diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py
index 9ab431a2d6d..8325889e644 100644
--- a/release/scripts/ui/properties_scene.py
+++ b/release/scripts/ui/properties_scene.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class SceneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -35,11 +37,15 @@ class SCENE_PT_scene(SceneButtonsPanel):
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
scene = context.scene
- layout.itemR(scene, "camera")
- layout.itemR(scene, "set", text="Background")
+ if wide_ui:
+ layout.prop(scene, "camera")
+ layout.prop(scene, "set", text="Background")
+ else:
+ layout.prop(scene, "camera", text="")
+ layout.prop(scene, "set", text="")
class SCENE_PT_unit(SceneButtonsPanel):
@@ -48,16 +54,21 @@ class SCENE_PT_unit(SceneButtonsPanel):
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
unit = context.scene.unit_settings
col = layout.column()
- col.row().itemR(unit, "system", expand=True)
+ col.row().prop(unit, "system", expand=True)
- row = layout.row()
- row.active = (unit.system != 'NONE')
- row.itemR(unit, "scale_length", text="Scale")
- row.itemR(unit, "use_separate")
+ split = layout.split()
+ split.active = (unit.system != 'NONE')
+
+ col = split.column()
+ col.prop(unit, "scale_length", text="Scale")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(unit, "use_separate")
class SCENE_PT_keying_sets(SceneButtonsPanel):
@@ -67,44 +78,46 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
layout = self.layout
scene = context.scene
-
+ wide_ui = context.region.width > narrowui
row = layout.row()
col = row.column()
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
col = row.column(align=True)
- col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
- col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
+ col.operator("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
ks = scene.active_keying_set
if ks:
row = layout.row()
col = row.column()
- col.itemR(ks, "name")
- col.itemR(ks, "absolute")
+ col.prop(ks, "name")
+ col.prop(ks, "absolute")
- col = row.column()
- col.itemL(text="Keyframing Settings:")
- col.itemR(ks, "insertkey_needed", text="Needed")
- col.itemR(ks, "insertkey_visual", text="Visual")
+ if wide_ui:
+ col = row.column()
+ col.label(text="Keyframing Settings:")
+ col.prop(ks, "insertkey_needed", text="Needed")
+ col.prop(ks, "insertkey_visual", text="Visual")
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
bl_label = "Active Keying Set"
def poll(self, context):
- return (context.scene != None) and (context.scene.active_keying_set != None)
+ return (context.scene.active_keying_set is not None)
def draw(self, context):
layout = self.layout
scene = context.scene
ks = scene.active_keying_set
+ wide_ui = context.region.width > narrowui
row = layout.row()
- row.itemL(text="Paths:")
+ row.label(text="Paths:")
row = layout.row()
@@ -112,13 +125,13 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
col.template_list(ks, "paths", ks, "active_path_index", rows=2)
col = row.column(align=True)
- col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
- col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
+ col.operator("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
+ col.operator("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
ksp = ks.active_path
if ksp:
col = layout.column()
- col.itemL(text="Target:")
+ col.label(text="Target:")
col.template_any_ID(ksp, "id", "id_type")
col.template_path_builder(ksp, "rna_path", ksp.id)
@@ -126,16 +139,17 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
row = layout.row()
col = row.column()
- col.itemL(text="Array Target:")
- col.itemR(ksp, "entire_array")
- if ksp.entire_array == False:
- col.itemR(ksp, "array_index")
+ col.label(text="Array Target:")
+ col.prop(ksp, "entire_array")
+ if ksp.entire_array is False:
+ col.prop(ksp, "array_index")
- col = row.column()
- col.itemL(text="F-Curve Grouping:")
- col.itemR(ksp, "grouping")
+ if wide_ui:
+ col = row.column()
+ col.label(text="F-Curve Grouping:")
+ col.prop(ksp, "grouping")
if ksp.grouping == 'NAMED':
- col.itemR(ksp, "group")
+ col.prop(ksp, "group")
class SCENE_PT_physics(SceneButtonsPanel):
@@ -143,16 +157,20 @@ class SCENE_PT_physics(SceneButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- self.layout.itemR(context.scene, "use_gravity", text="")
+ self.layout.prop(context.scene, "use_gravity", text="")
def draw(self, context):
layout = self.layout
scene = context.scene
+ wide_ui = context.region.width > narrowui
layout.active = scene.use_gravity
- layout.itemR(scene, "gravity", text="")
+ if wide_ui:
+ layout.prop(scene, "gravity", text="")
+ else:
+ layout.column().prop(scene, "gravity", text="")
bpy.types.register(SCENE_PT_scene)
bpy.types.register(SCENE_PT_unit)
diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py
index 69540f7dea7..1844599e957 100644
--- a/release/scripts/ui/properties_texture.py
+++ b/release/scripts/ui/properties_texture.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
def active_node_mat(mat):
if mat:
@@ -32,22 +34,21 @@ def active_node_mat(mat):
def context_tex_datablock(context):
-
- idblock = active_node_mat(context.material)
- if idblock:
- return idblock
-
- idblock = context.lamp
- if idblock:
- return idblock
-
- idblock = context.world
- if idblock:
- return idblock
-
- idblock = context.brush
+ idblock = active_node_mat(context.material)
+ if idblock:
return idblock
+ idblock = context.lamp
+ if idblock:
+ return idblock
+
+ idblock = context.world
+ if idblock:
+ return idblock
+
+ idblock = context.brush
+ return idblock
+
class TextureButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -87,7 +88,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
layout = self.layout
tex = context.texture
-
+ wide_ui = context.region.width > narrowui
idblock = context_tex_datablock(context)
space = context.space_data
@@ -98,16 +99,18 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2)
col = row.column(align=True)
- col.item_enumO("texture.slot_move", "type", 'UP', text="", icon='ICON_TRIA_UP')
- col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
+ col.operator("texture.slot_move", text="", icon='ICON_TRIA_UP').type = 'UP'
+ col.operator("texture.slot_move", text="", icon='ICON_TRIA_DOWN').type = 'DOWN'
- split = layout.split(percentage=0.65)
-
- if idblock:
- split.template_ID(idblock, "active_texture", new="texture.new")
- elif tex:
- split.template_ID(space, "pin_id")
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if idblock:
+ split.template_ID(idblock, "active_texture", new="texture.new")
+ elif tex:
+ split.template_ID(space, "pin_id")
+ else:
+ layout.template_ID(idblock, "active_texture", new="texture.new")
if (not space.pin_id) and (
context.sculpt_object or
@@ -115,10 +118,10 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
context.weight_paint_object or
context.texture_paint_object):
- split.itemR(space, "brush_texture", text="Brush", toggle=True)
+ split.prop(space, "brush_texture", text="Brush", toggle=True)
if tex:
- layout.itemR(tex, "use_nodes")
+ layout.prop(tex, "use_nodes")
split = layout.split(percentage=0.2)
@@ -126,12 +129,15 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
slot = context.texture_slot
if slot:
- split.itemL(text="Output:")
- split.itemR(slot, "output_node", text="")
+ split.label(text="Output:")
+ split.prop(slot, "output_node", text="")
else:
- split.itemL(text="Type:")
- split.itemR(tex, "type", text="")
+ if wide_ui:
+ split.label(text="Type:")
+ split.prop(tex, "type", text="")
+ else:
+ layout.prop(tex, "type", text="")
class TEXTURE_PT_colors(TextureButtonsPanel):
@@ -142,24 +148,26 @@ class TEXTURE_PT_colors(TextureButtonsPanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "use_color_ramp", text="Ramp")
+ layout.prop(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex, "color_ramp", expand=True)
split = layout.split()
col = split.column()
- col.itemL(text="RGB Multiply:")
+ col.label(text="RGB Multiply:")
sub = col.column(align=True)
- sub.itemR(tex, "factor_red", text="R")
- sub.itemR(tex, "factor_green", text="G")
- sub.itemR(tex, "factor_blue", text="B")
+ sub.prop(tex, "factor_red", text="R")
+ sub.prop(tex, "factor_green", text="G")
+ sub.prop(tex, "factor_blue", text="B")
- col = split.column()
- col.itemL(text="Adjust:")
- col.itemR(tex, "brightness")
- col.itemR(tex, "contrast")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Adjust:")
+ col.prop(tex, "brightness")
+ col.prop(tex, "contrast")
# Texture Slot Panels #
@@ -180,73 +188,80 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
idblock = context_tex_datablock(context)
tex = context.texture_slot
- textype = context.texture
+ # textype = context.texture
+ wide_ui = context.region.width > narrowui
if type(idblock) != bpy.types.Brush:
split = layout.split(percentage=0.3)
col = split.column()
- col.itemL(text="Coordinates:")
+ col.label(text="Coordinates:")
col = split.column()
- col.itemR(tex, "texture_coordinates", text="")
+ col.prop(tex, "texture_coordinates", text="")
if tex.texture_coordinates == 'ORCO':
"""
ob = context.object
if ob and ob.type == 'MESH':
split = layout.split(percentage=0.3)
- split.itemL(text="Mesh:")
- split.itemR(ob.data, "texco_mesh", text="")
+ split.label(text="Mesh:")
+ split.prop(ob.data, "texco_mesh", text="")
"""
elif tex.texture_coordinates == 'UV':
split = layout.split(percentage=0.3)
- split.itemL(text="Layer:")
+ split.label(text="Layer:")
ob = context.object
if ob and ob.type == 'MESH':
- split.item_pointerR(tex, "uv_layer", ob.data, "uv_textures", text="")
+ split.prop_object(tex, "uv_layer", ob.data, "uv_textures", text="")
else:
- split.itemR(tex, "uv_layer", text="")
+ split.prop(tex, "uv_layer", text="")
elif tex.texture_coordinates == 'OBJECT':
split = layout.split(percentage=0.3)
- split.itemL(text="Object:")
- split.itemR(tex, "object", text="")
+ split.label(text="Object:")
+ split.prop(tex, "object", text="")
if type(idblock) == bpy.types.Brush:
- layout.itemR(tex, "map_mode", expand=True)
+ layout.prop(tex, "map_mode", expand=True)
row = layout.row()
row.active = tex.map_mode in ('FIXED', 'TILED')
- row.itemR(tex, "angle")
+ row.prop(tex, "angle")
row = layout.row()
row.active = tex.map_mode in ('TILED', '3D')
- row.column().itemR(tex, "size")
+ row.column().prop(tex, "size")
else:
if type(idblock) == bpy.types.Material:
split = layout.split(percentage=0.3)
- split.itemL(text="Projection:")
- split.itemR(tex, "mapping", text="")
+ split.label(text="Projection:")
+ split.prop(tex, "mapping", text="")
split = layout.split()
col = split.column()
if tex.texture_coordinates in ('ORCO', 'UV'):
- col.itemR(tex, "from_dupli")
+ col.prop(tex, "from_dupli")
elif tex.texture_coordinates == 'OBJECT':
- col.itemR(tex, "from_original")
- else:
- col.itemL()
+ col.prop(tex, "from_original")
+ elif wide_ui:
+ col.label()
- col = split.column()
+ if wide_ui:
+ col = split.column()
row = col.row()
- row.itemR(tex, "x_mapping", text="")
- row.itemR(tex, "y_mapping", text="")
- row.itemR(tex, "z_mapping", text="")
+ row.prop(tex, "x_mapping", text="")
+ row.prop(tex, "y_mapping", text="")
+ row.prop(tex, "z_mapping", text="")
# any non brush
- row = layout.row()
- row.column().itemR(tex, "offset")
- row.column().itemR(tex, "size")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "offset")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "size")
class TEXTURE_PT_influence(TextureSlotPanel):
@@ -261,47 +276,49 @@ class TEXTURE_PT_influence(TextureSlotPanel):
idblock = context_tex_datablock(context)
- textype = context.texture
+ # textype = context.texture
tex = context.texture_slot
+ wide_ui = context.region.width > narrowui
def factor_but(layout, active, toggle, factor, name):
row = layout.row(align=True)
- row.itemR(tex, toggle, text="")
+ row.prop(tex, toggle, text="")
sub = row.row()
sub.active = active
- sub.itemR(tex, factor, text=name, slider=True)
+ sub.prop(tex, factor, text=name, slider=True)
if type(idblock) == bpy.types.Material:
if idblock.type in ('SURFACE', 'HALO', 'WIRE'):
split = layout.split()
col = split.column()
- col.itemL(text="Diffuse:")
+ col.label(text="Diffuse:")
factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
- col.itemL(text="Specular:")
+ col.label(text="Specular:")
factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
- col = split.column()
- col.itemL(text="Shading:")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Shading:")
factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
- col.itemL(text="Geometry:")
+ col.label(text="Geometry:")
factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
#sub = col.column()
#sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
- #sub.itemR(tex, "default_value", text="Amount", slider=True)
+ #sub.prop(tex, "default_value", text="Amount", slider=True)
elif idblock.type == 'VOLUME':
split = layout.split()
@@ -311,16 +328,22 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
- col = split.column()
- col.itemL(text=" ")
+ if wide_ui:
+ col = split.column()
+ col.label(text=" ")
factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
elif type(idblock) == bpy.types.Lamp:
- row = layout.row()
- factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
- factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
+ split = layout.split()
+
+ col = split.column()
+ factor_but(col, tex.map_color, "map_color", "color_factor", "Color")
+
+ if wide_ui:
+ col = split.column()
+ factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif type(idblock) == bpy.types.World:
split = layout.split()
@@ -329,27 +352,29 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
- col = split.column()
+ if wide_ui:
+ col = split.column()
factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemR(tex, "blend_type", text="Blend")
- col.itemR(tex, "rgb_to_intensity")
+ col.prop(tex, "blend_type", text="Blend")
+ col.prop(tex, "rgb_to_intensity")
sub = col.column()
sub.active = tex.rgb_to_intensity
- sub.itemR(tex, "color", text="")
+ sub.prop(tex, "color", text="")
- col = split.column()
- col.itemR(tex, "negate", text="Negative")
- col.itemR(tex, "stencil")
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "negate", text="Negative")
+ col.prop(tex, "stencil")
if type(idblock) in (bpy.types.Material, bpy.types.World):
- col.itemR(tex, "default_value", text="DVar", slider=True)
+ col.prop(tex, "default_value", text="DVar", slider=True)
# Texture Type Panels #
@@ -369,16 +394,25 @@ class TEXTURE_PT_clouds(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "stype", expand=True)
- layout.itemL(text="Noise:")
- layout.itemR(tex, "noise_type", text="Type", expand=True)
- layout.itemR(tex, "noise_basis", text="Basis")
+ layout.prop(tex, "stype", expand=True)
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ if wide_ui:
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_basis", text="")
- flow = layout.column_flow()
- flow.itemR(tex, "noise_size", text="Size")
- flow.itemR(tex, "noise_depth", text="Depth")
- flow.itemR(tex, "nabla", text="Nabla")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "noise_size", text="Size")
+ col.prop(tex, "noise_depth", text="Depth")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel):
@@ -389,21 +423,32 @@ class TEXTURE_PT_wood(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "noisebasis2", expand=True)
- layout.itemR(tex, "stype", expand=True)
+ layout.prop(tex, "noisebasis2", expand=True)
+ if wide_ui:
+ layout.prop(tex, "stype", expand=True)
+ else:
+ layout.prop(tex, "stype", text="")
col = layout.column()
col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
- col.itemL(text="Noise:")
- col.row().itemR(tex, "noise_type", text="Type", expand=True)
- col.itemR(tex, "noise_basis", text="Basis")
+ col.label(text="Noise:")
+ col.row().prop(tex, "noise_type", text="Type", expand=True)
+ if wide_ui:
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_basis", text="")
- flow = layout.column_flow()
- flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
- flow.itemR(tex, "noise_size", text="Size")
- flow.itemR(tex, "turbulence")
- flow.itemR(tex, "nabla")
+ split = layout.split()
+ split.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
+
+ col = split.column()
+ col.prop(tex, "noise_size", text="Size")
+ col.prop(tex, "turbulence")
+
+ col = split.column()
+ col.prop(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel):
@@ -414,18 +459,27 @@ class TEXTURE_PT_marble(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "stype", expand=True)
- layout.itemR(tex, "noisebasis2", expand=True)
- layout.itemL(text="Noise:")
- layout.itemR(tex, "noise_type", text="Type", expand=True)
- layout.itemR(tex, "noise_basis", text="Basis")
+ layout.prop(tex, "stype", expand=True)
+ layout.prop(tex, "noisebasis2", expand=True)
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ if wide_ui:
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_basis", text="")
- flow = layout.column_flow()
- flow.itemR(tex, "noise_size", text="Size")
- flow.itemR(tex, "noise_depth", text="Depth")
- flow.itemR(tex, "turbulence")
- flow.itemR(tex, "nabla")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "noise_size", text="Size")
+ col.prop(tex, "noise_depth", text="Depth")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "turbulence")
+ col.prop(tex, "nabla")
class TEXTURE_PT_magic(TextureTypePanel):
@@ -436,10 +490,16 @@ class TEXTURE_PT_magic(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- row = layout.row()
- row.itemR(tex, "noise_depth", text="Depth")
- row.itemR(tex, "turbulence")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "noise_depth", text="Depth")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel):
@@ -450,12 +510,17 @@ class TEXTURE_PT_blend(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
+
+ if wide_ui:
+ layout.prop(tex, "progression")
+ else:
+ layout.prop(tex, "progression", text="")
- layout.itemR(tex, "progression")
sub = layout.row()
sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
- sub.itemR(tex, "flip_axis", expand=True)
+ sub.prop(tex, "flip_axis", expand=True)
class TEXTURE_PT_stucci(TextureTypePanel):
@@ -466,15 +531,24 @@ class TEXTURE_PT_stucci(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "stype", expand=True)
- layout.itemL(text="Noise:")
- layout.itemR(tex, "noise_type", text="Type", expand=True)
- layout.itemR(tex, "noise_basis", text="Basis")
+ layout.prop(tex, "stype", expand=True)
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ if wide_ui:
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_basis", text="")
- row = layout.row()
- row.itemR(tex, "noise_size", text="Size")
- row.itemR(tex, "turbulence")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "noise_size", text="Size")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel):
@@ -498,41 +572,44 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
layout = self.layout
tex = context.texture
- slot = context.texture_slot
+ # slot = context.texture_slot
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Alpha:")
- col.itemR(tex, "use_alpha", text="Use")
- col.itemR(tex, "calculate_alpha", text="Calculate")
- col.itemR(tex, "invert_alpha", text="Invert")
+ col.label(text="Alpha:")
+ col.prop(tex, "use_alpha", text="Use")
+ col.prop(tex, "calculate_alpha", text="Calculate")
+ col.prop(tex, "invert_alpha", text="Invert")
+ col.separator()
+ col.prop(tex, "flip_axis", text="Flip X/Y Axis")
- col.itemL(text="Flip:")
- col.itemR(tex, "flip_axis", text="X/Y Axis")
-
- col = split.column()
- col.itemR(tex, "normal_map")
+ if wide_ui:
+ col = split.column()
+ else:
+ col.separator()
+ col.prop(tex, "normal_map")
row = col.row()
row.active = tex.normal_map
- row.itemR(tex, "normal_space", text="")
+ row.prop(tex, "normal_space", text="")
- col.itemL(text="Filter:")
- col.itemR(tex, "filter", text="")
- col.itemR(tex, "filter_size")
- col.itemR(tex, "filter_size_minimum")
- col.itemR(tex, "mipmap")
+ col.label(text="Filter:")
+ col.prop(tex, "filter", text="")
+ col.prop(tex, "filter_size")
+ col.prop(tex, "filter_size_minimum")
+ col.prop(tex, "mipmap")
row = col.row()
row.active = tex.mipmap
- row.itemR(tex, "mipmap_gauss")
+ row.prop(tex, "mipmap_gauss")
- col.itemR(tex, "interpolation")
+ col.prop(tex, "interpolation")
if tex.mipmap and tex.filter != 'DEFAULT':
if tex.filter == 'FELINE':
- col.itemR(tex, "filter_probes", text="Probes")
+ col.prop(tex, "filter_probes", text="Probes")
else:
- col.itemR(tex, "filter_eccentricity", text="Eccentricity")
+ col.prop(tex, "filter_eccentricity", text="Eccentricity")
class TEXTURE_PT_image_mapping(TextureTypePanel):
@@ -544,44 +621,53 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "extension")
+ if wide_ui:
+ layout.prop(tex, "extension")
+ else:
+ layout.prop(tex, "extension", text="")
split = layout.split()
if tex.extension == 'REPEAT':
col = split.column(align=True)
- col.itemL(text="Repeat:")
- col.itemR(tex, "repeat_x", text="X")
- col.itemR(tex, "repeat_y", text="Y")
+ col.label(text="Repeat:")
+ col.prop(tex, "repeat_x", text="X")
+ col.prop(tex, "repeat_y", text="Y")
- col = split.column(align=True)
- col.itemL(text="Mirror:")
- col.itemR(tex, "mirror_x", text="X")
- col.itemR(tex, "mirror_y", text="Y")
- layout.itemS()
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Mirror:")
+ col.prop(tex, "mirror_x", text="X")
+ col.prop(tex, "mirror_y", text="Y")
+ layout.separator()
elif tex.extension == 'CHECKER':
col = split.column(align=True)
row = col.row()
- row.itemR(tex, "checker_even", text="Even")
- row.itemR(tex, "checker_odd", text="Odd")
+ row.prop(tex, "checker_even", text="Even")
+ row.prop(tex, "checker_odd", text="Odd")
- split.itemR(tex, "checker_distance", text="Distance")
- layout.itemS()
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "checker_distance", text="Distance")
+
+ layout.separator()
split = layout.split()
col = split.column(align=True)
- #col.itemR(tex, "crop_rectangle")
- col.itemL(text="Crop Minimum:")
- col.itemR(tex, "crop_min_x", text="X")
- col.itemR(tex, "crop_min_y", text="Y")
+ #col.prop(tex, "crop_rectangle")
+ col.label(text="Crop Minimum:")
+ col.prop(tex, "crop_min_x", text="X")
+ col.prop(tex, "crop_min_y", text="Y")
- col = split.column(align=True)
- col.itemL(text="Crop Maximum:")
- col.itemR(tex, "crop_max_x", text="X")
- col.itemR(tex, "crop_max_y", text="Y")
+ if wide_ui:
+ col = split.column(align=True)
+ col.label(text="Crop Maximum:")
+ col.prop(tex, "crop_max_x", text="X")
+ col.prop(tex, "crop_max_y", text="Y")
class TEXTURE_PT_plugin(TextureTypePanel):
@@ -591,9 +677,9 @@ class TEXTURE_PT_plugin(TextureTypePanel):
def draw(self, context):
layout = self.layout
- tex = context.texture
+ # tex = context.texture
- layout.itemL(text="Nothing yet")
+ layout.label(text="Nothing yet")
class TEXTURE_PT_envmap(TextureTypePanel):
@@ -603,9 +689,9 @@ class TEXTURE_PT_envmap(TextureTypePanel):
def draw(self, context):
layout = self.layout
- tex = context.texture
+ # tex = context.texture
- layout.itemL(text="Nothing yet")
+ layout.label(text="Nothing yet")
class TEXTURE_PT_musgrave(TextureTypePanel):
@@ -616,30 +702,43 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "musgrave_type")
+ if wide_ui:
+ layout.prop(tex, "musgrave_type")
+ else:
+ layout.prop(tex, "musgrave_type", text="")
split = layout.split()
col = split.column()
- col.itemR(tex, "highest_dimension", text="Dimension")
- col.itemR(tex, "lacunarity")
- col.itemR(tex, "octaves")
+ col.prop(tex, "highest_dimension", text="Dimension")
+ col.prop(tex, "lacunarity")
+ col.prop(tex, "octaves")
+
+ if wide_ui:
+ col = split.column()
+ if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
+ col.prop(tex, "offset")
+ if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
+ col.prop(tex, "gain")
+ col.prop(tex, "noise_intensity", text="Intensity")
+
+ layout.label(text="Noise:")
+
+ if wide_ui:
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_basis", text="")
+
+ split = layout.split()
col = split.column()
- if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
- col.itemR(tex, "offset")
- if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
- col.itemR(tex, "gain")
- col.itemR(tex, "noise_intensity", text="Intensity")
+ col.prop(tex, "noise_size", text="Size")
- layout.itemL(text="Noise:")
-
- layout.itemR(tex, "noise_basis", text="Basis")
-
- row = layout.row()
- row.itemR(tex, "noise_size", text="Size")
- row.itemR(tex, "nabla")
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "nabla")
class TEXTURE_PT_voronoi(TextureTypePanel):
@@ -650,31 +749,39 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Distance Metric:")
- col.itemR(tex, "distance_metric", text="")
+ col.label(text="Distance Metric:")
+ col.prop(tex, "distance_metric", text="")
sub = col.column()
sub.active = tex.distance_metric == 'MINKOVSKY'
- sub.itemR(tex, "minkovsky_exponent", text="Exponent")
- col.itemL(text="Coloring:")
- col.itemR(tex, "coloring", text="")
- col.itemR(tex, "noise_intensity", text="Intensity")
+ sub.prop(tex, "minkovsky_exponent", text="Exponent")
+ col.label(text="Coloring:")
+ col.prop(tex, "coloring", text="")
+ col.prop(tex, "noise_intensity", text="Intensity")
- col = split.column(align=True)
- col.itemL(text="Feature Weights:")
- col.itemR(tex, "weight_1", text="1", slider=True)
- col.itemR(tex, "weight_2", text="2", slider=True)
- col.itemR(tex, "weight_3", text="3", slider=True)
- col.itemR(tex, "weight_4", text="4", slider=True)
+ if wide_ui:
+ col = split.column()
+ sub = col.column(align=True)
+ sub.label(text="Feature Weights:")
+ sub.prop(tex, "weight_1", text="1", slider=True)
+ sub.prop(tex, "weight_2", text="2", slider=True)
+ sub.prop(tex, "weight_3", text="3", slider=True)
+ sub.prop(tex, "weight_4", text="4", slider=True)
- layout.itemL(text="Noise:")
+ layout.label(text="Noise:")
- row = layout.row()
- row.itemR(tex, "noise_size", text="Size")
- row.itemR(tex, "nabla")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "noise_size", text="Size")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureTypePanel):
@@ -685,14 +792,24 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
layout = self.layout
tex = context.texture
+ wide_ui = context.region.width > narrowui
- layout.itemR(tex, "noise_distortion")
- layout.itemR(tex, "noise_basis", text="Basis")
+ if wide_ui:
+ layout.prop(tex, "noise_distortion")
+ layout.prop(tex, "noise_basis", text="Basis")
+ else:
+ layout.prop(tex, "noise_distortion", text="")
+ layout.prop(tex, "noise_basis", text="")
- flow = layout.column_flow()
- flow.itemR(tex, "distortion", text="Distortion")
- flow.itemR(tex, "noise_size", text="Size")
- flow.itemR(tex, "nabla")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(tex, "distortion", text="Distortion")
+ col.prop(tex, "noise_size", text="Size")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(tex, "nabla")
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
@@ -708,22 +825,22 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel):
tex = context.texture
vd = tex.voxeldata
- layout.itemR(vd, "file_format")
+ layout.prop(vd, "file_format")
if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
- layout.itemR(vd, "source_path")
+ layout.prop(vd, "source_path")
if vd.file_format == 'RAW_8BIT':
- layout.itemR(vd, "resolution")
+ layout.prop(vd, "resolution")
elif vd.file_format == 'SMOKE':
- layout.itemR(vd, "domain_object")
+ layout.prop(vd, "domain_object")
- layout.itemR(vd, "still")
+ layout.prop(vd, "still")
row = layout.row()
row.active = vd.still
- row.itemR(vd, "still_frame_number")
+ row.prop(vd, "still_frame_number")
- layout.itemR(vd, "interpolation")
- layout.itemR(vd, "extension")
- layout.itemR(vd, "intensity")
+ layout.prop(vd, "interpolation")
+ layout.prop(vd, "extension")
+ layout.prop(vd, "intensity")
class TEXTURE_PT_pointdensity(TextureButtonsPanel):
@@ -738,45 +855,50 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
+ wide_ui = context.region.width > narrowui
- layout.itemR(pd, "point_source", expand=True)
+ if wide_ui:
+ layout.prop(pd, "point_source", expand=True)
+ else:
+ layout.prop(pd, "point_source", text="")
split = layout.split()
col = split.column()
if pd.point_source == 'PARTICLE_SYSTEM':
- col.itemL(text="Object:")
- col.itemR(pd, "object", text="")
+ col.label(text="Object:")
+ col.prop(pd, "object", text="")
sub = col.column()
- sub.enabled = pd.object
+ sub.enabled = bool(pd.object)
if pd.object:
- sub.itemL(text="System:")
- sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
- sub.itemL(text="Cache:")
- sub.itemR(pd, "particle_cache", text="")
+ sub.label(text="System:")
+ sub.prop_object(pd, "particle_system", pd.object, "particle_systems", text="")
+ sub.label(text="Cache:")
+ sub.prop(pd, "particle_cache", text="")
else:
- col.itemL(text="Object:")
- col.itemR(pd, "object", text="")
- col.itemL(text="Cache:")
- col.itemR(pd, "vertices_cache", text="")
+ col.label(text="Object:")
+ col.prop(pd, "object", text="")
+ col.label(text="Cache:")
+ col.prop(pd, "vertices_cache", text="")
- col.itemS()
+ col.separator()
- col.itemL(text="Color Source:")
- col.itemR(pd, "color_source", text="")
+ col.label(text="Color Source:")
+ col.prop(pd, "color_source", text="")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
- col.itemR(pd, "speed_scale")
+ col.prop(pd, "speed_scale")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
layout.template_color_ramp(pd, "color_ramp", expand=True)
- col = split.column()
- col.itemL()
- col.itemR(pd, "radius")
- col.itemL(text="Falloff:")
- col.itemR(pd, "falloff", text="")
+ if wide_ui:
+ col = split.column()
+ col.label()
+ col.prop(pd, "radius")
+ col.label(text="Falloff:")
+ col.prop(pd, "falloff", text="")
if pd.falloff == 'SOFT':
- col.itemR(pd, "falloff_softness")
+ col.prop(pd, "falloff_softness")
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
@@ -792,7 +914,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
- layout.itemR(pd, "turbulence", text="")
+ layout.prop(pd, "turbulence", text="")
def draw(self, context):
layout = self.layout
@@ -800,20 +922,22 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
tex = context.texture
pd = tex.pointdensity
layout.active = pd.turbulence
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
- col.itemL(text="Influence:")
- col.itemR(pd, "turbulence_influence", text="")
- col.itemL(text="Noise Basis:")
- col.itemR(pd, "noise_basis", text="")
+ col.label(text="Influence:")
+ col.prop(pd, "turbulence_influence", text="")
+ col.label(text="Noise Basis:")
+ col.prop(pd, "noise_basis", text="")
- col = split.column()
- col.itemL()
- col.itemR(pd, "turbulence_size")
- col.itemR(pd, "turbulence_depth")
- col.itemR(pd, "turbulence_strength")
+ if wide_ui:
+ col = split.column()
+ col.label()
+ col.prop(pd, "turbulence_size")
+ col.prop(pd, "turbulence_depth")
+ col.prop(pd, "turbulence_strength")
bpy.types.register(TEXTURE_PT_context_texture)
bpy.types.register(TEXTURE_PT_preview)
diff --git a/release/scripts/ui/properties_world.py b/release/scripts/ui/properties_world.py
index d00592470f0..4f662df8cc8 100644
--- a/release/scripts/ui/properties_world.py
+++ b/release/scripts/ui/properties_world.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class WorldButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -54,13 +56,17 @@ class WORLD_PT_context_world(WorldButtonsPanel):
scene = context.scene
world = context.world
space = context.space_data
+ wide_ui = context.region.width > narrowui
- split = layout.split(percentage=0.65)
- if scene:
- split.template_ID(scene, "world", new="world.new")
- elif world:
- split.template_ID(space, "pin_id")
+ if wide_ui:
+ split = layout.split(percentage=0.65)
+ if scene:
+ split.template_ID(scene, "world", new="world.new")
+ elif world:
+ split.template_ID(space, "pin_id")
+ else:
+ layout.template_ID(scene, "world", new="world.new")
class WORLD_PT_world(WorldButtonsPanel):
@@ -69,20 +75,26 @@ class WORLD_PT_world(WorldButtonsPanel):
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
world = context.world
- row = layout.row()
- row.itemR(world, "paper_sky")
- row.itemR(world, "blend_sky")
- row.itemR(world, "real_sky")
+ if wide_ui:
+ row = layout.row()
+ row.prop(world, "paper_sky")
+ row.prop(world, "blend_sky")
+ row.prop(world, "real_sky")
+ else:
+ col = layout.column()
+ col.prop(world, "paper_sky")
+ col.prop(world, "blend_sky")
+ col.prop(world, "real_sky")
row = layout.row()
- row.column().itemR(world, "horizon_color")
+ row.column().prop(world, "horizon_color")
col = row.column()
- col.itemR(world, "zenith_color")
+ col.prop(world, "zenith_color")
col.active = world.blend_sky
- row.column().itemR(world, "ambient_color")
+ row.column().prop(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
@@ -92,22 +104,27 @@ class WORLD_PT_mist(WorldButtonsPanel):
def draw_header(self, context):
world = context.world
- self.layout.itemR(world.mist, "enabled", text="")
+ self.layout.prop(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
world = context.world
layout.active = world.mist.enabled
- flow = layout.column_flow()
- flow.itemR(world.mist, "intensity", slider=True)
- flow.itemR(world.mist, "start")
- flow.itemR(world.mist, "depth")
- flow.itemR(world.mist, "height")
+ split = layout.split()
- layout.itemR(world.mist, "falloff")
+ col = split.column()
+ col.prop(world.mist, "intensity", slider=True)
+ col.prop(world.mist, "start")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(world.mist, "depth")
+ col.prop(world.mist, "height")
+
+ layout.prop(world.mist, "falloff")
class WORLD_PT_stars(WorldButtonsPanel):
@@ -117,20 +134,25 @@ class WORLD_PT_stars(WorldButtonsPanel):
def draw_header(self, context):
world = context.world
- self.layout.itemR(world.stars, "enabled", text="")
+ self.layout.prop(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
world = context.world
layout.active = world.stars.enabled
- flow = layout.column_flow()
- flow.itemR(world.stars, "size")
- flow.itemR(world.stars, "color_randomization", text="Colors")
- flow.itemR(world.stars, "min_distance", text="Min. Dist")
- flow.itemR(world.stars, "average_separation", text="Separation")
+ split = layout.split()
+
+ col = split.column()
+ col.prop(world.stars, "size")
+ col.prop(world.stars, "color_randomization", text="Colors")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(world.stars, "min_distance", text="Min. Dist")
+ col.prop(world.stars, "average_separation", text="Separation")
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
@@ -140,66 +162,67 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
def draw_header(self, context):
world = context.world
- self.layout.itemR(world.ambient_occlusion, "enabled", text="")
+ self.layout.prop(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
-
+ wide_ui = context.region.width > narrowui
ao = context.world.ambient_occlusion
layout.active = ao.enabled
- layout.itemR(ao, "gather_method", expand=True)
+ layout.prop(ao, "gather_method", expand=True)
split = layout.split()
col = split.column()
- col.itemL(text="Attenuation:")
+ col.label(text="Attenuation:")
if ao.gather_method == 'RAYTRACE':
- col.itemR(ao, "distance")
- col.itemR(ao, "falloff")
+ col.prop(ao, "distance")
+ col.prop(ao, "falloff")
sub = col.row()
sub.active = ao.falloff
- sub.itemR(ao, "falloff_strength", text="Strength")
+ sub.prop(ao, "falloff_strength", text="Strength")
if ao.gather_method == 'RAYTRACE':
- col = split.column()
+ if wide_ui:
+ col = split.column()
- col.itemL(text="Sampling:")
- col.itemR(ao, "sample_method", text="")
+ col.label(text="Sampling:")
+ col.prop(ao, "sample_method", text="")
sub = col.column()
- sub.itemR(ao, "samples")
+ sub.prop(ao, "samples")
if ao.sample_method == 'ADAPTIVE_QMC':
- sub.itemR(ao, "threshold")
- sub.itemR(ao, "adapt_to_speed", slider=True)
+ sub.prop(ao, "threshold")
+ sub.prop(ao, "adapt_to_speed", slider=True)
elif ao.sample_method == 'CONSTANT_JITTERED':
- sub.itemR(ao, "bias")
+ sub.prop(ao, "bias")
if ao.gather_method == 'APPROXIMATE':
- col = split.column()
+ if wide_ui:
+ col = split.column()
- col.itemL(text="Sampling:")
- col.itemR(ao, "passes")
- col.itemR(ao, "error_tolerance", text="Error")
- col.itemR(ao, "pixel_cache")
- col.itemR(ao, "correction")
+ col.label(text="Sampling:")
+ col.prop(ao, "passes")
+ col.prop(ao, "error_tolerance", text="Error")
+ col.prop(ao, "pixel_cache")
+ col.prop(ao, "correction")
col = layout.column()
- col.itemL(text="Influence:")
+ col.label(text="Influence:")
- col.row().itemR(ao, "blend_mode", expand=True)
+ col.row().prop(ao, "blend_mode", expand=True)
split = layout.split()
col = split.column()
- col.itemR(ao, "energy")
+ col.prop(ao, "energy")
- col = split.column()
- sub = col.split(percentage=0.3)
- sub.itemL(text="Color:")
- sub.itemR(ao, "color", text="")
+ if wide_ui:
+ col = split.column()
+ col.prop(ao, "color")
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
diff --git a/release/scripts/ui/space_buttons.py b/release/scripts/ui/space_buttons.py
index d1b7f99cf5d..c0e66013501 100644
--- a/release/scripts/ui/space_buttons.py
+++ b/release/scripts/ui/space_buttons.py
@@ -34,11 +34,11 @@ class Buttons_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("Buttons_MT_view", text="View")
+ sub.menu("Buttons_MT_view", text="View")
row = layout.row()
- row.itemR(so, "buttons_context", expand=True, text="")
- row.itemR(scene, "current_frame")
+ row.prop(so, "buttons_context", expand=True, text="")
+ row.prop(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
@@ -49,7 +49,7 @@ class Buttons_MT_view(bpy.types.Menu):
so = context.space_data
col = layout.column()
- col.itemR(so, "panel_alignment", expand=True)
+ col.prop(so, "panel_alignment", expand=True)
bpy.types.register(Buttons_HT_header)
bpy.types.register(Buttons_MT_view)
diff --git a/release/scripts/ui/space_console.py b/release/scripts/ui/space_console.py
index d5392645387..63e8055b148 100644
--- a/release/scripts/ui/space_console.py
+++ b/release/scripts/ui/space_console.py
@@ -17,7 +17,6 @@
# ##### END GPL LICENSE BLOCK #####
#
-import sys
import bpy
from bpy.props import *
@@ -37,27 +36,27 @@ class CONSOLE_HT_header(bpy.types.Header):
sub = row.row(align=True)
if sc.console_type == 'REPORT':
- sub.itemM("CONSOLE_MT_report")
+ sub.menu("CONSOLE_MT_report")
else:
- sub.itemM("CONSOLE_MT_console")
+ sub.menu("CONSOLE_MT_console")
- layout.itemS()
- layout.itemR(sc, "console_type", expand=True)
+ layout.separator()
+ layout.prop(sc, "console_type", expand=True)
if sc.console_type == 'REPORT':
row = layout.row(align=True)
- row.itemR(sc, "show_report_debug", text="Debug")
- row.itemR(sc, "show_report_info", text="Info")
- row.itemR(sc, "show_report_operator", text="Operators")
- row.itemR(sc, "show_report_warn", text="Warnings")
- row.itemR(sc, "show_report_error", text="Errors")
+ row.prop(sc, "show_report_debug", text="Debug")
+ row.prop(sc, "show_report_info", text="Info")
+ row.prop(sc, "show_report_operator", text="Operators")
+ row.prop(sc, "show_report_warn", text="Warnings")
+ row.prop(sc, "show_report_error", text="Errors")
row = layout.row()
row.enabled = sc.show_report_operator
- row.itemO("console.report_replay")
+ row.operator("console.report_replay")
else:
row = layout.row(align=True)
- row.itemO("console.autocomplete", text="Autocomplete")
+ row.operator("console.autocomplete", text="Autocomplete")
class CONSOLE_MT_console(bpy.types.Menu):
@@ -66,10 +65,10 @@ class CONSOLE_MT_console(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.column()
- layout.itemO("console.clear")
- layout.itemO("console.copy")
- layout.itemO("console.paste")
- layout.itemM("CONSOLE_MT_language")
+ layout.operator("console.clear")
+ layout.operator("console.copy")
+ layout.operator("console.paste")
+ layout.menu("CONSOLE_MT_language")
class CONSOLE_MT_report(bpy.types.Menu):
@@ -78,29 +77,32 @@ class CONSOLE_MT_report(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.column()
- layout.itemO("console.select_all_toggle")
- layout.itemO("console.select_border")
- layout.itemO("console.report_delete")
- layout.itemO("console.report_copy")
+ layout.operator("console.select_all_toggle")
+ layout.operator("console.select_border")
+ layout.operator("console.report_delete")
+ layout.operator("console.report_copy")
+
class CONSOLE_MT_language(bpy.types.Menu):
bl_label = "Languages..."
def draw(self, context):
+ import sys
+
layout = self.layout
layout.column()
- mod = bpy.ops.console
+ # Collect modules with 'console_*.execute'
languages = []
- for opname in dir(mod):
- # execute_python, execute_shell etc.
- if opname.startswith("execute_"):
- languages.append(opname.split('_', 1)[-1])
+ for modname, mod in sys.modules.items():
+ if modname.startswith("console_") and hasattr(mod, "execute"):
+ languages.append(modname.split('_', 1)[-1])
languages.sort()
for language in languages:
- layout.item_stringO("console.language", "language", language, text=language[0].upper() + language[1:])
+ layout.operator("console.language", text=language[0].upper() + language[1:]).language = language
+
def add_scrollback(text, text_type):
for l in text.split('\n'):
@@ -117,14 +119,14 @@ class ConsoleExec(bpy.types.Operator):
def execute(self, context):
sc = context.space_data
- execute = getattr(bpy.ops.console, "execute_" + sc.language, None)
+ module = __import__("console_" + sc.language)
+ execute = getattr(module, "execute", None)
if execute:
- execute()
+ return execute(context)
else:
print("Error: bpy.ops.console.execute_" + sc.language + " - not found")
-
- return ('FINISHED',)
+ return ('FINISHED',)
class ConsoleAutocomplete(bpy.types.Operator):
@@ -139,15 +141,14 @@ class ConsoleAutocomplete(bpy.types.Operator):
def execute(self, context):
sc = context.space_data
-
- autocomplete = getattr(bpy.ops.console, "autocomplete_" + sc.language, None)
+ module = __import__("console_" + sc.language)
+ autocomplete = getattr(module, "autocomplete", None)
if autocomplete:
- autocomplete()
+ return autocomplete(context)
else:
print("Error: bpy.ops.console.autocomplete_" + sc.language + " - not found")
-
- return ('FINISHED',)
+ return ('FINISHED',)
class ConsoleBanner(bpy.types.Operator):
@@ -160,27 +161,26 @@ class ConsoleBanner(bpy.types.Operator):
if not sc.language:
sc.language = 'python'
- banner = getattr(bpy.ops.console, "banner_" + sc.language, None)
+ module = __import__("console_" + sc.language)
+ banner = getattr(module, "banner", None)
if banner:
- banner()
+ return banner(context)
else:
print("Error: bpy.ops.console.banner_" + sc.language + " - not found")
-
- return ('FINISHED',)
-
+ return ('FINISHED',)
class ConsoleLanguage(bpy.types.Operator):
'''Set the current language for this console'''
bl_idname = "console.language"
- language = StringProperty(name="Language", maxlen= 32, default= "")
+ language = StringProperty(name="Language", maxlen=32, default="")
def execute(self, context):
sc = context.space_data
# defailt to python
- sc.language = self.language
+ sc.language = self.properties.language
bpy.ops.console.banner()
diff --git a/release/scripts/ui/space_filebrowser.py b/release/scripts/ui/space_filebrowser.py
index 2269cdd9a97..3b8734bdb21 100644
--- a/release/scripts/ui/space_filebrowser.py
+++ b/release/scripts/ui/space_filebrowser.py
@@ -32,36 +32,36 @@ class FILEBROWSER_HT_header(bpy.types.Header):
layout.template_header(menus=False)
row = layout.row()
- row.itemS()
+ row.separator()
row = layout.row(align=True)
- row.itemO("file.previous", text="", icon='ICON_BACK')
- row.itemO("file.next", text="", icon='ICON_FORWARD')
- row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
- row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH')
+ row.operator("file.previous", text="", icon='ICON_BACK')
+ row.operator("file.next", text="", icon='ICON_FORWARD')
+ row.operator("file.parent", text="", icon='ICON_FILE_PARENT')
+ row.operator("file.refresh", text="", icon='ICON_FILE_REFRESH')
row = layout.row()
- row.itemS()
+ row.separator()
row = layout.row(align=True)
- row.itemO("file.directory_new", text="", icon='ICON_NEWFOLDER')
+ row.operator("file.directory_new", text="", icon='ICON_NEWFOLDER')
- layout.itemR(params, "display", expand=True, text="")
- layout.itemR(params, "sort", expand=True, text="")
+ layout.prop(params, "display", expand=True, text="")
+ layout.prop(params, "sort", expand=True, text="")
- layout.itemR(params, "hide_dot", text="Hide Invisible")
- layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
+ layout.prop(params, "hide_dot", text="Hide Invisible")
+ layout.prop(params, "do_filter", text="", icon='ICON_FILTER')
row = layout.row(align=True)
row.active = params.do_filter
- row.itemR(params, "filter_folder", text="")
- row.itemR(params, "filter_blender", text="")
- row.itemR(params, "filter_image", text="")
- row.itemR(params, "filter_movie", text="")
- row.itemR(params, "filter_script", text="")
- row.itemR(params, "filter_font", text="")
- row.itemR(params, "filter_sound", text="")
- row.itemR(params, "filter_text", text="")
+ row.prop(params, "filter_folder", text="")
+ row.prop(params, "filter_blender", text="")
+ row.prop(params, "filter_image", text="")
+ row.prop(params, "filter_movie", text="")
+ row.prop(params, "filter_script", text="")
+ row.prop(params, "filter_font", text="")
+ row.prop(params, "filter_sound", text="")
+ row.prop(params, "filter_text", text="")
bpy.types.register(FILEBROWSER_HT_header)
diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py
index 95425958f3e..32c5dbb9375 100644
--- a/release/scripts/ui/space_image.py
+++ b/release/scripts/ui/space_image.py
@@ -19,6 +19,8 @@
#
import bpy
+narrowui = 180
+
class IMAGE_MT_view(bpy.types.Menu):
bl_label = "View"
@@ -27,39 +29,39 @@ class IMAGE_MT_view(bpy.types.Menu):
layout = self.layout
sima = context.space_data
- uv = sima.uv_editor
+ # uv = sima.uv_editor
settings = context.tool_settings
show_uvedit = sima.show_uvedit
- layout.itemO("image.properties", icon='ICON_MENU_PANEL')
+ layout.operator("image.properties", icon='ICON_MENU_PANEL')
- layout.itemS()
+ layout.separator()
- layout.itemR(sima, "update_automatically")
+ layout.prop(sima, "update_automatically")
if show_uvedit:
- layout.itemR(settings, "uv_local_view") # Numpad /
+ layout.prop(settings, "uv_local_view") # Numpad /
- layout.itemS()
+ layout.separator()
- layout.itemO("image.view_zoom_in")
- layout.itemO("image.view_zoom_out")
+ layout.operator("image.view_zoom_in")
+ layout.operator("image.view_zoom_out")
- layout.itemS()
+ layout.separator()
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]]
for a, b in ratios:
text = "Zoom %d:%d" % (a, b)
- layout.item_floatO("image.view_zoom_ratio", "ratio", a / b, text=text)
+ layout.operator("image.view_zoom_ratio", text=text).ratio = a / b
- layout.itemS()
+ layout.separator()
if show_uvedit:
- layout.itemO("image.view_selected")
+ layout.operator("image.view_selected")
- layout.itemO("image.view_all")
- layout.itemO("screen.screen_full_area")
+ layout.operator("image.view_all")
+ layout.operator("screen.screen_full_area")
class IMAGE_MT_select(bpy.types.Menu):
@@ -68,19 +70,19 @@ class IMAGE_MT_select(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("uv.select_border")
- layout.item_booleanO("uv.select_border", "pinned", True)
+ layout.operator("uv.select_border")
+ layout.operator("uv.select_border").pinned = True
- layout.itemS()
+ layout.separator()
- layout.itemO("uv.select_all_toggle")
- layout.itemO("uv.select_inverse")
- layout.itemO("uv.unlink_selection")
+ layout.operator("uv.select_all_toggle")
+ layout.operator("uv.select_inverse")
+ layout.operator("uv.unlink_selection")
- layout.itemS()
+ layout.separator()
- layout.itemO("uv.select_pinned")
- layout.itemO("uv.select_linked")
+ layout.operator("uv.select_pinned")
+ layout.operator("uv.select_linked")
class IMAGE_MT_image(bpy.types.Menu):
@@ -92,39 +94,39 @@ class IMAGE_MT_image(bpy.types.Menu):
sima = context.space_data
ima = sima.image
- layout.itemO("image.new")
- layout.itemO("image.open")
+ layout.operator("image.new")
+ layout.operator("image.open")
show_render = sima.show_render
if ima:
if not show_render:
- layout.itemO("image.replace")
- layout.itemO("image.reload")
+ layout.operator("image.replace")
+ layout.operator("image.reload")
- layout.itemO("image.save")
- layout.itemO("image.save_as")
+ layout.operator("image.save")
+ layout.operator("image.save_as")
if ima.source == 'SEQUENCE':
- layout.itemO("image.save_sequence")
+ layout.operator("image.save_sequence")
if not show_render:
- layout.itemS()
+ layout.separator()
if ima.packed_file:
- layout.itemO("image.unpack")
+ layout.operator("image.unpack")
else:
- layout.itemO("image.pack")
+ layout.operator("image.pack")
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.dirty:
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
- layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
+ layout.operator("image.pack", text="Pack As PNG").as_png = True
- layout.itemS()
+ layout.separator()
- layout.itemR(sima, "image_painting")
+ layout.prop(sima, "image_painting")
class IMAGE_MT_uvs_showhide(bpy.types.Menu):
@@ -133,9 +135,9 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("uv.reveal")
- layout.itemO("uv.hide")
- layout.item_booleanO("uv.hide", "unselected", True)
+ layout.operator("uv.reveal")
+ layout.operator("uv.hide")
+ layout.operator("uv.hide").unselected = True
class IMAGE_MT_uvs_transform(bpy.types.Menu):
@@ -144,9 +146,26 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("tfm.translate")
- layout.itemO("tfm.rotate")
- layout.itemO("tfm.resize")
+ layout.operator("tfm.translate")
+ layout.operator("tfm.rotate")
+ layout.operator("tfm.resize")
+
+
+class IMAGE_MT_uvs_snap(bpy.types.Menu):
+ bl_label = "Snap"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'EXEC_REGION_WIN'
+
+ layout.operator("uv.snap_selection", text="Selected to Pixels").target = 'PIXELS'
+ layout.operator("uv.snap_selection", text="Selected to Cursor").target = 'CURSOR'
+ layout.operator("uv.snap_selection", text="Selected to Adjacent Unselected").target = 'ADJACENT_UNSELECTED'
+
+ layout.separator()
+
+ layout.operator("uv.snap_cursor", text="Cursor to Pixels").target = 'PIXELS'
+ layout.operator("uv.snap_cursor", text="Cursor to Selection").target = 'SELECTION'
class IMAGE_MT_uvs_mirror(bpy.types.Menu):
@@ -154,13 +173,10 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = "EXEC_REGION_WIN"
+ layout.operator_context = 'EXEC_REGION_WIN'
- props = layout.itemO("tfm.mirror", text="X Axis", properties=True)
- props.constraint_axis[0] = True
-
- props = layout.itemO("tfm.mirror", text="Y Axis", properties=True)
- props.constraint_axis[1] = True
+ layout.operator("tfm.mirror", text="X Axis").constraint_axis[0] = True
+ layout.operator("tfm.mirror", text="Y Axis").constraint_axis[1] = True
class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
@@ -169,8 +185,8 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("uv.weld") # W, 1
- layout.items_enumO("uv.align", "axis") # W, 2/3/4
+ layout.operator("uv.weld") # W, 1
+ layout.operator_enums("uv.align", "axis") # W, 2/3/4
class IMAGE_MT_uvs(bpy.types.Menu):
@@ -183,37 +199,38 @@ class IMAGE_MT_uvs(bpy.types.Menu):
uv = sima.uv_editor
settings = context.tool_settings
- layout.itemR(uv, "snap_to_pixels")
- layout.itemR(uv, "constrain_to_image_bounds")
+ layout.prop(uv, "snap_to_pixels")
+ layout.prop(uv, "constrain_to_image_bounds")
- layout.itemS()
+ layout.separator()
- layout.itemR(uv, "live_unwrap")
- layout.itemO("uv.unwrap")
- layout.item_booleanO("uv.pin", "clear", True, text="Unpin")
- layout.itemO("uv.pin")
+ layout.prop(uv, "live_unwrap")
+ layout.operator("uv.unwrap")
+ layout.operator("uv.pin", text="Unpin").clear = True
+ layout.operator("uv.pin")
- layout.itemS()
+ layout.separator()
- layout.itemO("uv.pack_islands")
- layout.itemO("uv.average_islands_scale")
- layout.itemO("uv.minimize_stretch")
- layout.itemO("uv.stitch")
+ layout.operator("uv.pack_islands")
+ layout.operator("uv.average_islands_scale")
+ layout.operator("uv.minimize_stretch")
+ layout.operator("uv.stitch")
- layout.itemS()
+ layout.separator()
- layout.itemM("IMAGE_MT_uvs_transform")
- layout.itemM("IMAGE_MT_uvs_mirror")
- layout.itemM("IMAGE_MT_uvs_weldalign")
+ layout.menu("IMAGE_MT_uvs_transform")
+ layout.menu("IMAGE_MT_uvs_mirror")
+ layout.menu("IMAGE_MT_uvs_snap")
+ layout.menu("IMAGE_MT_uvs_weldalign")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumR(settings, "proportional_editing")
- layout.item_menu_enumR(settings, "proportional_editing_falloff")
+ layout.prop_menu_enum(settings, "proportional_editing")
+ layout.prop_menu_enum(settings, "proportional_editing_falloff")
- layout.itemS()
+ layout.separator()
- layout.itemM("IMAGE_MT_uvs_showhide")
+ layout.menu("IMAGE_MT_uvs_showhide")
class IMAGE_HT_header(bpy.types.Header):
@@ -227,8 +244,8 @@ class IMAGE_HT_header(bpy.types.Header):
iuser = sima.image_user
settings = context.tool_settings
- show_render = sima.show_render
- show_paint = sima.show_paint
+ # show_render = sima.show_render
+ # show_paint = sima.show_paint
show_uvedit = sima.show_uvedit
row = layout.row(align=True)
@@ -237,18 +254,18 @@ class IMAGE_HT_header(bpy.types.Header):
# menus
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("IMAGE_MT_view")
+ sub.menu("IMAGE_MT_view")
if show_uvedit:
- sub.itemM("IMAGE_MT_select")
+ sub.menu("IMAGE_MT_select")
if ima and ima.dirty:
- sub.itemM("IMAGE_MT_image", text="Image*")
+ sub.menu("IMAGE_MT_image", text="Image*")
else:
- sub.itemM("IMAGE_MT_image", text="Image")
+ sub.menu("IMAGE_MT_image", text="Image")
if show_uvedit:
- sub.itemM("IMAGE_MT_uvs")
+ sub.menu("IMAGE_MT_uvs")
layout.template_ID(sima, "image", new="image.new")
@@ -256,45 +273,42 @@ class IMAGE_HT_header(bpy.types.Header):
if show_uvedit:
uvedit = sima.uv_editor
- layout.itemR(uvedit, "pivot", text="", icon_only=True)
- layout.itemR(settings, "uv_sync_selection", text="")
+ layout.prop(uvedit, "pivot", text="", icon_only=True)
+ layout.prop(settings, "uv_sync_selection", text="")
if settings.uv_sync_selection:
- layout.itemR(settings, "mesh_selection_mode", text="", expand=True)
+ layout.prop(settings, "mesh_selection_mode", text="", expand=True)
else:
- layout.itemR(settings, "uv_selection_mode", text="", expand=True)
- layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
- pass
+ layout.prop(settings, "uv_selection_mode", text="", expand=True)
+ layout.prop(uvedit, "sticky_selection_mode", text="", icon_only=True)
row = layout.row(align=True)
- row.itemR(settings, "snap", text="")
+ row.prop(settings, "snap", text="")
if settings.snap:
- row.itemR(settings, "snap_mode", text="")
+ row.prop(settings, "snap_mode", text="")
- """
- mesh = context.edit_object.data
- row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
- """
+ # mesh = context.edit_object.data
+ # row.prop_object(mesh, "active_uv_layer", mesh, "uv_textures")
if ima:
# layers
layout.template_image_layers(ima, iuser)
# painting
- layout.itemR(sima, "image_painting", text="")
+ layout.prop(sima, "image_painting", text="")
# draw options
row = layout.row(align=True)
- row.itemR(sima, "draw_channels", text="", expand=True)
+ row.prop(sima, "draw_channels", text="", expand=True)
row = layout.row(align=True)
if ima.type == 'COMPOSITE':
- row.itemO("image.record_composite", icon='ICON_REC')
+ row.operator("image.record_composite", icon='ICON_REC')
if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
- row.itemO("image.play_composite", icon='ICON_PLAY')
+ row.operator("image.play_composite", icon='ICON_PLAY')
if show_uvedit or sima.image_painting:
- layout.itemR(sima, "update_automatically", text="")
+ layout.prop(sima, "update_automatically", text="")
class IMAGE_PT_image_properties(bpy.types.Panel):
@@ -310,7 +324,7 @@ class IMAGE_PT_image_properties(bpy.types.Panel):
layout = self.layout
sima = context.space_data
- ima = sima.image
+ # ima = sima.image
iuser = sima.image_user
layout.template_image(sima, "image", iuser, compact=True)
@@ -331,32 +345,34 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
sima = context.space_data
ima = sima.image
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
sub = col.column(align=True)
- sub.itemR(ima, "animated")
+ sub.prop(ima, "animated")
subsub = sub.column()
subsub.active = ima.animated
- subsub.itemR(ima, "animation_start", text="Start")
- subsub.itemR(ima, "animation_end", text="End")
- subsub.itemR(ima, "animation_speed", text="Speed")
+ subsub.prop(ima, "animation_start", text="Start")
+ subsub.prop(ima, "animation_end", text="End")
+ subsub.prop(ima, "animation_speed", text="Speed")
- col.itemR(ima, "tiles")
+ col.prop(ima, "tiles")
sub = col.column(align=True)
sub.active = ima.tiles or ima.animated
- sub.itemR(ima, "tiles_x", text="X")
- sub.itemR(ima, "tiles_y", text="Y")
+ sub.prop(ima, "tiles_x", text="X")
+ sub.prop(ima, "tiles_y", text="Y")
- col = split.column()
- col.itemL(text="Clamp:")
- col.itemR(ima, "clamp_x", text="X")
- col.itemR(ima, "clamp_y", text="Y")
- col.itemS()
- col.itemR(ima, "mapping", expand=True)
+ if wide_ui:
+ col = split.column()
+ col.label(text="Clamp:")
+ col.prop(ima, "clamp_x", text="X")
+ col.prop(ima, "clamp_y", text="Y")
+ col.separator()
+ col.prop(ima, "mapping", expand=True)
class IMAGE_PT_view_properties(bpy.types.Panel):
@@ -375,42 +391,47 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
+ wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
if ima:
- col.itemR(ima, "display_aspect", text="Aspect Ratio")
+ col.prop(ima, "display_aspect", text="Aspect Ratio")
- col = split.column()
- col.itemL(text="Coordinates:")
- col.itemR(sima, "draw_repeated", text="Repeat")
+ if wide_ui:
+ col = split.column()
+ col.label(text="Coordinates:")
+ col.prop(sima, "draw_repeated", text="Repeat")
if show_uvedit:
- col.itemR(uvedit, "normalized_coordinates", text="Normalized")
+ col.prop(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
- col.itemL(text="Coordinates:")
- col.itemR(uvedit, "normalized_coordinates", text="Normalized")
+ col.label(text="Coordinates:")
+ col.prop(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
- col.itemL(text="UVs:")
+ col.label(text="UVs:")
row = col.row()
- row.itemR(uvedit, "edge_draw_type", expand=True)
+ if wide_ui:
+ row.prop(uvedit, "edge_draw_type", expand=True)
+ else:
+ row.prop(uvedit, "edge_draw_type", text="")
split = layout.split()
-
col = split.column()
- col.itemR(uvedit, "draw_stretch", text="Stretch")
+ col.prop(uvedit, "draw_smooth_edges", text="Smooth")
+ col.prop(uvedit, "draw_modified_edges", text="Modified")
+ #col.prop(uvedit, "draw_edges")
+ #col.prop(uvedit, "draw_faces")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(uvedit, "draw_stretch", text="Stretch")
sub = col.column()
sub.active = uvedit.draw_stretch
- sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
-
- col = split.column()
- col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
- col.itemR(uvedit, "draw_modified_edges", text="Modified")
- #col.itemR(uvedit, "draw_edges")
- #col.itemR(uvedit, "draw_faces")
+ sub.row().prop(uvedit, "draw_stretch_type", expand=True)
class IMAGE_PT_paint(bpy.types.Panel):
@@ -427,6 +448,7 @@ class IMAGE_PT_paint(bpy.types.Panel):
settings = context.tool_settings.image_paint
brush = settings.brush
+ wide_ui = context.region.width > narrowui
col = layout.split().column()
row = col.row()
@@ -434,29 +456,32 @@ class IMAGE_PT_paint(bpy.types.Panel):
col.template_ID(settings, "brush", new="brush.add")
- row = layout.row(align=True)
- row.item_enumR(settings, "tool", 'DRAW')
- row.item_enumR(settings, "tool", 'SOFTEN')
- row.item_enumR(settings, "tool", 'CLONE')
- row.item_enumR(settings, "tool", 'SMEAR')
+ if wide_ui:
+ sub = layout.row(align=True)
+ else:
+ sub = layout.column(align=True)
+ sub.prop_enum(settings, "tool", 'DRAW')
+ sub.prop_enum(settings, "tool", 'SOFTEN')
+ sub.prop_enum(settings, "tool", 'CLONE')
+ sub.prop_enum(settings, "tool", 'SMEAR')
if brush:
col = layout.column()
- col.itemR(brush, "color", text="")
+ col.prop(brush, "color", text="")
row = col.row(align=True)
- row.itemR(brush, "size", slider=True)
- row.itemR(brush, "use_size_pressure", toggle=True, text="")
+ row.prop(brush, "size", slider=True)
+ row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "use_strength_pressure", toggle=True, text="")
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "jitter", slider=True)
- row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
+ row.prop(brush, "jitter", slider=True)
+ row.prop(brush, "use_jitter_pressure", toggle=True, text="")
- col.itemR(brush, "blend", text="Blend")
+ col.prop(brush, "blend", text="Blend")
class IMAGE_PT_paint_stroke(bpy.types.Panel):
@@ -476,16 +501,16 @@ class IMAGE_PT_paint_stroke(bpy.types.Panel):
settings = context.tool_settings.image_paint
brush = settings.brush
- layout.itemR(brush, "use_airbrush")
+ layout.prop(brush, "use_airbrush")
col = layout.column()
col.active = brush.use_airbrush
- col.itemR(brush, "rate", slider=True)
+ col.prop(brush, "rate", slider=True)
- layout.itemR(brush, "use_space")
+ layout.prop(brush, "use_space")
row = layout.row(align=True)
row.active = brush.use_space
- row.itemR(brush, "spacing", text="Distance", slider=True)
- row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
+ row.prop(brush, "spacing", text="Distance", slider=True)
+ row.prop(brush, "use_spacing_pressure", toggle=True, text="")
class IMAGE_PT_paint_curve(bpy.types.Panel):
@@ -506,13 +531,14 @@ class IMAGE_PT_paint_curve(bpy.types.Panel):
brush = settings.brush
layout.template_curve_mapping(brush, "curve")
- layout.item_menu_enumO("brush.curve_preset", property="shape")
+ layout.operator_menu_enum("brush.curve_preset", property="shape")
bpy.types.register(IMAGE_MT_view)
bpy.types.register(IMAGE_MT_select)
bpy.types.register(IMAGE_MT_image)
bpy.types.register(IMAGE_MT_uvs_showhide)
bpy.types.register(IMAGE_MT_uvs_transform)
+bpy.types.register(IMAGE_MT_uvs_snap)
bpy.types.register(IMAGE_MT_uvs_mirror)
bpy.types.register(IMAGE_MT_uvs_weldalign)
bpy.types.register(IMAGE_MT_uvs)
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index 2fb4651ed2e..acbf44eb532 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -29,7 +29,6 @@ class INFO_HT_header(bpy.types.Header):
def draw(self, context):
layout = self.layout
- st = context.space_data
scene = context.scene
rd = scene.render_data
@@ -38,30 +37,30 @@ class INFO_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("INFO_MT_file")
- sub.itemM("INFO_MT_add")
+ sub.menu("INFO_MT_file")
+ sub.menu("INFO_MT_add")
if rd.use_game_engine:
- sub.itemM("INFO_MT_game")
+ sub.menu("INFO_MT_game")
else:
- sub.itemM("INFO_MT_render")
- sub.itemM("INFO_MT_help")
+ sub.menu("INFO_MT_render")
+ sub.menu("INFO_MT_help")
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
- layout.itemS()
+ layout.separator()
if rd.multiple_engines:
- layout.itemR(rd, "engine", text="")
+ layout.prop(rd, "engine", text="")
- layout.itemS()
+ layout.separator()
layout.template_operator_search()
layout.template_running_jobs()
- layout.itemL(text=scene.statistics())
+ layout.label(text=scene.statistics())
- layout.itemO("wm.window_fullscreen_toggle", icon='ICON_FULLSCREEN_ENTER', text="")
+ layout.operator("wm.window_fullscreen_toggle", icon='ICON_FULLSCREEN_ENTER', text="")
class INFO_MT_file(bpy.types.Menu):
@@ -70,39 +69,39 @@ class INFO_MT_file(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = "EXEC_AREA"
- layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
- layout.operator_context = "INVOKE_AREA"
- layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
- layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
- layout.itemO("wm.recover_last_session")
- layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("wm.read_homefile", text="New", icon='ICON_NEW')
+ layout.operator_context = 'INVOKE_AREA'
+ layout.operator("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
+ layout.operator_menu_enum("wm.open_recentfile", "file", text="Open Recent")
+ layout.operator("wm.recover_last_session")
+ layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "EXEC_AREA"
- layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
- layout.operator_context = "INVOKE_AREA"
- layout.itemO("wm.save_as_mainfile", text="Save As...")
- layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
+ layout.operator_context = 'INVOKE_AREA'
+ layout.operator("wm.save_as_mainfile", text="Save As...")
+ layout.operator("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
- layout.itemS()
- layout.operator_context = "INVOKE_AREA"
- layout.itemO("wm.link_append", text="Link")
- layout.item_booleanO("wm.link_append", "link", False, text="Append")
- layout.itemS()
+ layout.separator()
+ layout.operator_context = 'INVOKE_AREA'
+ layout.operator("wm.link_append", text="Link")
+ layout.operator("wm.link_append", text="Append").link = False
+ layout.separator()
- layout.itemM("INFO_MT_file_import")
- layout.itemM("INFO_MT_file_export")
+ layout.menu("INFO_MT_file_import")
+ layout.menu("INFO_MT_file_export")
- layout.itemS()
+ layout.separator()
- layout.itemM("INFO_MT_file_external_data")
+ layout.menu("INFO_MT_file_external_data")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "EXEC_AREA"
- layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("wm.exit_blender", text="Quit", icon='ICON_QUIT')
# test for expanding menus
'''
@@ -112,7 +111,7 @@ class INFO_MT_file_more(INFO_MT_file):
def draw(self, context):
layout = self.layout
- layout.itemO("wm.read_homefile", text="TESTING ")
+ layout.operator("wm.read_homefile", text="TESTING ")
dynamic_menu.setup(INFO_MT_file_more)
'''
@@ -123,7 +122,8 @@ class INFO_MT_file_import(dynamic_menu.DynMenu):
bl_label = "Import"
def draw(self, context):
- self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
+ if "collada_import" in dir(bpy.ops.wm):
+ self.layout.operator("wm.collada_import", text="COLLADA (.dae)...")
class INFO_MT_file_export(dynamic_menu.DynMenu):
@@ -131,7 +131,8 @@ class INFO_MT_file_export(dynamic_menu.DynMenu):
bl_label = "Export"
def draw(self, context):
- self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
+ if "collada_export" in dir(bpy.ops.wm):
+ self.layout.operator("wm.collada_export", text="COLLADA (.dae)...")
class INFO_MT_file_external_data(bpy.types.Menu):
@@ -140,15 +141,15 @@ class INFO_MT_file_external_data(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("file.pack_all", text="Pack into .blend file")
- layout.itemO("file.unpack_all", text="Unpack into Files...")
+ layout.operator("file.pack_all", text="Pack into .blend file")
+ layout.operator("file.unpack_all", text="Unpack into Files...")
- layout.itemS()
+ layout.separator()
- layout.itemO("file.make_paths_relative")
- layout.itemO("file.make_paths_absolute")
- layout.itemO("file.report_missing_files")
- layout.itemO("file.find_missing_files")
+ layout.operator("file.make_paths_relative")
+ layout.operator("file.make_paths_absolute")
+ layout.operator("file.report_missing_files")
+ layout.operator("file.find_missing_files")
class INFO_MT_mesh_add(dynamic_menu.DynMenu):
@@ -158,16 +159,16 @@ class INFO_MT_mesh_add(dynamic_menu.DynMenu):
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
- layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
- layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
- layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
- layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
- layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
- layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
- layout.itemS()
- layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
- layout.itemO("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
+ layout.operator("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
+ layout.operator("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
+ layout.operator("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
+ layout.operator("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
+ layout.operator("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
+ layout.operator("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
+ layout.operator("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
+ layout.separator()
+ layout.operator("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
+ layout.operator("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
class INFO_MT_add(bpy.types.Menu):
@@ -176,39 +177,39 @@ class INFO_MT_add(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.operator_context = "EXEC_SCREEN"
+ layout.operator_context = 'EXEC_SCREEN'
- # layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
- layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
+ #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
+ layout.menu("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
- layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
- layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
- layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
- layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
+ layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
+ layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
+ layout.operator_menu_enum("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
+ layout.operator("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
- layout.itemS()
+ layout.separator()
- layout.operator_context = "INVOKE_SCREEN"
+ layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
- layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
- layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
+ layout.operator("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
+ layout.operator("object.add", text="Lattice", icon='ICON_OUTLINER_OB_LATTICE').type = 'LATTICE'
+ layout.operator("object.add", text="Empty", icon='ICON_OUTLINER_OB_EMPTY').type = 'EMPTY'
- layout.itemS()
+ layout.separator()
- layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
+ layout.operator("object.add", text="Camera", icon='ICON_OUTLINER_OB_CAMERA').type = 'CAMERA'
- layout.operator_context = "EXEC_SCREEN"
+ layout.operator_context = 'EXEC_SCREEN'
- layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
+ layout.operator_menu_enum("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
+ layout.operator_menu_enum("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
+ layout.operator_menu_enum("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
class INFO_MT_game(bpy.types.Menu):
@@ -219,14 +220,14 @@ class INFO_MT_game(bpy.types.Menu):
gs = context.scene.game_data
- layout.itemO("view3d.game_start")
+ layout.operator("view3d.game_start")
- layout.itemS()
+ layout.separator()
- layout.itemR(gs, "show_debug_properties")
- layout.itemR(gs, "show_framerate_profile")
- layout.itemR(gs, "show_physics_visualization")
- layout.itemR(gs, "deprecation_warnings")
+ layout.prop(gs, "show_debug_properties")
+ layout.prop(gs, "show_framerate_profile")
+ layout.prop(gs, "show_physics_visualization")
+ layout.prop(gs, "deprecation_warnings")
class INFO_MT_render(bpy.types.Menu):
@@ -235,19 +236,19 @@ class INFO_MT_render(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- rd = context.scene.render_data
+ # rd = context.scene.render_data
- layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
- layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
+ layout.operator("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
+ layout.operator("screen.render", text="Render Animation", icon='ICON_RENDER_ANIMATION').animation = True
- layout.itemS()
+ layout.separator()
- layout.itemO("screen.opengl_render", text="OpenGL Render Image")
- layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
+ layout.operator("screen.opengl_render", text="OpenGL Render Image")
+ layout.operator("screen.opengl_render", text="OpenGL Render Animation").animation = True
- layout.itemS()
+ layout.separator()
- layout.itemO("screen.render_view_show")
+ layout.operator("screen.render_view_show")
class INFO_MT_help(bpy.types.Menu):
@@ -256,19 +257,20 @@ class INFO_MT_help(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("help.manual", icon='ICON_HELP')
- layout.itemO("help.release_logs", icon='ICON_URL')
+ layout.operator("help.manual", icon='ICON_HELP')
+ layout.operator("help.release_logs", icon='ICON_URL')
- layout.itemS()
+ layout.separator()
- layout.itemO("help.blender_website", icon='ICON_URL')
- layout.itemO("help.blender_eshop", icon='ICON_URL')
- layout.itemO("help.developer_community", icon='ICON_URL')
- layout.itemO("help.user_community", icon='ICON_URL')
- layout.itemS()
- layout.itemO("help.report_bug", icon='ICON_URL')
- layout.itemS()
- layout.itemO("help.operator_cheat_sheet")
+ layout.operator("help.blender_website", icon='ICON_URL')
+ layout.operator("help.blender_eshop", icon='ICON_URL')
+ layout.operator("help.developer_community", icon='ICON_URL')
+ layout.operator("help.user_community", icon='ICON_URL')
+ layout.separator()
+ layout.operator("help.report_bug", icon='ICON_URL')
+ layout.separator()
+ layout.operator("help.python_api", icon='ICON_URL')
+ layout.operator("help.operator_cheat_sheet")
bpy.types.register(INFO_HT_header)
bpy.types.register(INFO_MT_file)
@@ -296,14 +298,14 @@ class HELP_OT_manual(HelpOperator):
'''The Blender Wiki manual'''
bl_idname = "help.manual"
bl_label = "Manual"
- _url = 'http://wiki.blender.org/index.php/Manual'
+ _url = 'http://wiki.blender.org/index.php/Doc:Manual'
class HELP_OT_release_logs(HelpOperator):
'''Information about the changes in this version of Blender'''
bl_idname = "help.release_logs"
- bl_label = "Release Logs"
- _url = 'http://www.blender.org/development/release-logs/'
+ bl_label = "Release Log"
+ _url = 'http://www.blender.org/development/release-logs/blender-250/'
class HELP_OT_blender_website(HelpOperator):
@@ -341,6 +343,13 @@ class HELP_OT_report_bug(HelpOperator):
_url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
+class HELP_OT_python_api(HelpOperator):
+ '''Reference for operator and data Python API'''
+ bl_idname = "help.python_api"
+ bl_label = "Python API Reference"
+ _url = 'http://www.blender.org/documentation/250PythonDoc/'
+
+
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
bl_idname = "help.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet (new textblock)"
@@ -374,4 +383,5 @@ bpy.ops.add(HELP_OT_blender_eshop)
bpy.ops.add(HELP_OT_developer_community)
bpy.ops.add(HELP_OT_user_community)
bpy.ops.add(HELP_OT_report_bug)
+bpy.ops.add(HELP_OT_python_api)
bpy.ops.add(HELP_OT_operator_cheat_sheet)
diff --git a/release/scripts/ui/space_logic.py b/release/scripts/ui/space_logic.py
index 42daa4ace07..e547da6bb8f 100644
--- a/release/scripts/ui/space_logic.py
+++ b/release/scripts/ui/space_logic.py
@@ -35,15 +35,15 @@ class LOGIC_PT_properties(bpy.types.Panel):
ob = context.active_object
game = ob.game
- layout.itemO("object.game_property_new", text="Add Game Property")
+ layout.operator("object.game_property_new", text="Add Game Property")
for i, prop in enumerate(game.properties):
row = layout.row(align=True)
- row.itemR(prop, "name", text="")
- row.itemR(prop, "type", text="")
- row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
- row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
- row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
+ row.prop(prop, "name", text="")
+ row.prop(prop, "type", text="")
+ row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
+ row.prop(prop, "debug", text="", toggle=True, icon='ICON_INFO')
+ row.operator("object.game_property_remove", text="", icon='ICON_X').index = i
bpy.types.register(LOGIC_PT_properties)
diff --git a/release/scripts/ui/space_node.py b/release/scripts/ui/space_node.py
index 9880a320e25..cc5b3fe7977 100644
--- a/release/scripts/ui/space_node.py
+++ b/release/scripts/ui/space_node.py
@@ -33,38 +33,38 @@ class NODE_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("NODE_MT_view")
- sub.itemM("NODE_MT_select")
- sub.itemM("NODE_MT_add")
- sub.itemM("NODE_MT_node")
+ sub.menu("NODE_MT_view")
+ sub.menu("NODE_MT_select")
+ sub.menu("NODE_MT_add")
+ sub.menu("NODE_MT_node")
row = layout.row()
- row.itemR(snode, "tree_type", text="", expand=True)
+ row.prop(snode, "tree_type", text="", expand=True)
if snode.tree_type == 'MATERIAL':
ob = snode.id_from
- id = snode.id
+ snode_id = snode.id
if ob:
layout.template_ID(ob, "active_material", new="material.new")
- if id:
- layout.itemR(id, "use_nodes")
+ if snode_id:
+ layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'TEXTURE':
- row.itemR(snode, "texture_type", text="", expand=True)
+ row.prop(snode, "texture_type", text="", expand=True)
- id = snode.id
+ snode_id = snode.id
id_from = snode.id_from
if id_from:
layout.template_ID(id_from, "active_texture", new="texture.new")
- if id:
- layout.itemR(id, "use_nodes")
+ if snode_id:
+ layout.prop(snode_id, "use_nodes")
elif snode.tree_type == 'COMPOSITING':
- id = snode.id
+ snode_id = snode.id
- layout.itemR(id, "use_nodes")
- layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused")
- layout.itemR(snode, "backdrop")
+ layout.prop(snode_id, "use_nodes")
+ layout.prop(snode_id.render_data, "free_unused_nodes", text="Free Unused")
+ layout.prop(snode, "backdrop")
class NODE_MT_view(bpy.types.Menu):
@@ -73,16 +73,16 @@ class NODE_MT_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- # layout.itemO("grease_pencil..")
- # layout.itemS()
+ layout.operator("node.properties", icon='ICON_MENU_PANEL')
+ layout.separator()
- layout.itemO("view2d.zoom_in")
- layout.itemO("view2d.zoom_out")
+ layout.operator("view2d.zoom_in")
+ layout.operator("view2d.zoom_out")
- layout.itemS()
+ layout.separator()
- layout.itemO("node.view_all")
- layout.itemO("screen.screen_full_area")
+ layout.operator("node.view_all")
+ layout.operator("screen.screen_full_area")
class NODE_MT_select(bpy.types.Menu):
@@ -91,12 +91,12 @@ class NODE_MT_select(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("node.select_border")
+ layout.operator("node.select_border")
- layout.itemS()
- layout.itemO("node.select_all")
- layout.itemO("node.select_linked_from")
- layout.itemO("node.select_linked_to")
+ layout.separator()
+ layout.operator("node.select_all")
+ layout.operator("node.select_linked_from")
+ layout.operator("node.select_linked_to")
class NODE_MT_node(bpy.types.Menu):
@@ -105,31 +105,34 @@ class NODE_MT_node(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("tfm.translate")
- layout.itemO("tfm.resize")
- layout.itemO("tfm.rotate")
+ layout.operator("tfm.translate")
+ layout.operator("tfm.rotate")
+ layout.operator("tfm.resize")
- layout.itemS()
+ layout.separator()
- layout.itemO("node.duplicate")
- layout.itemO("node.delete")
+ layout.operator("node.duplicate_move")
+ layout.operator("node.delete")
+
+ layout.separator()
+ layout.operator("node.link_make")
+
+ layout.separator()
+ layout.operator("node.group_edit")
+ layout.operator("node.group_ungroup")
+ layout.operator("node.group_make")
+
+ layout.separator()
+
+ layout.operator("node.hide")
+ layout.operator("node.mute")
# XXX
- # layout.itemS()
- # layout.itemO("node.make_link")
- layout.itemS()
- layout.itemO("node.group_edit")
- layout.itemO("node.group_ungroup")
- layout.itemO("node.group_make")
+ # layout.operator("node.rename")
- layout.itemS()
+ layout.separator()
- layout.itemO("node.visibility_toggle")
-
- # XXX
- # layout.itemO("node.rename")
- # layout.itemS()
- # layout.itemO("node.show_cyclic_dependencies")
+ layout.operator("node.show_cyclic_dependencies")
bpy.types.register(NODE_HT_header)
bpy.types.register(NODE_MT_view)
diff --git a/release/scripts/ui/space_outliner.py b/release/scripts/ui/space_outliner.py
index 4d517cd9046..a398bc66f45 100644
--- a/release/scripts/ui/space_outliner.py
+++ b/release/scripts/ui/space_outliner.py
@@ -35,29 +35,29 @@ class OUTLINER_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("OUTLINER_MT_view")
+ sub.menu("OUTLINER_MT_view")
if space.display_mode == 'DATABLOCKS':
- sub.itemM("OUTLINER_MT_edit_datablocks")
+ sub.menu("OUTLINER_MT_edit_datablocks")
- layout.itemR(space, "display_mode", text="")
+ layout.prop(space, "display_mode", text="")
- layout.itemS()
+ layout.separator()
if space.display_mode == 'DATABLOCKS':
row = layout.row(align=True)
- row.itemO("outliner.keyingset_add_selected", icon='ICON_ZOOMIN', text="")
- row.itemO("outliner.keyingset_remove_selected", icon='ICON_ZOOMOUT', text="")
+ row.operator("outliner.keyingset_add_selected", icon='ICON_ZOOMIN', text="")
+ row.operator("outliner.keyingset_remove_selected", icon='ICON_ZOOMOUT', text="")
if ks:
row = layout.row(align=False)
- row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
+ row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
row = layout.row(align=True)
- row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
- row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
+ row.operator("anim.keyframe_insert", text="", icon='ICON_KEY_HLT')
+ row.operator("anim.keyframe_delete", text="", icon='ICON_KEY_DEHLT')
else:
row = layout.row(align=False)
- row.itemL(text="No Keying Set active")
+ row.label(text="No Keying Set active")
class OUTLINER_MT_view(bpy.types.Menu):
@@ -70,12 +70,12 @@ class OUTLINER_MT_view(bpy.types.Menu):
col = layout.column()
if space.display_mode not in ('DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'):
- col.itemR(space, "show_restriction_columns")
- col.itemS()
- col.itemO("outliner.show_active")
+ col.prop(space, "show_restriction_columns")
+ col.separator()
+ col.operator("outliner.show_active")
- col.itemO("outliner.show_one_level")
- col.itemO("outliner.show_hierarchy")
+ col.operator("outliner.show_one_level")
+ col.operator("outliner.show_hierarchy")
class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
@@ -86,13 +86,13 @@ class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
col = layout.column()
- col.itemO("outliner.keyingset_add_selected")
- col.itemO("outliner.keyingset_remove_selected")
+ col.operator("outliner.keyingset_add_selected")
+ col.operator("outliner.keyingset_remove_selected")
- col.itemS()
+ col.separator()
- col.itemO("outliner.drivers_add_selected")
- col.itemO("outliner.drivers_delete_selected")
+ col.operator("outliner.drivers_add_selected")
+ col.operator("outliner.drivers_delete_selected")
bpy.types.register(OUTLINER_HT_header)
bpy.types.register(OUTLINER_MT_view)
diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py
index 9468510c7a5..8476a98992c 100644
--- a/release/scripts/ui/space_sequencer.py
+++ b/release/scripts/ui/space_sequencer.py
@@ -23,7 +23,7 @@ import bpy
def act_strip(context):
try:
return context.scene.sequence_editor.active_strip
- except:
+ except AttributeError:
return None
@@ -40,23 +40,23 @@ class SEQUENCER_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("SEQUENCER_MT_view")
+ sub.menu("SEQUENCER_MT_view")
- row.itemS()
+ row.separator()
if st.display_mode == 'SEQUENCER':
- sub.itemM("SEQUENCER_MT_select")
- sub.itemM("SEQUENCER_MT_marker")
- sub.itemM("SEQUENCER_MT_add")
- sub.itemM("SEQUENCER_MT_strip")
+ sub.menu("SEQUENCER_MT_select")
+ sub.menu("SEQUENCER_MT_marker")
+ sub.menu("SEQUENCER_MT_add")
+ sub.menu("SEQUENCER_MT_strip")
- layout.itemR(st, "display_mode", text="")
+ layout.prop(st, "display_mode", text="")
if st.display_mode == 'SEQUENCER':
- layout.itemS()
- layout.itemO("sequencer.reload")
+ layout.separator()
+ layout.operator("sequencer.refresh_all")
else:
- layout.itemR(st, "display_channel", text="Channel")
+ layout.prop(st, "display_channel", text="Channel")
class SEQUENCER_MT_view(bpy.types.Menu):
@@ -97,11 +97,11 @@ class SEQUENCER_MT_view(bpy.types.Menu):
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
"""
- layout.itemS()
- layout.itemO("sequencer.view_all")
- layout.itemO("sequencer.view_selected")
- layout.itemS()
- layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
+ layout.separator()
+ layout.operator("sequencer.view_all")
+ layout.operator("sequencer.view_selected")
+ layout.separator()
+ layout.operator("screen.screen_full_area", text="Toggle Full Screen")
"""
@@ -114,11 +114,12 @@ class SEQUENCER_MT_view(bpy.types.Menu):
uiDefMenuSep(block);
"""
- layout.itemR(st, "draw_frames")
+ layout.prop(st, "draw_frames")
+ layout.prop(st, "show_cframe_indicator")
if st.display_mode == 'IMAGE':
- layout.itemR(st, "draw_safe_margin")
+ layout.prop(st, "draw_safe_margin")
if st.display_mode == 'WAVEFORM':
- layout.itemR(st, "separate_color_preview")
+ layout.prop(st, "separate_color_preview")
"""
if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, "");
@@ -133,19 +134,17 @@ class SEQUENCER_MT_select(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- st = context.space_data
-
layout.column()
- layout.item_enumO("sequencer.select_active_side", "side", 'LEFT', text="Strips to the Left")
- layout.item_enumO("sequencer.select_active_side", "side", 'RIGHT', text="Strips to the Right")
- layout.itemS()
- layout.item_enumO("sequencer.select_handles", "side", 'BOTH', text="Surrounding Handles")
- layout.item_enumO("sequencer.select_handles", "side", 'LEFT', text="Left Handle")
- layout.item_enumO("sequencer.select_handles", "side", 'RIGHT', text="Right Handle")
- layout.itemS()
- layout.itemO("sequencer.select_linked")
- layout.itemO("sequencer.select_all_toggle")
- layout.itemO("sequencer.select_inverse")
+ layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
+ layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
+ layout.separator()
+ layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
+ layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
+ layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
+ layout.separator()
+ layout.operator("sequencer.select_linked")
+ layout.operator("sequencer.select_all_toggle")
+ layout.operator("sequencer.select_inverse")
class SEQUENCER_MT_marker(bpy.types.Menu):
@@ -154,17 +153,15 @@ class SEQUENCER_MT_marker(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- st = context.space_data
-
layout.column()
- layout.itemO("marker.add", text="Add Marker")
- layout.itemO("marker.duplicate", text="Duplicate Marker")
- layout.itemO("marker.move", text="Grab/Move Marker")
- layout.itemO("marker.delete", text="Delete Marker")
- layout.itemS()
- layout.itemL(text="ToDo: Name Marker")
+ layout.operator("marker.add", text="Add Marker")
+ layout.operator("marker.duplicate", text="Duplicate Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
+ layout.operator("marker.delete", text="Delete Marker")
+ layout.separator()
+ layout.label(text="ToDo: Name Marker")
- #layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
+ #layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
class SEQUENCER_MT_add(bpy.types.Menu):
@@ -174,15 +171,13 @@ class SEQUENCER_MT_add(bpy.types.Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- st = context.space_data
-
layout.column()
- layout.itemO("sequencer.scene_strip_add", text="Scene")
- layout.itemO("sequencer.movie_strip_add", text="Movie")
- layout.itemO("sequencer.image_strip_add", text="Image")
- layout.itemO("sequencer.sound_strip_add", text="Sound")
+ layout.operator("sequencer.scene_strip_add", text="Scene")
+ layout.operator("sequencer.movie_strip_add", text="Movie")
+ layout.operator("sequencer.image_strip_add", text="Image")
+ layout.operator("sequencer.sound_strip_add", text="Sound")
- layout.itemM("SEQUENCER_MT_add_effect")
+ layout.menu("SEQUENCER_MT_add_effect")
class SEQUENCER_MT_add_effect(bpy.types.Menu):
@@ -191,22 +186,21 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu):
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- st = context.space_data
layout.column()
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'SUBTRACT')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_OVER')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'MULTIPLY')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'OVER_DROP')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'PLUGIN')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'WIPE')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'GLOW')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'TRANSFORM')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'COLOR')
- layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED')
+ layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
+ layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
+ layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
+ layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
+ layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
+ layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
+ layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
+ layout.operator("sequencer.effect_strip_add", text="Plugin").type = 'PLUGIN'
+ layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
+ layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
+ layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
+ layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
+ layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
class SEQUENCER_MT_strip(bpy.types.Menu):
@@ -215,23 +209,21 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- st = context.space_data
-
layout.operator_context = 'INVOKE_REGION_WIN'
layout.column()
- layout.item_enumO("tfm.transform", "mode", 'TRANSLATION', text="Grab/Move")
- layout.item_enumO("tfm.transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame")
+ layout.operator("tfm.transform", text="Grab/Move").mode = 'TRANSLATION'
+ layout.operator("tfm.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
# uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
- layout.itemS()
+ layout.separator()
- layout.item_enumO("sequencer.cut", "type", 'HARD', text="Cut (hard) at frame")
- layout.item_enumO("sequencer.cut", "type", 'SOFT', text="Cut (soft) at frame")
- layout.itemO("sequencer.images_separate")
- layout.itemS()
+ layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
+ layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
+ layout.operator("sequencer.images_separate")
+ layout.separator()
- layout.itemO("sequencer.duplicate")
- layout.itemO("sequencer.delete")
+ layout.operator("sequencer.duplicate")
+ layout.operator("sequencer.delete")
strip = act_strip(context)
@@ -239,45 +231,45 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
stype = strip.type
if stype == 'EFFECT':
- layout.itemS()
- layout.itemO("sequencer.effect_change")
- layout.itemO("sequencer.effect_reassign_inputs")
+ layout.separator()
+ layout.operator("sequencer.effect_change")
+ layout.operator("sequencer.effect_reassign_inputs")
elif stype == 'IMAGE':
- layout.itemS()
- layout.itemO("sequencer.image_change")
- layout.itemO("sequencer.rendersize")
+ layout.separator()
+ layout.operator("sequencer.image_change")
+ layout.operator("sequencer.rendersize")
elif stype == 'SCENE':
- layout.itemS()
- layout.itemO("sequencer.scene_change", text="Change Scene")
+ layout.separator()
+ layout.operator("sequencer.scene_change", text="Change Scene")
elif stype == 'MOVIE':
- layout.itemS()
- layout.itemO("sequencer.movie_change")
- layout.itemO("sequencer.rendersize")
+ layout.separator()
+ layout.operator("sequencer.movie_change")
+ layout.operator("sequencer.rendersize")
- layout.itemS()
+ layout.separator()
- layout.itemO("sequencer.meta_make")
- layout.itemO("sequencer.meta_separate")
+ layout.operator("sequencer.meta_make")
+ layout.operator("sequencer.meta_separate")
#if (ed && (ed->metastack.first || (ed->act_seq && ed->act_seq->type == SEQ_META))) {
# uiItemS(layout);
# uiItemO(layout, NULL, 0, "sequencer.meta_toggle");
#}
- layout.itemS()
- layout.itemO("sequencer.reload")
- layout.itemS()
- layout.itemO("sequencer.lock")
- layout.itemO("sequencer.unlock")
- layout.itemO("sequencer.mute")
- layout.itemO("sequencer.unmute")
+ layout.separator()
+ layout.operator("sequencer.reload")
+ layout.separator()
+ layout.operator("sequencer.lock")
+ layout.operator("sequencer.unlock")
+ layout.operator("sequencer.mute")
+ layout.operator("sequencer.unmute")
- layout.item_booleanO("sequencer.mute", "unselected", 1, text="Mute Deselected Strips")
+ layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
- layout.itemO("sequencer.snap")
+ layout.operator("sequencer.snap")
- layout.itemO("sequencer.swap_right")
- layout.itemO("sequencer.swap_left")
+ layout.operator("sequencer.swap_right")
+ layout.operator("sequencer.swap_left")
class SequencerButtonsPanel(bpy.types.Panel):
@@ -285,7 +277,7 @@ class SequencerButtonsPanel(bpy.types.Panel):
bl_region_type = 'UI'
def poll(self, context):
- return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None
+ return (context.space_data.display_mode == 'SEQUENCER') and (act_strip(context) is not None)
class SequencerButtonsPanel_Output(bpy.types.Panel):
@@ -305,47 +297,47 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
strip = act_strip(context)
split = layout.split(percentage=0.3)
- split.itemL(text="Name:")
- split.itemR(strip, "name", text="")
+ split.label(text="Name:")
+ split.prop(strip, "name", text="")
split = layout.split(percentage=0.3)
- split.itemL(text="Type:")
- split.itemR(strip, "type", text="")
+ split.label(text="Type:")
+ split.prop(strip, "type", text="")
split = layout.split(percentage=0.3)
- split.itemL(text="Blend:")
- split.itemR(strip, "blend_mode", text="")
+ split.label(text="Blend:")
+ split.prop(strip, "blend_mode", text="")
row = layout.row()
if strip.mute == True:
- row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_ON', text="")
- elif strip.mute == False:
- row.itemR(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_OFF', text="")
+ row.prop(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_ON', text="")
+ elif strip.mute is False:
+ row.prop(strip, "mute", toggle=True, icon='ICON_RESTRICT_VIEW_OFF', text="")
sub = row.row()
sub.active = (not strip.mute)
- sub.itemR(strip, "blend_opacity", text="Opacity", slider=True)
+ sub.prop(strip, "blend_opacity", text="Opacity", slider=True)
row = layout.row()
- row.itemR(strip, "lock")
- row.itemR(strip, "frame_locked", text="Frame Lock")
+ row.prop(strip, "lock")
+ row.prop(strip, "frame_locked", text="Frame Lock")
col = layout.column()
col.enabled = not strip.lock
- col.itemR(strip, "channel")
- col.itemR(strip, "start_frame")
- col.itemR(strip, "length")
+ col.prop(strip, "channel")
+ col.prop(strip, "start_frame")
+ col.prop(strip, "length")
col = layout.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(strip, "start_offset", text="Start")
- col.itemR(strip, "end_offset", text="End")
+ col.label(text="Offset:")
+ col.prop(strip, "start_offset", text="Start")
+ col.prop(strip, "end_offset", text="End")
col = layout.column(align=True)
- col.itemL(text="Still:")
- col.itemR(strip, "start_still", text="Start")
- col.itemR(strip, "end_still", text="End")
+ col.label(text="Still:")
+ col.prop(strip, "start_still", text="Start")
+ col.prop(strip, "end_still", text="End")
class SEQUENCER_PT_effect(SequencerButtonsPanel):
@@ -359,7 +351,10 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
if not strip:
return False
- return strip.type in ('COLOR', 'WIPE', 'GLOW', 'SPEED', 'TRANSFORM')
+ return strip.type in ('ADD','SUBTRACT','ALPHA_OVER','ALPHA_UNDER',
+ 'GAMMA_CROSS','MULTIPLY','OVER_DROP',
+ 'PLUGIN',
+ 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED')
def draw(self, context):
layout = self.layout
@@ -367,73 +362,81 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
strip = act_strip(context)
if strip.type == 'COLOR':
- layout.itemR(strip, "color")
+ layout.prop(strip, "color")
elif strip.type == 'WIPE':
col = layout.column()
- col.itemR(strip, "transition_type")
- col.itemL(text="Direction:")
- col.row().itemR(strip, "direction", expand=True)
+ col.prop(strip, "transition_type")
+ col.label(text="Direction:")
+ col.row().prop(strip, "direction", expand=True)
col = layout.column()
- col.itemR(strip, "blur_width", slider=True)
+ col.prop(strip, "blur_width", slider=True)
if strip.transition_type in ('SINGLE', 'DOUBLE'):
- col.itemR(strip, "angle")
+ col.prop(strip, "angle")
elif strip.type == 'GLOW':
flow = layout.column_flow()
- flow.itemR(strip, "threshold", slider=True)
- flow.itemR(strip, "clamp", slider=True)
- flow.itemR(strip, "boost_factor")
- flow.itemR(strip, "blur_distance")
+ flow.prop(strip, "threshold", slider=True)
+ flow.prop(strip, "clamp", slider=True)
+ flow.prop(strip, "boost_factor")
+ flow.prop(strip, "blur_distance")
row = layout.row()
- row.itemR(strip, "quality", slider=True)
- row.itemR(strip, "only_boost")
+ row.prop(strip, "quality", slider=True)
+ row.prop(strip, "only_boost")
elif strip.type == 'SPEED':
- layout.itemR(strip, "global_speed")
+ layout.prop(strip, "global_speed")
flow = layout.column_flow()
- flow.itemR(strip, "curve_velocity")
- flow.itemR(strip, "curve_compress_y")
- flow.itemR(strip, "frame_blending")
+ flow.prop(strip, "curve_velocity")
+ flow.prop(strip, "curve_compress_y")
+ flow.prop(strip, "frame_blending")
elif strip.type == 'TRANSFORM':
col = layout.column()
- col.itemR(strip, "interpolation")
- col.itemR(strip, "translation_unit")
+ col.prop(strip, "interpolation")
+ col.prop(strip, "translation_unit")
col = layout.column(align=True)
- col.itemL(text="Position X:")
- col.itemR(strip, "translate_start_x", text="Start")
- col.itemR(strip, "translate_end_x", text="End")
+ col.label(text="Position X:")
+ col.prop(strip, "translate_start_x", text="Start")
+ col.prop(strip, "translate_end_x", text="End")
col = layout.column(align=True)
- col.itemL(text="Position Y:")
- col.itemR(strip, "translate_start_y", text="Start")
- col.itemR(strip, "translate_end_y", text="End")
+ col.label(text="Position Y:")
+ col.prop(strip, "translate_start_y", text="Start")
+ col.prop(strip, "translate_end_y", text="End")
- layout.itemS()
+ layout.separator()
col = layout.column(align=True)
- col.itemL(text="Scale X:")
- col.itemR(strip, "scale_start_x", text="Start")
- col.itemR(strip, "scale_end_x", text="End")
+ col.label(text="Scale X:")
+ col.prop(strip, "scale_start_x", text="Start")
+ col.prop(strip, "scale_end_x", text="End")
col = layout.column(align=True)
- col.itemL(text="Scale Y:")
- col.itemR(strip, "scale_start_y", text="Start")
- col.itemR(strip, "scale_end_y", text="End")
+ col.label(text="Scale Y:")
+ col.prop(strip, "scale_start_y", text="Start")
+ col.prop(strip, "scale_end_y", text="End")
- layout.itemS()
+ layout.separator()
col = layout.column(align=True)
- col.itemL(text="Rotation:")
- col.itemR(strip, "rotation_start", text="Start")
- col.itemR(strip, "rotation_end", text="End")
+ col.label(text="Rotation:")
+ col.prop(strip, "rotation_start", text="Start")
+ col.prop(strip, "rotation_end", text="End")
+
+ col = layout.column(align=True)
+ if strip.type == 'SPEED':
+ col.prop(strip, "speed_fader", text="Speed fader")
+ else:
+ col.prop(strip, "use_effect_default_fade", "Default fade")
+ if not strip.use_effect_default_fade:
+ col.prop(strip, "effect_fader", text="Effect fader")
class SEQUENCER_PT_input(SequencerButtonsPanel):
@@ -456,9 +459,9 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
split = layout.split(percentage=0.2)
col = split.column()
- col.itemL(text="Path:")
+ col.label(text="Path:")
col = split.column()
- col.itemR(strip, "directory", text="")
+ col.prop(strip, "directory", text="")
# Current element for the filename
@@ -466,30 +469,30 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
if elem:
split = layout.split(percentage=0.2)
col = split.column()
- col.itemL(text="File:")
+ col.label(text="File:")
col = split.column()
- col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
+ col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
- layout.itemR(strip, "use_translation", text="Image Offset:")
+ layout.prop(strip, "use_translation", text="Image Offset:")
if strip.transform:
col = layout.column(align=True)
col.active = strip.use_translation
- col.itemR(strip.transform, "offset_x", text="X")
- col.itemR(strip.transform, "offset_y", text="Y")
+ col.prop(strip.transform, "offset_x", text="X")
+ col.prop(strip.transform, "offset_y", text="Y")
- layout.itemR(strip, "use_crop", text="Image Crop:")
+ layout.prop(strip, "use_crop", text="Image Crop:")
if strip.crop:
col = layout.column(align=True)
col.active = strip.use_crop
- col.itemR(strip.crop, "top")
- col.itemR(strip.crop, "left")
- col.itemR(strip.crop, "bottom")
- col.itemR(strip.crop, "right")
+ col.prop(strip.crop, "top")
+ col.prop(strip.crop, "left")
+ col.prop(strip.crop, "bottom")
+ col.prop(strip.crop, "right")
col = layout.column(align=True)
- col.itemL(text="Trim Duration:")
- col.itemR(strip, "animation_start_offset", text="Start")
- col.itemR(strip, "animation_end_offset", text="End")
+ col.label(text="Trim Duration:")
+ col.prop(strip, "animation_start_offset", text="Start")
+ col.prop(strip, "animation_end_offset", text="End")
class SEQUENCER_PT_sound(SequencerButtonsPanel):
@@ -503,25 +506,48 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel):
if not strip:
return False
- return strip.type in ('SOUND', )
+ return (strip.type == 'SOUND')
def draw(self, context):
layout = self.layout
strip = act_strip(context)
- layout.template_ID(strip, "sound", new="sound.open")
+ layout.template_ID(strip, "sound", open="sound.open")
- layout.itemS()
- layout.itemR(strip.sound, "filename", text="")
+ layout.separator()
+ layout.prop(strip.sound, "filename", text="")
row = layout.row()
if strip.sound.packed_file:
- row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack")
+ row.operator("sound.unpack", icon='ICON_PACKAGE', text="Unpack")
else:
- row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack")
+ row.operator("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack")
- row.itemR(strip.sound, "caching")
+ row.prop(strip.sound, "caching")
+
+ layout.prop(strip, "volume")
+
+
+class SEQUENCER_PT_scene(SequencerButtonsPanel):
+ bl_label = "Scene"
+
+ def poll(self, context):
+ if context.space_data.display_mode != 'SEQUENCER':
+ return False
+
+ strip = act_strip(context)
+ if not strip:
+ return False
+
+ return (strip.type == 'SCENE')
+
+ def draw(self, context):
+ layout = self.layout
+
+ strip = act_strip(context)
+
+ layout.template_ID(strip, "scene")
class SEQUENCER_PT_filter(SequencerButtonsPanel):
@@ -543,35 +569,35 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel):
strip = act_strip(context)
col = layout.column()
- col.itemL(text="Video:")
- col.itemR(strip, "strobe")
- col.itemR(strip, "de_interlace")
+ col.label(text="Video:")
+ col.prop(strip, "strobe")
+ col.prop(strip, "de_interlace")
col = layout.column()
- col.itemL(text="Colors:")
- col.itemR(strip, "multiply_colors", text="Multiply")
- col.itemR(strip, "premultiply")
- col.itemR(strip, "convert_float")
+ col.label(text="Colors:")
+ col.prop(strip, "multiply_colors", text="Multiply")
+ col.prop(strip, "premultiply")
+ col.prop(strip, "convert_float")
col = layout.column()
- col.itemL(text="Flip:")
- col.itemR(strip, "flip_x", text="X")
- col.itemR(strip, "flip_y", text="Y")
- col.itemR(strip, "reverse_frames", text="Backwards")
+ col.label(text="Flip:")
+ col.prop(strip, "flip_x", text="X")
+ col.prop(strip, "flip_y", text="Y")
+ col.prop(strip, "reverse_frames", text="Backwards")
- layout.itemR(strip, "use_color_balance")
+ layout.prop(strip, "use_color_balance")
if strip.color_balance: # TODO - need to add this somehow
row = layout.row()
row.active = strip.use_color_balance
col = row.column()
- col.itemR(strip.color_balance, "lift")
- col.itemR(strip.color_balance, "inverse_lift", text="Inverse")
+ col.prop(strip.color_balance, "lift")
+ col.prop(strip.color_balance, "inverse_lift", text="Inverse")
col = row.column()
- col.itemR(strip.color_balance, "gamma")
- col.itemR(strip.color_balance, "inverse_gamma", text="Inverse")
+ col.prop(strip.color_balance, "gamma")
+ col.prop(strip.color_balance, "inverse_gamma", text="Inverse")
col = row.column()
- col.itemR(strip.color_balance, "gain")
- col.itemR(strip.color_balance, "inverse_gain", text="Inverse")
+ col.prop(strip.color_balance, "gain")
+ col.prop(strip.color_balance, "inverse_gain", text="Inverse")
class SEQUENCER_PT_proxy(SequencerButtonsPanel):
@@ -590,7 +616,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
def draw_header(self, context):
strip = act_strip(context)
- self.layout.itemR(strip, "use_proxy", text="")
+ self.layout.prop(strip, "use_proxy", text="")
def draw(self, context):
layout = self.layout
@@ -598,10 +624,10 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
strip = act_strip(context)
flow = layout.column_flow()
- flow.itemR(strip, "proxy_custom_directory")
+ flow.prop(strip, "proxy_custom_directory")
if strip.proxy: # TODO - need to add this somehow
- flow.itemR(strip.proxy, "directory")
- flow.itemR(strip.proxy, "file")
+ flow.prop(strip.proxy, "directory")
+ flow.prop(strip.proxy, "file")
class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
@@ -613,8 +639,8 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
st = context.space_data
col = layout.column()
- col.itemR(st, "draw_overexposed") # text="Zebra"
- col.itemR(st, "draw_safe_margin")
+ col.prop(st, "draw_overexposed") # text="Zebra"
+ col.prop(st, "draw_safe_margin")
bpy.types.register(SEQUENCER_HT_header) # header/menu classes
bpy.types.register(SEQUENCER_MT_view)
@@ -628,6 +654,7 @@ bpy.types.register(SEQUENCER_PT_edit) # sequencer panels
bpy.types.register(SEQUENCER_PT_effect)
bpy.types.register(SEQUENCER_PT_input)
bpy.types.register(SEQUENCER_PT_sound)
+bpy.types.register(SEQUENCER_PT_scene)
bpy.types.register(SEQUENCER_PT_filter)
bpy.types.register(SEQUENCER_PT_proxy)
diff --git a/release/scripts/ui/space_text.py b/release/scripts/ui/space_text.py
index 0d33f181a06..6ea499704fc 100644
--- a/release/scripts/ui/space_text.py
+++ b/release/scripts/ui/space_text.py
@@ -34,38 +34,39 @@ class TEXT_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("TEXT_MT_text")
+ sub.menu("TEXT_MT_text")
if text:
- sub.itemM("TEXT_MT_edit")
- sub.itemM("TEXT_MT_format")
+ sub.menu("TEXT_MT_edit")
+ sub.menu("TEXT_MT_format")
if text and text.modified:
row = layout.row()
# row.color(redalert)
- row.itemO("text.resolve_conflict", text="", icon='ICON_HELP')
+ row.operator("text.resolve_conflict", text="", icon='ICON_HELP')
layout.template_ID(st, "text", new="text.new", unlink="text.unlink")
row = layout.row(align=True)
- row.itemR(st, "line_numbers", text="")
- row.itemR(st, "word_wrap", text="")
- row.itemR(st, "syntax_highlight", text="")
+ row.prop(st, "line_numbers", text="")
+ row.prop(st, "word_wrap", text="")
+ row.prop(st, "syntax_highlight", text="")
if text:
+ row = layout.row()
+ row.operator("text.run_script")
+ row.prop(text, "use_module")
+
row = layout.row()
if text.filename != "":
if text.dirty:
- row.itemL(text="File: *%s (unsaved)" % text.filename)
+ row.label(text="File: *%s (unsaved)" % text.filename)
else:
- row.itemL(text="File: %s" % text.filename)
+ row.label(text="File: %s" % text.filename)
else:
if text.library:
- row.itemL(text="Text: External")
+ row.label(text="Text: External")
else:
- row.itemL(text="Text: Internal")
-
- row = layout.row()
- row.itemO("text.run_script")
+ row.label(text="Text: Internal")
class TEXT_PT_properties(bpy.types.Panel):
@@ -79,14 +80,14 @@ class TEXT_PT_properties(bpy.types.Panel):
st = context.space_data
flow = layout.column_flow()
- flow.itemR(st, "line_numbers")
- flow.itemR(st, "word_wrap")
- flow.itemR(st, "syntax_highlight")
- flow.itemR(st, "live_edit")
+ flow.prop(st, "line_numbers")
+ flow.prop(st, "word_wrap")
+ flow.prop(st, "syntax_highlight")
+ flow.prop(st, "live_edit")
flow = layout.column_flow()
- flow.itemR(st, "font_size")
- flow.itemR(st, "tab_width")
+ flow.prop(st, "font_size")
+ flow.prop(st, "tab_width")
class TEXT_PT_find(bpy.types.Panel):
@@ -102,24 +103,24 @@ class TEXT_PT_find(bpy.types.Panel):
# find
col = layout.column(align=True)
row = col.row()
- row.itemR(st, "find_text", text="")
- row.itemO("text.find_set_selected", text="", icon='ICON_TEXT')
- col.itemO("text.find")
+ row.prop(st, "find_text", text="")
+ row.operator("text.find_set_selected", text="", icon='ICON_TEXT')
+ col.operator("text.find")
# replace
col = layout.column(align=True)
row = col.row()
- row.itemR(st, "replace_text", text="")
- row.itemO("text.replace_set_selected", text="", icon='ICON_TEXT')
- col.itemO("text.replace")
+ row.prop(st, "replace_text", text="")
+ row.operator("text.replace_set_selected", text="", icon='ICON_TEXT')
+ col.operator("text.replace")
# mark
- layout.itemO("text.mark_all")
+ layout.operator("text.mark_all")
# settings
row = layout.row()
- row.itemR(st, "find_wrap", text="Wrap")
- row.itemR(st, "find_all", text="All")
+ row.prop(st, "find_wrap", text="Wrap")
+ row.prop(st, "find_all", text="All")
class TEXT_MT_text(bpy.types.Menu):
@@ -132,40 +133,32 @@ class TEXT_MT_text(bpy.types.Menu):
text = st.text
layout.column()
- layout.itemO("text.new")
- layout.itemO("text.open")
+ layout.operator("text.new")
+ layout.operator("text.open")
if text:
- layout.itemO("text.reload")
+ layout.operator("text.reload")
layout.column()
- layout.itemO("text.save")
- layout.itemO("text.save_as")
+ layout.operator("text.save")
+ layout.operator("text.save_as")
if text.filename != "":
- layout.itemO("text.make_internal")
+ layout.operator("text.make_internal")
layout.column()
- layout.itemO("text.run_script")
+ layout.operator("text.run_script")
#ifndef DISABLE_PYTHON
# XXX if(BPY_is_pyconstraint(text))
# XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints");
#endif
- layout.itemS()
+ layout.separator()
- layout.itemO("text.properties", icon='ICON_MENU_PANEL')
+ layout.operator("text.properties", icon='ICON_MENU_PANEL')
-
-
- #ifndef DISABLE_PYTHON
- # XXX layout.column()
- # XXX uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, "");
- # XXX uiDefIconTextBlockBut(block, text_plugin_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Text Plugins", 0, yco-=20, 120, 19, "");
- #endif
-
- layout.itemM("TEXT_MT_templates")
+ layout.menu("TEXT_MT_templates")
class TEXT_MT_templates(bpy.types.Menu):
@@ -175,23 +168,7 @@ class TEXT_MT_templates(bpy.types.Menu):
bl_label = "Script Templates"
def draw(self, context):
- import os
-
- def path_to_name(f):
- f_base = os.path.splitext(f)[0]
- f_base = f_base.replace("_", " ")
- return ' '.join([w[0].upper() + w[1:] for w in f_base.split()])
-
- layout = self.layout
- template_dir = os.path.join(os.path.dirname(__file__), os.path.pardir, "templates")
-
- for f in sorted(os.listdir(template_dir)):
-
- if f.startswith("."):
- continue
-
- path = os.path.join(template_dir, f)
- layout.item_stringO("text.open", "path", path, text=path_to_name(f))
+ self.path_menu(bpy.utils.script_paths("templates"), "text.open")
class TEXT_MT_edit_view(bpy.types.Menu):
@@ -200,8 +177,8 @@ class TEXT_MT_edit_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.item_enumO("text.move", "type", 'FILE_TOP', text="Top of File")
- layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File")
+ layout.operator("text.move", text="Top of File").type = 'FILE_TOP'
+ layout.operator("text.move", text="Bottom of File").type = 'FILE_BOTTOM'
class TEXT_MT_edit_select(bpy.types.Menu):
@@ -210,8 +187,8 @@ class TEXT_MT_edit_select(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("text.select_all")
- layout.itemO("text.select_line")
+ layout.operator("text.select_all")
+ layout.operator("text.select_line")
class TEXT_MT_edit_markers(bpy.types.Menu):
@@ -220,9 +197,9 @@ class TEXT_MT_edit_markers(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("text.markers_clear")
- layout.itemO("text.next_marker")
- layout.itemO("text.previous_marker")
+ layout.operator("text.markers_clear")
+ layout.operator("text.next_marker")
+ layout.operator("text.previous_marker")
class TEXT_MT_format(bpy.types.Menu):
@@ -231,17 +208,17 @@ class TEXT_MT_format(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("text.indent")
- layout.itemO("text.unindent")
+ layout.operator("text.indent")
+ layout.operator("text.unindent")
- layout.itemS()
+ layout.separator()
- layout.itemO("text.comment")
- layout.itemO("text.uncomment")
+ layout.operator("text.comment")
+ layout.operator("text.uncomment")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("text.convert_whitespace", "type")
+ layout.operator_menu_enum("text.convert_whitespace", "type")
class TEXT_MT_edit_to3d(bpy.types.Menu):
@@ -250,8 +227,8 @@ class TEXT_MT_edit_to3d(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.item_booleanO("text.to_3d_object", "split_lines", False, text="One Object")
- layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line")
+ layout.operator("text.to_3d_object", text="One Object").split_lines = False
+ layout.operator("text.to_3d_object", text="One Object Per Line").split_lines = True
class TEXT_MT_edit(bpy.types.Menu):
@@ -263,29 +240,29 @@ class TEXT_MT_edit(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("ed.undo")
- layout.itemO("ed.redo")
+ layout.operator("ed.undo")
+ layout.operator("ed.redo")
- layout.itemS()
+ layout.separator()
- layout.itemO("text.cut")
- layout.itemO("text.copy")
- layout.itemO("text.paste")
+ layout.operator("text.cut")
+ layout.operator("text.copy")
+ layout.operator("text.paste")
- layout.itemS()
+ layout.separator()
- layout.itemM("TEXT_MT_edit_view")
- layout.itemM("TEXT_MT_edit_select")
- layout.itemM("TEXT_MT_edit_markers")
+ layout.menu("TEXT_MT_edit_view")
+ layout.menu("TEXT_MT_edit_select")
+ layout.menu("TEXT_MT_edit_markers")
- layout.itemS()
+ layout.separator()
- layout.itemO("text.jump")
- layout.itemO("text.properties", text="Find...")
+ layout.operator("text.jump")
+ layout.operator("text.properties", text="Find...")
- layout.itemS()
+ layout.separator()
- layout.itemM("TEXT_MT_edit_to3d")
+ layout.menu("TEXT_MT_edit_to3d")
bpy.types.register(TEXT_HT_header)
bpy.types.register(TEXT_PT_properties)
diff --git a/release/scripts/ui/space_time.py b/release/scripts/ui/space_time.py
index 42734589d48..938a365ed3a 100644
--- a/release/scripts/ui/space_time.py
+++ b/release/scripts/ui/space_time.py
@@ -26,7 +26,6 @@ class TIME_HT_header(bpy.types.Header):
def draw(self, context):
layout = self.layout
- st = context.space_data
scene = context.scene
tools = context.tool_settings
screen = context.screen
@@ -36,51 +35,51 @@ class TIME_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("TIME_MT_view")
- sub.itemM("TIME_MT_frame")
- sub.itemM("TIME_MT_playback")
+ sub.menu("TIME_MT_view")
+ sub.menu("TIME_MT_frame")
+ sub.menu("TIME_MT_playback")
- layout.itemR(scene, "use_preview_range", text="PR")
+ layout.prop(scene, "use_preview_range", text="PR")
row = layout.row(align=True)
if not scene.use_preview_range:
- row.itemR(scene, "start_frame", text="Start")
- row.itemR(scene, "end_frame", text="End")
+ row.prop(scene, "start_frame", text="Start")
+ row.prop(scene, "end_frame", text="End")
else:
- row.itemR(scene, "preview_range_start_frame", text="Start")
- row.itemR(scene, "preview_range_end_frame", text="End")
+ row.prop(scene, "preview_range_start_frame", text="Start")
+ row.prop(scene, "preview_range_end_frame", text="End")
- layout.itemR(scene, "current_frame", text="")
+ layout.prop(scene, "current_frame", text="")
- layout.itemS()
+ layout.separator()
row = layout.row(align=True)
- row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW')
- row.item_booleanO("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME')
+ row.operator("screen.frame_jump", text="", icon='ICON_REW').end = False
+ row.operator("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME').next = False
if not screen.animation_playing:
- row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
- row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
+ row.operator("screen.animation_play", text="", icon='ICON_PLAY_REVERSE').reverse = True
+ row.operator("screen.animation_play", text="", icon='ICON_PLAY')
else:
sub = row.row()
sub.scale_x = 2.0
- sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
- row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
- row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
+ sub.operator("screen.animation_play", text="", icon='ICON_PAUSE')
+ row.operator("screen.keyframe_jump", text="", icon='ICON_NEXT_KEYFRAME').next = True
+ row.operator("screen.frame_jump", text="", icon='ICON_FF').end = True
row = layout.row(align=True)
- row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
+ row.prop(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
if screen.animation_playing and tools.enable_auto_key:
subsub = row.row()
- subsub.itemR(tools, "record_with_nla", toggle=True)
+ subsub.prop(tools, "record_with_nla", toggle=True)
- layout.itemR(scene, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER')
+ layout.prop(scene, "sync_audio", text="Realtime", toggle=True, icon='ICON_SPEAKER')
- layout.itemS()
+ layout.separator()
row = layout.row(align=True)
- row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="")
- row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
- row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
+ row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
+ row.operator("anim.keyframe_insert", text="", icon='ICON_KEY_HLT')
+ row.operator("anim.keyframe_delete", text="", icon='ICON_KEY_DEHLT')
class TIME_MT_view(bpy.types.Menu):
@@ -91,11 +90,11 @@ class TIME_MT_view(bpy.types.Menu):
st = context.space_data
- layout.itemO("anim.time_toggle")
+ layout.operator("anim.time_toggle")
- layout.itemS()
+ layout.separator()
- layout.itemR(st, "only_selected")
+ layout.prop(st, "only_selected")
class TIME_MT_frame(bpy.types.Menu):
@@ -103,24 +102,24 @@ class TIME_MT_frame(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- tools = context.tool_settings
+ # tools = context.tool_settings
- layout.itemO("marker.add", text="Add Marker")
- layout.itemO("marker.duplicate", text="Duplicate Marker")
- layout.itemO("marker.move", text="Grab/Move Marker")
- layout.itemO("marker.delete", text="Delete Marker")
- layout.itemL(text="ToDo: Name Marker")
+ layout.operator("marker.add", text="Add Marker")
+ layout.operator("marker.duplicate", text="Duplicate Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
+ layout.operator("marker.delete", text="Delete Marker")
+ layout.label(text="ToDo: Name Marker")
- layout.itemS()
+ layout.separator()
- layout.itemO("time.start_frame_set")
- layout.itemO("time.end_frame_set")
+ layout.operator("time.start_frame_set")
+ layout.operator("time.end_frame_set")
- layout.itemS()
+ layout.separator()
sub = layout.row()
#sub.active = tools.enable_auto_key
- sub.itemM("TIME_MT_autokey")
+ sub.menu("TIME_MT_autokey")
class TIME_MT_playback(bpy.types.Menu):
@@ -132,23 +131,23 @@ class TIME_MT_playback(bpy.types.Menu):
st = context.space_data
scene = context.scene
- layout.itemR(st, "play_top_left")
- layout.itemR(st, "play_all_3d")
- layout.itemR(st, "play_anim")
- layout.itemR(st, "play_buttons")
- layout.itemR(st, "play_image")
- layout.itemR(st, "play_sequencer")
- layout.itemR(st, "play_nodes")
+ layout.prop(st, "play_top_left")
+ layout.prop(st, "play_all_3d")
+ layout.prop(st, "play_anim")
+ layout.prop(st, "play_buttons")
+ layout.prop(st, "play_image")
+ layout.prop(st, "play_sequencer")
+ layout.prop(st, "play_nodes")
- layout.itemS()
+ layout.separator()
- layout.itemR(st, "continue_physics")
+ layout.prop(st, "continue_physics")
- layout.itemS()
+ layout.separator()
- layout.itemR(scene, "sync_audio", icon='ICON_SPEAKER')
- layout.itemR(scene, "mute_audio")
- layout.itemR(scene, "scrub_audio")
+ layout.prop(scene, "sync_audio", text="Realtime Playback", icon='ICON_SPEAKER')
+ layout.prop(scene, "mute_audio")
+ layout.prop(scene, "scrub_audio")
class TIME_MT_autokey(bpy.types.Menu):
@@ -160,8 +159,8 @@ class TIME_MT_autokey(bpy.types.Menu):
layout.active = tools.enable_auto_key
- layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
- layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS')
+ layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
+ layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
bpy.types.register(TIME_HT_header)
bpy.types.register(TIME_MT_view)
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py
index 75fbfd7e8b9..32a9f0d2534 100644
--- a/release/scripts/ui/space_userpref.py
+++ b/release/scripts/ui/space_userpref.py
@@ -29,19 +29,19 @@ class USERPREF_HT_header(bpy.types.Header):
userpref = context.user_preferences
- layout.operator_context = "EXEC_AREA"
- layout.itemO("wm.save_homefile", text="Save As Default")
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("wm.save_homefile", text="Save As Default")
if userpref.active_section == 'INPUT':
- layout.operator_context = "INVOKE_DEFAULT"
- layout.itemO("wm.keyconfig_export", "Export Key Configuration...")
+ layout.operator_context = 'INVOKE_DEFAULT'
+ layout.operator("wm.keyconfig_export", "Export Key Configuration...").path = "keymap.py"
class USERPREF_MT_view(bpy.types.Menu):
bl_label = "View"
def draw(self, context):
- layout = self.layout
+ pass # layout = self.layout
class USERPREF_PT_tabs(bpy.types.Panel):
@@ -55,7 +55,7 @@ class USERPREF_PT_tabs(bpy.types.Panel):
userpref = context.user_preferences
- layout.itemR(userpref, "active_section", expand=True)
+ layout.prop(userpref, "active_section", expand=True)
class USERPREF_PT_interface(bpy.types.Panel):
@@ -80,68 +80,68 @@ class USERPREF_PT_interface(bpy.types.Panel):
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="Display:")
- sub1.itemR(view, "tooltips")
- sub1.itemR(view, "display_object_info", text="Object Info")
- sub1.itemR(view, "use_large_cursors")
- sub1.itemR(view, "show_view_name", text="View Name")
- sub1.itemR(view, "show_playback_fps", text="Playback FPS")
- sub1.itemR(view, "global_scene")
- sub1.itemR(view, "pin_floating_panels")
- sub1.itemR(view, "object_center_size")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
- sub1.itemR(view, "show_mini_axis", text="Display Mini Axis")
+ sub1.label(text="Display:")
+ sub1.prop(view, "tooltips")
+ sub1.prop(view, "display_object_info", text="Object Info")
+ sub1.prop(view, "use_large_cursors")
+ sub1.prop(view, "show_view_name", text="View Name")
+ sub1.prop(view, "show_playback_fps", text="Playback FPS")
+ sub1.prop(view, "global_scene")
+ sub1.prop(view, "pin_floating_panels")
+ sub1.prop(view, "object_center_size")
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
+ sub1.prop(view, "show_mini_axis", text="Display Mini Axis")
sub2 = sub1.column()
sub2.enabled = view.show_mini_axis
- sub2.itemR(view, "mini_axis_size", text="Size")
- sub2.itemR(view, "mini_axis_brightness", text="Brightness")
+ sub2.prop(view, "mini_axis_size", text="Size")
+ sub2.prop(view, "mini_axis_brightness", text="Brightness")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="View Manipulation:")
- sub1.itemR(view, "auto_depth")
- sub1.itemR(view, "global_pivot")
- sub1.itemR(view, "zoom_to_mouse")
- sub1.itemR(view, "rotate_around_selection")
- sub1.itemS()
+ sub1.label(text="View Manipulation:")
+ sub1.prop(view, "auto_depth")
+ sub1.prop(view, "global_pivot")
+ sub1.prop(view, "zoom_to_mouse")
+ sub1.prop(view, "rotate_around_selection")
+ sub1.separator()
- sub1.itemR(view, "auto_perspective")
- sub1.itemR(view, "smooth_view")
- sub1.itemR(view, "rotation_angle")
+ sub1.prop(view, "auto_perspective")
+ sub1.prop(view, "smooth_view")
+ sub1.prop(view, "rotation_angle")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
#Toolbox doesn't exist yet
-# sub1.itemL(text="Toolbox:")
-# sub1.itemR(view, "use_column_layout")
-# sub1.itemL(text="Open Toolbox Delay:")
-# sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
-# sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
+# sub1.label(text="Toolbox:")
+# sub1.prop(view, "use_column_layout")
+# sub1.label(text="Open Toolbox Delay:")
+# sub1.prop(view, "open_left_mouse_delay", text="Hold LMB")
+# sub1.prop(view, "open_right_mouse_delay", text="Hold RMB")
#manipulator
- sub1.itemR(view, "use_manipulator")
+ sub1.prop(view, "use_manipulator")
sub2 = sub1.column()
sub2.enabled = view.use_manipulator
- sub2.itemR(view, "manipulator_size", text="Size")
- sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
- sub2.itemR(view, "manipulator_hotspot", text="Hotspot")
+ sub2.prop(view, "manipulator_size", text="Size")
+ sub2.prop(view, "manipulator_handle_size", text="Handle Size")
+ sub2.prop(view, "manipulator_hotspot", text="Hotspot")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
- sub1.itemL(text="Menus:")
- sub1.itemR(view, "open_mouse_over")
- sub1.itemL(text="Menu Open Delay:")
- sub1.itemR(view, "open_toplevel_delay", text="Top Level")
- sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
+ sub1.label(text="Menus:")
+ sub1.prop(view, "open_mouse_over")
+ sub1.label(text="Menu Open Delay:")
+ sub1.prop(view, "open_toplevel_delay", text="Top Level")
+ sub1.prop(view, "open_sublevel_delay", text="Sub Level")
class USERPREF_PT_edit(bpy.types.Panel):
@@ -166,87 +166,87 @@ class USERPREF_PT_edit(bpy.types.Panel):
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="Link Materials To:")
- sub1.row().itemR(edit, "material_link", expand=True)
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
- sub1.itemL(text="New Objects:")
- sub1.itemR(edit, "enter_edit_mode")
- sub1.itemL(text="Align To:")
- sub1.row().itemR(edit, "object_align", expand=True)
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.label(text="Link Materials To:")
+ sub1.row().prop(edit, "material_link", expand=True)
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
+ sub1.label(text="New Objects:")
+ sub1.prop(edit, "enter_edit_mode")
+ sub1.label(text="Align To:")
+ sub1.row().prop(edit, "object_align", expand=True)
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
- sub1.itemL(text="Undo:")
- sub1.itemR(edit, "global_undo")
- sub1.itemR(edit, "undo_steps", text="Steps")
- sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+ sub1.label(text="Undo:")
+ sub1.prop(edit, "global_undo")
+ sub1.prop(edit, "undo_steps", text="Steps")
+ sub1.prop(edit, "undo_memory_limit", text="Memory Limit")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="Snap:")
- sub1.itemR(edit, "snap_translate", text="Translate")
- sub1.itemR(edit, "snap_rotate", text="Rotate")
- sub1.itemR(edit, "snap_scale", text="Scale")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
- sub1.itemL(text="Grease Pencil:")
- sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
- sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
- # sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
- sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
- sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
+ sub1.label(text="Snap:")
+ sub1.prop(edit, "snap_translate", text="Translate")
+ sub1.prop(edit, "snap_rotate", text="Rotate")
+ sub1.prop(edit, "snap_scale", text="Scale")
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
+ sub1.label(text="Grease Pencil:")
+ sub1.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
+ sub1.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
+ # sub1.prop(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
+ sub1.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
+ sub1.prop(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="Keyframing:")
- sub1.itemR(edit, "use_visual_keying")
- sub1.itemR(edit, "keyframe_insert_needed", text="Only Insert Needed")
- sub1.itemS()
- sub1.itemL(text="New F-Curve Defaults:")
- sub1.itemR(edit, "new_interpolation_type", text="Interpolation")
- sub1.itemS()
- sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing:")
+ sub1.label(text="Keyframing:")
+ sub1.prop(edit, "use_visual_keying")
+ sub1.prop(edit, "keyframe_insert_needed", text="Only Insert Needed")
+ sub1.separator()
+ sub1.label(text="New F-Curve Defaults:")
+ sub1.prop(edit, "new_interpolation_type", text="Interpolation")
+ sub1.separator()
+ sub1.prop(edit, "auto_keying_enable", text="Auto Keyframing:")
sub2 = sub1.column()
sub2.active = edit.auto_keying_enable
- sub2.itemR(edit, "auto_keyframe_insert_keyingset", text="Only Insert for Keying Set")
- sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
+ sub2.prop(edit, "auto_keyframe_insert_keyingset", text="Only Insert for Keying Set")
+ sub2.prop(edit, "auto_keyframe_insert_available", text="Only Insert Available")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
- sub1.itemL(text="Transform:")
- sub1.itemR(edit, "drag_immediately")
+ sub1.label(text="Transform:")
+ sub1.prop(edit, "drag_immediately")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
col = split.column()
sub = col.split(percentage=0.85)
sub1 = sub.column()
- sub1.itemL(text="Duplicate Data:")
- sub1.itemR(edit, "duplicate_mesh", text="Mesh")
- sub1.itemR(edit, "duplicate_surface", text="Surface")
- sub1.itemR(edit, "duplicate_curve", text="Curve")
- sub1.itemR(edit, "duplicate_text", text="Text")
- sub1.itemR(edit, "duplicate_metaball", text="Metaball")
- sub1.itemR(edit, "duplicate_armature", text="Armature")
- sub1.itemR(edit, "duplicate_lamp", text="Lamp")
- sub1.itemR(edit, "duplicate_material", text="Material")
- sub1.itemR(edit, "duplicate_texture", text="Texture")
- sub1.itemR(edit, "duplicate_ipo", text="F-Curve")
- sub1.itemR(edit, "duplicate_action", text="Action")
- sub1.itemR(edit, "duplicate_particle", text="Particle")
+ sub1.label(text="Duplicate Data:")
+ sub1.prop(edit, "duplicate_mesh", text="Mesh")
+ sub1.prop(edit, "duplicate_surface", text="Surface")
+ sub1.prop(edit, "duplicate_curve", text="Curve")
+ sub1.prop(edit, "duplicate_text", text="Text")
+ sub1.prop(edit, "duplicate_metaball", text="Metaball")
+ sub1.prop(edit, "duplicate_armature", text="Armature")
+ sub1.prop(edit, "duplicate_lamp", text="Lamp")
+ sub1.prop(edit, "duplicate_material", text="Material")
+ sub1.prop(edit, "duplicate_texture", text="Texture")
+ sub1.prop(edit, "duplicate_ipo", text="F-Curve")
+ sub1.prop(edit, "duplicate_action", text="Action")
+ sub1.prop(edit, "duplicate_particle", text="Particle")
class USERPREF_PT_system(bpy.types.Panel):
@@ -264,6 +264,9 @@ class USERPREF_PT_system(bpy.types.Panel):
userpref = context.user_preferences
system = userpref.system
+ lamp0 = system.solid_lights[0]
+ lamp1 = system.solid_lights[1]
+ lamp2 = system.solid_lights[2]
split = layout.split()
@@ -271,75 +274,102 @@ class USERPREF_PT_system(bpy.types.Panel):
sub = col.split(percentage=0.9)
sub1 = sub.column()
- sub1.itemL(text="General:")
- sub1.itemR(system, "dpi")
- sub1.itemR(system, "frame_server_port")
- sub1.itemR(system, "scrollback", text="Console Scrollback")
- sub1.itemR(system, "emulate_numpad")
- sub1.itemR(system, "auto_run_python_scripts")
+ sub1.label(text="General:")
+ sub1.prop(system, "dpi")
+ sub1.prop(system, "frame_server_port")
+ sub1.prop(system, "scrollback", text="Console Scrollback")
+ sub1.prop(system, "auto_run_python_scripts")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
- sub1.itemL(text="Sound:")
- sub1.row().itemR(system, "audio_device", expand=True)
+ sub1.label(text="Sound:")
+ sub1.row().prop(system, "audio_device", expand=True)
sub2 = sub1.column()
sub2.active = system.audio_device != 'NONE'
- sub2.itemR(system, "enable_all_codecs")
- sub2.itemR(system, "game_sound")
- sub2.itemR(system, "audio_channels", text="Channels")
- sub2.itemR(system, "audio_mixing_buffer", text="Mixing Buffer")
- sub2.itemR(system, "audio_sample_rate", text="Sample Rate")
- sub2.itemR(system, "audio_sample_format", text="Sample Format")
+ sub2.prop(system, "enable_all_codecs")
+ sub2.prop(system, "game_sound")
+ sub2.prop(system, "audio_channels", text="Channels")
+ sub2.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
+ sub2.prop(system, "audio_sample_rate", text="Sample Rate")
+ sub2.prop(system, "audio_sample_format", text="Sample Format")
col = split.column()
sub = col.split(percentage=0.9)
sub1 = sub .column()
- sub1.itemL(text="Weight Colors:")
- sub1.itemR(system, "use_weight_color_range", text="Use Custom Range")
+ sub1.label(text="Weight Colors:")
+ sub1.prop(system, "use_weight_color_range", text="Use Custom Range")
sub2 = sub1.column()
sub2.active = system.use_weight_color_range
sub2.template_color_ramp(system, "weight_color_range", expand=True)
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
- sub1.itemR(system, "language")
- sub1.itemL(text="Translate:")
- sub1.itemR(system, "translate_tooltips", text="Tooltips")
- sub1.itemR(system, "translate_buttons", text="Labels")
- sub1.itemR(system, "translate_toolbox", text="Toolbox")
+ sub1.prop(system, "language")
+ sub1.label(text="Translate:")
+ sub1.prop(system, "translate_tooltips", text="Tooltips")
+ sub1.prop(system, "translate_buttons", text="Labels")
+ sub1.prop(system, "translate_toolbox", text="Toolbox")
- sub1.itemS()
+ sub1.separator()
- sub1.itemR(system, "use_textured_fonts")
+ sub1.prop(system, "use_textured_fonts")
col = split.column()
sub = col.split(percentage=0.9)
sub1 = sub.column()
- sub1.itemL(text="OpenGL:")
- sub1.itemR(system, "clip_alpha", slider=True)
- sub1.itemR(system, "use_mipmaps")
- sub1.itemR(system, "use_vbos")
- sub1.itemL(text="Window Draw Method:")
- sub1.row().itemR(system, "window_draw_method", expand=True)
- sub1.itemL(text="Textures:")
- sub1.itemR(system, "gl_texture_limit", text="Limit Size")
- sub1.itemR(system, "texture_time_out", text="Time Out")
- sub1.itemR(system, "texture_collection_rate", text="Collection Rate")
+ sub1.label(text="Solid OpenGL lights:")
- sub1.itemS()
- sub1.itemS()
- sub1.itemS()
+ sub2 = sub1.split()
- sub1.itemL(text="Sequencer:")
- sub1.itemR(system, "prefetch_frames")
- sub1.itemR(system, "memory_cache_limit")
+ col = sub2.column()
+ col.prop(lamp0, "enabled")
+ sub = col.column()
+ sub.active = lamp0.enabled
+ sub.prop(lamp0, "diffuse_color")
+ sub.prop(lamp0, "specular_color")
+ sub.prop(lamp0, "direction")
+
+ col = sub2.column()
+ col.prop(lamp1, "enabled")
+ sub = col.column()
+ sub.active = lamp1.enabled
+ sub.prop(lamp1, "diffuse_color")
+ sub.prop(lamp1, "specular_color")
+ sub.prop(lamp1, "direction")
+
+ col = sub2.column()
+ col.prop(lamp2, "enabled")
+ sub = col.column()
+ sub.active = lamp2.enabled
+ sub.prop(lamp2, "diffuse_color")
+ sub.prop(lamp2, "specular_color")
+ sub.prop(lamp2, "direction")
+
+ sub1.label(text="OpenGL:")
+ sub1.prop(system, "clip_alpha", slider=True)
+ sub1.prop(system, "use_mipmaps")
+ sub1.prop(system, "use_vbos")
+ sub1.label(text="Window Draw Method:")
+ sub1.row().prop(system, "window_draw_method", expand=True)
+ sub1.label(text="Textures:")
+ sub1.prop(system, "gl_texture_limit", text="Limit Size")
+ sub1.prop(system, "texture_time_out", text="Time Out")
+ sub1.prop(system, "texture_collection_rate", text="Collection Rate")
+
+ sub1.separator()
+ sub1.separator()
+ sub1.separator()
+
+ sub1.label(text="Sequencer:")
+ sub1.prop(system, "prefetch_frames")
+ sub1.prop(system, "memory_cache_limit")
class USERPREF_PT_theme(bpy.types.Panel):
@@ -360,9 +390,9 @@ class USERPREF_PT_theme(bpy.types.Panel):
split = layout.split(percentage=0.33)
- split.itemR(theme, "active_theme", text="")
+ split.prop(theme, "active_theme", text="")
- layout.itemS()
+ layout.separator()
split = layout.split()
@@ -370,692 +400,651 @@ class USERPREF_PT_theme(bpy.types.Panel):
v3d = theme.view_3d
col = split.column()
- col.itemR(v3d, "back")
- col.itemR(v3d, "title")
- col.itemR(v3d, "text")
- col.itemR(v3d, "text_hi")
- col.itemR(v3d, "header")
- col.itemR(v3d, "header_text")
+ col.prop(v3d, "back")
+ col.prop(v3d, "button")
+ col.prop(v3d, "button_title")
+ col.prop(v3d, "button_text")
+ col.prop(v3d, "header")
col = split.column()
- col.itemR(v3d, "header_text_hi")
- col.itemR(v3d, "grid")
- col.itemR(v3d, "panel", slider=True)
- col.itemR(v3d, "wire")
- col.itemR(v3d, "lamp", slider=True)
+ col.prop(v3d, "grid")
+ col.prop(v3d, "wire")
+ col.prop(v3d, "lamp", slider=True)
+ col.prop(v3d, "editmesh_active", slider=True)
col = split.column()
- col.itemR(v3d, "current_frame")
- col.itemR(v3d, "editmesh_active", slider=True)
- col.itemR(v3d, "object_selected")
- col.itemR(v3d, "object_active")
- col.itemR(v3d, "object_grouped")
- col.itemR(v3d, "object_grouped_active")
+
+ col.prop(v3d, "object_selected")
+ col.prop(v3d, "object_active")
+ col.prop(v3d, "object_grouped")
+ col.prop(v3d, "object_grouped_active")
+ col.prop(v3d, "transform")
col = split.column()
- col.itemR(v3d, "transform")
- col.itemR(v3d, "vertex")
- col.itemR(v3d, "face", slider=True)
- col.itemR(v3d, "normal")
- col.itemR(v3d, "bone_solid")
- col.itemR(v3d, "bone_pose")
+ col.prop(v3d, "vertex")
+ col.prop(v3d, "face", slider=True)
+ col.prop(v3d, "normal")
+ col.prop(v3d, "bone_solid")
+ col.prop(v3d, "bone_pose")
-# col.itemR(v3d, "edge") Doesn't seem to work
+# col.prop(v3d, "edge") Doesn't seem to work
elif theme.active_theme == 'USER_INTERFACE':
ui = theme.user_interface.wcol_regular
- layout.itemL(text="Regular:")
+ layout.label(text="Regular:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
- layout.itemS()
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
+ layout.separator()
ui = theme.user_interface.wcol_tool
- layout.itemL(text="Tool:")
+ layout.label(text="Tool:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_radio
- layout.itemL(text="Radio Buttons:")
+ layout.label(text="Radio Buttons:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_text
- layout.itemL(text="Text:")
+ layout.label(text="Text:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_option
- layout.itemL(text="Option:")
+ layout.label(text="Option:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_toggle
- layout.itemL(text="Toggle:")
+ layout.label(text="Toggle:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_num
- layout.itemL(text="Number Field:")
+ layout.label(text="Number Field:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_numslider
- layout.itemL(text="Value Slider:")
+ layout.label(text="Value Slider:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_box
- layout.itemL(text="Box:")
+ layout.label(text="Box:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_menu
- layout.itemL(text="Menu:")
+ layout.label(text="Menu:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_pulldown
- layout.itemL(text="Pulldown:")
+ layout.label(text="Pulldown:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_menu_back
- layout.itemL(text="Menu Back:")
+ layout.label(text="Menu Back:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_menu_item
- layout.itemL(text="Menu Item:")
+ layout.label(text="Menu Item:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_scroll
- layout.itemL(text="Scroll Bar:")
+ layout.label(text="Scroll Bar:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_list_item
- layout.itemL(text="List Item:")
+ layout.label(text="List Item:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "outline")
- sub1.itemR(ui, "item", slider=True)
+ sub1.prop(ui, "outline")
+ sub1.prop(ui, "item", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "inner", slider=True)
- sub1.itemR(ui, "inner_sel", slider=True)
+ sub1.prop(ui, "inner", slider=True)
+ sub1.prop(ui, "inner_sel", slider=True)
sub1 = sub.column()
- sub1.itemR(ui, "text")
- sub1.itemR(ui, "text_sel")
+ sub1.prop(ui, "text")
+ sub1.prop(ui, "text_sel")
sub1 = sub.column()
- sub1.itemR(ui, "shaded")
+ sub1.prop(ui, "shaded")
sub2 = sub1.column(align=True)
sub2.active = ui.shaded
- sub2.itemR(ui, "shadetop")
- sub2.itemR(ui, "shadedown")
+ sub2.prop(ui, "shadetop")
+ sub2.prop(ui, "shadedown")
ui = theme.user_interface.wcol_state
- layout.itemL(text="State:")
+ layout.label(text="State:")
sub = layout.row()
sub1 = sub.column()
- sub1.itemR(ui, "inner_anim")
- sub1.itemR(ui, "inner_anim_sel")
+ sub1.prop(ui, "inner_anim")
+ sub1.prop(ui, "inner_anim_sel")
sub1 = sub.column()
- sub1.itemR(ui, "inner_driven")
- sub1.itemR(ui, "inner_driven_sel")
+ sub1.prop(ui, "inner_driven")
+ sub1.prop(ui, "inner_driven_sel")
sub1 = sub.column()
- sub1.itemR(ui, "inner_key")
- sub1.itemR(ui, "inner_key_sel")
+ sub1.prop(ui, "inner_key")
+ sub1.prop(ui, "inner_key_sel")
sub1 = sub.column()
- sub1.itemR(ui, "blend")
+ sub1.prop(ui, "blend")
ui = theme.user_interface
- layout.itemS()
+ layout.separator()
sub = layout.row()
- sub.itemR(ui, "icon_file")
+ sub.prop(ui, "icon_file")
- layout.itemS()
- layout.itemS()
+ layout.separator()
+ layout.separator()
elif theme.active_theme == 'GRAPH_EDITOR':
graph = theme.graph_editor
col = split.column()
- col.itemR(graph, "back")
- col.itemR(graph, "title")
- col.itemR(graph, "text")
- col.itemR(graph, "text_hi")
- col.itemR(graph, "header")
+ col.prop(graph, "back")
+ col.prop(graph, "button")
+ col.prop(graph, "button_title")
+ col.prop(graph, "button_text")
col = split.column()
- col.itemR(graph, "header_text")
- col.itemR(graph, "header_text_hi")
- col.itemR(graph, "grid")
- col.itemR(graph, "panel")
- col.itemR(graph, "window_sliders")
+ col.prop(graph, "header")
+ col.prop(graph, "grid")
+ col.prop(graph, "list")
+ col.prop(graph, "channel_group")
col = split.column()
- col.itemR(graph, "channels_region")
- col.itemR(graph, "vertex")
- col.itemR(graph, "current_frame")
- col.itemR(graph, "handle_vertex")
- col.itemR(graph, "handle_vertex_select")
+ col.prop(graph, "active_channels_group")
+ col.prop(graph, "dopesheet_channel")
+ col.prop(graph, "dopesheet_subchannel")
+ col.prop(graph, "vertex")
col = split.column()
- col.itemR(graph, "handle_vertex_size")
- col.itemR(graph, "channel_group")
- col.itemR(graph, "active_channels_group")
- col.itemR(graph, "dopesheet_channel")
- col.itemR(graph, "dopesheet_subchannel")
-
+ col.prop(graph, "current_frame")
+ col.prop(graph, "handle_vertex")
+ col.prop(graph, "handle_vertex_select")
+ col.separator()
+ col.prop(graph, "handle_vertex_size")
elif theme.active_theme == 'FILE_BROWSER':
- file = theme.file_browser
+ file_browse = theme.file_browser
col = split.column()
- col.itemR(file, "back")
- col.itemR(file, "title")
- col.itemR(file, "text")
- col.itemR(file, "text_hi")
+ col.prop(file_browse, "back")
+ col.prop(file_browse, "text")
+ col.prop(file_browse, "text_hi")
col = split.column()
- col.itemR(file, "header")
- col.itemR(file, "header_text")
- col.itemR(file, "header_text_hi")
+ col.prop(file_browse, "header")
+ col.prop(file_browse, "list")
col = split.column()
- col.itemR(file, "selected_file")
- col.itemR(file, "tiles")
- col.itemR(file, "scrollbar")
+ col.prop(file_browse, "selected_file")
+ col.prop(file_browse, "tiles")
col = split.column()
- col.itemR(file, "scroll_handle")
- col.itemR(file, "active_file")
- col.itemR(file, "active_file_text")
+ col.prop(file_browse, "active_file")
+ col.prop(file_browse, "active_file_text")
elif theme.active_theme == 'NLA_EDITOR':
nla = theme.nla_editor
col = split.column()
- col.itemR(nla, "back")
- col.itemR(nla, "title")
- col.itemR(nla, "text")
- col.itemR(nla, "text_hi")
+ col.prop(nla, "back")
+ col.prop(nla, "button")
+ col.prop(nla, "button_title")
col = split.column()
- col.itemR(nla, "header")
- col.itemR(nla, "header_text")
- col.itemR(nla, "header_text_hi")
- col.itemR(nla, "grid")
+ col.prop(nla, "button_text")
+ col.prop(nla, "text")
+ col.prop(nla, "header")
col = split.column()
- col.itemR(nla, "view_sliders")
- col.itemR(nla, "bars")
- col.itemR(nla, "bars_selected")
+ col.prop(nla, "grid")
+ col.prop(nla, "bars")
+ col.prop(nla, "bars_selected")
col = split.column()
- col.itemR(nla, "strips")
- col.itemR(nla, "strips_selected")
- col.itemR(nla, "current_frame")
+ col.prop(nla, "strips")
+ col.prop(nla, "strips_selected")
+ col.prop(nla, "current_frame")
elif theme.active_theme == 'DOPESHEET_EDITOR':
dope = theme.dopesheet_editor
col = split.column()
- col.itemR(dope, "back")
- col.itemR(dope, "title")
- col.itemR(dope, "text")
- col.itemR(dope, "text_hi")
- col.itemR(dope, "header")
+ col.prop(dope, "back")
+ col.prop(dope, "list")
+ col.prop(dope, "text")
+ col.prop(dope, "header")
col = split.column()
- col.itemR(dope, "header_text")
- col.itemR(dope, "header_text_hi")
- col.itemR(dope, "grid")
- col.itemR(dope, "value_sliders")
- col.itemR(dope, "view_sliders")
+ col.prop(dope, "grid")
+ col.prop(dope, "channels")
+ col.prop(dope, "channels_selected")
+ col.prop(dope, "channel_group")
col = split.column()
- col.itemR(dope, "channels")
- col.itemR(dope, "channels_selected")
- col.itemR(dope, "channel_group")
- col.itemR(dope, "active_channels_group")
- col.itemR(dope, "long_key")
+ col.prop(dope, "active_channels_group")
+ col.prop(dope, "long_key")
+ col.prop(dope, "long_key_selected")
col = split.column()
- col.itemR(dope, "long_key_selected")
- col.itemR(dope, "current_frame")
- col.itemR(dope, "dopesheet_channel")
- col.itemR(dope, "dopesheet_subchannel")
+ col.prop(dope, "current_frame")
+ col.prop(dope, "dopesheet_channel")
+ col.prop(dope, "dopesheet_subchannel")
elif theme.active_theme == 'IMAGE_EDITOR':
image = theme.image_editor
col = split.column()
- col.itemR(image, "back")
- col.itemR(image, "title")
+ col.prop(image, "back")
+ col.prop(image, "button")
col = split.column()
- col.itemR(image, "text")
- col.itemR(image, "text_hi")
+ col.prop(image, "button_title")
+ col.prop(image, "button_text")
col = split.column()
- col.itemR(image, "header")
- col.itemR(image, "header_text")
+ col.prop(image, "header")
col = split.column()
- col.itemR(image, "header_text_hi")
- col.itemR(image, "editmesh_active", slider=True)
+ col.prop(image, "editmesh_active", slider=True)
elif theme.active_theme == 'SEQUENCE_EDITOR':
seq = theme.sequence_editor
col = split.column()
- col.itemR(seq, "back")
- col.itemR(seq, "title")
- col.itemR(seq, "text")
- col.itemR(seq, "text_hi")
- col.itemR(seq, "header")
+ col.prop(seq, "back")
+ col.prop(seq, "button")
+ col.prop(seq, "button_title")
+ col.prop(seq, "button_text")
+ col.prop(seq, "text")
col = split.column()
- col.itemR(seq, "header_text")
- col.itemR(seq, "header_text_hi")
- col.itemR(seq, "grid")
- col.itemR(seq, "window_sliders")
- col.itemR(seq, "movie_strip")
+ col.prop(seq, "header")
+ col.prop(seq, "grid")
+ col.prop(seq, "movie_strip")
+ col.prop(seq, "image_strip")
+ col.prop(seq, "scene_strip")
col = split.column()
- col.itemR(seq, "image_strip")
- col.itemR(seq, "scene_strip")
- col.itemR(seq, "audio_strip")
- col.itemR(seq, "effect_strip")
- col.itemR(seq, "plugin_strip")
+ col.prop(seq, "audio_strip")
+ col.prop(seq, "effect_strip")
+ col.prop(seq, "plugin_strip")
+ col.prop(seq, "transition_strip")
col = split.column()
- col.itemR(seq, "transition_strip")
- col.itemR(seq, "meta_strip")
- col.itemR(seq, "current_frame")
- col.itemR(seq, "keyframe")
- col.itemR(seq, "draw_action")
+ col.prop(seq, "meta_strip")
+ col.prop(seq, "current_frame")
+ col.prop(seq, "keyframe")
+ col.prop(seq, "draw_action")
elif theme.active_theme == 'PROPERTIES':
prop = theme.properties
col = split.column()
- col.itemR(prop, "back")
- col.itemR(prop, "title")
+ col.prop(prop, "back")
col = split.column()
- col.itemR(prop, "text")
- col.itemR(prop, "text_hi")
+ col.prop(prop, "title")
col = split.column()
- col.itemR(prop, "header")
- col.itemR(prop, "header_text")
+ col.prop(prop, "text")
col = split.column()
- col.itemR(prop, "header_text_hi")
- col.itemR(prop, "panel")
+ col.prop(prop, "header")
elif theme.active_theme == 'TEXT_EDITOR':
text = theme.text_editor
col = split.column()
- col.itemR(text, "back")
- col.itemR(text, "title")
- col.itemR(text, "text")
- col.itemR(text, "text_hi")
+ col.prop(text, "back")
+ col.prop(text, "button")
+ col.prop(text, "button_title")
+ col.prop(text, "button_text")
col = split.column()
- col.itemR(text, "header")
- col.itemR(text, "header_text")
- col.itemR(text, "header_text_hi")
- col.itemR(text, "line_numbers_background")
+ col.prop(text, "text")
+ col.prop(text, "text_hi")
+ col.prop(text, "header")
+ col.prop(text, "line_numbers_background")
col = split.column()
- col.itemR(text, "scroll_bar")
- col.itemR(text, "selected_text")
- col.itemR(text, "cursor")
- col.itemR(text, "syntax_builtin")
+ col.prop(text, "selected_text")
+ col.prop(text, "cursor")
+ col.prop(text, "syntax_builtin")
+ col.prop(text, "syntax_special")
col = split.column()
- col.itemR(text, "syntax_special")
- col.itemR(text, "syntax_comment")
- col.itemR(text, "syntax_string")
- col.itemR(text, "syntax_numbers")
+ col.prop(text, "syntax_comment")
+ col.prop(text, "syntax_string")
+ col.prop(text, "syntax_numbers")
elif theme.active_theme == 'TIMELINE':
time = theme.timeline
col = split.column()
- col.itemR(time, "back")
- col.itemR(time, "title")
- col.itemR(time, "text")
+ col.prop(time, "back")
+ col.prop(time, "text")
col = split.column()
- col.itemR(time, "text_hi")
- col.itemR(time, "header")
+ col.prop(time, "header")
col = split.column()
- col.itemR(time, "header_text")
- col.itemR(time, "header_text_hi")
+ col.prop(time, "grid")
col = split.column()
- col.itemR(time, "grid")
- col.itemR(time, "current_frame")
+ col.prop(time, "current_frame")
elif theme.active_theme == 'NODE_EDITOR':
node = theme.node_editor
col = split.column()
- col.itemR(node, "back")
- col.itemR(node, "title")
- col.itemR(node, "text")
- col.itemR(node, "text_hi")
+ col.prop(node, "back")
+ col.prop(node, "button")
+ col.prop(node, "button_title")
+ col.prop(node, "button_text")
+
col = split.column()
- col.itemR(node, "header")
- col.itemR(node, "header_text")
- col.itemR(node, "header_text_hi")
- col.itemR(node, "wires")
+ col.prop(node, "text")
+ col.prop(node, "text_hi")
+ col.prop(node, "header")
+ col.prop(node, "wires")
col = split.column()
- col.itemR(node, "wire_select")
- col.itemR(node, "selected_text")
- col.itemR(node, "node_backdrop")
- col.itemR(node, "in_out_node")
+ col.prop(node, "wire_select")
+ col.prop(node, "selected_text")
+ col.prop(node, "node_backdrop", slider=True)
+ col.prop(node, "in_out_node")
col = split.column()
- col.itemR(node, "converter_node")
- col.itemR(node, "operator_node")
- col.itemR(node, "group_node")
+ col.prop(node, "converter_node")
+ col.prop(node, "operator_node")
+ col.prop(node, "group_node")
elif theme.active_theme == 'LOGIC_EDITOR':
logic = theme.logic_editor
col = split.column()
- col.itemR(logic, "back")
- col.itemR(logic, "title")
+ col.prop(logic, "back")
+ col.prop(logic, "button")
col = split.column()
- col.itemR(logic, "text")
- col.itemR(logic, "text_hi")
+ col.prop(logic, "button_title")
+ col.prop(logic, "button_text")
col = split.column()
- col.itemR(logic, "header")
- col.itemR(logic, "header_text")
+ col.prop(logic, "text")
+ col.prop(logic, "header")
col = split.column()
- col.itemR(logic, "header_text_hi")
- col.itemR(logic, "panel")
+ col.prop(logic, "panel")
elif theme.active_theme == 'OUTLINER':
out = theme.outliner
col = split.column()
- col.itemR(out, "back")
- col.itemR(out, "title")
+ col.prop(out, "back")
col = split.column()
- col.itemR(out, "text")
- col.itemR(out, "text_hi")
+ col.prop(out, "text")
col = split.column()
- col.itemR(out, "header")
- col.itemR(out, "header_text")
+ col.prop(out, "text_hi")
col = split.column()
- col.itemR(out, "header_text_hi")
+ col.prop(out, "header")
elif theme.active_theme == 'INFO':
info = theme.info
col = split.column()
- col.itemR(info, "back")
- col.itemR(info, "title")
+ col.prop(info, "back")
col = split.column()
- col.itemR(info, "text")
- col.itemR(info, "text_hi")
+ col.prop(info, "header")
col = split.column()
- col.itemR(info, "header")
- col.itemR(info, "header_text")
+ col.prop(info, "header_text")
col = split.column()
- col.itemR(info, "header_text_hi")
elif theme.active_theme == 'USER_PREFERENCES':
prefs = theme.user_preferences
col = split.column()
- col.itemR(prefs, "back")
- col.itemR(prefs, "title")
+ col.prop(prefs, "back")
col = split.column()
- col.itemR(prefs, "text")
- col.itemR(prefs, "text_hi")
+ col.prop(prefs, "text")
col = split.column()
- col.itemR(prefs, "header")
- col.itemR(prefs, "header_text")
+ col.prop(prefs, "header")
col = split.column()
- col.itemR(prefs, "header_text_hi")
+ col.prop(prefs, "header_text")
class USERPREF_PT_file(bpy.types.Panel):
@@ -1077,53 +1066,53 @@ class USERPREF_PT_file(bpy.types.Panel):
split = layout.split(percentage=0.6)
col = split.column()
- col.itemL(text="File Paths:")
+ col.label(text="File Paths:")
sub = col.split(percentage=0.3)
- sub.itemL(text="Fonts:")
- sub.itemR(paths, "fonts_directory", text="")
+ sub.label(text="Fonts:")
+ sub.prop(paths, "fonts_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Textures:")
- sub.itemR(paths, "textures_directory", text="")
+ sub.label(text="Textures:")
+ sub.prop(paths, "textures_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Texture Plugins:")
- sub.itemR(paths, "texture_plugin_directory", text="")
+ sub.label(text="Texture Plugins:")
+ sub.prop(paths, "texture_plugin_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Sequence Plugins:")
- sub.itemR(paths, "sequence_plugin_directory", text="")
+ sub.label(text="Sequence Plugins:")
+ sub.prop(paths, "sequence_plugin_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Render Output:")
- sub.itemR(paths, "render_output_directory", text="")
+ sub.label(text="Render Output:")
+ sub.prop(paths, "render_output_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Scripts:")
- sub.itemR(paths, "python_scripts_directory", text="")
+ sub.label(text="Scripts:")
+ sub.prop(paths, "python_scripts_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Sounds:")
- sub.itemR(paths, "sounds_directory", text="")
+ sub.label(text="Sounds:")
+ sub.prop(paths, "sounds_directory", text="")
sub = col.split(percentage=0.3)
- sub.itemL(text="Temp:")
- sub.itemR(paths, "temporary_directory", text="")
+ sub.label(text="Temp:")
+ sub.prop(paths, "temporary_directory", text="")
col = split.column()
sub = col.split(percentage=0.2)
- sub1 = sub.column()
+ sub.column() # sub1, unused
sub2 = sub.column()
- sub2.itemL(text="Save & Load:")
- sub2.itemR(paths, "use_relative_paths")
- sub2.itemR(paths, "compress_file")
- sub2.itemR(paths, "load_ui")
- sub2.itemR(paths, "filter_file_extensions")
- sub2.itemR(paths, "hide_dot_files_datablocks")
- sub2.itemS()
- sub2.itemS()
- sub2.itemL(text="Auto Save:")
- sub2.itemR(paths, "save_version")
- sub2.itemR(paths, "recent_files")
- sub2.itemR(paths, "save_preview_images")
- sub2.itemR(paths, "auto_save_temporary_files")
+ sub2.label(text="Save & Load:")
+ sub2.prop(paths, "use_relative_paths")
+ sub2.prop(paths, "compress_file")
+ sub2.prop(paths, "load_ui")
+ sub2.prop(paths, "filter_file_extensions")
+ sub2.prop(paths, "hide_dot_files_datablocks")
+ sub2.separator()
+ sub2.separator()
+ sub2.label(text="Auto Save:")
+ sub2.prop(paths, "save_version")
+ sub2.prop(paths, "recent_files")
+ sub2.prop(paths, "save_preview_images")
+ sub2.prop(paths, "auto_save_temporary_files")
sub3 = sub2.column()
sub3.enabled = paths.auto_save_temporary_files
- sub3.itemR(paths, "auto_save_time", text="Timer (mins)")
+ sub3.prop(paths, "auto_save_time", text="Timer (mins)")
class USERPREF_PT_input(bpy.types.Panel):
@@ -1142,7 +1131,7 @@ class USERPREF_PT_input(bpy.types.Panel):
userpref = context.user_preferences
wm = context.manager
#input = userpref.input
- input = userpref
+ #input = userpref
inputs = userpref.inputs
split = layout.split(percentage=0.25)
@@ -1152,70 +1141,72 @@ class USERPREF_PT_input(bpy.types.Panel):
col = row.column()
sub = col.column()
- sub.itemL(text="Configuration:")
- sub.item_pointerR(wm, "active_keyconfig", wm, "keyconfigs", text="")
+ sub.label(text="Configuration:")
+ sub.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="")
- col.itemS()
+ col.separator()
sub = col.column()
- sub.itemL(text="Mouse:")
+ sub.label(text="Mouse:")
sub1 = sub.column()
sub1.enabled = (inputs.select_mouse == 'RIGHT')
- sub1.itemR(inputs, "emulate_3_button_mouse")
- sub.itemR(inputs, "continuous_mouse")
+ sub1.prop(inputs, "emulate_3_button_mouse")
+ sub.prop(inputs, "continuous_mouse")
- sub.itemL(text="Select With:")
- sub.row().itemR(inputs, "select_mouse", expand=True)
- sub.itemL(text="Middle Mouse:")
- sub.row().itemR(inputs, "middle_mouse", expand=True)
+ sub.label(text="Select With:")
+ sub.row().prop(inputs, "select_mouse", expand=True)
- sub.itemS()
- sub.itemS()
- sub.itemS()
+ sub.separator()
- sub.itemL(text="Orbit Style:")
- sub.row().itemR(inputs, "view_rotation", expand=True)
+ sub.prop(inputs, "emulate_numpad")
- sub.itemL(text="Zoom Style:")
- sub.row().itemR(inputs, "viewport_zoom_style", expand=True)
+ sub.separator()
- #sub.itemR(inputs, "use_middle_mouse_paste")
+ sub.label(text="Orbit Style:")
+ sub.row().prop(inputs, "view_rotation", expand=True)
- #col.itemS()
+ sub.label(text="Zoom Style:")
+ sub.row().prop(inputs, "viewport_zoom_style", expand=True)
+ if inputs.viewport_zoom_style == 'DOLLY':
+ sub.row().prop(inputs, "zoom_axis", expand=True)
+ sub.prop(inputs, "invert_zoom_direction")
+
+ #sub.prop(inputs, "use_middle_mouse_paste")
+
+ #col.separator()
#sub = col.column()
- #sub.itemL(text="Mouse Wheel:")
- #sub.itemR(view, "wheel_invert_zoom", text="Invert Zoom")
- #sub.itemR(view, "wheel_scroll_lines", text="Scroll Lines")
+ #sub.label(text="Mouse Wheel:")
+ #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
- col.itemS()
+ col.separator()
sub = col.column()
- sub.itemL(text="NDOF Device:")
- sub.itemR(inputs, "ndof_pan_speed", text="Pan Speed")
- sub.itemR(inputs, "ndof_rotate_speed", text="Orbit Speed")
+ sub.label(text="NDOF Device:")
+ sub.prop(inputs, "ndof_pan_speed", text="Pan Speed")
+ sub.prop(inputs, "ndof_rotate_speed", text="Orbit Speed")
- row.itemS()
+ row.separator()
# Keymap Settings
col = split.column()
- kc = wm.active_keyconfig
+ # kc = wm.active_keyconfig
defkc = wm.default_keyconfig
km = wm.active_keymap
subsplit = col.split()
- subsplit.item_pointerR(wm, "active_keymap", defkc, "keymaps", text="Map:")
+ subsplit.prop_object(wm, "active_keymap", defkc, "keymaps", text="Map:")
if km.user_defined:
row = subsplit.row()
- row.itemO("WM_OT_keymap_restore", text="Restore")
- row.item_booleanO("WM_OT_keymap_restore", "all", True, text="Restore All")
+ row.operator("WM_OT_keymap_restore", text="Restore")
+ row.operator("WM_OT_keymap_restore", text="Restore All").all = True
else:
row = subsplit.row()
- row.itemO("WM_OT_keymap_edit", text="Edit")
- row.itemL()
+ row.operator("WM_OT_keymap_edit", text="Edit")
+ row.label()
- col.itemS()
+ col.separator()
for kmi in km.items:
subcol = col.column()
@@ -1224,77 +1215,82 @@ class USERPREF_PT_input(bpy.types.Panel):
row = subcol.row()
if kmi.expanded:
- row.itemR(kmi, "expanded", text="", icon='ICON_TRIA_DOWN')
+ row.prop(kmi, "expanded", text="", icon='ICON_TRIA_DOWN')
else:
- row.itemR(kmi, "expanded", text="", icon='ICON_TRIA_RIGHT')
+ row.prop(kmi, "expanded", text="", icon='ICON_TRIA_RIGHT')
itemrow = row.row()
itemrow.enabled = km.user_defined
if kmi.active:
- itemrow.itemR(kmi, "active", text="", icon='ICON_CHECKBOX_HLT')
+ itemrow.prop(kmi, "active", text="", icon='ICON_CHECKBOX_HLT')
else:
- itemrow.itemR(kmi, "active", text="", icon='ICON_CHECKBOX_DEHLT')
+ itemrow.prop(kmi, "active", text="", icon='ICON_CHECKBOX_DEHLT')
itemcol = itemrow.column()
itemcol.active = kmi.active
row = itemcol.row()
- row.itemR(kmi, "idname", text="")
+
+ if km.modal:
+ row.prop(kmi, "propvalue", text="")
+ else:
+ row.prop(kmi, "idname", text="")
sub = row.row()
sub.scale_x = 0.6
- sub.itemR(kmi, "map_type", text="")
+ sub.prop(kmi, "map_type", text="")
sub = row.row(align=True)
if kmi.map_type == 'KEYBOARD':
- sub.itemR(kmi, "type", text="", full_event=True)
+ sub.prop(kmi, "type", text="", full_event=True)
elif kmi.map_type == 'MOUSE':
- sub.itemR(kmi, "type", text="", full_event=True)
+ sub.prop(kmi, "type", text="", full_event=True)
elif kmi.map_type == 'TWEAK':
sub.scale_x = 0.5
- sub.itemR(kmi, "type", text="")
- sub.itemR(kmi, "value", text="")
+ sub.prop(kmi, "type", text="")
+ sub.prop(kmi, "value", text="")
elif kmi.map_type == 'TIMER':
- sub.itemR(kmi, "type", text="")
+ sub.prop(kmi, "type", text="")
else:
- sub.itemL()
+ sub.label()
if kmi.expanded:
if kmi.map_type not in ('TEXTINPUT', 'TIMER'):
sub = itemcol.row(align=True)
if kmi.map_type == 'KEYBOARD':
- sub.itemR(kmi, "type", text="", event=True)
- sub.itemR(kmi, "value", text="")
+ sub.prop(kmi, "type", text="", event=True)
+ sub.prop(kmi, "value", text="")
elif kmi.map_type == 'MOUSE':
- sub.itemR(kmi, "type", text="")
- sub.itemR(kmi, "value", text="")
+ sub.prop(kmi, "type", text="")
+ sub.prop(kmi, "value", text="")
else:
- sub.itemL()
- sub.itemL()
+ sub.label()
+ sub.label()
subrow = sub.row()
subrow.scale_x = 0.75
- subrow.itemR(kmi, "shift")
- subrow.itemR(kmi, "ctrl")
- subrow.itemR(kmi, "alt")
- subrow.itemR(kmi, "oskey", text="Cmd")
- sub.itemR(kmi, "key_modifier", text="", event=True)
+ subrow.prop(kmi, "any")
+ subrow.prop(kmi, "shift")
+ subrow.prop(kmi, "ctrl")
+ subrow.prop(kmi, "alt")
+ subrow.prop(kmi, "oskey", text="Cmd")
+ sub.prop(kmi, "key_modifier", text="", event=True)
flow = itemcol.column_flow(columns=2)
props = kmi.properties
- if props != None:
+ if props is not None:
for pname in dir(props):
if not props.is_property_hidden(pname):
- flow.itemR(props, pname)
+ flow.prop(props, pname)
- itemcol.itemS()
+ itemcol.separator()
- itemrow.itemO("wm.keyitem_remove", text="", icon='ICON_ZOOMOUT')
+ itemrow.operator("wm.keyitem_remove", text="", icon='ICON_ZOOMOUT')
itemrow = col.row()
- itemrow.itemL()
- itemrow.itemO("wm.keyitem_add", text="", icon='ICON_ZOOMIN')
+ itemrow.label()
+ itemrow.operator("wm.keyitem_add", text="", icon='ICON_ZOOMIN')
itemrow.enabled = km.user_defined
bpy.types.register(USERPREF_HT_header)
@@ -1345,10 +1341,10 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
return result
def execute(self, context):
- if not self.path:
+ if not self.properties.path:
raise Exception("File path not set.")
- f = open(self.path, "w")
+ f = open(self.properties.path, "w")
if not f:
raise Exception("Could not open file.")
@@ -1361,25 +1357,32 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
f.write("kc = wm.add_keyconfig(\'%s\')\n\n" % kc.name)
for km in kc.keymaps:
+ km = km.active()
f.write("# Map %s\n" % km.name)
- f.write("km = kc.add_keymap(\'%s\', space_type=\'%s\', region_type=\'%s\')\n\n" % (km.name, km.space_type, km.region_type))
+ f.write("km = kc.add_keymap(\'%s\', space_type=\'%s\', region_type=\'%s\', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.modal))
for kmi in km.items:
- f.write("kmi = km.add_item(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value))
- if kmi.shift:
- f.write(", shift=True")
- if kmi.ctrl:
- f.write(", ctrl=True")
- if kmi.alt:
- f.write(", alt=True")
- if kmi.oskey:
- f.write(", oskey=True")
+ if km.modal:
+ f.write("kmi = km.add_modal_item(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value))
+ else:
+ f.write("kmi = km.add_item(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value))
+ if kmi.any:
+ f.write(", any=True")
+ else:
+ if kmi.shift:
+ f.write(", shift=True")
+ if kmi.ctrl:
+ f.write(", ctrl=True")
+ if kmi.alt:
+ f.write(", alt=True")
+ if kmi.oskey:
+ f.write(", oskey=True")
if kmi.key_modifier and kmi.key_modifier != 'NONE':
f.write(", key_modifier=\'%s\'" % kmi.key_modifier)
f.write(")\n")
props = kmi.properties
- if props != None:
+ if props is not None:
for pname in dir(props):
if props.is_property_set(pname) and not props.is_property_hidden(pname):
value = eval("props.%s" % pname)
@@ -1421,7 +1424,7 @@ class WM_OT_keymap_restore(bpy.types.Operator):
def execute(self, context):
wm = context.manager
- if self.all:
+ if self.properties.all:
for km in wm.default_keyconfig.keymaps:
km.restore_to_default()
else:
@@ -1439,7 +1442,10 @@ class WM_OT_keyitem_add(bpy.types.Operator):
def execute(self, context):
wm = context.manager
km = wm.active_keymap
- kmi = km.add_item("", 'A', 'PRESS')
+ if km.modal:
+ km.add_modal_item("", 'A', 'PRESS') # kmi
+ else:
+ km.add_item("", 'A', 'PRESS') # kmi
return ('FINISHED',)
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py
index 09043c3407c..5b33fbecac2 100644
--- a/release/scripts/ui/space_view3d.py
+++ b/release/scripts/ui/space_view3d.py
@@ -30,8 +30,9 @@ class VIEW3D_HT_header(bpy.types.Header):
view = context.space_data
mode_string = context.mode
edit_object = context.edit_object
- object = context.active_object
-
+ obj = context.active_object
+ toolsettings = context.scene.tool_settings
+
row = layout.row(align=True)
row.template_header()
@@ -39,24 +40,65 @@ class VIEW3D_HT_header(bpy.types.Header):
if context.area.show_menus:
sub = row.row(align=True)
- sub.itemM("VIEW3D_MT_view")
+ sub.menu("VIEW3D_MT_view")
# Select Menu
if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'):
- sub.itemM("VIEW3D_MT_select_%s" % mode_string.lower())
+ sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
if edit_object:
- sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type.lower())
- elif object:
- ob_mode_string = object.mode
-
+ sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
+ elif obj:
if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
- sub.itemM("VIEW3D_MT_%s" % mode_string.lower())
+ sub.menu("VIEW3D_MT_%s" % mode_string.lower())
else:
- sub.itemM("VIEW3D_MT_object")
+ sub.menu("VIEW3D_MT_object")
layout.template_header_3D()
+ # Particle edit
+ if obj and obj.mode == 'PARTICLE_EDIT':
+ layout.prop(toolsettings.particle_edit, "selection_mode", text="", expand=True)
+
+ # Occlude geometry
+ if obj and view.viewport_shading in ('SOLID', 'SHADED', 'TEXTURED') and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')):
+ layout.prop(view, "occlude_geometry", text="")
+
+ # Proportional editing
+ if obj and obj.mode in ('OBJECT', 'EDIT'):
+ row = layout.row(align=True)
+ row.prop(toolsettings, "proportional_editing", text="", icon_only=True)
+ if toolsettings.proportional_editing != 'DISABLED':
+ row.prop(toolsettings, "proportional_editing_falloff", text="", icon_only=True)
+
+ # Snap
+ row = layout.row(align=True)
+ row.prop(toolsettings, "snap", text="")
+ row.prop(toolsettings, "snap_element", text="", icon_only=True)
+ if toolsettings.snap_element != 'INCREMENT':
+ row.prop(toolsettings, "snap_target", text="", icon_only=True)
+ if obj and obj.mode == 'OBJECT':
+ row.prop(toolsettings, "snap_align_rotation", text="")
+ if toolsettings.snap_element == 'VOLUME':
+ row.prop(toolsettings, "snap_peel_object", text="")
+ elif toolsettings.snap_element == 'FACE':
+ row.prop(toolsettings, "snap_project", text="")
+
+ # OpenGL render
+ row = layout.row(align=True)
+ row.operator("screen.opengl_render", text="", icon='ICON_RENDER_STILL')
+ props = row.operator("screen.opengl_render", text="", icon='ICON_RENDER_ANIMATION')
+ props.animation = True
+
+ # Pose
+ if obj and obj.mode == 'POSE':
+ row = layout.row(align=True)
+ row.operator("pose.copy", text="", icon='ICON_COPYDOWN')
+ row.operator("pose.paste", text="", icon='ICON_PASTEDOWN')
+ props = row.operator("pose.paste", text="", icon='ICON_PASTEFLIPDOWN')
+ props.flipped = 1
+
+
# ********** Menu **********
# ********** Utilities **********
@@ -69,9 +111,80 @@ class VIEW3D_MT_showhide(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden")
- layout.itemO("%s.hide" % self._operator_name, text="Hide Selected")
- layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected")
+ layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
+ layout.operator("%s.hide" % self._operator_name, text="Hide Selected")
+ layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
+
+
+class VIEW3D_MT_transform(bpy.types.Menu):
+ bl_label = "Transform"
+
+ # TODO: get rid of the custom text strings?
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("tfm.translate", text="Grab/Move")
+ # TODO: sub-menu for grab per axis
+ layout.operator("tfm.rotate", text="Rotate")
+ # TODO: sub-menu for rot per axis
+ layout.operator("tfm.resize", text="Scale")
+ # TODO: sub-menu for scale per axis
+
+ layout.separator()
+
+ layout.operator("tfm.tosphere", text="To Sphere")
+ layout.operator("tfm.shear", text="Shear")
+ layout.operator("tfm.warp", text="Warp")
+ layout.operator("tfm.transform", text="Push/Pull").mode = 'PUSHPULL'
+ if context.edit_object and context.edit_object.type == 'ARMATURE':
+ layout.operator("armature.align")
+ else:
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("tfm.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
+
+ layout.separator()
+
+ layout.operator_context = 'EXEC_AREA'
+
+ layout.operator("object.center_set", text="ObData to Centroid").type = 'CENTER'
+ layout.operator("object.center_set", text="Centroid to ObData").type = 'CENTER_NEW'
+ layout.operator("object.center_set", text="Centroid to 3D Cursor").type = 'CENTER_CURSOR'
+
+
+class VIEW3D_MT_mirror(bpy.types.Menu):
+ bl_label = "Mirror"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("tfm.mirror", text="Interactive Mirror")
+
+ layout.separator()
+
+ layout.operator_context = 'INVOKE_REGION_WIN'
+
+ props = layout.operator("tfm.mirror", text="X Global")
+ props.constraint_axis = (True, False, False)
+ props.constraint_orientation = 'GLOBAL'
+ props = layout.operator("tfm.mirror", text="Y Global")
+ props.constraint_axis = (False, True, False)
+ props.constraint_orientation = 'GLOBAL'
+ props = layout.operator("tfm.mirror", text="Z Global")
+ props.constraint_axis = (False, False, True)
+ props.constraint_orientation = 'GLOBAL'
+
+ if context.edit_object:
+ layout.separator()
+
+ props = layout.operator("tfm.mirror", text="X Local")
+ props.constraint_axis = (True, False, False)
+ props.constraint_orientation = 'LOCAL'
+ props = layout.operator("tfm.mirror", text="Y Local")
+ props.constraint_axis = (False, True, False)
+ props.constraint_orientation = 'LOCAL'
+ props = layout.operator("tfm.mirror", text="Z Local")
+ props.constraint_axis = (False, False, True)
+ props.constraint_orientation = 'LOCAL'
class VIEW3D_MT_snap(bpy.types.Menu):
@@ -80,15 +193,16 @@ class VIEW3D_MT_snap(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid")
- layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor")
- layout.itemO("view3d.snap_selected_to_center", text="Selection to Center")
+ layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
+ layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
+ layout.operator("view3d.snap_selected_to_center", text="Selection to Center")
- layout.itemS()
+ layout.separator()
+
+ layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
+ layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
+ layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
- layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected")
- layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
- layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
class VIEW3D_MT_uv_map(dynamic_menu.DynMenu):
bl_label = "UV Mapping"
@@ -96,15 +210,15 @@ class VIEW3D_MT_uv_map(dynamic_menu.DynMenu):
def draw(self, context):
layout = self.layout
- layout.itemO("uv.unwrap")
- layout.itemO("uv.cube_project")
- layout.itemO("uv.cylinder_project")
- layout.itemO("uv.sphere_project")
- layout.itemO("uv.project_from_view")
+ layout.operator("uv.unwrap")
+ layout.operator("uv.cube_project")
+ layout.operator("uv.cylinder_project")
+ layout.operator("uv.sphere_project")
+ layout.operator("uv.project_from_view")
- layout.itemS()
+ layout.separator()
- layout.itemO("uv.reset")
+ layout.operator("uv.reset")
# ********** View menus **********
@@ -115,52 +229,52 @@ class VIEW3D_MT_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.properties", icon='ICON_MENU_PANEL')
- layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL')
+ layout.operator("view3d.properties", icon='ICON_MENU_PANEL')
+ layout.operator("view3d.toolbar", icon='ICON_MENU_PANEL')
- layout.itemS()
+ layout.separator()
- layout.item_enumO("view3d.viewnumpad", "type", 'CAMERA')
- layout.item_enumO("view3d.viewnumpad", "type", 'TOP')
- layout.item_enumO("view3d.viewnumpad", "type", 'FRONT')
- layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT')
+ layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
+ layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
+ layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
+ layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
- layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
+ layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
- layout.itemS()
+ layout.separator()
- layout.itemO("view3d.view_persportho")
+ layout.operator("view3d.view_persportho")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_view_navigation")
- layout.itemM("VIEW3D_MT_view_align")
+ layout.menu("VIEW3D_MT_view_navigation")
+ layout.menu("VIEW3D_MT_view_align")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "INVOKE_REGION_WIN"
+ layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("view3d.clip_border", text="Clipping Border...")
- layout.itemO("view3d.zoom_border", text="Zoom Border...")
+ layout.operator("view3d.clip_border", text="Clipping Border...")
+ layout.operator("view3d.zoom_border", text="Zoom Border...")
- layout.itemS()
+ layout.separator()
- layout.item_intO("view3d.layers", "nr", 0, text="Show All Layers")
+ layout.operator("view3d.layers", text="Show All Layers").nr = 0
- layout.itemS()
+ layout.separator()
- layout.itemO("view3d.localview", text="View Global/Local")
- layout.itemO("view3d.view_center")
- layout.itemO("view3d.view_all")
+ layout.operator("view3d.localview", text="View Global/Local")
+ layout.operator("view3d.view_center")
+ layout.operator("view3d.view_all")
- layout.itemS()
+ layout.separator()
- layout.itemO("screen.region_foursplit", text="Toggle Quad View")
- layout.itemO("screen.screen_full_area", text="Toggle Full Screen")
+ layout.operator("screen.region_foursplit", text="Toggle Quad View")
+ layout.operator("screen.screen_full_area", text="Toggle Full Screen")
- layout.itemS()
+ layout.separator()
- layout.itemO("screen.animation_play", text="Playback Animation", icon='ICON_PLAY')
+ layout.operator("screen.animation_play", text="Playback Animation", icon='ICON_PLAY')
class VIEW3D_MT_view_navigation(bpy.types.Menu):
@@ -169,20 +283,20 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.items_enumO("view3d.view_orbit", "type")
+ layout.operator_enums("view3d.view_orbit", "type")
- layout.itemS()
+ layout.separator()
- layout.items_enumO("view3d.view_pan", "type")
+ layout.operator_enums("view3d.view_pan", "type")
- layout.itemS()
+ layout.separator()
- layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In")
- layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out")
+ layout.operator("view3d.zoom", text="Zoom In").delta = 1.0
+ layout.operator("view3d.zoom", text="Zoom Out").delta = -1.0
- layout.itemS()
+ layout.separator()
- layout.itemO("view3d.fly")
+ layout.operator("view3d.fly")
class VIEW3D_MT_view_align(bpy.types.Menu):
@@ -191,13 +305,14 @@ class VIEW3D_MT_view_align(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemM("VIEW3D_MT_view_align_selected")
+ layout.menu("VIEW3D_MT_view_align_selected")
- layout.itemS()
+ layout.separator()
- layout.item_booleanO("view3d.view_all", "center", True, text="Center Cursor and View All")
- layout.itemO("view3d.camera_to_view", text="Align Active Camera to View")
- layout.itemO("view3d.view_center")
+ layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
+ layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
+ layout.operator("view3d.view_center")
+ layout.operator("view3d.view_center_cursor")
class VIEW3D_MT_view_align_selected(bpy.types.Menu):
@@ -206,22 +321,22 @@ class VIEW3D_MT_view_align_selected(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Top")
+ props = layout.operator("view3d.viewnumpad", text="Top")
props.align_active = True
props.type = 'TOP'
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Bottom")
+ props = layout.operator("view3d.viewnumpad", text="Bottom")
props.align_active = True
props.type = 'BOTTOM'
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Front")
+ props = layout.operator("view3d.viewnumpad", text="Front")
props.align_active = True
props.type = 'FRONT'
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Back")
+ props = layout.operator("view3d.viewnumpad", text="Back")
props.align_active = True
props.type = 'BACK'
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Right")
+ props = layout.operator("view3d.viewnumpad", text="Right")
props.align_active = True
props.type = 'RIGHT'
- props = layout.itemO("view3d.viewnumpad", properties=True, text="Left")
+ props = layout.operator("view3d.viewnumpad", text="Left")
props.align_active = True
props.type = 'LEFT'
@@ -232,8 +347,8 @@ class VIEW3D_MT_view_cameras(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.object_as_camera")
- layout.item_enumO("view3d.viewnumpad", "type", 'CAMERA', text="Active Camera")
+ layout.operator("view3d.object_as_camera")
+ layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
# ********** Select menus, suffix from context.mode **********
@@ -244,23 +359,23 @@ class VIEW3D_MT_select_object(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
- layout.itemO("view3d.select_circle")
+ layout.operator("view3d.select_border")
+ layout.operator("view3d.select_circle")
- layout.itemS()
+ layout.separator()
- layout.itemO("object.select_all_toggle", text="Select/Deselect All")
- layout.itemO("object.select_inverse", text="Inverse")
- layout.itemO("object.select_random", text="Random")
- layout.itemO("object.select_mirror", text="Mirror")
- layout.itemO("object.select_by_layer", text="Select All by Layer")
- layout.item_menu_enumO("object.select_by_type", "type", "", text="Select All by Type...")
+ layout.operator("object.select_all_toggle", text="Select/Deselect All")
+ layout.operator("object.select_inverse", text="Inverse")
+ layout.operator("object.select_random", text="Random")
+ layout.operator("object.select_mirror", text="Mirror")
+ layout.operator("object.select_by_layer", text="Select All by Layer")
+ layout.operator_menu_enum("object.select_by_type", "type", "", text="Select All by Type...")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("object.select_grouped", "type", text="Grouped")
- layout.item_menu_enumO("object.select_linked", "type", text="Linked")
- layout.itemO("object.select_pattern", text="Select Pattern...")
+ layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
+ layout.operator_menu_enum("object.select_linked", "type", text="Linked")
+ layout.operator("object.select_pattern", text="Select Pattern...")
class VIEW3D_MT_select_pose(bpy.types.Menu):
@@ -269,27 +384,27 @@ class VIEW3D_MT_select_pose(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
+ layout.operator("view3d.select_border")
- layout.itemS()
+ layout.separator()
- layout.itemO("pose.select_all_toggle", text="Select/Deselect All")
- layout.itemO("pose.select_inverse", text="Inverse")
- layout.itemO("pose.select_constraint_target", text="Constraint Target")
- layout.itemO("pose.select_linked", text="Linked")
+ layout.operator("pose.select_all_toggle", text="Select/Deselect All")
+ layout.operator("pose.select_inverse", text="Inverse")
+ layout.operator("pose.select_constraint_target", text="Constraint Target")
+ layout.operator("pose.select_linked", text="Linked")
- layout.itemS()
+ layout.separator()
- layout.item_enumO("pose.select_hierarchy", "direction", 'PARENT')
- layout.item_enumO("pose.select_hierarchy", "direction", 'CHILD')
+ layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT'
+ layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD'
- layout.itemS()
+ layout.separator()
- props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent")
+ props = layout.operator("pose.select_hierarchy", text="Extend Parent")
props.extend = True
props.direction = 'PARENT'
- props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child")
+ props = layout.operator("pose.select_hierarchy", text="Extend Child")
props.extend = True
props.direction = 'CHILD'
@@ -300,23 +415,23 @@ class VIEW3D_MT_select_particle(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
+ layout.operator("view3d.select_border")
- layout.itemS()
+ layout.separator()
- layout.itemO("particle.select_all_toggle", text="Select/Deselect All")
- layout.itemO("particle.select_linked")
- layout.itemO("particle.select_inverse")
+ layout.operator("particle.select_all_toggle", text="Select/Deselect All")
+ layout.operator("particle.select_linked")
+ layout.operator("particle.select_inverse")
- layout.itemS()
+ layout.separator()
- layout.itemO("particle.select_more")
- layout.itemO("particle.select_less")
+ layout.operator("particle.select_more")
+ layout.operator("particle.select_less")
- layout.itemS()
+ layout.separator()
- layout.itemO("particle.select_first", text="Roots")
- layout.itemO("particle.select_last", text="Tips")
+ layout.operator("particle.select_first", text="Roots")
+ layout.operator("particle.select_last", text="Tips")
class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
@@ -325,47 +440,47 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
- layout.itemO("view3d.select_circle")
+ layout.operator("view3d.select_border")
+ layout.operator("view3d.select_circle")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.select_all_toggle", text="Select/Deselect All")
- layout.itemO("mesh.select_inverse", text="Inverse")
+ layout.operator("mesh.select_all_toggle", text="Select/Deselect All")
+ layout.operator("mesh.select_inverse", text="Inverse")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.select_random", text="Random...")
- layout.itemO("mesh.edges_select_sharp", text="Sharp Edges")
- layout.itemO("mesh.faces_select_linked_flat", text="Linked Flat Faces")
- layout.itemO("mesh.faces_select_interior", text="Interior Faces")
- layout.itemO("mesh.select_axis", text="Side of Active")
+ layout.operator("mesh.select_random", text="Random...")
+ layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
+ layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
+ layout.operator("mesh.faces_select_interior", text="Interior Faces")
+ layout.operator("mesh.select_axis", text="Side of Active")
- layout.itemS()
+ layout.separator()
- layout.item_enumO("mesh.select_by_number_vertices", "type", 'TRIANGLES', text="Triangles")
- layout.item_enumO("mesh.select_by_number_vertices", "type", 'QUADS', text="Quads")
- layout.item_enumO("mesh.select_by_number_vertices", "type", 'OTHER', text="Loose Verts/Edges")
- layout.itemO("mesh.select_similar", text="Similar...")
+ layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES'
+ layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS'
+ layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER'
+ layout.operator("mesh.select_similar", text="Similar...")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.select_less", text="Less")
- layout.itemO("mesh.select_more", text="More")
+ layout.operator("mesh.select_less", text="Less")
+ layout.operator("mesh.select_more", text="More")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.select_mirror", text="Mirror")
+ layout.operator("mesh.select_mirror", text="Mirror")
- layout.itemO("mesh.select_linked", text="Linked")
- layout.itemO("mesh.select_vertex_path", text="Vertex Path")
- layout.itemO("mesh.loop_multi_select", text="Edge Loop")
- layout.item_booleanO("mesh.loop_multi_select", "ring", True, text="Edge Ring")
+ layout.operator("mesh.select_linked", text="Linked")
+ layout.operator("mesh.select_vertex_path", text="Vertex Path")
+ layout.operator("mesh.loop_multi_select", text="Edge Loop")
+ layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.loop_to_region")
- layout.itemO("mesh.region_to_loop")
+ layout.operator("mesh.loop_to_region")
+ layout.operator("mesh.region_to_loop")
class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
@@ -374,27 +489,27 @@ class VIEW3D_MT_select_edit_curve(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
- layout.itemO("view3d.select_circle")
+ layout.operator("view3d.select_border")
+ layout.operator("view3d.select_circle")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
- layout.itemO("curve.select_inverse")
- layout.itemO("curve.select_random")
- layout.itemO("curve.select_every_nth")
+ layout.operator("curve.select_all_toggle", text="Select/Deselect All")
+ layout.operator("curve.select_inverse")
+ layout.operator("curve.select_random")
+ layout.operator("curve.select_every_nth")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.de_select_first")
- layout.itemO("curve.de_select_last")
- layout.itemO("curve.select_next")
- layout.itemO("curve.select_previous")
+ layout.operator("curve.de_select_first")
+ layout.operator("curve.de_select_last")
+ layout.operator("curve.select_next")
+ layout.operator("curve.select_previous")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.select_more")
- layout.itemO("curve.select_less")
+ layout.operator("curve.select_more")
+ layout.operator("curve.select_less")
class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
@@ -403,24 +518,24 @@ class VIEW3D_MT_select_edit_surface(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
- layout.itemO("view3d.select_circle")
+ layout.operator("view3d.select_border")
+ layout.operator("view3d.select_circle")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.select_all_toggle", text="Select/Deselect All")
- layout.itemO("curve.select_inverse")
- layout.itemO("curve.select_random")
- layout.itemO("curve.select_every_nth")
+ layout.operator("curve.select_all_toggle", text="Select/Deselect All")
+ layout.operator("curve.select_inverse")
+ layout.operator("curve.select_random")
+ layout.operator("curve.select_every_nth")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.select_row")
+ layout.operator("curve.select_row")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.select_more")
- layout.itemO("curve.select_less")
+ layout.operator("curve.select_more")
+ layout.operator("curve.select_less")
class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
@@ -429,16 +544,16 @@ class VIEW3D_MT_select_edit_metaball(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
+ layout.operator("view3d.select_border")
- layout.itemS()
+ layout.separator()
- layout.itemO("mball.select_deselect_all_metaelems")
- layout.itemO("mball.select_inverse_metaelems")
+ layout.operator("mball.select_deselect_all_metaelems")
+ layout.operator("mball.select_inverse_metaelems")
- layout.itemS()
+ layout.separator()
- layout.itemO("mball.select_random_metaelems")
+ layout.operator("mball.select_random_metaelems")
class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
@@ -447,11 +562,11 @@ class VIEW3D_MT_select_edit_lattice(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
+ layout.operator("view3d.select_border")
- layout.itemS()
+ layout.separator()
- layout.itemO("lattice.select_all_toggle", text="Select/Deselect All")
+ layout.operator("lattice.select_all_toggle", text="Select/Deselect All")
class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
@@ -460,26 +575,26 @@ class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("view3d.select_border")
+ layout.operator("view3d.select_border")
- layout.itemS()
+ layout.separator()
- layout.itemO("armature.select_all_toggle", text="Select/Deselect All")
- layout.itemO("armature.select_inverse", text="Inverse")
+ layout.operator("armature.select_all_toggle", text="Select/Deselect All")
+ layout.operator("armature.select_inverse", text="Inverse")
- layout.itemS()
+ layout.separator()
- layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent")
- layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child")
+ layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
+ layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
- layout.itemS()
+ layout.separator()
- props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent")
+ props = layout.operator("armature.select_hierarchy", text="Extend Parent")
props.extend = True
props.direction = 'PARENT'
- props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child")
+ props = layout.operator("armature.select_hierarchy", text="Extend Child")
props.extend = True
props.direction = 'CHILD'
@@ -490,7 +605,8 @@ class VIEW3D_MT_select_face(bpy.types.Menu):# XXX no matching enum
def draw(self, context):
layout = self.layout
- layout.view3d_select_faceselmenu()
+ # TODO
+ # see view3d_select_faceselmenu
# ********** Object menu **********
@@ -502,43 +618,45 @@ class VIEW3D_MT_object(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemM("VIEW3D_MT_object_clear")
- layout.itemM("VIEW3D_MT_object_apply")
- layout.itemM("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_object_clear")
+ layout.menu("VIEW3D_MT_object_apply")
+ layout.menu("VIEW3D_MT_snap")
- layout.itemS()
+ layout.separator()
- layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
- layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
+ layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
+ layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
- layout.itemS()
+ layout.separator()
- layout.itemO("object.duplicate_move")
- layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
- layout.itemO("object.delete", text="Delete...")
- layout.itemO("object.proxy_make", text="Make Proxy...")
- layout.itemM("VIEW3D_MT_make_links", text="Make Links...")
- layout.item_menu_enumO("object.make_local", "type", text="Make Local...")
- layout.itemM("VIEW3D_MT_make_single_user")
- layout.itemM("VIEW3D_MT_make_links")
+ layout.operator("object.duplicate_move")
+ layout.operator("object.duplicate", text="Duplicate Linked").linked = True
+ layout.operator("object.delete", text="Delete...")
+ layout.operator("object.proxy_make", text="Make Proxy...")
+ layout.menu("VIEW3D_MT_make_links", text="Make Links...")
+ layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
+ layout.menu("VIEW3D_MT_make_single_user")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_object_parent")
- layout.itemM("VIEW3D_MT_object_track")
- layout.itemM("VIEW3D_MT_object_group")
- layout.itemM("VIEW3D_MT_object_constraints")
+ layout.menu("VIEW3D_MT_object_parent")
+ layout.menu("VIEW3D_MT_object_track")
+ layout.menu("VIEW3D_MT_object_group")
+ layout.menu("VIEW3D_MT_object_constraints")
- layout.itemS()
+ layout.separator()
- layout.itemO("object.join")
+ layout.operator("object.join_shapes")
+ layout.operator("object.join")
- layout.itemS()
+ layout.separator()
- layout.itemO("object.move_to_layer", text="Move to Layer...")
- layout.itemM("VIEW3D_MT_object_showhide")
+ layout.operator("object.move_to_layer", text="Move to Layer...")
+ layout.menu("VIEW3D_MT_object_showhide")
- layout.item_menu_enumO("object.convert", "target")
+ layout.operator_menu_enum("object.convert", "target")
class VIEW3D_MT_object_clear(bpy.types.Menu):
@@ -547,10 +665,10 @@ class VIEW3D_MT_object_clear(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.location_clear", text="Location")
- layout.itemO("object.rotation_clear", text="Rotation")
- layout.itemO("object.scale_clear", text="Scale")
- layout.itemO("object.origin_clear", text="Origin")
+ layout.operator("object.location_clear", text="Location")
+ layout.operator("object.rotation_clear", text="Rotation")
+ layout.operator("object.scale_clear", text="Scale")
+ layout.operator("object.origin_clear", text="Origin")
class VIEW3D_MT_object_apply(bpy.types.Menu):
@@ -559,12 +677,12 @@ class VIEW3D_MT_object_apply(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.location_apply", text="Location")
- layout.itemO("object.rotation_apply", text="Rotation")
- layout.itemO("object.scale_apply", text="Scale")
- layout.itemS()
- layout.itemO("object.visual_transform_apply", text="Visual Transform")
- layout.itemO("object.duplicates_make_real")
+ layout.operator("object.location_apply", text="Location")
+ layout.operator("object.rotation_apply", text="Rotation")
+ layout.operator("object.scale_apply", text="Scale")
+ layout.separator()
+ layout.operator("object.visual_transform_apply", text="Visual Transform")
+ layout.operator("object.duplicates_make_real")
class VIEW3D_MT_object_parent(bpy.types.Menu):
@@ -573,8 +691,8 @@ class VIEW3D_MT_object_parent(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.parent_set", text="Set")
- layout.itemO("object.parent_clear", text="Clear")
+ layout.operator("object.parent_set", text="Set")
+ layout.operator("object.parent_clear", text="Clear")
class VIEW3D_MT_object_track(bpy.types.Menu):
@@ -583,8 +701,8 @@ class VIEW3D_MT_object_track(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.track_set", text="Set")
- layout.itemO("object.track_clear", text="Clear")
+ layout.operator("object.track_set", text="Set")
+ layout.operator("object.track_clear", text="Clear")
class VIEW3D_MT_object_group(bpy.types.Menu):
@@ -593,13 +711,13 @@ class VIEW3D_MT_object_group(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("group.group_create")
- layout.itemO("group.objects_remove")
+ layout.operator("group.create")
+ layout.operator("group.objects_remove")
- layout.itemS()
+ layout.separator()
- layout.itemO("group.objects_add_active")
- layout.itemO("group.objects_remove_active")
+ layout.operator("group.objects_add_active")
+ layout.operator("group.objects_remove_active")
class VIEW3D_MT_object_constraints(bpy.types.Menu):
@@ -608,8 +726,8 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.constraint_add_with_targets")
- layout.itemO("object.constraints_clear")
+ layout.operator("object.constraint_add_with_targets")
+ layout.operator("object.constraints_clear")
class VIEW3D_MT_object_showhide(bpy.types.Menu):
@@ -618,9 +736,9 @@ class VIEW3D_MT_object_showhide(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("object.restrictview_clear", text="Show Hidden")
- layout.itemO("object.restrictview_set", text="Hide Selected")
- layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected")
+ layout.operator("object.restrictview_clear", text="Show Hidden")
+ layout.operator("object.restrictview_set", text="Hide Selected")
+ layout.operator("object.restrictview_set", text="Hide Unselected").unselected = True
class VIEW3D_MT_make_single_user(bpy.types.Menu):
@@ -629,19 +747,19 @@ class VIEW3D_MT_make_single_user(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- props = layout.itemO("object.make_single_user", properties=True, text="Object")
+ props = layout.operator("object.make_single_user", text="Object")
props.object = True
- props = layout.itemO("object.make_single_user", properties=True, text="Object & ObData")
+ props = layout.operator("object.make_single_user", text="Object & ObData")
props.object = props.obdata = True
- props = layout.itemO("object.make_single_user", properties=True, text="Object & ObData & Materials+Tex")
+ props = layout.operator("object.make_single_user", text="Object & ObData & Materials+Tex")
props.object = props.obdata = props.material = props.texture = True
- props = layout.itemO("object.make_single_user", properties=True, text="Materials+Tex")
+ props = layout.operator("object.make_single_user", text="Materials+Tex")
props.material = props.texture = True
- props = layout.itemO("object.make_single_user", properties=True, text="Animation")
+ props = layout.operator("object.make_single_user", text="Animation")
props.animation = True
@@ -651,9 +769,9 @@ class VIEW3D_MT_make_links(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.item_menu_enumO("object.make_links_scene", "type", text="Objects to Scene...")
+ layout.operator_menu_enum("object.make_links_scene", "type", text="Objects to Scene...")
- layout.items_enumO("object.make_links_data", property="type") # inline
+ layout.operator_enums("object.make_links_data", property="type") # inline
# ********** Vertex paint menu **********
@@ -665,11 +783,51 @@ class VIEW3D_MT_paint_vertex(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- sculpt = context.tool_settings.sculpt
+ layout.operator("paint.vertex_color_set")
+ layout.operator("paint.vertex_color_set", text="Set Selected Vertex Colors").selected = True
+
+
+class VIEW3D_MT_hook(bpy.types.Menu):
+ bl_label = "Hooks"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("object.hook_add_newob")
+ layout.operator("object.hook_add_selob")
+
+ if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
+ layout.separator()
+ layout.operator_menu_enum("object.hook_assign", "modifier")
+ layout.operator_menu_enum("object.hook_remove", "modifier")
+ layout.separator()
+ layout.operator_menu_enum("object.hook_select", "modifier")
+ layout.operator_menu_enum("object.hook_reset", "modifier")
+ layout.operator_menu_enum("object.hook_recenter", "modifier")
+
+
+class VIEW3D_MT_vertex_group(bpy.types.Menu):
+ bl_label = "Vertex Groups"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
+
+ ob = context.active_object
+ if ob.mode == 'EDIT':
+ if ob.vertex_groups and ob.active_vertex_group:
+ layout.separator()
+ layout.operator("object.vertex_group_assign", text="Assign to Active Group")
+ layout.operator("object.vertex_group_remove_from", text="Remove from Active Group")
+ layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
+ layout.separator()
+
+ if ob.vertex_groups and ob.active_vertex_group:
+ layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
+ layout.operator("object.vertex_group_remove", text="Remove Active Group")
+ layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
- layout.itemO("paint.vertex_color_set")
- props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True)
- props.selected = True
# ********** Sculpt menu **********
@@ -683,29 +841,31 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
sculpt = context.tool_settings.sculpt
brush = context.tool_settings.sculpt.brush
- layout.itemR(sculpt, "symmetry_x")
- layout.itemR(sculpt, "symmetry_y")
- layout.itemR(sculpt, "symmetry_z")
- layout.itemS()
- layout.itemR(sculpt, "lock_x")
- layout.itemR(sculpt, "lock_y")
- layout.itemR(sculpt, "lock_z")
- layout.itemS()
- layout.item_menu_enumO("brush.curve_preset", property="shape")
- layout.itemS()
+ layout.prop(sculpt, "symmetry_x")
+ layout.prop(sculpt, "symmetry_y")
+ layout.prop(sculpt, "symmetry_z")
+ layout.separator()
+ layout.prop(sculpt, "lock_x")
+ layout.prop(sculpt, "lock_y")
+ layout.prop(sculpt, "lock_z")
+ layout.separator()
+ layout.operator_menu_enum("brush.curve_preset", property="shape")
+ layout.separator()
- if brush.sculpt_tool != 'GRAB':
- layout.itemR(brush, "use_airbrush")
+ sculpt_tool = brush.sculpt_tool
- if brush.sculpt_tool != 'LAYER':
- layout.itemR(brush, "use_anchor")
+ if sculpt_tool != 'GRAB':
+ layout.prop(brush, "use_airbrush")
- if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
- layout.itemR(brush, "flip_direction")
+ if sculpt_tool != 'LAYER':
+ layout.prop(brush, "use_anchor")
- if brush.sculpt_tool == 'LAYER':
- layout.itemR(brush, "use_persistent")
- layout.itemO("sculpt.set_persistent_base")
+ if sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
+ layout.prop(brush, "flip_direction")
+
+ if sculpt_tool == 'LAYER':
+ layout.prop(brush, "use_persistent")
+ layout.operator("sculpt.set_persistent_base")
# ********** Particle menu **********
@@ -718,21 +878,21 @@ class VIEW3D_MT_particle(bpy.types.Menu):
particle_edit = context.tool_settings.particle_edit
- layout.itemO("particle.mirror")
+ layout.operator("particle.mirror")
- layout.itemS()
+ layout.separator()
- layout.itemO("particle.remove_doubles")
- layout.itemO("particle.delete")
+ layout.operator("particle.remove_doubles")
+ layout.operator("particle.delete")
if particle_edit.selection_mode == 'POINT':
- layout.itemO("particle.subdivide")
+ layout.operator("particle.subdivide")
- layout.itemO("particle.rekey")
+ layout.operator("particle.rekey")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_particle_showhide")
+ layout.menu("VIEW3D_MT_particle_showhide")
class VIEW3D_MT_particle_showhide(VIEW3D_MT_showhide):
@@ -749,57 +909,59 @@ class VIEW3D_MT_pose(bpy.types.Menu):
arm = context.active_object.data
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_snap")
if arm.drawtype in ('BBONE', 'ENVELOPE'):
- layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
+ layout.operator("tfm.transform", text="Scale Envelope Distance").mode = 'BONESIZE'
- layout.itemM("VIEW3D_MT_pose_transform")
+ layout.menu("VIEW3D_MT_pose_transform")
- layout.itemS()
+ layout.separator()
- layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...")
- layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...")
+ layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
+ layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
- layout.itemS()
+ layout.separator()
- layout.itemO("pose.apply")
- layout.itemO("pose.relax")
+ layout.operator("pose.apply")
+ layout.operator("pose.relax")
- layout.itemS()
+ layout.separator()
- layout.itemO("pose.copy")
- layout.itemO("pose.paste")
- layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose")
+ layout.operator("pose.copy")
+ layout.operator("pose.paste")
+ layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_pose_pose")
- layout.itemM("VIEW3D_MT_pose_motion")
- layout.itemM("VIEW3D_MT_pose_group")
+ layout.menu("VIEW3D_MT_pose_pose")
+ layout.menu("VIEW3D_MT_pose_motion")
+ layout.menu("VIEW3D_MT_pose_group")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_pose_ik")
- layout.itemM("VIEW3D_MT_pose_constraints")
+ layout.menu("VIEW3D_MT_pose_ik")
+ layout.menu("VIEW3D_MT_pose_constraints")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "EXEC_AREA"
- layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right")
- layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back")
- layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom")
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
+ layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
+ layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
- layout.itemO("pose.flip_names")
+ layout.operator("pose.flip_names")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "INVOKE_AREA"
- layout.itemO("pose.armature_layers", text="Change Armature Layers...")
- layout.itemO("pose.bone_layers", text="Change Bone Layers...")
+ layout.operator_context = 'INVOKE_AREA'
+ layout.operator("pose.armature_layers", text="Change Armature Layers...")
+ layout.operator("pose.bone_layers", text="Change Bone Layers...")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_pose_showhide")
- layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings")
+ layout.menu("VIEW3D_MT_pose_showhide")
+ layout.operator_menu_enum("pose.flags_set", 'mode', text="Bone Settings")
class VIEW3D_MT_pose_transform(bpy.types.Menu):
@@ -808,13 +970,13 @@ class VIEW3D_MT_pose_transform(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemL(text="User Transform")
+ layout.label(text="User Transform")
- layout.itemO("pose.loc_clear", text="Location")
- layout.itemO("pose.rot_clear", text="Rotation")
- layout.itemO("pose.scale_clear", text="Scale")
+ layout.operator("pose.loc_clear", text="Location")
+ layout.operator("pose.rot_clear", text="Rotation")
+ layout.operator("pose.scale_clear", text="Scale")
- layout.itemL(text="Origin")
+ layout.label(text="Origin")
class VIEW3D_MT_pose_pose(bpy.types.Menu):
@@ -823,13 +985,13 @@ class VIEW3D_MT_pose_pose(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("poselib.browse_interactive", text="Browse Poses...")
+ layout.operator("poselib.browse_interactive", text="Browse Poses...")
- layout.itemS()
+ layout.separator()
- layout.itemO("poselib.pose_add", text="Add Pose...")
- layout.itemO("poselib.pose_rename", text="Rename Pose...")
- layout.itemO("poselib.pose_remove", text="Remove Pose...")
+ layout.operator("poselib.pose_add", text="Add Pose...")
+ layout.operator("poselib.pose_rename", text="Rename Pose...")
+ layout.operator("poselib.pose_remove", text="Remove Pose...")
class VIEW3D_MT_pose_motion(bpy.types.Menu):
@@ -838,8 +1000,8 @@ class VIEW3D_MT_pose_motion(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("pose.paths_calculate", text="Calculate")
- layout.itemO("pose.paths_clear", text="Clear")
+ layout.operator("pose.paths_calculate", text="Calculate")
+ layout.operator("pose.paths_clear", text="Clear")
class VIEW3D_MT_pose_group(bpy.types.Menu):
@@ -847,13 +1009,13 @@ class VIEW3D_MT_pose_group(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("pose.group_add")
- layout.itemO("pose.group_remove")
+ layout.operator("pose.group_add")
+ layout.operator("pose.group_remove")
- layout.itemS()
+ layout.separator()
- layout.itemO("pose.group_assign")
- layout.itemO("pose.group_unassign")
+ layout.operator("pose.group_assign")
+ layout.operator("pose.group_unassign")
class VIEW3D_MT_pose_ik(bpy.types.Menu):
@@ -862,8 +1024,8 @@ class VIEW3D_MT_pose_ik(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("pose.ik_add")
- layout.itemO("pose.ik_clear")
+ layout.operator("pose.ik_add")
+ layout.operator("pose.ik_clear")
class VIEW3D_MT_pose_constraints(bpy.types.Menu):
@@ -872,8 +1034,8 @@ class VIEW3D_MT_pose_constraints(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...")
- layout.itemO("pose.constraints_clear")
+ layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
+ layout.operator("pose.constraints_clear")
class VIEW3D_MT_pose_showhide(VIEW3D_MT_showhide):
@@ -890,39 +1052,41 @@ class VIEW3D_MT_edit_mesh(bpy.types.Menu):
settings = context.tool_settings
- layout.itemO("ed.undo")
- layout.itemO("ed.redo")
+ layout.operator("ed.undo")
+ layout.operator("ed.redo")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_snap")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_uv_map", text="UV Unwrap...")
+ layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.extrude_move")
- layout.itemO("mesh.duplicate_move")
- layout.itemO("mesh.delete", text="Delete...")
+ layout.operator("mesh.extrude_move")
+ layout.operator("mesh.duplicate_move")
+ layout.operator("mesh.delete", text="Delete...")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_mesh_vertices")
- layout.itemM("VIEW3D_MT_edit_mesh_edges")
- layout.itemM("VIEW3D_MT_edit_mesh_faces")
- layout.itemM("VIEW3D_MT_edit_mesh_normals")
+ layout.menu("VIEW3D_MT_edit_mesh_vertices")
+ layout.menu("VIEW3D_MT_edit_mesh_edges")
+ layout.menu("VIEW3D_MT_edit_mesh_faces")
+ layout.menu("VIEW3D_MT_edit_mesh_normals")
- layout.itemS()
+ layout.separator()
- layout.itemR(settings, "automerge_editing")
- layout.item_menu_enumR(settings, "proportional_editing")
- layout.item_menu_enumR(settings, "proportional_editing_falloff")
+ layout.prop(settings, "automerge_editing")
+ layout.prop_menu_enum(settings, "proportional_editing")
+ layout.prop_menu_enum(settings, "proportional_editing_falloff")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_mesh_showhide")
+ layout.menu("VIEW3D_MT_edit_mesh_showhide")
class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
@@ -933,21 +1097,21 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("mesh.subdivide", text="Subdivide")
- layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth")
- layout.itemO("mesh.merge", text="Merge...")
- layout.itemO("mesh.remove_doubles")
- layout.itemO("mesh.hide", text="Hide")
- layout.itemO("mesh.reveal", text="Reveal")
- layout.itemO("mesh.select_inverse")
- layout.itemO("mesh.flip_normals")
- layout.itemO("mesh.vertices_smooth", text="Smooth")
- # layout.itemO("mesh.bevel", text="Bevel")
- layout.itemO("mesh.faces_shade_smooth")
- layout.itemO("mesh.faces_shade_flat")
- layout.itemO("mesh.blend_from_shape")
- layout.itemO("mesh.shape_propagate_to_all")
- layout.itemO("mesh.select_vertex_path")
+ layout.operator("mesh.subdivide", text="Subdivide")
+ layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
+ layout.operator("mesh.merge", text="Merge...")
+ layout.operator("mesh.remove_doubles")
+ layout.operator("mesh.hide", text="Hide")
+ layout.operator("mesh.reveal", text="Reveal")
+ layout.operator("mesh.select_inverse")
+ layout.operator("mesh.flip_normals")
+ layout.operator("mesh.vertices_smooth", text="Smooth")
+ # layout.operator("mesh.bevel", text="Bevel")
+ layout.operator("mesh.faces_shade_smooth")
+ layout.operator("mesh.faces_shade_flat")
+ layout.operator("mesh.blend_from_shape")
+ layout.operator("mesh.shape_propagate_to_all")
+ layout.operator("mesh.select_vertex_path")
class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
@@ -957,22 +1121,27 @@ class VIEW3D_MT_edit_mesh_vertices(bpy.types.Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("mesh.merge")
- layout.itemO("mesh.rip")
- layout.itemO("mesh.split")
- layout.itemO("mesh.separate")
+ layout.operator("mesh.merge")
+ layout.operator("mesh.rip")
+ layout.operator("mesh.split")
+ layout.operator("mesh.separate")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.vertices_smooth")
- layout.itemO("mesh.remove_doubles")
+ layout.operator("mesh.vertices_smooth")
+ layout.operator("mesh.remove_doubles")
- layout.itemO("mesh.select_vertex_path")
+ layout.operator("mesh.select_vertex_path")
- layout.itemO("mesh.blend_from_shape")
+ layout.operator("mesh.blend_from_shape")
- layout.itemO("object.vertex_group_blend")
- layout.itemO("mesh.shape_propagate_to_all")
+ layout.operator("object.vertex_group_blend")
+ layout.operator("mesh.shape_propagate_to_all")
+
+ layout.separator()
+
+ layout.menu("VIEW3D_MT_vertex_group")
+ layout.menu("VIEW3D_MT_hook")
class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
@@ -982,36 +1151,36 @@ class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.itemO("mesh.edge_face_add")
- layout.itemO("mesh.subdivide")
+ layout.operator("mesh.edge_face_add")
+ layout.operator("mesh.subdivide")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.mark_seam")
- layout.item_booleanO("mesh.mark_seam", "clear", True, text="Clear Seam")
+ layout.operator("mesh.mark_seam")
+ layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.mark_sharp")
- layout.item_booleanO("mesh.mark_sharp", "clear", True, text="Clear Sharp")
+ layout.operator("mesh.mark_sharp")
+ layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
- layout.itemS()
+ layout.separator()
- layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
- layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW")
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
- layout.itemS()
+ layout.separator()
- layout.itemO("TFM_OT_edge_slide", text="Edge Slide")
- layout.itemO("mesh.loop_multi_select", text="Edge Loop")
+ layout.operator("TFM_OT_edge_slide", text="Edge Slide")
+ layout.operator("mesh.loop_multi_select", text="Edge Loop")
# uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
# uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
- layout.item_booleanO("mesh.loop_multi_select", "ring", True, text="Edge Ring")
+ layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
- layout.itemO("mesh.loop_to_region")
- layout.itemO("mesh.region_to_loop")
+ layout.operator("mesh.loop_to_region")
+ layout.operator("mesh.region_to_loop")
class VIEW3D_MT_edit_mesh_faces(dynamic_menu.DynMenu):
@@ -1022,36 +1191,36 @@ class VIEW3D_MT_edit_mesh_faces(dynamic_menu.DynMenu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- # layout.itemO("mesh.bevel")
- # layout.itemO("mesh.bevel")
- layout.itemO("mesh.edge_face_add")
- layout.itemO("mesh.fill")
- layout.itemO("mesh.beauty_fill")
+ # layout.operator("mesh.bevel")
+ # layout.operator("mesh.bevel")
+ layout.operator("mesh.edge_face_add")
+ layout.operator("mesh.fill")
+ layout.operator("mesh.beauty_fill")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.quads_convert_to_tris")
- layout.itemO("mesh.tris_convert_to_quads")
- layout.itemO("mesh.edge_flip")
+ layout.operator("mesh.quads_convert_to_tris")
+ layout.operator("mesh.tris_convert_to_quads")
+ layout.operator("mesh.edge_flip")
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.faces_shade_smooth")
- layout.itemO("mesh.faces_shade_flat")
+ layout.operator("mesh.faces_shade_smooth")
+ layout.operator("mesh.faces_shade_flat")
- layout.itemS()
+ layout.separator()
# uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
# uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
- layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW")
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("mesh.uvs_rotate", "direction")
- layout.item_menu_enumO("mesh.uvs_mirror", "axis")
- layout.item_menu_enumO("mesh.colors_rotate", "direction")
- layout.item_menu_enumO("mesh.colors_mirror", "axis")
+ layout.operator_menu_enum("mesh.uvs_rotate", "direction")
+ layout.operator_menu_enum("mesh.uvs_mirror", "axis")
+ layout.operator_menu_enum("mesh.colors_rotate", "direction")
+ layout.operator_menu_enum("mesh.colors_mirror", "axis")
class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
@@ -1060,12 +1229,12 @@ class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("mesh.normals_make_consistent", text="Recalculate Outside")
- layout.item_booleanO("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside")
+ layout.operator("mesh.normals_make_consistent", text="Recalculate Outside")
+ layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
- layout.itemS()
+ layout.separator()
- layout.itemO("mesh.flip_normals")
+ layout.operator("mesh.flip_normals")
class VIEW3D_MT_edit_mesh_showhide(VIEW3D_MT_showhide):
@@ -1080,30 +1249,32 @@ def draw_curve(self, context):
settings = context.tool_settings
- layout.itemM("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_snap")
- layout.itemS()
+ layout.separator()
- layout.itemO("curve.extrude")
- layout.itemO("curve.duplicate")
- layout.itemO("curve.separate")
- layout.itemO("curve.make_segment")
- layout.itemO("curve.cyclic_toggle")
- layout.itemO("curve.delete", text="Delete...")
+ layout.operator("curve.extrude")
+ layout.operator("curve.duplicate")
+ layout.operator("curve.separate")
+ layout.operator("curve.make_segment")
+ layout.operator("curve.cyclic_toggle")
+ layout.operator("curve.delete", text="Delete...")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_curve_ctrlpoints")
- layout.itemM("VIEW3D_MT_edit_curve_segments")
+ layout.menu("VIEW3D_MT_edit_curve_ctrlpoints")
+ layout.menu("VIEW3D_MT_edit_curve_segments")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumR(settings, "proportional_editing")
- layout.item_menu_enumR(settings, "proportional_editing_falloff")
+ layout.prop_menu_enum(settings, "proportional_editing")
+ layout.prop_menu_enum(settings, "proportional_editing_falloff")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_curve_showhide")
+ layout.menu("VIEW3D_MT_edit_curve_showhide")
class VIEW3D_MT_edit_curve(bpy.types.Menu):
@@ -1121,13 +1292,17 @@ class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
edit_object = context.edit_object
if edit_object.type == 'CURVE':
- layout.item_enumO("tfm.transform", "mode", 'TILT')
- layout.itemO("curve.tilt_clear")
- layout.itemO("curve.separate")
+ layout.operator("tfm.transform").mode = 'TILT'
+ layout.operator("curve.tilt_clear")
+ layout.operator("curve.separate")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("curve.handle_type_set", "type")
+ layout.operator_menu_enum("curve.handle_type_set", "type")
+
+ layout.separator()
+
+ layout.menu("VIEW3D_MT_hook")
class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
@@ -1136,8 +1311,8 @@ class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("curve.subdivide")
- layout.itemO("curve.switch_direction")
+ layout.operator("curve.subdivide")
+ layout.operator("curve.switch_direction")
class VIEW3D_MT_edit_curve_showhide(VIEW3D_MT_showhide):
@@ -1156,11 +1331,11 @@ class VIEW3D_MT_edit_text(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("font.file_paste")
+ layout.operator("font.file_paste")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_text_chars")
+ layout.menu("VIEW3D_MT_edit_text_chars")
class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
@@ -1169,32 +1344,32 @@ class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.item_stringO("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R")
+ layout.operator("font.text_insert", text="Copyright|Alt C").text = b'\xC2\xA9'.decode()
+ layout.operator("font.text_insert", text="Registered Trademark|Alt R").text = b'\xC2\xAE'.decode()
- layout.itemS()
+ layout.separator()
- layout.item_stringO("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G")
- layout.item_stringO("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x")
- layout.item_stringO("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <")
- layout.item_stringO("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %")
+ layout.operator("font.text_insert", text="Degree Sign|Alt G").text = b'\xC2\xB0'.decode()
+ layout.operator("font.text_insert", text="Multiplication Sign|Alt x").text = b'\xC3\x97'.decode()
+ layout.operator("font.text_insert", text="Circle|Alt .").text = b'\xC2\x8A'.decode()
+ layout.operator("font.text_insert", text="Superscript 1|Alt 1").text = b'\xC2\xB9'.decode()
+ layout.operator("font.text_insert", text="Superscript 2|Alt 2").text = b'\xC2\xB2'.decode()
+ layout.operator("font.text_insert", text="Superscript 3|Alt 3").text = b'\xC2\xB3'.decode()
+ layout.operator("font.text_insert", text="Double >>|Alt >").text = b'\xC2\xBB'.decode()
+ layout.operator("font.text_insert", text="Double <<|Alt <").text = b'\xC2\xAB'.decode()
+ layout.operator("font.text_insert", text="Promillage|Alt %").text = b'\xE2\x80\xB0'.decode()
- layout.itemS()
+ layout.separator()
- layout.item_stringO("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y")
+ layout.operator("font.text_insert", text="Dutch Florin|Alt F").text = b'\xC2\xA4'.decode()
+ layout.operator("font.text_insert", text="British Pound|Alt L").text = b'\xC2\xA3'.decode()
+ layout.operator("font.text_insert", text="Japanese Yen|Alt Y").text = b'\xC2\xA5'.decode()
- layout.itemS()
+ layout.separator()
- layout.item_stringO("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?")
- layout.item_stringO("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !")
+ layout.operator("font.text_insert", text="German S|Alt S").text = b'\xC3\x9F'.decode()
+ layout.operator("font.text_insert", text="Spanish Question Mark|Alt ?").text = b'\xC2\xBF'.decode()
+ layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = b'\xC2\xA1'.decode()
class VIEW3D_MT_edit_meta(bpy.types.Menu):
@@ -1205,26 +1380,28 @@ class VIEW3D_MT_edit_meta(bpy.types.Menu):
settings = context.tool_settings
- layout.itemO("ed.undo")
- layout.itemO("ed.redo")
+ layout.operator("ed.undo")
+ layout.operator("ed.redo")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_snap")
- layout.itemS()
+ layout.separator()
- layout.itemO("mball.delete_metaelems", text="Delete...")
- layout.itemO("mball.duplicate_metaelems")
+ layout.operator("mball.delete_metaelems", text="Delete...")
+ layout.operator("mball.duplicate_metaelems")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumR(settings, "proportional_editing")
- layout.item_menu_enumR(settings, "proportional_editing_falloff")
+ layout.prop_menu_enum(settings, "proportional_editing")
+ layout.prop_menu_enum(settings, "proportional_editing_falloff")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_meta_showhide")
+ layout.menu("VIEW3D_MT_edit_meta_showhide")
class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
@@ -1233,9 +1410,9 @@ class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("mball.reveal_metaelems", text="Show Hidden")
- layout.itemO("mball.hide_metaelems", text="Hide Selected")
- layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected")
+ layout.operator("mball.reveal_metaelems", text="Show Hidden")
+ layout.operator("mball.hide_metaelems", text="Hide Selected")
+ layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
class VIEW3D_MT_edit_lattice(bpy.types.Menu):
@@ -1246,16 +1423,18 @@ class VIEW3D_MT_edit_lattice(bpy.types.Menu):
settings = context.tool_settings
- layout.itemM("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_snap")
- layout.itemS()
+ layout.separator()
- layout.itemO("lattice.make_regular")
+ layout.operator("lattice.make_regular")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumR(settings, "proportional_editing")
- layout.item_menu_enumR(settings, "proportional_editing_falloff")
+ layout.prop_menu_enum(settings, "proportional_editing")
+ layout.prop_menu_enum(settings, "proportional_editing_falloff")
class VIEW3D_MT_edit_armature(bpy.types.Menu):
@@ -1267,53 +1446,75 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
edit_object = context.edit_object
arm = edit_object.data
- layout.itemM("VIEW3D_MT_snap")
- layout.itemM("VIEW3D_MT_edit_armature_roll")
+ layout.menu("VIEW3D_MT_transform")
+ layout.menu("VIEW3D_MT_mirror")
+ layout.menu("VIEW3D_MT_snap")
+ layout.menu("VIEW3D_MT_edit_armature_roll")
if arm.drawtype == 'ENVELOPE':
- layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance")
+ layout.operator("tfm.transform", text="Scale Envelope Distance").mode = 'BONESIZE'
else:
- layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width")
+ layout.operator("tfm.transform", text="Scale B-Bone Width").mode = 'BONESIZE'
- layout.itemS()
+ layout.separator()
- layout.itemO("armature.extrude_move")
+ layout.operator("armature.extrude_move")
-# EXTRUDE FORKED DOESN'T WORK YET
-# if arm.x_axis_mirror:
-# layout.item_booleanO("armature.extrude_move", "forked", True, text="Extrude Forked")
+ if arm.x_axis_mirror:
+ layout.operator("armature.extrude_forked")
- layout.itemO("armature.duplicate_move")
- layout.itemO("armature.merge")
- layout.itemO("armature.fill")
- layout.itemO("armature.delete")
- layout.itemO("armature.separate")
+ layout.operator("armature.duplicate_move")
+ layout.operator("armature.merge")
+ layout.operator("armature.fill")
+ layout.operator("armature.delete")
+ layout.operator("armature.separate")
- layout.itemS()
+ layout.separator()
- layout.itemO("armature.subdivide_multi", text="Subdivide")
+ layout.operator("armature.subdivide_multi", text="Subdivide")
+ layout.operator("armature.switch_direction", text="Switch Direction")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "EXEC_AREA"
- layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right")
- layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back")
- layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom")
- layout.itemO("armature.flip_names")
+ layout.operator_context = 'EXEC_AREA'
+ layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
+ layout.operator("armature.flip_names")
- layout.itemS()
+ layout.separator()
- layout.operator_context = "INVOKE_DEFAULT"
- layout.itemO("armature.armature_layers")
- layout.itemO("armature.bone_layers")
+ layout.operator_context = 'INVOKE_DEFAULT'
+ layout.operator("armature.armature_layers")
+ layout.operator("armature.bone_layers")
- layout.itemS()
+ layout.separator()
- layout.itemM("VIEW3D_MT_edit_armature_parent")
+ layout.menu("VIEW3D_MT_edit_armature_parent")
- layout.itemS()
+ layout.separator()
- layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings")
+ layout.operator_menu_enum("armature.flags_set", "mode", text="Bone Settings")
+
+
+class VIEW3D_MT_armature_specials(bpy.types.Menu):
+ bl_label = "Specials"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator_context = 'INVOKE_REGION_WIN'
+
+ layout.operator("armature.subdivide_multi", text="Subdivide")
+ layout.operator("armature.switch_direction", text="Switch Direction")
+
+ layout.separator()
+
+ layout.operator_context = 'EXEC_REGION_WIN'
+ layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
+ layout.operator("armature.flip_names", text="Flip Names")
class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
@@ -1322,8 +1523,8 @@ class VIEW3D_MT_edit_armature_parent(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.itemO("armature.parent_set", text="Make")
- layout.itemO("armature.parent_clear", text="Clear")
+ layout.operator("armature.parent_set", text="Make")
+ layout.operator("armature.parent_clear", text="Clear")
class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
@@ -1332,12 +1533,12 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
def draw(self, context):
layout = self.layout
- layout.item_enumO("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)")
- layout.item_enumO("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor")
+ layout.operator("armature.calculate_roll", text="Clear Roll (Z-Axis Up)").type = 'GLOBALUP'
+ layout.operator("armature.calculate_roll", text="Roll to Cursor").type = 'CURSOR'
- layout.itemS()
+ layout.separator()
- layout.item_enumO("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll")
+ layout.operator("tfm.transform", text="Set Roll").mode = 'BONE_ROLL'
# ********** Panel **********
@@ -1358,50 +1559,45 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
scene = context.scene
col = layout.column()
- col.itemL(text="Camera:")
- col.itemR(view, "camera", text="")
- col.itemR(view, "lens")
+ col.label(text="Camera:")
+ col.prop(view, "camera", text="")
+ col.prop(view, "lens")
+ col.label(text="Lock to Object:")
+ col.prop(view, "lock_object", text="")
+ if view.lock_object and view.lock_object.type == 'ARMATURE':
+ col.prop_object(view, "lock_bone", view.lock_object.data, "bones", text="")
col = layout.column(align=True)
- col.itemL(text="Clip:")
- col.itemR(view, "clip_start", text="Start")
- col.itemR(view, "clip_end", text="End")
+ col.label(text="Clip:")
+ col.prop(view, "clip_start", text="Start")
+ col.prop(view, "clip_end", text="End")
- col = layout.column(align=True)
- col.itemL(text="Grid:")
- col.itemR(view, "grid_lines", text="Lines")
- col.itemR(view, "grid_spacing", text="Spacing")
- col.itemR(view, "grid_subdivisions", text="Subdivisions")
+ layout.column().prop(scene, "cursor_location", text="3D Cursor:")
- layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
-class VIEW3D_PT_3dview_item(bpy.types.Panel):
+class VIEW3D_PT_3dview_name(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Item"
def poll(self, context):
- return (context.active_object or context.bone or context.edit_bone)
+ return (context.space_data and context.active_object)
def draw(self, context):
layout = self.layout
- ob = context.object
-
+ ob = context.active_object
row = layout.row()
- row.itemL(text="", icon='ICON_OBJECT_DATA')
- row.itemR(ob, "name", text="")
+ row.label(text="", icon='ICON_OBJECT_DATA')
+ row.prop(ob, "name", text="")
- if ((context.active_bone or context.active_pchan) and ob.type == 'ARMATURE' and (ob.mode == 'EDIT' or ob.mode == 'POSE')):
+ if ob.type == 'ARMATURE' and ob.mode in ('EDIT', 'POSE'):
bone = context.active_bone
- if not bone:
- pchan = context.active_pchan
- if pchan:
- bone = pchan.bone
+ if bone:
+ row = layout.row()
+ row.label(text="", icon='ICON_BONE_DATA')
+ row.prop(bone, "name", text="")
- row = layout.row()
- row.itemL(text="", icon='ICON_BONE_DATA')
- row.itemR(bone, "name", text="")
class VIEW3D_PT_3dview_display(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
@@ -1421,30 +1617,37 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel):
ob = context.object
col = layout.column()
- col.itemR(view, "display_floor", text="Grid Floor")
- col.itemR(view, "display_x_axis", text="X Axis")
- col.itemR(view, "display_y_axis", text="Y Axis")
- col.itemR(view, "display_z_axis", text="Z Axis")
- col.itemR(view, "outline_selected")
- col.itemR(view, "all_object_centers")
- col.itemR(view, "relationship_lines")
+ col.prop(view, "display_x_axis", text="X Axis")
+ col.prop(view, "display_y_axis", text="Y Axis")
+ col.prop(view, "display_z_axis", text="Z Axis")
+ col.prop(view, "outline_selected")
+ col.prop(view, "all_object_centers")
+ col.prop(view, "relationship_lines")
if ob and ob.type == 'MESH':
mesh = ob.data
- col.itemR(mesh, "all_edges")
+ col.prop(mesh, "all_edges")
col = layout.column()
- col.itemL(text="Shading:")
- col.itemR(gs, "material_mode", text="")
- col.itemR(view, "textured_solid")
+ col.prop(view, "display_floor", text="Grid Floor")
+ sub = col.column(align=True)
+ sub.active = view.display_floor
+ sub.prop(view, "grid_lines", text="Lines")
+ sub.prop(view, "grid_spacing", text="Spacing")
+ sub.prop(view, "grid_subdivisions", text="Subdivisions")
+
+ col = layout.column()
+ col.label(text="Shading:")
+ col.prop(gs, "material_mode", text="")
+ col.prop(view, "textured_solid")
# XXX - the Quad View options don't work yet
-# layout.itemS()
+# layout.separator()
#
-# layout.itemO("screen.region_foursplit", text="Toggle Quad View")
+# layout.operator("screen.region_foursplit", text="Toggle Quad View")
# col = layout.column()
-# col.itemR(view, "lock_rotation")
-# col.itemR(view, "box_preview")
-# col.itemR(view, "box_clip")
+# col.prop(view, "lock_rotation")
+# col.prop(view, "box_preview")
+# col.prop(view, "box_clip")
class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
@@ -1462,25 +1665,25 @@ class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel):
mesh = context.active_object.data
col = layout.column()
- col.itemL(text="Overlays:")
- col.itemR(mesh, "draw_edges", text="Edges")
- col.itemR(mesh, "draw_faces", text="Faces")
- col.itemR(mesh, "draw_creases", text="Creases")
- col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
- col.itemR(mesh, "draw_seams", text="Seams")
- col.itemR(mesh, "draw_sharp", text="Sharp")
+ col.label(text="Overlays:")
+ col.prop(mesh, "draw_edges", text="Edges")
+ col.prop(mesh, "draw_faces", text="Faces")
+ col.prop(mesh, "draw_creases", text="Creases")
+ col.prop(mesh, "draw_bevel_weights", text="Bevel Weights")
+ col.prop(mesh, "draw_seams", text="Seams")
+ col.prop(mesh, "draw_sharp", text="Sharp")
- col.itemS()
- col.itemL(text="Normals:")
- col.itemR(mesh, "draw_normals", text="Face")
- col.itemR(mesh, "draw_vertex_normals", text="Vertex")
- col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
+ col.separator()
+ col.label(text="Normals:")
+ col.prop(mesh, "draw_normals", text="Face")
+ col.prop(mesh, "draw_vertex_normals", text="Vertex")
+ col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
- col.itemS()
- col.itemL(text="Numerics:")
- col.itemR(mesh, "draw_edge_lenght")
- col.itemR(mesh, "draw_edge_angle")
- col.itemR(mesh, "draw_face_area")
+ col.separator()
+ col.label(text="Numerics:")
+ col.prop(mesh, "draw_edge_lenght")
+ col.prop(mesh, "draw_edge_angle")
+ col.prop(mesh, "draw_face_area")
class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel):
@@ -1498,10 +1701,10 @@ class VIEW3D_PT_3dview_curvedisplay(bpy.types.Panel):
curve = context.active_object.data
col = layout.column()
- col.itemL(text="Overlays:")
- col.itemR(curve, "draw_handles", text="Handles")
- col.itemR(curve, "draw_normals", text="Normals")
- col.itemR(context.scene.tool_settings, "normal_size", text="Normal Size")
+ col.label(text="Overlays:")
+ col.prop(curve, "draw_handles", text="Handles")
+ col.prop(curve, "draw_normals", text="Normals")
+ col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
class VIEW3D_PT_background_image(bpy.types.Panel):
@@ -1512,14 +1715,14 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
def poll(self, context):
view = context.space_data
- bg = context.space_data.background_image
+ # bg = context.space_data.background_image
return (view)
def draw_header(self, context):
layout = self.layout
view = context.space_data
- layout.itemR(view, "display_background_image", text="")
+ layout.prop(view, "display_background_image", text="")
def draw(self, context):
layout = self.layout
@@ -1531,16 +1734,15 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
layout.active = view.display_background_image
col = layout.column()
- col.itemR(bg, "image", text="")
- #col.itemR(bg, "image_user")
- col.itemR(bg, "size")
- col.itemR(bg, "transparency", slider=True)
+ col.template_ID(bg, "image", open="image.open")
+ col.prop(bg, "size")
+ col.prop(bg, "transparency", slider=True)
col = layout.column(align=True)
- col.itemL(text="Offset:")
- col.itemR(bg, "offset_x", text="X")
- col.itemR(bg, "offset_y", text="Y")
+ col.label(text="Offset:")
+ col.prop(bg, "offset_x", text="X")
+ col.prop(bg, "offset_y", text="Y")
class VIEW3D_PT_transform_orientations(bpy.types.Panel):
@@ -1560,14 +1762,14 @@ class VIEW3D_PT_transform_orientations(bpy.types.Panel):
col = layout.column()
- col.itemR(view, "transform_orientation")
- col.itemO("tfm.create_orientation", text="Create")
+ col.prop(view, "transform_orientation")
+ col.operator("tfm.create_orientation", text="Create")
orientation = view.current_orientation
if orientation:
- col.itemR(orientation, "name")
- col.itemO("tfm.delete_orientation", text="Delete")
+ col.prop(orientation, "name")
+ col.operator("tfm.delete_orientation", text="Delete")
class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
@@ -1585,7 +1787,7 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
layout = self.layout
toolsettings = context.scene.tool_settings
- layout.itemR(toolsettings, "bone_sketching", text="")
+ layout.prop(toolsettings, "bone_sketching", text="")
def draw(self, context):
layout = self.layout
@@ -1593,64 +1795,61 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
col = layout.column()
- col.itemR(toolsettings, "etch_quick")
- col.itemR(toolsettings, "etch_overdraw")
+ col.prop(toolsettings, "etch_quick")
+ col.prop(toolsettings, "etch_overdraw")
- col.itemR(toolsettings, "etch_convert_mode")
+ col.prop(toolsettings, "etch_convert_mode")
if toolsettings.etch_convert_mode == 'LENGTH':
- col.itemR(toolsettings, "etch_length_limit")
+ col.prop(toolsettings, "etch_length_limit")
elif toolsettings.etch_convert_mode == 'ADAPTIVE':
- col.itemR(toolsettings, "etch_adaptive_limit")
+ col.prop(toolsettings, "etch_adaptive_limit")
elif toolsettings.etch_convert_mode == 'FIXED':
- col.itemR(toolsettings, "etch_subdivision_number")
+ col.prop(toolsettings, "etch_subdivision_number")
elif toolsettings.etch_convert_mode == 'RETARGET':
- col.itemR(toolsettings, "etch_template")
- col.itemR(toolsettings, "etch_roll_mode")
- col.itemR(toolsettings, "etch_autoname")
- col.itemR(toolsettings, "etch_number")
- col.itemR(toolsettings, "etch_side")
+ col.prop(toolsettings, "etch_template")
+ col.prop(toolsettings, "etch_roll_mode")
+ col.prop(toolsettings, "etch_autoname")
+ col.prop(toolsettings, "etch_number")
+ col.prop(toolsettings, "etch_side")
-# Operators
-from bpy.props import *
+class VIEW3D_PT_context_properties(bpy.types.Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_label = "Properties"
+ bl_default_closed = True
+ def _active_context_member(self, context):
+ obj = context.object
+ if obj:
+ mode = obj.mode
+ if mode == 'POSE':
+ return "active_pose_bone"
+ elif mode == 'EDIT' and obj.type == 'ARMATURE':
+ return "active_bone"
+ else:
+ return "object"
-class OBJECT_OT_select_pattern(bpy.types.Operator):
- '''Select object matching a naming pattern.'''
- bl_idname = "object.select_pattern"
- bl_label = "Select Pattern"
- bl_register = True
- bl_undo = True
+ return ""
- pattern = StringProperty(name="Pattern", description="Name filter using '*' and '?' wildcard chars", maxlen=32, default="*")
- case_sensitive = BoolProperty(name="Case Sensitive", description="Do a case sensitive compare", default=False)
- extend = BoolProperty(name="Extend", description="Extend the existing selection", default=True)
+ def poll(self, context):
+ member = self._active_context_member(context)
+ if member:
+ context_member = getattr(context, member)
+ return context_member and context_member.keys()
- def execute(self, context):
+ return False
- import fnmatch
+ def draw(self, context):
+ import rna_prop_ui
+ # reload(rna_prop_ui)
+ member = self._active_context_member(context)
- if self.case_sensitive:
- pattern_match = fnmatch.fnmatchcase
- else:
- pattern_match = lambda a, b: fnmatch.fnmatchcase(a.upper(), b.upper())
+ if member:
+ # Draw with no edit button
+ rna_prop_ui.draw(self.layout, context, member, False)
- for ob in context.visible_objects:
- if pattern_match(ob.name, self.pattern):
- ob.selected = True
- elif not self.extend:
- ob.selected = False
-
- return ('FINISHED',)
-
- # TODO - python cant do popups yet
- '''
- def invoke(self, context, event):
- wm = context.manager
- wm.add_fileselect(self)
- return ('RUNNING_MODAL',)
- '''
bpy.types.register(VIEW3D_HT_header) # Header
@@ -1671,6 +1870,11 @@ bpy.types.register(VIEW3D_MT_select_edit_lattice)
bpy.types.register(VIEW3D_MT_select_edit_armature)
bpy.types.register(VIEW3D_MT_select_face) # XXX todo
+bpy.types.register(VIEW3D_MT_transform) # Object/Edit Menus
+bpy.types.register(VIEW3D_MT_mirror) # Object/Edit Menus
+bpy.types.register(VIEW3D_MT_snap) # Object/Edit Menus
+bpy.types.register(VIEW3D_MT_uv_map) # Edit Menus
+
bpy.types.register(VIEW3D_MT_object) # Object Menu
bpy.types.register(VIEW3D_MT_object_apply)
bpy.types.register(VIEW3D_MT_object_clear)
@@ -1682,6 +1886,8 @@ bpy.types.register(VIEW3D_MT_object_showhide)
bpy.types.register(VIEW3D_MT_make_single_user)
bpy.types.register(VIEW3D_MT_make_links)
+bpy.types.register(VIEW3D_MT_hook)
+bpy.types.register(VIEW3D_MT_vertex_group)
bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
@@ -1699,9 +1905,6 @@ bpy.types.register(VIEW3D_MT_pose_ik)
bpy.types.register(VIEW3D_MT_pose_constraints)
bpy.types.register(VIEW3D_MT_pose_showhide)
-bpy.types.register(VIEW3D_MT_snap) # Edit Menus
-bpy.types.register(VIEW3D_MT_uv_map) # Edit Menus
-
bpy.types.register(VIEW3D_MT_edit_mesh)
bpy.types.register(VIEW3D_MT_edit_mesh_specials) # Only as a menu for keybindings
bpy.types.register(VIEW3D_MT_edit_mesh_vertices)
@@ -1729,13 +1932,16 @@ bpy.types.register(VIEW3D_MT_edit_armature)
bpy.types.register(VIEW3D_MT_edit_armature_parent)
bpy.types.register(VIEW3D_MT_edit_armature_roll)
-bpy.types.register(VIEW3D_PT_3dview_item) # Panels
+bpy.types.register(VIEW3D_MT_armature_specials) # Only as a menu for keybindings
+
+ # Panels
bpy.types.register(VIEW3D_PT_3dview_properties)
bpy.types.register(VIEW3D_PT_3dview_display)
+bpy.types.register(VIEW3D_PT_3dview_name)
bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
bpy.types.register(VIEW3D_PT_3dview_curvedisplay)
bpy.types.register(VIEW3D_PT_background_image)
bpy.types.register(VIEW3D_PT_transform_orientations)
bpy.types.register(VIEW3D_PT_etch_a_ton)
-bpy.ops.add(OBJECT_OT_select_pattern)
+bpy.types.register(VIEW3D_PT_context_properties)
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index 771e1e9046b..8559efa42c6 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -36,40 +36,41 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Object:")
- col.itemO("object.duplicate_move")
- col.itemO("object.delete")
+ col.label(text="Object:")
+ col.operator("object.duplicate_move")
+ col.operator("object.delete")
+ col.operator("object.join")
active_object = context.active_object
if active_object and active_object.type == 'MESH':
col = layout.column(align=True)
- col.itemL(text="Shading:")
- col.itemO("object.shade_smooth", text="Smooth")
- col.itemO("object.shade_flat", text="Flat")
+ col.label(text="Shading:")
+ col.operator("object.shade_smooth", text="Smooth")
+ col.operator("object.shade_flat", text="Flat")
col = layout.column(align=True)
- col.itemL(text="Keyframes:")
- col.itemO("anim.insert_keyframe_menu", text="Insert")
- col.itemO("anim.delete_keyframe_v3d", text="Remove")
+ col.label(text="Keyframes:")
+ col.operator("anim.keyframe_insert_menu", text="Insert")
+ col.operator("anim.keyframe_delete_v3d", text="Remove")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_mesh ****************
@@ -82,50 +83,63 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
+ col.operator("tfm.shrink_fatten", text="Along Normal")
+
col = layout.column(align=True)
- col.itemL(text="Mesh:")
- col.itemO("mesh.duplicate_move")
- col.itemO("mesh.delete")
+ col.label(text="Deform:")
+ col.operator("tfm.edge_slide")
+ col.operator("mesh.rip_move")
+ col.operator("mesh.vertices_smooth")
+
col = layout.column(align=True)
- col.itemL(text="Modeling:")
- col.itemO("mesh.extrude_move")
- col.itemO("mesh.subdivide")
- col.itemO("mesh.loopcut")
- col.itemO("mesh.spin")
- col.itemO("mesh.screw")
- col.itemO("mesh.merge")
- col.itemO("mesh.rip_move")
- col.itemO("mesh.flip_normals")
+ col.label(text="Add:")
+ col.operator("mesh.extrude_move")
+ col.operator("mesh.subdivide")
+ col.operator("mesh.loopcut_slide")
+ col.operator("mesh.duplicate_move")
+ col.operator("mesh.spin")
+ col.operator("mesh.screw")
col = layout.column(align=True)
- col.itemL(text="Shading:")
- col.itemO("mesh.faces_shade_smooth", text="Smooth")
- col.itemO("mesh.faces_shade_flat", text="Flat")
+ col.label(text="Remove:")
+ col.operator("mesh.delete")
+ col.operator("mesh.merge")
+ col.operator("mesh.remove_doubles")
col = layout.column(align=True)
- col.itemL(text="UV Mapping:")
- col.item_stringO("wm.call_menu", "name", "VIEW3D_MT_uv_map", text="Unwrap")
-
- col.itemO("mesh.uvs_rotate")
- col.itemO("mesh.uvs_mirror")
+ col.label(text="Normals:")
+ col.operator("mesh.normals_make_consistent", text="Recalculate")
+ col.operator("mesh.flip_normals", text="Flip Direction")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="UV Mapping:")
+ col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
+ col.operator("mesh.mark_seam")
+ col.operator("mesh.mark_seam", text="Clear Seam").clear = True
+
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Shading:")
+ col.operator("mesh.faces_shade_smooth", text="Smooth")
+ col.operator("mesh.faces_shade_flat", text="Flat")
+
+ col = layout.column(align=True)
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
+
+ col = layout.column(align=True)
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_meshedit_options(View3DPanel):
@@ -140,7 +154,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
if ob:
mesh = context.active_object.data
col = layout.column(align=True)
- col.itemR(mesh, "use_mirror_x")
+ col.prop(mesh, "use_mirror_x")
# ********** default tools for editmode_curve ****************
@@ -153,42 +167,48 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Curve:")
- col.itemO("curve.duplicate")
- col.itemO("curve.delete")
- col.itemO("curve.cyclic_toggle")
- col.itemO("curve.switch_direction")
- col.itemO("curve.spline_type_set")
+ col.operator("tfm.transform", text="Tilt").mode = 'TILT'
+ col.operator("tfm.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
col = layout.column(align=True)
- col.itemL(text="Handles:")
- col.item_enumO("curve.handle_type_set", "type", 'AUTOMATIC')
- col.item_enumO("curve.handle_type_set", "type", 'VECTOR')
- col.item_enumO("curve.handle_type_set", "type", 'ALIGN')
- col.item_enumO("curve.handle_type_set", "type", 'FREE_ALIGN')
+ col.label(text="Curve:")
+ col.operator("curve.duplicate")
+ col.operator("curve.delete")
+ col.operator("curve.cyclic_toggle")
+ col.operator("curve.switch_direction")
+ col.operator("curve.spline_type_set")
col = layout.column(align=True)
- col.itemL(text="Modeling:")
- col.itemO("curve.extrude")
- col.itemO("curve.subdivide")
+ col.label(text="Handles:")
+ row = col.row()
+ row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
+ row.operator("curve.handle_type_set", text="Vector").type = 'VECTOR'
+ row = col.row()
+ row.operator("curve.handle_type_set", text="Align").type = 'ALIGN'
+ row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Modeling:")
+ col.operator("curve.extrude")
+ col.operator("curve.subdivide")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
+
+ col = layout.column(align=True)
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_surface ****************
@@ -201,34 +221,34 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Curve:")
- col.itemO("curve.duplicate")
- col.itemO("curve.delete")
- col.itemO("curve.cyclic_toggle")
- col.itemO("curve.switch_direction")
+ col.label(text="Curve:")
+ col.operator("curve.duplicate")
+ col.operator("curve.delete")
+ col.operator("curve.cyclic_toggle")
+ col.operator("curve.switch_direction")
col = layout.column(align=True)
- col.itemL(text="Modeling:")
- col.itemO("curve.extrude")
- col.itemO("curve.subdivide")
+ col.label(text="Modeling:")
+ col.operator("curve.extrude")
+ col.operator("curve.subdivide")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_text ****************
@@ -241,21 +261,27 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Text Edit:")
- col.itemO("font.text_copy", text="Copy")
- col.itemO("font.text_cut", text="Cut")
- col.itemO("font.text_paste", text="Paste")
+ col.label(text="Text Edit:")
+ col.operator("font.text_copy", text="Copy")
+ col.operator("font.text_cut", text="Cut")
+ col.operator("font.text_paste", text="Paste")
col = layout.column(align=True)
- col.itemL(text="Style:")
- col.itemO("font.case_set")
- col.itemO("font.style_toggle")
+ col.label(text="Set Case:")
+ col.operator("font.case_set", text="To Upper").case = 'UPPER'
+ col.operator("font.case_set", text="To Lower").case = 'LOWER'
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Style:")
+ col.operator("font.style_toggle", text="Bold").style = 'BOLD'
+ col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
+ col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
+
+ col = layout.column(align=True)
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
+
# ********** default tools for editmode_armature ****************
@@ -268,33 +294,33 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Bones:")
- col.itemO("armature.bone_primitive_add", text="Add")
- col.itemO("armature.duplicate_move", text="Duplicate")
- col.itemO("armature.delete", text="Delete")
+ col.label(text="Bones:")
+ col.operator("armature.bone_primitive_add", text="Add")
+ col.operator("armature.duplicate_move", text="Duplicate")
+ col.operator("armature.delete", text="Delete")
col = layout.column(align=True)
- col.itemL(text="Modeling:")
- col.itemO("armature.extrude_move")
- col.itemO("armature.subdivide_multi", text="Subdivide")
+ col.label(text="Modeling:")
+ col.operator("armature.extrude_move")
+ col.operator("armature.subdivide_multi", text="Subdivide")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
@@ -307,7 +333,7 @@ class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
arm = context.active_object.data
col = layout.column(align=True)
- col.itemR(arm, "x_axis_mirror")
+ col.prop(arm, "x_axis_mirror")
# ********** default tools for editmode_mball ****************
@@ -320,22 +346,22 @@ class VIEW3D_PT_tools_mballedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_lattice ****************
@@ -348,22 +374,26 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.operator("lattice.make_regular")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
+
+ col = layout.column(align=True)
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
+
# ********** default tools for posemode ****************
@@ -376,45 +406,44 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
layout = self.layout
col = layout.column(align=True)
- col.itemL(text="Transform:")
- col.itemO("tfm.translate")
- col.itemO("tfm.rotate")
- col.itemO("tfm.resize", text="Scale")
+ col.label(text="Transform:")
+ col.operator("tfm.translate")
+ col.operator("tfm.rotate")
+ col.operator("tfm.resize", text="Scale")
col = layout.column(align=True)
- col.itemL(text="Bones:")
- col.itemO("pose.hide", text="Hide")
- col.itemO("pose.reveal", text="Reveal")
+ col.label(text="In-Between:")
+ row = col.row()
+ row.operator("pose.push", text="Push")
+ row.operator("pose.relax", text="Relax")
+ col.operator("pose.breakdown", text="Breakdowner")
col = layout.column(align=True)
- col.itemL(text="Keyframes:")
- col.itemO("anim.insert_keyframe_menu", text="Insert")
- col.itemO("anim.delete_keyframe_v3d", text="Remove")
+ col.label(text="Pose:")
+ row = col.row()
+ row.operator("pose.copy", text="Copy")
+ row.operator("pose.paste", text="Paste")
col = layout.column(align=True)
- col.itemL(text="Pose:")
- col.itemO("pose.copy", text="Copy")
- col.itemO("pose.paste", text="Paste")
- col.itemO("poselib.pose_add", text="Add To Library")
- col.itemO("poselib.browse_interactive", text="Browse Library")
+ col.operator("poselib.pose_add", text="Add To Library")
col = layout.column(align=True)
- col.itemL(text="In-Between:")
- col.itemO("pose.relax", text="Relax")
- col.itemO("pose.push", text="Push")
- col.itemO("pose.breakdown", text="Breakdowner")
+ col.label(text="Keyframes:")
+
+ col.operator("anim.keyframe_insert_menu", text="Insert")
+ col.operator("anim.keyframe_delete_v3d", text="Remove")
col = layout.column(align=True)
- col.itemL(text="Grease Pencil:")
- col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand")
- col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line")
- col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser")
+ col.label(text="Repeat:")
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
col = layout.column(align=True)
- col.itemL(text="Repeat:")
- col.itemO("screen.repeat_last")
- col.itemO("screen.repeat_history", text="History...")
- col.itemO("screen.redo_last", text="Tweak...")
+ col.label(text="Grease Pencil:")
+ row = col.row()
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_posemode_options(View3DPanel):
@@ -427,8 +456,8 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel):
arm = context.active_object.data
col = layout.column(align=True)
- col.itemR(arm, "x_axis_mirror")
- col.itemR(arm, "auto_ik")
+ col.prop(arm, "x_axis_mirror")
+ col.prop(arm, "auto_ik")
# ********** default tools for paint modes ****************
@@ -478,120 +507,119 @@ class VIEW3D_PT_tools_brush(PaintPanel):
# XXX This needs a check if psys is editable.
if context.particle_edit_object:
# XXX Select Particle System
- layout.column().itemR(settings, "tool", expand=True)
+ layout.column().prop(settings, "tool", expand=True)
if settings.tool != 'NONE':
col = layout.column()
- col.itemR(brush, "size", slider=True)
- col.itemR(brush, "strength", slider=True)
+ col.prop(brush, "size", slider=True)
+ col.prop(brush, "strength", slider=True)
if settings.tool == 'ADD':
col = layout.column()
- col.itemR(settings, "add_interpolate")
+ col.prop(settings, "add_interpolate")
sub = col.column(align=True)
sub.active = settings.add_interpolate
- sub.itemR(brush, "steps", slider=True)
- sub.itemR(settings, "add_keys", slider=True)
+ sub.prop(brush, "steps", slider=True)
+ sub.prop(settings, "add_keys", slider=True)
elif settings.tool == 'LENGTH':
- layout.itemR(brush, "length_mode", expand=True)
+ layout.prop(brush, "length_mode", expand=True)
elif settings.tool == 'PUFF':
- layout.itemR(brush, "puff_mode", expand=True)
+ layout.prop(brush, "puff_mode", expand=True)
# Sculpt Mode #
elif context.sculpt_object and brush:
col = layout.column()
- col.itemS()
- col.itemR(brush, "sculpt_tool", expand=True)
- col.itemS()
+ col.separator()
+ col.prop(brush, "sculpt_tool", expand=True)
+ col.separator()
row = col.row(align=True)
- row.itemR(brush, "size", slider=True)
- row.itemR(brush, "use_size_pressure", toggle=True, text="")
+ row.prop(brush, "size", slider=True)
+ row.prop(brush, "use_size_pressure", toggle=True, text="")
if brush.sculpt_tool != 'GRAB':
row = col.row(align=True)
- row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "use_strength_pressure", text="")
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_strength_pressure", text="")
+
+ # XXX - TODO
+ #row = col.row(align=True)
+ #row.prop(brush, "jitter", slider=True)
+ #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
- ''' # XXX - TODO
- row = col.row(align=True)
- row.itemR(brush, "jitter", slider=True)
- row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
- '''
col = layout.column()
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
- col.row().itemR(brush, "direction", expand=True)
+ col.row().prop(brush, "direction", expand=True)
if brush.sculpt_tool == 'LAYER':
- col.itemR(brush, "use_persistent")
- col.itemO("sculpt.set_persistent_base")
+ col.prop(brush, "use_persistent")
+ col.operator("sculpt.set_persistent_base")
# Texture Paint Mode #
elif context.texture_paint_object and brush:
col = layout.column(align=True)
- col.item_enumR(settings, "tool", 'DRAW')
- col.item_enumR(settings, "tool", 'SOFTEN')
- col.item_enumR(settings, "tool", 'CLONE')
- col.item_enumR(settings, "tool", 'SMEAR')
+ col.prop_enum(settings, "tool", 'DRAW')
+ col.prop_enum(settings, "tool", 'SOFTEN')
+ col.prop_enum(settings, "tool", 'CLONE')
+ col.prop_enum(settings, "tool", 'SMEAR')
col = layout.column()
- col.itemR(brush, "color", text="")
+ col.prop(brush, "color", text="")
row = col.row(align=True)
- row.itemR(brush, "size", slider=True)
- row.itemR(brush, "use_size_pressure", toggle=True, text="")
+ row.prop(brush, "size", slider=True)
+ row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "use_strength_pressure", toggle=True, text="")
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "jitter", slider=True)
- row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
+ row.prop(brush, "jitter", slider=True)
+ row.prop(brush, "use_jitter_pressure", toggle=True, text="")
- col.itemR(brush, "blend", text="Blend")
+ col.prop(brush, "blend", text="Blend")
# Weight Paint Mode #
elif context.weight_paint_object and brush:
- layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
- layout.itemR(context.tool_settings, "auto_normalize", text="Auto Normalize")
+ layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
+ layout.prop(context.tool_settings, "auto_normalize", text="Auto Normalize")
col = layout.column()
row = col.row(align=True)
- row.itemR(brush, "size", slider=True)
- row.itemR(brush, "use_size_pressure", toggle=True, text="")
+ row.prop(brush, "size", slider=True)
+ row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "use_strength_pressure", toggle=True, text="")
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "jitter", slider=True)
- row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
+ row.prop(brush, "jitter", slider=True)
+ row.prop(brush, "use_jitter_pressure", toggle=True, text="")
# Vertex Paint Mode #
elif context.vertex_paint_object and brush:
col = layout.column()
- col.itemR(brush, "color", text="")
+ col.prop(brush, "color", text="")
row = col.row(align=True)
- row.itemR(brush, "size", slider=True)
- row.itemR(brush, "use_size_pressure", toggle=True, text="")
+ row.prop(brush, "size", slider=True)
+ row.prop(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
- row.itemR(brush, "strength", slider=True)
- row.itemR(brush, "use_strength_pressure", toggle=True, text="")
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_strength_pressure", toggle=True, text="")
- ''' # XXX - TODO
- row = col.row(align=True)
- row.itemR(brush, "jitter", slider=True)
- row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
- '''
+ # XXX - TODO
+ #row = col.row(align=True)
+ #row.prop(brush, "jitter", slider=True)
+ #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
class VIEW3D_PT_tools_brush_stroke(PaintPanel):
@@ -614,27 +642,27 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
if context.sculpt_object:
if brush.sculpt_tool != 'LAYER':
- layout.itemR(brush, "use_anchor")
- layout.itemR(brush, "use_rake")
+ layout.prop(brush, "use_anchor")
+ layout.prop(brush, "use_rake")
- layout.itemR(brush, "use_airbrush")
+ layout.prop(brush, "use_airbrush")
col = layout.column()
col.active = brush.use_airbrush
- col.itemR(brush, "rate", slider=True)
+ col.prop(brush, "rate", slider=True)
if not texture_paint:
- layout.itemR(brush, "use_smooth_stroke")
+ layout.prop(brush, "use_smooth_stroke")
col = layout.column()
col.active = brush.use_smooth_stroke
- col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True)
- col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True)
+ col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
+ col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
- layout.itemR(brush, "use_space")
+ layout.prop(brush, "use_space")
row = layout.row(align=True)
row.active = brush.use_space
- row.itemR(brush, "spacing", text="Distance", slider=True)
+ row.prop(brush, "spacing", text="Distance", slider=True)
if texture_paint:
- row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
+ row.prop(brush, "use_spacing_pressure", toggle=True, text="")
class VIEW3D_PT_tools_brush_curve(PaintPanel):
@@ -652,7 +680,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
brush = settings.brush
layout.template_curve_mapping(brush, "curve")
- layout.item_menu_enumO("brush.curve_preset", property="shape")
+ layout.operator_menu_enum("brush.curve_preset", property="shape")
class VIEW3D_PT_sculpt_options(PaintPanel):
@@ -667,22 +695,22 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
sculpt = context.tool_settings.sculpt
col = layout.column()
- col.itemR(sculpt, "partial_redraw", text="Partial Refresh")
- col.itemR(sculpt, "show_brush")
+ col.prop(sculpt, "partial_redraw", text="Partial Refresh")
+ col.prop(sculpt, "show_brush")
split = self.layout.split()
col = split.column()
- col.itemL(text="Symmetry:")
- col.itemR(sculpt, "symmetry_x", text="X")
- col.itemR(sculpt, "symmetry_y", text="Y")
- col.itemR(sculpt, "symmetry_z", text="Z")
+ col.label(text="Symmetry:")
+ col.prop(sculpt, "symmetry_x", text="X")
+ col.prop(sculpt, "symmetry_y", text="Y")
+ col.prop(sculpt, "symmetry_z", text="Z")
col = split.column()
- col.itemL(text="Lock:")
- col.itemR(sculpt, "lock_x", text="X")
- col.itemR(sculpt, "lock_y", text="Y")
- col.itemR(sculpt, "lock_z", text="Z")
+ col.label(text="Lock:")
+ col.prop(sculpt, "lock_x", text="X")
+ col.prop(sculpt, "lock_y", text="Y")
+ col.prop(sculpt, "lock_z", text="Z")
# ********** default tools for weightpaint ****************
@@ -694,14 +722,13 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
def draw(self, context):
layout = self.layout
- wpaint = context.tool_settings.weight_paint
-
col = layout.column()
- # col.itemL(text="Blend:")
- col.itemO("object.vertex_group_normalize_all", text="Normalize All")
- col.itemO("object.vertex_group_normalize", text="Normalize")
- col.itemO("object.vertex_group_invert", text="Invert")
- col.itemO("object.vertex_group_clean", text="Clean")
+ # col.label(text="Blend:")
+ col.operator("object.vertex_group_normalize_all", text="Normalize All")
+ col.operator("object.vertex_group_normalize", text="Normalize")
+ col.operator("object.vertex_group_invert", text="Invert")
+ col.operator("object.vertex_group_clean", text="Clean")
+ col.operator("object.vertex_group_levels", text="Levels")
class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
@@ -714,23 +741,21 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
wpaint = context.tool_settings.weight_paint
col = layout.column()
- col.itemL(text="Blend:")
- col.itemR(wpaint, "mode", text="")
- col.itemR(wpaint, "all_faces")
- col.itemR(wpaint, "normals")
- col.itemR(wpaint, "spray")
- col.itemR(wpaint, "vertex_dist", text="Distance")
-
+ col.label(text="Blend:")
+ col.prop(wpaint, "mode", text="")
+ col.prop(wpaint, "all_faces")
+ col.prop(wpaint, "normals")
+ col.prop(wpaint, "spray")
data = context.weight_paint_object.data
if type(data) == bpy.types.Mesh:
- col.itemR(data, "use_mirror_x")
+ col.prop(data, "use_mirror_x")
# Commented out because the Apply button isn't an operator yet, making these settings useless
-# col.itemL(text="Gamma:")
-# col.itemR(wpaint, "gamma", text="")
-# col.itemL(text="Multiply:")
-# col.itemR(wpaint, "mul", text="")
+# col.label(text="Gamma:")
+# col.prop(wpaint, "gamma", text="")
+# col.label(text="Multiply:")
+# col.prop(wpaint, "mul", text="")
# Also missing now:
# Soft, Vgroup, X-Mirror and "Clear" Operator.
@@ -748,17 +773,17 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
vpaint = context.tool_settings.vertex_paint
col = layout.column()
- col.itemL(text="Blend:")
- col.itemR(vpaint, "mode", text="")
- col.itemR(vpaint, "all_faces")
- col.itemR(vpaint, "normals")
- col.itemR(vpaint, "spray")
- col.itemR(vpaint, "vertex_dist", text="Distance")
+ col.label(text="Blend:")
+ col.prop(vpaint, "mode", text="")
+ col.prop(vpaint, "all_faces")
+ col.prop(vpaint, "normals")
+ col.prop(vpaint, "spray")
+
# Commented out because the Apply button isn't an operator yet, making these settings useless
-# col.itemL(text="Gamma:")
-# col.itemR(vpaint, "gamma", text="")
-# col.itemL(text="Multiply:")
-# col.itemR(vpaint, "mul", text="")
+# col.label(text="Gamma:")
+# col.prop(vpaint, "gamma", text="")
+# col.label(text="Multiply:")
+# col.prop(vpaint, "mul", text="")
# ********** default tools for texturepaint ****************
@@ -773,7 +798,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
def draw_header(self, context):
ipaint = context.tool_settings.image_paint
- self.layout.itemR(ipaint, "use_projection", text="")
+ self.layout.prop(ipaint, "use_projection", text="")
def draw(self, context):
layout = self.layout
@@ -785,36 +810,36 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel):
col = layout.column()
sub = col.column()
sub.active = use_projection
- sub.itemR(ipaint, "use_occlude")
- sub.itemR(ipaint, "use_backface_cull")
+ sub.prop(ipaint, "use_occlude")
+ sub.prop(ipaint, "use_backface_cull")
split = layout.split()
col = split.column()
col.active = (use_projection)
- col.itemR(ipaint, "use_normal_falloff")
+ col.prop(ipaint, "use_normal_falloff")
col = split.column()
col.active = (ipaint.use_normal_falloff and use_projection)
- col.itemR(ipaint, "normal_angle", text="")
+ col.prop(ipaint, "normal_angle", text="")
split = layout.split(percentage=0.7)
col = split.column(align=False)
col.active = (use_projection)
- col.itemR(ipaint, "use_stencil_layer")
+ col.prop(ipaint, "use_stencil_layer")
col = split.column(align=False)
col.active = (use_projection and ipaint.use_stencil_layer)
- col.itemR(ipaint, "invert_stencil", text="Inv")
+ col.prop(ipaint, "invert_stencil", text="Inv")
col = layout.column()
sub = col.column()
sub.active = (settings.tool == 'CLONE')
- sub.itemR(ipaint, "use_clone_layer")
+ sub.prop(ipaint, "use_clone_layer")
sub = col.column()
- sub.itemR(ipaint, "seam_bleed")
+ sub.prop(ipaint, "seam_bleed")
class VIEW3D_PT_tools_particlemode(View3DPanel):
@@ -828,7 +853,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
pe = context.tool_settings.particle_edit
ob = pe.object
- layout.itemR(pe, "type", text="")
+ layout.prop(pe, "type", text="")
ptcache = None
@@ -848,36 +873,36 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
if not pe.editable:
- layout.itemL(text="Point cache must be baked")
- layout.itemL(text="to enable editing!")
+ layout.label(text="Point cache must be baked")
+ layout.label(text="to enable editing!")
col = layout.column(align=True)
if pe.hair:
col.active = pe.editable
- col.itemR(pe, "emitter_deflect", text="Deflect emitter")
+ col.prop(pe, "emitter_deflect", text="Deflect emitter")
sub = col.row()
sub.active = pe.emitter_deflect
- sub.itemR(pe, "emitter_distance", text="Distance")
+ sub.prop(pe, "emitter_distance", text="Distance")
col = layout.column(align=True)
col.active = pe.editable
- col.itemL(text="Keep:")
- col.itemR(pe, "keep_lengths", text="Lenghts")
- col.itemR(pe, "keep_root", text="Root")
+ col.label(text="Keep:")
+ col.prop(pe, "keep_lengths", text="Lenghts")
+ col.prop(pe, "keep_root", text="Root")
if not pe.hair:
- col.itemL(text="Correct:")
- col.itemR(pe, "auto_velocity", text="Velocity")
+ col.label(text="Correct:")
+ col.prop(pe, "auto_velocity", text="Velocity")
col = layout.column(align=True)
col.active = pe.editable
- col.itemL(text="Draw:")
- col.itemR(pe, "draw_step", text="Path Steps")
+ col.label(text="Draw:")
+ col.prop(pe, "draw_step", text="Path Steps")
if pe.type == 'PARTICLES':
- col.itemR(pe, "draw_particles", text="Particles")
- col.itemR(pe, "fade_time")
+ col.prop(pe, "draw_particles", text="Particles")
+ col.prop(pe, "fade_time")
sub = col.row()
sub.active = pe.fade_time
- sub.itemR(pe, "fade_frames", slider=True)
+ sub.prop(pe, "fade_frames", slider=True)
bpy.types.register(VIEW3D_PT_tools_weightpaint)
diff --git a/release/text/blender.html b/release/text/blender.html
deleted file mode 100644
index 30c8f0b0dc2..00000000000
--- a/release/text/blender.html
+++ /dev/null
@@ -1,516 +0,0 @@
-
-
-
- A brief introduction to Blender
-
-
-
-
-
-
-
-
- - About
- - Package Contents and Install
- - Getting Started:
-
- - Running
- - First steps,
-The 3d View
-
- - Resources
- - Troubleshooting
- - (FAQ) A few remarks
-
-
-
-
-Welcome to the world of Blender!
-The program you have now in your hands is a free and fully functional 3D
-modeling, animation, rendering, compositing, video editing and game creation suite. It is available for
-Unix-based (Linux, Mac OS X, etc.) and Windows systems and has a large
-world-wide community.
-
-Blender is free to be applied for any purpose, including commercial usage and
-distribution. It's free and open-source software, released under the GNU GPL
-licence. The full program sources are available on our website.
-
-For impatient readers, here the two most important links:
-www.blender.org the main website
-wiki.blender.org the documentation website
-
-back to top
-
-
-
-This is what you should get from a downloaded Blender package:
-
-
- - The Blender program for some specific platform;
- - This text, with links and the copyright notice;
- - A basic set of scripts, including importers and exporters to other 3d
- formats.
-
-
-The latest version for all supported platforms can always be found at the
-main Blender site, along with documentation, sample .blend files, many scripts,
-plugins and more.
-
-If you are interested in the development of the program, information for
-coders and the CVS repository with the sources can be found at the
-developer's section of the site.
-
-
-
-Installing is mostly a matter of executing a self-installer package or unpacking it to
-some folder. Blender has a minimum of system dependencies (like OpenGL and SDL), and doesn't
-install by overwriting libraries in your system. There are also some extra
-files needed for a good install, like an antialiased font and standard python scripts, but these
-are optional. Typically these will go to your HOME/.blender/
-directory. Below you find instructions for it per OS.
-
-
-Windows: the .exe installer handles registry of file types for you. The .zip download has
-a .blender directory included, which can be manually copied.
-The directory .blender is located by Blender while checking the following list:
-- whether environment variable HOME exists,
-- or, if environment USERPROFILE exists, and the installer has created there the Application Data\Blender Foundation\Blender\
-directory,
-- or it uses the .blender directory from the installation directory (where blender.exe resides)
-Also note that Blender comes with two dll files, which have to reside next to blender.exe.
-
-Linux, FreeBSD, Irix, Solaris: after unpacking the distribution, you can copy the .blender
-directory from it to your home directory.
-
-OSX: the .blender directory is in Blender.app/Contents/Resources/. This is being located
-by default. If you like to alter some of the files, copy this directory to your home dir.
-
-Other settings:
-There are many paths you can set in Blender itself, to tell it where to
-look for your collections of texture and sound files, fonts, plugins and
-additional scripts, besides where it should save rendered images, temporary
-data, etc. If you're only starting, there's no need to worry about this now.
-
-
-Python:
-Some downloaded scripts may require extra Python modules not shipped with
-Blender. Installing the whole Python distribution is a way to solve this
-issue for most cases except scripts that require extensions (3rd party
-modules), but we are starting to add more modules to Blender itself so that
-most scripts don't depend on full Python installs anymore. This is mostly
-about Windows, in other platforms Python is usually a standard component
-nowadays, so unless there's a version mismatch or an incomplete py
-installation, there should be no problems.
-
-Even if you do have the right version of Python installed you may need to
-tell the embedded Python interpreter where the installation is. To do that
-it's enough to set a system variable called PYTHON to the full path to the
-stand-alone Python executable (to find out execute "import sys; print
-sys.executable" inside the stand-alone interpreter, not in Blender). To check
-which Python was linked to your Blender binary, execute "import sys; print
-sys.version" at Blender's text editor), it's probably 2.5.something -- only the
-two first numbers should have to match with yours.
-
-
-back to top
-
-
-
-Blender's main strength is at modeling, animating and rendering 3d
-scenes, from simple cubes and monkey heads to the complex environments found in
-videogames and movies with computer graphics (CG) art.
-
-Rendering is the process of generating 2d images from 3d
-data (basically lit 3d models) as if viewed by a virtual camera. In simple
-terms, rendering is like taking a picture of the scene, but with many more
-ways to influence the results. Blender comes with a very flexible renderer
-and is well integrated with the open source YafRay package. There are also
-scripts to export to other popular third party renderers like Povray and
-Renderman compliant ones. By animating the data and rendering
-pictures of each successive frame, movie sequences can be created.
-
-In compositing a set of techniques is used to add effects
-to rendered images and combine these into a single frame. This is how, for
-example, artists add laser beams, glows and dinosaurs to motion
-pictures. Blender also has builtin
-support for video sequence editing and sound synchronization.
-
-The game engine inside Blender lets users create and play
-nifty 3d games, complete with 3d graphics, sound, physics and scripted rules.
-
-
-Via scripting the program's functionality can be automated
-and extended in real-time with important new capabilities. True displacement
-mapping, for example, is now part of the core program, but before that it was
-already possible using scripts. Since they are written in a nice higher-level
-programming language -- Python in our case
--- development is considerably faster and easier than normal C/C++ coding.
-Naturally, they run slower than compiled code, but still fast enough for
-many purposes or for mixed approaches like some plugins use.
-
-
-
-Depending on your platform, the installation may have put an icon on your
-desktop and a menu entry for Blender. If not, it's not hard to do that
-yourself for your favorite window manager.
-
-But for more flexibility, you can execute Blender from a shell window or
-command-line prompt. Try "blender -h" to see all available options.
-
-Blender saves data in its own custom binary format, using ".blend" as
-extension. The default start-up configuration is saved in a file in your home directory called
-.B.blend. To save your changes to it, click on
-File->Save Default Settings or use the Control+u shortcut
-directly.
-
-
-
-This is the point where we stop and warn newcomers that 3d Computer
-Graphics is a vast field and Blender has a lot of packed functionality.
-If you already tried to run it and fell victim to the "too many buttons!"
-syndrome, just relax and read this part of the F.A.Q.
-
-Hoping the explanations helped, let's start Blender and take a look at it.
-At the top header you can see the main menu. Under "File" you'll find entries
-to save, load and quit. If someone ever messes with your workspace
-and you can't find your way around: use the menu File->Load Factory settings.
-
-Blender's screen is divided in "areas". Each of them has a top or bottom
-header and can show any of the available builtin applications (called "spaces",
-like the 3d View, the Text Editor, etc). If you started with a default
-configuration, there should now be three areas:
-
-
-
- - A thin strip at the top where you can see the header of the User
-Preferences Window (its header is also Blender's main menu);
- - A big one in the middle with the 3d View, where you
-model and preview your scenes;
- - A smaller at the bottom with the Buttons Window, where
-you add and configure most of your scene data.
-
-
-These are the three most important spaces, at least when you are starting.
-At the left corner of each header you can find the "Window Types" button,
-which is like the "Start" buttom of many desktop environments. Clicking on
-it lets you change what is shown in that area.
-
-Highly configurable workspace
-
-Blender's interface has been considerably improved for the 2.3x series.
-Besides the goals of exposing functionality via menus and adding tooltips
-for all buttons, there are even more ways now to change your workspace.
-
-As before, areas can be resized, subdivided in two or joined; headers can
-be moved to the top or bottom of an area or hidden completely. Just experiment
-to find out how, it's trivial. Hint: the mouse cursor changes to a double arrow
-when it is over the inter-area edges.
-
-There should be a button with "SCR:" in the top header. It has some preset
-workspaces that can be tried now for a tour of the possibilities. When you
-change your current setup to something worth keeping, that same button has the
-option to save the new screen.
-
-Since version 2.30 Blender lets users define new color themes that can also
-be shared with others when saved in the default startup .B.blend file.
-
-The User Preferences space has many options there that you may want to
-tweak, like turning button tooltips on/off, setting paths, etc. Just remember
-to save your configuration if you want to keep it for the next session).
-Since these preferences are not saved in regular .blend files, the presets will
-retain working even when loading files from others. Note however, that the arrangement
-of the UI itself - its screens and windows - are always saved in each file.
-
-
-
-
-Mouse buttons and the toolbox
-
-Pressing the SPACEBAR or Shift+a while the mouse pointer is inside a 3d
-View space will open up the toolbox. The toolbox gives you faster access to
-many functions, like adding new objects to your scene, editing their properties,
-selecting and so on.
-
-This is how the mouse buttons work in this space:
-
- - Left button: anchor the 3d cursor in a new location -- it defines where
-your next added object will appear, among other things.
- - Right button: selection. If you hold it and move, you can move the
-selected item around.
- - Middle button: 3d space rotation or translation -- choose which one in
-one of the User Preferences tabs.
-
-Combinations of mouse buttons and Shift or Control will give you additional
-options like zooming, panning and restricted movement. 3d scenes can be seen
-from any position and orientation, but there are some default ones you can
-reach with Numpad buttons or the "View" menu in the 3d View's header.
-
-Edit Mode
-
-When you want to edit the vertices of a mesh, for example, it's necessary to
-select the object and enter "Edit Mode", either using the 3d View header "Mode"
-button or by pressing TAB on your keyboard (press it again to return to object
-mode).
-
-And this was only the beginning ...
-
-The above guidelines should have given new users enough to start playing
-with the interface. The next section lists online references that can actually teach about 3d and this program, but it's a good idea to spend some time just
-playing with Blender, looking at menus and finding what mouse actions do in
-each space.
-
-back to top
-
-
-
-
-
-This short presentation is meant to guide newcomers to Blender through their
-very first steps, giving directions to where you can find the
-resources you will need. We can't teach you 3D in these few lines of text,
-that would take a lengthy book.
-
-Irc users are invited to try #blenderchat on irc.freenode.net .
-
-There are also local Blender community sites in some countries, that should
-be listed at the Community section of the main site.
-
-If you are a coder wanting to get in touch with Blender development, a good read
-is the "Get Involved" page at www.blender.org. A
-good way to start is to follow the mailing lists for a while and check bug
-reports, to see if you can fix one. On irc.freenode.net: #blendercoders you'll find many active developers, here also the weekly meetings take place.
-
-
-
-In the realm of open-source cg programs, it's a pleasure to mention other
-great projects that can help you achieve your visions. Note that these
-programs are completely independent from Blender and have their own sites,
-documentation and support channels. Note also that this list is not complete
-and should be updated on future versions of this text.
-
-
- - The Gimp
- - The mighty GNU Image Manipulation Program. In 3d work it is a valuable
-resource to create, convert and, of course, manipulate texture images.
-It is also useful for work with rendered pictures, for example to add 2d text,
-logos or to touch-up, apply factory or hand-made effects and compose with other
-images.
-
-
-
-Renderers:
-
-
- - YafRay
- - A currently inactive but very impressive program. Blender has builtin
-support for it.
- - Povray
- - One of the best and most popular renderers in the world. There is a
-script to export Blender scenes to be rendered with it.
- - Renderman-compliant:
-open-source: Aqsis,
-Pixie. Closed-source:
-3delight.
- - The Renderman spec was created by Pixar years ago to define both a
-standard and powerful representation of 3d data for renderers and the expected
-quality of the renderization itself. Think about 3d art from some movie -- it
-was much probably created by Pixar's own Photorealistic Renderman (PRMan)
-renderer. This is a good site to learn more:
-The Renderman Academy. Neither
-Pixar nor its products are affiliated with Blender.
-
-
-back to top
-
-
-
-If something isn't working, please read this entire section before looking
-for help.
-
-
-
-
-
-If the program crashes or something isn't working properly, try running
-Blender in debug mode: execute it as "blender -d" from a
-command prompt. This might give some info about what is wrong. There are also
-other options that might be useful, "blender -h" lists all of them.
-Most likely an immediate crash is due to Blender's need for a compliant and
-stable working OpenGL.
-
-
-
-Although OpenGL is cherished as an excellent cross platform library, the enormous
-growth of different 3D cards have made this a complicated affair for Blender. Unlike
-other programs - or 3D games - Blender utilizes OpenGL for its entire GUI, including
-buttons and pulldown menus. That means also the 2D options for OpenGL should
-work good, something easily ignored or badly tested by 3D card manufacturors, who
-target more at the latest SFX features for new 3D games.
-In general Blender performs
-very well on 3D cards from renowned brands, such as NVidia, ATI or 3DLabs.
-
-
-
-
-To be sure that some functionality is scripted: all scripts in Blender can
-be accessed from the "Scripts" menu in the Scripts Window's header, even if the
-same functionality is also in another menu somewhere. If you see an entry in
-one of the submenus there, it refers to a script. Please don't report problems
-with scripts to the bug tracker or other normal Blender channels. You should
-find the author's site or contact email in the script's text itself, but
-usually the Python & Plugins forum at
-Blenderartists.org is used for posting
-announcements, questions, suggestions and bug reports related to scripts. It's
-the recommended place to look first, specially if no site was specified at the
-script's window or source file(s).
-If some or all scripts that should appear in menus are not there, running
-Blender in debug mode can possibly inform what is
-wrong. Make sure the reported dir(s) really exist.
-
-
-
-If you really think you found a new bug in Blender, check the Bug Tracker
-entries at the projects site and if
-it was not reported yet, please log in (or register) and fill in detailed
-information about the error. A small .blend file or script (if it is a problem
-with the Blender Python API) showcasing the bug can help a lot.
-
-back to top
-
-
-
-
- - Quick tips.
- - What's up with the interface?
- - How good is Blender? How does it compare to other 3d
-programs?
- - Something doesn't work, what do I do?
-
-
-
-
-Rendering: to see something when you render (F12) an image,
-make sure the scene has a camera pointing at your models (camera view is
-NumPad 0) and at least one light properly placed. Otherwise you'll only get a
-black rectangle.
-
-Setting texture map input to "uv" in the Material Buttons window is not enough
-to assign a texture image and uv data to a mesh. It's necessary to select the mesh,
-enter edit mode, indicate face selection mode (modes can be accessed in the 3d view's header), load an
-image in the UV/Image Editor window and then define a mapping (or unwrapping). Only then
-the mesh will have uv data available for exporting.
-
-If you want the fastest possible access to Blender's functionality, remember
-what a wise power user wrote: "keep one hand on the keyboard
-and the other on the mouse". Learn and use the shortcuts, configure your
-workspace to your needs.
-
-
-
-Blender uses a couple of innovative paradigms in the UI, not following more common, somewhat standard rules for user
-interfaces. In the past years several of our interface concepts have been adopted in more programs though,
-especially using a configurable non-overlapping subdivision layout and the paradigm to never block the UI from working by
-offering all editors and options in parallel.
-Typically free programs offer easy-to-use interfaces for large audiences. Blender however is, like other high-end 3D tools,
-meant to be a powerful production tool for professionals and 3D enthusiasts, for people who are dedicated to become 3D artists with enough time
-and motivation to master the software.
-This also has its origins in the 90ies, when Blender was born as an in-house studio tool, optimized to speed up daily heavy
-work, and not to please everyone. But it's true that you can consider Blender's interface
-to be not very newbie-friendly. Luckily you only have to learn it once, and once you get the basics it'll feel like 2nd nature!
-
-Blender also has been considerably
-improved since the 2.3x series, exposing most functionality via menus, adding
-panels, color "themability", tooltips for all buttons and internationalization
-support. This is an ongoing effort or, better, a goal to keep the best ideas
-in Blender's design while expanding and making it more user-friendly.
-
-Too many buttons!
-
-Again, 3D Computer Graphics is a vast and fun field. If you're only
-starting, Blender can seem daunting, specially because of all its packed
-functionality. Don't let that upset you, there is no need to care about
-all those buttons right now -- or ever.
-
-There are basic things all users should learn early up:
-
-
- - Start the program and access the main menus;
- - Find and configure user preferences;
- - Basic scene set-up: how to add and transform (move, scale, rotate)
- lights, cameras and objects;
- - Create and link materials to objects, at least to color them;
- - Render your scenes.
-
-
-One hour is enough time to assimilate and practice that before going on
-with basic mesh editing and texturing, for example. There are many different
-areas to learn about. Taste, interaction with other users and your main
-interests (game art, rendered stills, movies) will guide you and define the
-skills you'll want to master. Then it goes like a spiral: practice something
-for a while, study and find about new tricks or whole new areas, practice a
-little more and so on. Soon you'll become pleased to have all those buttons to
-play with. A few more months and you'll probably be back asking for more ...
-
-
-
-
-If you ever get the impression that it's not possible to create great
-looking or complex works with Blender, rejoice -- you are just plainly
-uninformed, as browsing blender.org galleries and community forums can easily confirm.
-
-How does it compare to other 3d programs?
-
-In short: it takes considerable dedication to become good, no matter which
-program you work with, as long as it is good enough not to get in your way.
-Blender has, like the others, its strong and weak points.
-
-Compared to commercial alternatives, Blender misses some features and isn't
-as "newbie-friendly". It doesn't come packed with "one-click" or "wizard"
-functionality, where you get much faster results in detriment of flexibility
-and value. It also isn't bundled with tens of megabytes of sample models,
-texture images, tutorials, etc. (which only partly explains how Blender can fit
-in such a small download).
-
-Thankfully, these are relatively minor shortcomings. Many of Blender's modeling, animation and
-rendering/compositing features are up-to-par with the industry standards. The pace at which features
-are being added or polished in Blender is impressive, now that it's a well
-stablished open source project. We get daily feedback from professionals and studios using Blender, and
-results from the Blender Foundation's Open Movie/Game projects such as Big Buck Bunny
-and Yo Frankie! have set a reference standard for what a program like Blender can achieve.
- More: through plugins and scripting, many
-repetitive or otherwise cumbersome tasks can be made trivial. But plugin and
-script authors go further, teaching Blender new tricks, from importers and
-exporters to more advanced "applications".
-
-About goodies, there are many places where you can get them (check
-resources). Besides the many available Blender books, the main site and
-blenderartists.org are the best ones to start. For free texture
-images, a simple search for "free textures" should bring many results, just pay
-attention to their licenses if you plan to release your work later.
-
-Commercial packages might make it easier for newbies to produce nice looking
-material, but only another newbie would praise the results. There's a huge
-difference between what a skilled artist and someone poking at buttons and
-using presets can accomplish.
-
-Last but best of all: Blender is open-source, free for all to use, study and
-improve.
-
-
-Thanks for reading, we hope you enjoy Blender!
-
-Document version 1.1, Sept 2008
-
-back to top
-
-
-
diff --git a/release/text/readme.html b/release/text/readme.html
new file mode 100644
index 00000000000..a9a98053a6a
--- /dev/null
+++ b/release/text/readme.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+Blender 2.5 Alpha 0
+
+
+Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and Irix and has a large world-wide community.
+Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.
+For more information, visit blender.org.
+
+
+The Blender Foundation and online developer community is proud to present Blender 2.5 Alpha 0. This release is the first official testing release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. More information about this release.
+What to Expect:
+ • Big improvements - This is our most exciting version to date, already a significant improvement in many ways over 2.49
+ • Missing/Incomplete Features - Although most of it is there, not all functionality from pre-2.5 versions has been restored yet. Some functionality may be re-implemented a different way.
+ • Bugs - We've fixed a lot lately, but there are still quite a few bugs. This is alpha software, we're still working on it!
+ • Changes - If you're used to the old Blenders, Blender 2.5 may seem quite different at first, but it won't be long before it grows on you even more than before.
+
+
+Blender 2.5 Alpha0 is unfinished software. If you encounter a bug, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.5. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.
+
+
+The downloaded Blender package includes:
+ • The Blender application for the chosen operating system.
+ • Scripts for importing and exporters to other 3d formats.
+ • Readme and copyright files.
+
+
+Windows: The download .zip contains a Blender folder. You may put this anywhere on your hard drive. To launch Blender, double-click on Blender.exe.
+Install scripts by putting them in the .blender/scripts folder next to the executable.
+Linux, FreeBSD, Irix, Solaris: Unpack the distribution, copy the .blender directory from it to your home directory. Then run the Blender executable.
+Install scripts by putting them in the .blender/scripts inside your home folder.
+Mac OS X: The downloaded package includes blender.app. Optionally copy this to your Applications folder, and add it to the dock by dragging it from there to the dock.
+Install scripts by putting them in the .blender/scripts inside your home folder. If the folder does not exist, you can create it manually.
+
+
+When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area on the right and a Timeline at the bottom.
+Orbit around in the 3D view by holding the middle mouse button and dragging. Alternatively, hold the alt key and drag the left mouse button. Additionally, hold Shift to pan the view and Ctrl to zoom.
+Select objects using the right mouse button. With the object selected, perform actions by clicking any of the tool buttons on the left, or make changes to its properties by altering any of the setting on the right.
+For more information on how to use Blender, watch tutorials or read the manual.
+
+
+Users:
+ General information www.blender.org
+ Full release log www.blender.org/development/release-logs/blender-250/
+ Tutorials www.blender.org/education-help/
+ Manual wiki.blender.org/index.php/Doc:Manual
+ User Forum www.blenderartists.org
+ IRC #blender on irc.freenode.net
+
+Developers:
+ Development www.blender.org/development/
+ SVN and Bug Tracker projects.blender.org
+ Get Involved www.blender.org/community/get-involved/
+ IRC #blendercoders on irc.freenode.net
+
+
+
+
+
+
+
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 8721e49f06b..c1b54c393c7 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -46,7 +46,7 @@
#include "BLI_blenlib.h"
#include "BLI_linklist.h" /* linknode */
#include "BLI_string.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BIF_gl.h"
#include "BLF_api.h"
@@ -459,7 +459,7 @@ static void blf_font_fill(FontBLF *font)
font->pos[0]= 0.0f;
font->pos[1]= 0.0f;
font->angle= 0.0f;
- Mat4One(font->mat);
+ unit_m4(font->mat);
font->clip_rec.xmin= 0.0f;
font->clip_rec.xmax= 0.0f;
font->clip_rec.ymin= 0.0f;
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 7d1e43a38df..1174197dce7 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -131,7 +131,8 @@ void blf_glyph_cache_free(GlyphCacheBLF *gc)
}
}
- glDeleteTextures(gc->cur_tex+1, gc->textures);
+ if (gc->cur_tex+1 > 0)
+ glDeleteTextures(gc->cur_tex+1, gc->textures);
free((void *)gc->textures);
MEM_freeN(gc);
}
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 076747cb845..514411e137d 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -54,6 +54,7 @@ struct Object;
struct Scene;
struct Mesh;
struct EditMesh;
+struct KeyBlock;
struct ModifierData;
struct MCol;
struct ColorBand;
@@ -318,6 +319,10 @@ int DM_release(DerivedMesh *dm);
*/
void DM_to_mesh(DerivedMesh *dm, struct Mesh *me);
+/* utility function to convert a DerivedMesh to a shape key block
+ */
+void DM_to_meshkey(DerivedMesh *dm, struct Mesh *me, struct KeyBlock *kb);
+
/* set the CD_FLAG_NOCOPY flag in custom data layers where the mask is
* zero for the layer type, so only layer types specified by the mask
* will be copied
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 17b56864d1e..6029ce01794 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -117,6 +117,12 @@ struct bActionGroup *action_groups_find_named(struct bAction *act, const char na
/* Pose API ----------------- */
+/**
+ * Deallocates a pose channel.
+ * Does not free the pose channel itself.
+ */
+void free_pose_channel(struct bPoseChannel *pchan);
+
/**
* Removes and deallocates all channels from a pose.
* Does not free the pose itself.
@@ -134,7 +140,11 @@ void free_pose(struct bPose *pose);
*/
void copy_pose(struct bPose **dst, struct bPose *src, int copyconstraints);
-
+/**
+ * Copy the internal members of each pose channel including constraints
+ * and ID-Props, used when duplicating bones in editmode.
+ */
+void duplicate_pose_channel_data(struct bPoseChannel *pchan, const struct bPoseChannel *pchan_from);
/**
* Return a pointer to the pose channel of the given name
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index e5b3adbd0c0..54dd82317fc 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -38,7 +38,7 @@
#include "BKE_DerivedMesh.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "DNA_cloth_types.h"
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 6446b48d553..e9110b99098 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -52,7 +52,7 @@ typedef struct bConstraintOb {
float startmat[4][4]; /* original matrix (before constraint solving) */
short type; /* type of owner */
- short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_arithb.h) */
+ short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */
} bConstraintOb;
/* ---------------------------------------------------------------------------- */
@@ -108,18 +108,25 @@ bConstraintTypeInfo *get_constraint_typeinfo(int type);
/* Constraint Target Macros */
#define VALID_CONS_TARGET(ct) ((ct) && (ct->tar))
-
/* ---------------------------------------------------------------------------- */
/* Constraint function prototypes */
void unique_constraint_name(struct bConstraint *con, struct ListBase *list);
void free_constraints(struct ListBase *list);
-void copy_constraints(struct ListBase *dst, struct ListBase *src);
+void copy_constraints(struct ListBase *dst, const struct ListBase *src);
void relink_constraints(struct ListBase *list);
void free_constraint_data(struct bConstraint *con);
+/* Constraint API function prototypes */
struct bConstraint *constraints_get_active(struct ListBase *list);
+void constraints_set_active(ListBase *list, struct bConstraint *con);
+
+struct bConstraint *add_ob_constraint(struct Object *ob, const char *name, short type);
+struct bConstraint *add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type);
+
+int remove_constraint(ListBase *list, struct bConstraint *con);
+int remove_constraint_index(ListBase *list, int index);
/* Constraints + Proxies function prototypes */
void extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index feba39ee11d..2c013a5231a 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -174,7 +174,7 @@ PointerRNA CTX_data_pointer_get(const bContext *C, const char *member);
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type);
ListBase CTX_data_collection_get(const bContext *C, const char *member);
ListBase CTX_data_dir_get(const bContext *C);
-void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb);
+int CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb);
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id);
void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *type, void *data);
@@ -248,9 +248,9 @@ int CTX_data_selected_editable_bones(const bContext *C, ListBase *list);
int CTX_data_visible_bones(const bContext *C, ListBase *list);
int CTX_data_editable_bones(const bContext *C, ListBase *list);
-struct bPoseChannel *CTX_data_active_pchan(const bContext *C);
-int CTX_data_selected_pchans(const bContext *C, ListBase *list);
-int CTX_data_visible_pchans(const bContext *C, ListBase *list);
+struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C);
+int CTX_data_selected_pose_bones(const bContext *C, ListBase *list);
+int CTX_data_visible_pose_bones(const bContext *C, ListBase *list);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index 6e273c81e39..5888c6d7530 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -34,6 +34,7 @@ struct ChannelDriver;
struct DriverTarget;
struct BezTriple;
+struct StructRNA;
#include "DNA_curve_types.h"
@@ -129,7 +130,8 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type);
struct FModifier *add_fmodifier(ListBase *modifiers, int type);
void copy_fmodifiers(ListBase *dst, ListBase *src);
-void remove_fmodifier(ListBase *modifiers, struct FModifier *fcm);
+int remove_fmodifier(ListBase *modifiers, struct FModifier *fcm);
+int remove_fmodifier_index(ListBase *modifiers, int index);
void free_fmodifiers(ListBase *modifiers);
struct FModifier *find_active_fmodifier(ListBase *modifiers);
@@ -155,6 +157,9 @@ void copy_fcurves(ListBase *dst, ListBase *src);
/* find matching F-Curve in the given list of F-Curves */
struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_index);
+/* high level function to get an fcurve from C without having the rna */
+struct FCurve *id_data_find_fcurve(ID* id, void *data, struct StructRNA *type, char *prop_name, int index);
+
/* Binary search algorithm for finding where to 'insert' BezTriple with given frame number.
* Returns the index to insert at (data already at that index will be offset if replace is 0)
*/
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index b66ddf13527..877e09b037f 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -42,8 +42,8 @@ void free_group(struct Group *group);
void unlink_group(struct Group *group);
struct Group *add_group(char *name);
struct Group *copy_group(struct Group *group);
-void add_to_group(struct Group *group, struct Object *ob);
-int rem_from_group(struct Group *group, struct Object *ob);
+int add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
+int rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
struct Group *find_group(struct Object *ob, struct Group *group);
int object_in_group(struct Object *ob, struct Group *group);
int group_is_animated(struct Object *parent, struct Group *group);
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 1980ba78c86..9c7460851cb 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -117,7 +117,7 @@ int IDP_InsertToGroup(struct IDProperty *group, struct IDProperty *previous,
*/
void IDP_RemFromGroup(struct IDProperty *group, struct IDProperty *prop);
-IDProperty *IDP_GetPropertyFromGroup(struct IDProperty *prop, char *name);
+IDProperty *IDP_GetPropertyFromGroup(struct IDProperty *prop, const char *name);
/*Get an iterator to iterate over the members of an id property group.
Note that this will automatically free the iterator once iteration is complete;
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index b70801a9edd..d5bae00d32e 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -59,7 +59,9 @@ void key_curve_normal_weights(float t, float *data, int type);
float *do_ob_key(struct Scene *scene, struct Object *ob);
struct Key *ob_get_key(struct Object *ob);
+struct KeyBlock *add_keyblock(struct Scene *scene, struct Key *key);
struct KeyBlock *ob_get_keyblock(struct Object *ob);
+struct KeyBlock *ob_get_reference_keyblock(struct Object *ob);
struct KeyBlock *key_get_keyblock(struct Key *key, int index);
struct KeyBlock *key_get_named_keyblock(struct Key *key, const char name[]);
char *key_get_curValue_rnaPath(struct Key *key, struct KeyBlock *kb);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 245db7e35ff..c30bfa3e247 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -281,6 +281,7 @@ int modifier_dependsOnTime(struct ModifierData *md);
int modifier_supportsMapping(struct ModifierData *md);
int modifier_couldBeCage(struct ModifierData *md);
int modifier_isDeformer(struct ModifierData *md);
+int modifier_sameTopology(ModifierData *md);
int modifier_isEnabled(struct ModifierData *md, int required_mode);
void modifier_setError(struct ModifierData *md, char *format, ...);
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 4c872fb247c..f9130e24a08 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -162,6 +162,7 @@ void nodeVerifyType(struct bNodeTree *ntree, struct bNode *node);
void nodeAddToPreview(struct bNode *, float *, int, int);
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
+void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
void nodeAddSockets(struct bNode *node, struct bNodeType *ntype);
struct bNode *nodeAddNodeType(struct bNodeTree *ntree, int type, struct bNodeTree *ngroup, struct ID *id);
void nodeRegisterType(struct ListBase *typelist, const struct bNodeType *ntype) ;
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index ba42aca1872..b532b0820d7 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -68,6 +68,9 @@ typedef struct SculptSession {
struct MFace *mface;
int totvert, totface;
float *face_normals;
+
+ struct Object *ob;
+ struct KeyBlock *kb, *refkb;
/* Mesh connectivity */
struct ListBase *fmap;
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 2291601bd47..2199240d77b 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -222,7 +222,7 @@ void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int tim
void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int distr, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor);
struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct ParticleSystem *psys);
-void object_add_particle_system(struct Scene *scene, struct Object *ob);
+struct ModifierData *object_add_particle_system(struct Scene *scene, struct Object *ob, char *name);
void object_remove_particle_system(struct Scene *scene, struct Object *ob);
struct ParticleSettings *psys_new_settings(char *name, struct Main *main);
struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part);
diff --git a/source/blender/blenkernel/BKE_sequence.h b/source/blender/blenkernel/BKE_sequence.h
index fb3c282b090..2f7526d524c 100644
--- a/source/blender/blenkernel/BKE_sequence.h
+++ b/source/blender/blenkernel/BKE_sequence.h
@@ -163,7 +163,7 @@ void update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_s
/* seqeffects.c */
// intern?
struct SeqEffectHandle get_sequence_blend(struct Sequence *seq);
-void sequence_effect_speed_rebuild_map(struct Sequence *seq, int force);
+void sequence_effect_speed_rebuild_map(struct Scene *scene, struct Sequence *seq, int force);
// extern
struct SeqEffectHandle get_sequence_effect(struct Sequence *seq);
@@ -183,10 +183,44 @@ void fix_single_seq(struct Sequence *seq);
int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test);
int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test);
int shuffle_seq_time(ListBase * seqbasep);
-void free_imbuf_seq(struct ListBase * seqbasep, int check_mem_usage);
+void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_mem_usage);
void seq_update_sound(struct Sequence *seq);
void clear_scene_in_allseqs(struct Scene *sce);
+struct Sequence *active_seq_get(struct Scene *scene);
+void active_seq_set(struct Scene *scene, struct Sequence *seq);
+
+/* api for adding new sequence strips */
+typedef struct SeqLoadInfo {
+ int start_frame;
+ int channel;
+ int flag; /* use sound, replace sel */
+ int type;
+ int tot_success;
+ int tot_error;
+ int len; /* only for image strips */
+ char path[512];
+ char name[32];
+} SeqLoadInfo;
+
+/* SeqLoadInfo.flag */
+#define SEQ_LOAD_REPLACE_SEL 1<<0
+#define SEQ_LOAD_FRAME_ADVANCE 1<<1
+#define SEQ_LOAD_MOVIE_SOUND 1<<2
+#define SEQ_LOAD_SOUND_CACHE 1<<3
+
+/* use as an api function */
+typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *);
+
+struct Sequence *alloc_sequence(ListBase *lb, int cfra, int machine);
+
+void seq_load_apply(struct Scene *scene, struct Sequence *seq, struct SeqLoadInfo *seq_load);
+
+void seqUniqueName(ListBase *seqbasep, struct Sequence *seq);
+
+struct Sequence *sequencer_add_image_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
+struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
+struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index d8053281ceb..92cb5542ad1 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -68,5 +68,8 @@ extern void sbObjectToSoftbody(struct Object *ob);
/* pass NULL to unlink again */
extern void sbSetInterruptCallBack(int (*f)(void));
+extern void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3]);
+
+
#endif
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index b9dc5916e69..95ada45f5d8 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -62,7 +62,7 @@ int do_colorband(struct ColorBand *coba, float in, float out[4]);
void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
void default_tex(struct Tex *tex);
-struct Tex *add_texture(char *name);
+struct Tex *add_texture(const char *name);
void default_mtex(struct MTex *mtex);
struct MTex *add_mtex(void);
struct Tex *copy_texture(struct Tex *tex);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 079a5411cf2..d2a6587336a 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -37,6 +37,8 @@ SET(INC
${ZLIB_INC}
)
+ADD_DEFINITIONS(-DGLEW_STATIC)
+
IF(WITH_BULLET)
SET(INC ${INC} ../../../extern/bullet2/src)
ADD_DEFINITIONS(-DUSE_BULLET)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index cceb4c685fa..fdd3a9e5276 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -16,7 +16,7 @@ incs += ' #/intern/audaspace/intern'
incs += ' ' + env['BF_OPENGL_INC']
incs += ' ' + env['BF_ZLIB_INC']
-defs = []
+defs = [ 'GLEW_STATIC' ]
if not env['WITH_BF_PYTHON']:
defs.append('DISABLE_PYTHON')
diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c
index 32065ea5151..d92e8fe4227 100644
--- a/source/blender/blenkernel/intern/BME_tools.c
+++ b/source/blender/blenkernel/intern/BME_tools.c
@@ -42,7 +42,7 @@
#include "BKE_utildefines.h"
#include "BKE_bmesh.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
/*split this all into a seperate bevel.c file in src*/
@@ -88,7 +88,7 @@ BME_TransData *BME_assign_transdata(BME_TransData_Head *td, BME_Mesh *bm, BME_Ve
else if (org != NULL) VECCOPY(vtd->org,org);
if (vec != NULL) {
VECCOPY(vtd->vec,vec);
- Normalize(vtd->vec);
+ normalize_v3(vtd->vec);
}
vtd->loc = loc;
@@ -261,7 +261,7 @@ static BME_Vert *BME_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Edge
nv = BME_SEMV(bm,v,e,ne);
if (nv == NULL) return NULL;
VECSUB(nv->co,v2->co,v->co);
- len = VecLength(nv->co);
+ len = len_v3(nv->co);
VECADDFAC(nv->co,v->co,nv->co,len*percent);
nv->flag = v->flag;
nv->bweight = v->bweight;
@@ -335,17 +335,17 @@ static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransDa
/* compare the transform origins to see if we can use the vert co's;
* if they belong to different origins, then we will use the origins to determine
* the vector */
- if (VecCompare(vtd1->org,vtd2->org,0.000001f)) {
+ if (compare_v3v3(vtd1->org,vtd2->org,0.000001f)) {
VECSUB(vec,v2->co,v1->co);
- if (VecLength(vec) < 0.000001f) {
- VecMulf(vec,0);
+ if (len_v3(vec) < 0.000001f) {
+ mul_v3_fl(vec,0);
}
return 0;
}
else {
VECSUB(vec,vtd2->org,vtd1->org);
- if (VecLength(vec) < 0.000001f) {
- VecMulf(vec,0);
+ if (len_v3(vec) < 0.000001f) {
+ mul_v3_fl(vec,0);
}
return 1;
}
@@ -363,18 +363,18 @@ static int BME_bevel_get_vec(float *vec, BME_Vert *v1, BME_Vert *v2, BME_TransDa
static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int is_forward, BME_TransData_Head *td) {
float factor, vec3[3], tmp[3],c1,c2;
- Crossf(tmp,vec1,vec2);
- Normalize(tmp);
- factor = Inpf(up_vec,tmp);
+ cross_v3_v3v3(tmp,vec1,vec2);
+ normalize_v3(tmp);
+ factor = dot_v3v3(up_vec,tmp);
if ((factor > 0 && is_forward) || (factor < 0 && !is_forward)) {
- Crossf(vec3,vec2,tmp); /* hmm, maybe up_vec should be used instead of tmp */
+ cross_v3_v3v3(vec3,vec2,tmp); /* hmm, maybe up_vec should be used instead of tmp */
}
else {
- Crossf(vec3,tmp,vec2); /* hmm, maybe up_vec should be used instead of tmp */
+ cross_v3_v3v3(vec3,tmp,vec2); /* hmm, maybe up_vec should be used instead of tmp */
}
- Normalize(vec3);
- c1 = Inpf(vec3,vec1);
- c2 = Inpf(vec1,vec1);
+ normalize_v3(vec3);
+ c1 = dot_v3v3(vec3,vec1);
+ c2 = dot_v3v3(vec1,vec1);
if (fabs(c1) < 0.000001f || fabs(c2) < 0.000001f) {
factor = 0.0f;
}
@@ -435,8 +435,8 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
ne->tflag1 = BME_BEVEL_ORIG; /* mark edge as original, even though it isn't */
BME_bevel_get_vec(vec1,v1,v,td);
BME_bevel_get_vec(vec2,v2,v,td);
- Crossf(t_up_vec,vec1,vec2);
- Normalize(t_up_vec);
+ cross_v3_v3v3(t_up_vec,vec1,vec2);
+ normalize_v3(t_up_vec);
up_vec = t_up_vec;
}
else {
@@ -486,8 +486,8 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
is_edge = BME_bevel_get_vec(vec1,v,v1,td); /* get the vector we will be projecting onto */
BME_bevel_get_vec(vec2,v,v2,td); /* get the vector we will be projecting parallel to */
- len = VecLength(vec1);
- Normalize(vec1);
+ len = len_v3(vec1);
+ normalize_v3(vec1);
vtd = BME_get_transdata(td, sv);
vtd1 = BME_get_transdata(td, v);
@@ -525,8 +525,8 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
}
VECADDFAC(sv->co,v->co,vec1,dis);
VECSUB(vec1,sv->co,vtd1->org);
- dis = VecLength(vec1);
- Normalize(vec1);
+ dis = len_v3(vec1);
+ normalize_v3(vec1);
BME_assign_transdata(td, bm, sv, vtd1->org, vtd1->org, vec1, sv->co, dis, scale, maxfactor, vtd->max);
return sv;
@@ -545,10 +545,10 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran
}
else {
VECCOPY(vec2,vtd1->vec);
- VecMulf(vec2,vtd1->factor);
- if (Inpf(vec1, vec1)) {
- Projf(vec2,vec2,vec1);
- fac1 = VecLength(vec2)/value;
+ mul_v3_fl(vec2,vtd1->factor);
+ if (dot_v3v3(vec1, vec1)) {
+ project_v3_v3v3(vec2,vec2,vec1);
+ fac1 = len_v3(vec2)/value;
}
else {
fac1 = 0;
@@ -560,10 +560,10 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran
}
else {
VECCOPY(vec3,vtd2->vec);
- VecMulf(vec3,vtd2->factor);
- if (Inpf(vec1, vec1)) {
- Projf(vec2,vec3,vec1);
- fac2 = VecLength(vec2)/value;
+ mul_v3_fl(vec3,vtd2->factor);
+ if (dot_v3v3(vec1, vec1)) {
+ project_v3_v3v3(vec2,vec3,vec1);
+ fac2 = len_v3(vec2)/value;
}
else {
fac2 = 0;
@@ -571,7 +571,7 @@ static float BME_bevel_set_max(BME_Vert *v1, BME_Vert *v2, float value, BME_Tran
}
if (fac1 || fac2) {
- max = VecLength(vec1)/(fac1 + fac2);
+ max = len_v3(vec1)/(fac1 + fac2);
if (vtd1->max && (*vtd1->max < 0 || max < *vtd1->max)) {
*vtd1->max = max;
}
@@ -760,12 +760,12 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti
for (i=0,ol=f->loopbase,l=ol->next; l->next!=ol; l=l->next) {
BME_bevel_get_vec(vec1,l->next->v,ol->v,td);
BME_bevel_get_vec(vec2,l->v,ol->v,td);
- Crossf(vec3,vec2,vec1);
+ cross_v3_v3v3(vec3,vec2,vec1);
VECADD(up_vec,up_vec,vec3);
i++;
}
- VecMulf(up_vec,1.0f/i);
- Normalize(up_vec);
+ mul_v3_fl(up_vec,1.0f/i);
+ normalize_v3(up_vec);
for (i=0,len=f->len; inext) {
if ((l->e->tflag1 & BME_BEVEL_BEVEL) && (l->e->tflag1 & BME_BEVEL_ORIG)) {
@@ -791,10 +791,10 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti
}
else {
VECCOPY(vec2,vtd1->vec);
- VecMulf(vec2,vtd1->factor);
- if (Inpf(vec1, vec1)) {
- Projf(vec2,vec2,vec1);
- fac1 = VecLength(vec2)/value;
+ mul_v3_fl(vec2,vtd1->factor);
+ if (dot_v3v3(vec1, vec1)) {
+ project_v3_v3v3(vec2,vec2,vec1);
+ fac1 = len_v3(vec2)/value;
}
else {
fac1 = 0;
@@ -805,17 +805,17 @@ static BME_Poly *BME_bevel_poly(BME_Mesh *bm, BME_Poly *f, float value, int opti
}
else {
VECCOPY(vec3,vtd2->vec);
- VecMulf(vec3,vtd2->factor);
- if (Inpf(vec1, vec1)) {
- Projf(vec2,vec3,vec1);
- fac2 = VecLength(vec2)/value;
+ mul_v3_fl(vec3,vtd2->factor);
+ if (dot_v3v3(vec1, vec1)) {
+ project_v3_v3v3(vec2,vec3,vec1);
+ fac2 = len_v3(vec2)/value;
}
else {
fac2 = 0;
}
}
if (fac1 || fac2) {
- max = VecLength(vec1)/(fac1 + fac2);
+ max = len_v3(vec1)/(fac1 + fac2);
if (vtd1->max && (*vtd1->max < 0 || max < *vtd1->max)) {
*vtd1->max = max;
}
@@ -880,7 +880,7 @@ static float BME_bevel_get_angle(BME_Mesh *bm, BME_Edge *e, BME_Vert *v) {
}
VECSUB(vec1,v1->co,v->co);
VECSUB(vec2,v2->co,v->co);
- Crossf(vec3,vec1,vec2);
+ cross_v3_v3v3(vec3,vec1,vec2);
l1 = l2;
if (l1->v == v) {
@@ -893,12 +893,12 @@ static float BME_bevel_get_angle(BME_Mesh *bm, BME_Edge *e, BME_Vert *v) {
}
VECSUB(vec1,v1->co,v->co);
VECSUB(vec2,v2->co,v->co);
- Crossf(vec4,vec2,vec1);
+ cross_v3_v3v3(vec4,vec2,vec1);
- Normalize(vec3);
- Normalize(vec4);
+ normalize_v3(vec3);
+ normalize_v3(vec4);
- return Inpf(vec3,vec4);
+ return dot_v3v3(vec3,vec4);
}
static int BME_face_sharededges(BME_Poly *f1, BME_Poly *f2){
BME_Loop *l;
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index cee032f364e..355ea70b178 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -3,12 +3,15 @@
#include
#include
#include
-#include
#include "CCGSubSurf.h"
#include "BLO_sys_types.h" // for intptr_t support
+/* used for normalize_v3 in BLI_math_vector
+ * float.h's FLT_EPSILON causes trouble with subsurf normals - campbell */
+#define EPSILON (1.0e-35f)
+
/***/
typedef unsigned char byte;
@@ -593,7 +596,7 @@ void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int lev
length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.f/length;
no[0] *= invLength;
@@ -1934,7 +1937,7 @@ static void ccgSubSurf__sync(CCGSubSurf *ss) {
length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.0f/length;
no[0] *= invLength;
no[1] *= invLength;
@@ -1993,7 +1996,7 @@ static void ccgSubSurf__sync(CCGSubSurf *ss) {
float *no = FACE_getIFNo(f, lvl, S, x, y);
float length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.0f/length;
no[0] *= invLength;
no[1] *= invLength;
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 11e58203bb3..209e4610c6a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -52,7 +52,7 @@
#include "DNA_space_types.h"
#include "DNA_particle_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
@@ -277,6 +277,26 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me)
*me = tmp;
}
+void DM_to_meshkey(DerivedMesh *dm, Mesh *me, KeyBlock *kb)
+{
+ int a, totvert = dm->getNumVerts(dm);
+ float *fp;
+ MVert *mvert;
+
+ if(totvert==0 || me->totvert==0 || me->totvert!=totvert) return;
+
+ if(kb->data) MEM_freeN(kb->data);
+ kb->data= MEM_callocN(me->key->elemsize*me->totvert, "kb->data");
+ kb->totelem= totvert;
+
+ fp= kb->data;
+ mvert=dm->getVertDataArray(dm, CD_MVERT);
+
+ for(a=0; atotelem; a++, fp+=3, mvert++) {
+ VECCOPY(fp, mvert->co);
+ }
+}
+
void DM_set_only_copy(DerivedMesh *dm, CustomDataMask mask)
{
CustomData_set_only_copy(&dm->vertData, mask);
@@ -619,20 +639,20 @@ static void emDM__calcFaceCent(EditFace *efa, float cent[3], float (*vertexCos)[
{
if (vertexCos) {
VECCOPY(cent, vertexCos[(int) efa->v1->tmp.l]);
- VecAddf(cent, cent, vertexCos[(int) efa->v2->tmp.l]);
- VecAddf(cent, cent, vertexCos[(int) efa->v3->tmp.l]);
- if (efa->v4) VecAddf(cent, cent, vertexCos[(int) efa->v4->tmp.l]);
+ add_v3_v3v3(cent, cent, vertexCos[(int) efa->v2->tmp.l]);
+ add_v3_v3v3(cent, cent, vertexCos[(int) efa->v3->tmp.l]);
+ if (efa->v4) add_v3_v3v3(cent, cent, vertexCos[(int) efa->v4->tmp.l]);
} else {
VECCOPY(cent, efa->v1->co);
- VecAddf(cent, cent, efa->v2->co);
- VecAddf(cent, cent, efa->v3->co);
- if (efa->v4) VecAddf(cent, cent, efa->v4->co);
+ add_v3_v3v3(cent, cent, efa->v2->co);
+ add_v3_v3v3(cent, cent, efa->v3->co);
+ if (efa->v4) add_v3_v3v3(cent, cent, efa->v4->co);
}
if (efa->v4) {
- VecMulf(cent, 0.25f);
+ mul_v3_fl(cent, 0.25f);
} else {
- VecMulf(cent, 0.33333333333f);
+ mul_v3_fl(cent, 0.33333333333f);
}
}
static void emDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *userData, int index, float *co, float *no), void *userData)
@@ -1498,25 +1518,25 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
if(efa->v4) {
float *v4 = vertexCos[(int) efa->v4->tmp.l];
- CalcNormFloat4(v1, v2, v3, v4, no);
- VecAddf(emdm->vertexNos[(int) efa->v4->tmp.l], emdm->vertexNos[(int) efa->v4->tmp.l], no);
+ normal_quad_v3( no,v1, v2, v3, v4);
+ add_v3_v3v3(emdm->vertexNos[(int) efa->v4->tmp.l], emdm->vertexNos[(int) efa->v4->tmp.l], no);
}
else {
- CalcNormFloat(v1, v2, v3, no);
+ normal_tri_v3( no,v1, v2, v3);
}
- VecAddf(emdm->vertexNos[(int) efa->v1->tmp.l], emdm->vertexNos[(int) efa->v1->tmp.l], no);
- VecAddf(emdm->vertexNos[(int) efa->v2->tmp.l], emdm->vertexNos[(int) efa->v2->tmp.l], no);
- VecAddf(emdm->vertexNos[(int) efa->v3->tmp.l], emdm->vertexNos[(int) efa->v3->tmp.l], no);
+ add_v3_v3v3(emdm->vertexNos[(int) efa->v1->tmp.l], emdm->vertexNos[(int) efa->v1->tmp.l], no);
+ add_v3_v3v3(emdm->vertexNos[(int) efa->v2->tmp.l], emdm->vertexNos[(int) efa->v2->tmp.l], no);
+ add_v3_v3v3(emdm->vertexNos[(int) efa->v3->tmp.l], emdm->vertexNos[(int) efa->v3->tmp.l], no);
}
for(i=0, eve= em->verts.first; eve; i++, eve=eve->next) {
float *no = emdm->vertexNos[i];
/* following Mesh convention; we use vertex coordinate itself
* for normal in this case */
- if (Normalize(no)==0.0) {
+ if (normalize_v3(no)==0.0) {
VECCOPY(no, vertexCos[i]);
- Normalize(no);
+ normalize_v3(no);
}
}
}
@@ -2482,7 +2502,7 @@ int editmesh_get_first_deform_matrices(Object *ob, EditMesh *em, float (**deform
defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats");
for(a=0; adeformMatricesEM(md, ob, em, dm, deformedVerts, defmats,
@@ -2554,11 +2574,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
if (mf->v4) {
v4= &mvert[mf->v4];
- CalcNormFloat4(v4->co, v3->co, v2->co, v1->co, fno);
+ normal_quad_v3( fno,v4->co, v3->co, v2->co, v1->co);
}
else {
v4= NULL;
- CalcNormFloat(v3->co, v2->co, v1->co, fno);
+ normal_tri_v3( fno,v3->co, v2->co, v1->co);
}
if(mtface) {
@@ -2569,11 +2589,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
}
else {
uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
- spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
- spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
+ map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+ map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+ map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
if(v4)
- spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
+ map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang);
@@ -2603,11 +2623,11 @@ void DM_add_tangent_layer(DerivedMesh *dm)
}
else {
uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3];
- spheremap(orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2], &uv[0][0], &uv[0][1]);
- spheremap(orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2], &uv[1][0], &uv[1][1]);
- spheremap(orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2], &uv[2][0], &uv[2][1]);
+ map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]);
+ map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]);
+ map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]);
if(len==4)
- spheremap(orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2], &uv[3][0], &uv[3][1]);
+ map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]);
}
mf_vi[0]= mf->v1;
@@ -2619,7 +2639,7 @@ void DM_add_tangent_layer(DerivedMesh *dm)
vtang= find_vertex_tangent(vtangents[mf_vi[j]], mtface ? tf->uv[j] : uv[j]);
VECCOPY(tangent[j], vtang);
- Normalize(tangent[j]);
+ normalize_v3(tangent[j]);
}
}
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 2505a3a70ac..ace1292f813 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -62,9 +62,11 @@
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_utildefines.h"
+#include "BKE_idprop.h"
+
#include "BIK_api.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
@@ -151,7 +153,6 @@ void make_local_action(bAction *act)
}
}
-
void free_action (bAction *act)
{
/* sanity check */
@@ -453,7 +454,9 @@ bPoseChannel *verify_pose_channel(bPose* pose, const char* name)
chan->limitmax[0]= chan->limitmax[1]= chan->limitmax[2]= 180.0f;
chan->stiffness[0]= chan->stiffness[1]= chan->stiffness[2]= 0.0f;
chan->ikrotweight = chan->iklinweight = 0.0f;
- Mat4One(chan->constinv);
+ unit_m4(chan->constinv);
+
+ chan->protectflag = OB_LOCK_ROT4D; /* lock by components by default */
BLI_addtail(&pose->chanbase, chan);
@@ -516,17 +519,22 @@ void copy_pose (bPose **dst, bPose *src, int copycon)
outPose->ikdata = NULL;
outPose->ikparam = MEM_dupallocN(src->ikparam);
- // TODO: rename this argument...
- if (copycon) {
- for (pchan=outPose->chanbase.first; pchan; pchan=pchan->next) {
+ for (pchan=outPose->chanbase.first; pchan; pchan=pchan->next) {
+ // TODO: rename this argument...
+ if (copycon) {
copy_constraints(&listb, &pchan->constraints); // copy_constraints NULLs listb
pchan->constraints= listb;
pchan->path= NULL;
}
- /* for now, duplicate Bone Groups too when doing this */
- BLI_duplicatelist(&outPose->agroups, &src->agroups);
+ if(pchan->prop) {
+ pchan->prop= IDP_CopyProperty(pchan->prop);
+ }
}
+
+ /* for now, duplicate Bone Groups too when doing this */
+ if(copycon)
+ BLI_duplicatelist(&outPose->agroups, &src->agroups);
*dst=outPose;
}
@@ -564,16 +572,27 @@ void init_pose_ikparam(bPose *pose)
}
}
+void free_pose_channel(bPoseChannel *pchan)
+{
+ if (pchan->path)
+ MEM_freeN(pchan->path);
+
+ free_constraints(&pchan->constraints);
+
+ if(pchan->prop) {
+ IDP_FreeProperty(pchan->prop);
+ MEM_freeN(pchan->prop);
+ }
+}
+
void free_pose_channels(bPose *pose)
{
bPoseChannel *pchan;
if (pose->chanbase.first) {
- for (pchan = pose->chanbase.first; pchan; pchan=pchan->next){
- if (pchan->path)
- MEM_freeN(pchan->path);
- free_constraints(&pchan->constraints);
- }
+ for (pchan = pose->chanbase.first; pchan; pchan=pchan->next)
+ free_pose_channel(pchan);
+
BLI_freelistN(&pose->chanbase);
}
}
@@ -611,17 +630,59 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
pchan->rotAngle= chan->rotAngle;
QUATCOPY(pchan->quat, chan->quat);
pchan->rotmode= chan->rotmode;
- Mat4CpyMat4(pchan->chan_mat, (float(*)[4])chan->chan_mat);
- Mat4CpyMat4(pchan->pose_mat, (float(*)[4])chan->pose_mat);
+ copy_m4_m4(pchan->chan_mat, (float(*)[4])chan->chan_mat);
+ copy_m4_m4(pchan->pose_mat, (float(*)[4])chan->pose_mat);
pchan->flag= chan->flag;
con= chan->constraints.first;
- for(pcon= pchan->constraints.first; pcon; pcon= pcon->next, con= con->next) {
+ for(pcon= pchan->constraints.first; pcon && con; pcon= pcon->next, con= con->next) {
pcon->enforce= con->enforce;
pcon->headtail= con->headtail;
}
}
+/* makes copies of internal data, unlike copy_pose_channel_data which only
+ * copies the pose state.
+ * hint: use when copying bones in editmode (on returned value from verify_pose_channel) */
+void duplicate_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *pchan_from)
+{
+ /* copy transform locks */
+ pchan->protectflag = pchan_from->protectflag;
+
+ /* copy rotation mode */
+ pchan->rotmode = pchan_from->rotmode;
+
+ /* copy bone group */
+ pchan->agrp_index= pchan_from->agrp_index;
+
+ /* ik (dof) settings */
+ pchan->ikflag = pchan_from->ikflag;
+ VECCOPY(pchan->limitmin, pchan_from->limitmin);
+ VECCOPY(pchan->limitmax, pchan_from->limitmax);
+ VECCOPY(pchan->stiffness, pchan_from->stiffness);
+ pchan->ikstretch= pchan_from->ikstretch;
+ pchan->ikrotweight= pchan_from->ikrotweight;
+ pchan->iklinweight= pchan_from->iklinweight;
+
+ /* constraints */
+ copy_constraints(&pchan->constraints, &pchan_from->constraints);
+
+ /* id-properties */
+ if(pchan->prop) {
+ /* unlikely but possible it exists */
+ IDP_FreeProperty(pchan->prop);
+ MEM_freeN(pchan->prop);
+ pchan->prop= NULL;
+ }
+ if(pchan_from->prop) {
+ pchan->prop= IDP_CopyProperty(pchan_from->prop);
+ }
+
+ /* custom shape */
+ pchan->custom= pchan_from->custom;
+}
+
+
/* checks for IK constraint, Spline IK, and also for Follow-Path constraint.
* can do more constraints flags later
*/
@@ -868,7 +929,7 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
/* build PointerRNA from provided data to obtain the paths to use */
if (pchan)
- RNA_pointer_create((ID *)ob, &RNA_PoseChannel, pchan, &ptr);
+ RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan, &ptr);
else if (ob)
RNA_id_pointer_create((ID *)ob, &ptr);
else
@@ -1013,8 +1074,8 @@ void copy_pose_result(bPose *to, bPose *from)
for(pchanfrom= from->chanbase.first; pchanfrom; pchanfrom= pchanfrom->next) {
pchanto= get_pose_channel(to, pchanfrom->name);
if(pchanto) {
- Mat4CpyMat4(pchanto->pose_mat, pchanfrom->pose_mat);
- Mat4CpyMat4(pchanto->chan_mat, pchanfrom->chan_mat);
+ copy_m4_m4(pchanto->pose_mat, pchanfrom->pose_mat);
+ copy_m4_m4(pchanto->chan_mat, pchanfrom->chan_mat);
/* used for local constraints */
VECCOPY(pchanto->loc, pchanfrom->loc);
@@ -1024,7 +1085,10 @@ void copy_pose_result(bPose *to, bPose *from)
VECCOPY(pchanto->pose_head, pchanfrom->pose_head);
VECCOPY(pchanto->pose_tail, pchanfrom->pose_tail);
+
+ pchanto->rotmode= pchanfrom->rotmode;
pchanto->flag= pchanfrom->flag;
+ pchanto->protectflag= pchanfrom->protectflag;
}
}
}
@@ -1040,12 +1104,14 @@ void what_does_obaction (Scene *scene, Object *ob, Object *workob, bPose *pose,
clear_workob(workob);
/* init workob */
- Mat4CpyMat4(workob->obmat, ob->obmat);
- Mat4CpyMat4(workob->parentinv, ob->parentinv);
- Mat4CpyMat4(workob->constinv, ob->constinv);
+ copy_m4_m4(workob->obmat, ob->obmat);
+ copy_m4_m4(workob->parentinv, ob->parentinv);
+ copy_m4_m4(workob->constinv, ob->constinv);
workob->parent= ob->parent;
workob->track= ob->track;
-
+
+ workob->rotmode= ob->rotmode;
+
workob->trackflag= ob->trackflag;
workob->upflag= ob->upflag;
@@ -1109,7 +1175,7 @@ static void blend_pose_strides(bPose *dst, bPose *src, float srcweight, short mo
dstweight = 1.0F;
}
- VecLerpf(dst->stride_offset, dst->stride_offset, src->stride_offset, srcweight);
+ interp_v3_v3v3(dst->stride_offset, dst->stride_offset, src->stride_offset, srcweight);
}
@@ -1169,27 +1235,27 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src,
execute_action_ipo(achan, &pchan);
/* store offset that moves src to location of pchan */
- VecSubf(vec, dpchan->loc, pchan.loc);
+ sub_v3_v3v3(vec, dpchan->loc, pchan.loc);
- Mat4Mul3Vecfl(dpchan->bone->arm_mat, vec);
+ mul_mat3_m4_v3(dpchan->bone->arm_mat, vec);
}
}
else {
/* store offset that moves src to location of dst */
- VecSubf(vec, dpchan->loc, spchan->loc);
- Mat4Mul3Vecfl(dpchan->bone->arm_mat, vec);
+ sub_v3_v3v3(vec, dpchan->loc, spchan->loc);
+ mul_mat3_m4_v3(dpchan->bone->arm_mat, vec);
}
/* if blending, we only add with factor scrweight */
- VecMulf(vec, srcweight);
+ mul_v3_fl(vec, srcweight);
- VecAddf(dst->cyclic_offset, dst->cyclic_offset, vec);
+ add_v3_v3v3(dst->cyclic_offset, dst->cyclic_offset, vec);
}
}
}
- VecAddf(dst->cyclic_offset, dst->cyclic_offset, src->cyclic_offset);
+ add_v3_v3v3(dst->cyclic_offset, dst->cyclic_offset, src->cyclic_offset);
}
/* added "sizecorr" here, to allow armatures to be scaled and still have striding.
@@ -1249,14 +1315,14 @@ static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip
if (pdistNewNormalized <= 1) {
// search for correction in positive path-direction
where_on_path(ob, pdistNewNormalized, vec2, dir); /* vec needs size 4 */
- VecSubf(stride_offset, vec2, vec1);
+ sub_v3_v3v3(stride_offset, vec2, vec1);
}
else {
// we reached the end of the path, search backwards instead
where_on_path(ob, (pathdist-pdist)/path->totdist, vec2, dir); /* vec needs size 4 */
- VecSubf(stride_offset, vec1, vec2);
+ sub_v3_v3v3(stride_offset, vec1, vec2);
}
- Mat4Mul3Vecfl(ob->obmat, stride_offset);
+ mul_mat3_m4_v3(ob->obmat, stride_offset);
return striptime;
}
}
@@ -1295,10 +1361,10 @@ static void cyclic_offs_bone(Object *ob, bPose *pose, bActionStrip *strip, float
}
if(foundvert) {
/* bring it into armature space */
- VecSubf(min, max, min);
+ sub_v3_v3v3(min, max, min);
bone= get_named_bone(ob->data, strip->offs_bone); /* weak */
if(bone) {
- Mat4Mul3Vecfl(bone->arm_mat, min);
+ mul_mat3_m4_v3(bone->arm_mat, min);
/* dominant motion, cyclic_offset was cleared in rest_pose */
if (strip->flag & (ACTSTRIP_CYCLIC_USEX | ACTSTRIP_CYCLIC_USEY | ACTSTRIP_CYCLIC_USEZ)) {
@@ -1549,7 +1615,7 @@ static void do_nla(Scene *scene, Object *ob, int blocktype)
}
else if(blocktype==ID_AR) {
/* apply stride offset to object */
- VecAddf(ob->obmat[3], ob->obmat[3], ob->pose->stride_offset);
+ add_v3_v3v3(ob->obmat[3], ob->obmat[3], ob->pose->stride_offset);
}
/* free */
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 5cae2418e89..6b8b604cb94 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -35,7 +35,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_rand.h"
#include "DNA_listBase.h"
@@ -134,11 +134,11 @@ void calc_curvepath(Object *ob)
for(a=0; avec, bevp->vec);
+ sub_v3_v3v3(xyz, bevpfirst->vec, bevp->vec);
else
- VecSubf(xyz, (bevp+1)->vec, bevp->vec);
+ sub_v3_v3v3(xyz, (bevp+1)->vec, bevp->vec);
- *fp= *(fp-1)+VecLength(xyz);
+ *fp= *(fp-1)+len_v3(xyz);
bevp++;
}
@@ -176,11 +176,11 @@ void calc_curvepath(Object *ob)
fac1= fac2/fac1;
fac2= 1.0f-fac1;
- VecLerpf(pp->vec, bevp->vec, bevpn->vec, fac2);
+ interp_v3_v3v3(pp->vec, bevp->vec, bevpn->vec, fac2);
pp->vec[3]= fac1*bevp->alfa + fac2*bevpn->alfa;
pp->radius= fac1*bevp->radius + fac2*bevpn->radius;
- QuatInterpol(pp->quat, bevp->quat, bevpn->quat, fac2);
- NormalQuat(pp->quat);
+ interp_qt_qtqt(pp->quat, bevp->quat, bevpn->quat, fac2);
+ normalize_qt(pp->quat);
pp++;
}
@@ -250,17 +250,13 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir, float *quat,
/* note, commented out for follow constraint */
//if(cu->flag & CU_FOLLOW) {
-
+
key_curve_tangent_weights(1.0f-fac, data, KEY_BSPLINE);
-
- dir[0]= data[0]*p0->vec[0] + data[1]*p1->vec[0] + data[2]*p2->vec[0] + data[3]*p3->vec[0] ;
- dir[1]= data[0]*p0->vec[1] + data[1]*p1->vec[1] + data[2]*p2->vec[1] + data[3]*p3->vec[1] ;
- dir[2]= data[0]*p0->vec[2] + data[1]*p1->vec[2] + data[2]*p2->vec[2] + data[3]*p3->vec[2] ;
-
+
+ interp_v3_v3v3v3v3(dir, p0->vec, p1->vec, p2->vec, p3->vec, data);
+
/* make compatible with vectoquat */
- dir[0]= -dir[0];
- dir[1]= -dir[1];
- dir[2]= -dir[2];
+ negate_v3(dir);
//}
nu= cu->nurb.first;
@@ -284,20 +280,20 @@ int where_on_path(Object *ob, float ctime, float *vec, float *dir, float *quat,
* to more then one index in data which can give divide by zero error */
/*
totfac= data[0]+data[1];
- if(totfac>0.000001) QuatInterpol(q1, p0->quat, p1->quat, data[0] / totfac);
+ if(totfac>0.000001) interp_qt_qtqt(q1, p0->quat, p1->quat, data[0] / totfac);
else QUATCOPY(q1, p1->quat);
- NormalQuat(q1);
+ normalize_qt(q1);
totfac= data[2]+data[3];
- if(totfac>0.000001) QuatInterpol(q2, p2->quat, p3->quat, data[2] / totfac);
+ if(totfac>0.000001) interp_qt_qtqt(q2, p2->quat, p3->quat, data[2] / totfac);
else QUATCOPY(q1, p3->quat);
- NormalQuat(q2);
+ normalize_qt(q2);
totfac = data[0]+data[1]+data[2]+data[3];
- if(totfac>0.000001) QuatInterpol(quat, q1, q2, (data[0]+data[1]) / totfac);
+ if(totfac>0.000001) interp_qt_qtqt(quat, q1, q2, (data[0]+data[1]) / totfac);
else QUATCOPY(quat, q2);
- NormalQuat(quat);
+ normalize_qt(quat);
*/
// XXX - find some way to make quat interpolation work correctly, above code fails in rare but nasty cases.
QUATCOPY(quat, p1->quat);
@@ -317,8 +313,8 @@ static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], i
BLI_addtail(lb, dob);
dob->ob= ob;
- Mat4CpyMat4(dob->mat, mat);
- Mat4CpyMat4(dob->omat, ob->obmat);
+ copy_m4_m4(dob->mat, mat);
+ copy_m4_m4(dob->omat, ob->obmat);
dob->origlay= ob->lay;
dob->index= index;
dob->type= type;
@@ -352,20 +348,20 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, i
/* Group Dupli Offset, should apply after everything else */
if (group->dupli_ofs[0] || group->dupli_ofs[1] || group->dupli_ofs[2]) {
- Mat4CpyMat4(tmat, go->ob->obmat);
- VecSubf(tmat[3], tmat[3], group->dupli_ofs);
- Mat4MulMat4(mat, tmat, ob->obmat);
+ copy_m4_m4(tmat, go->ob->obmat);
+ sub_v3_v3v3(tmat[3], tmat[3], group->dupli_ofs);
+ mul_m4_m4m4(mat, tmat, ob->obmat);
} else {
- Mat4MulMat4(mat, go->ob->obmat, ob->obmat);
+ mul_m4_m4m4(mat, go->ob->obmat, ob->obmat);
}
dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0, OB_DUPLIGROUP, animated);
dob->no_draw= (dob->origlay & group->layer)==0;
if(go->ob->transflag & OB_DUPLI) {
- Mat4CpyMat4(dob->ob->obmat, dob->mat);
+ copy_m4_m4(dob->ob->obmat, dob->mat);
object_duplilist_recursive((ID *)group, scene, go->ob, lb, ob->obmat, level+1, animated);
- Mat4CpyMat4(dob->ob->obmat, dob->omat);
+ copy_m4_m4(dob->ob->obmat, dob->omat);
}
}
}
@@ -402,7 +398,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
#endif // XXX old animation system
where_is_object_time(scene, ob, (float)scene->r.cfra);
dob= new_dupli_object(lb, ob, ob->obmat, ob->lay, scene->r.cfra, OB_DUPLIFRAMES, animated);
- Mat4CpyMat4(dob->omat, copyob.obmat);
+ copy_m4_m4(dob->omat, copyob.obmat);
}
}
@@ -430,11 +426,11 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
float vec[3], q2[4], mat[3][3], tmat[4][4], obmat[4][4];
VECCOPY(vec, co);
- Mat4MulVecfl(vdd->pmat, vec);
- VecSubf(vec, vec, vdd->pmat[3]);
- VecAddf(vec, vec, vdd->obmat[3]);
+ mul_m4_v3(vdd->pmat, vec);
+ sub_v3_v3v3(vec, vec, vdd->pmat[3]);
+ add_v3_v3v3(vec, vec, vdd->obmat[3]);
- Mat4CpyMat4(obmat, vdd->obmat);
+ copy_m4_m4(obmat, vdd->obmat);
VECCOPY(obmat[3], vec);
if(vdd->par->transflag & OB_DUPLIROT) {
@@ -445,11 +441,11 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
vec[0]= -no_s[0]; vec[1]= -no_s[1]; vec[2]= -no_s[2];
}
- vectoquat(vec, vdd->ob->trackflag, vdd->ob->upflag, q2);
+ vec_to_quat( q2,vec, vdd->ob->trackflag, vdd->ob->upflag);
- QuatToMat3(q2, mat);
- Mat4CpyMat4(tmat, obmat);
- Mat4MulMat43(obmat, tmat, mat);
+ quat_to_mat3( mat,q2);
+ copy_m4_m4(tmat, obmat);
+ mul_m4_m4m3(obmat, tmat, mat);
}
dob= new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index, OB_DUPLIVERTS, vdd->animated);
if(vdd->orco)
@@ -457,10 +453,10 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n
if(vdd->ob->transflag & OB_DUPLI) {
float tmpmat[4][4];
- Mat4CpyMat4(tmpmat, vdd->ob->obmat);
- Mat4CpyMat4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
+ copy_m4_m4(tmpmat, vdd->ob->obmat);
+ copy_m4_m4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
object_duplilist_recursive((ID *)vdd->id, vdd->scene, vdd->ob, vdd->lb, obmat, vdd->level+1, vdd->animated);
- Mat4CpyMat4(vdd->ob->obmat, tmpmat);
+ copy_m4_m4(vdd->ob->obmat, tmpmat);
}
}
@@ -478,7 +474,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
float vec[3], no[3], pmat[4][4];
int lay, totvert, a, oblay;
- Mat4CpyMat4(pmat, par->obmat);
+ copy_m4_m4(pmat, par->obmat);
/* simple preventing of too deep nested groups */
if(level>MAX_DUPLI_RECUR) return;
@@ -533,9 +529,9 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
*/
if(par_space_mat)
- Mat4MulMat4(vdd.obmat, ob->obmat, par_space_mat);
+ mul_m4_m4m4(vdd.obmat, ob->obmat, par_space_mat);
else
- Mat4CpyMat4(vdd.obmat, ob->obmat);
+ copy_m4_m4(vdd.obmat, ob->obmat);
vdd.id= id;
vdd.level= level;
@@ -544,7 +540,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
vdd.ob= ob;
vdd.scene= scene;
vdd.par= par;
- Mat4CpyMat4(vdd.pmat, pmat);
+ copy_m4_m4(vdd.pmat, pmat);
/* mballs have a different dupli handling */
if(ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
@@ -596,7 +592,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
/* simple preventing of too deep nested groups */
if(level>MAX_DUPLI_RECUR) return;
- Mat4CpyMat4(pmat, par->obmat);
+ copy_m4_m4(pmat, par->obmat);
em = BKE_mesh_get_editmesh(me);
if(em) {
@@ -664,11 +660,11 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
when par_space_mat is NULL ob->obmat can be used instead of ob__obmat
*/
if(par_space_mat)
- Mat4MulMat4(ob__obmat, ob->obmat, par_space_mat);
+ mul_m4_m4m4(ob__obmat, ob->obmat, par_space_mat);
else
- Mat4CpyMat4(ob__obmat, ob->obmat);
+ copy_m4_m4(ob__obmat, ob->obmat);
- Mat3CpyMat4(imat, ob->parentinv);
+ copy_m3_m4(imat, ob->parentinv);
/* mballs have a different dupli handling */
if(ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
@@ -686,34 +682,34 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
/* translation */
if(v4)
- CalcCent4f(cent, v1, v2, v3, v4);
+ cent_quad_v3(cent, v1, v2, v3, v4);
else
- CalcCent3f(cent, v1, v2, v3);
- Mat4MulVecfl(pmat, cent);
+ cent_tri_v3(cent, v1, v2, v3);
+ mul_m4_v3(pmat, cent);
- VecSubf(cent, cent, pmat[3]);
- VecAddf(cent, cent, ob__obmat[3]);
+ sub_v3_v3v3(cent, cent, pmat[3]);
+ add_v3_v3v3(cent, cent, ob__obmat[3]);
- Mat4CpyMat4(obmat, ob__obmat);
+ copy_m4_m4(obmat, ob__obmat);
VECCOPY(obmat[3], cent);
/* rotation */
- triatoquat(v1, v2, v3, quat);
- QuatToMat3(quat, mat);
+ tri_to_quat( quat,v1, v2, v3);
+ quat_to_mat3( mat,quat);
/* scale */
if(par->transflag & OB_DUPLIFACES_SCALE) {
- float size= v4?AreaQ3Dfl(v1, v2, v3, v4):AreaT3Dfl(v1, v2, v3);
+ float size= v4? area_quad_v3(v1, v2, v3, v4): area_tri_v3(v1, v2, v3);
size= sqrt(size) * par->dupfacesca;
- Mat3MulFloat(mat[0], size);
+ mul_m3_fl(mat, size);
}
- Mat3CpyMat3(mat3, mat);
- Mat3MulMat3(mat, imat, mat3);
+ copy_m3_m3(mat3, mat);
+ mul_m3_m3m3(mat, imat, mat3);
- Mat4CpyMat4(tmat, obmat);
- Mat4MulMat43(obmat, tmat, mat);
+ copy_m4_m4(tmat, obmat);
+ mul_m4_m4m3(obmat, tmat, mat);
dob= new_dupli_object(lb, ob, obmat, lay, a, OB_DUPLIFACES, animated);
if(G.rendering) {
@@ -744,10 +740,10 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
if(ob->transflag & OB_DUPLI) {
float tmpmat[4][4];
- Mat4CpyMat4(tmpmat, ob->obmat);
- Mat4CpyMat4(ob->obmat, obmat); /* pretend we are really this mat */
+ copy_m4_m4(tmpmat, ob->obmat);
+ copy_m4_m4(ob->obmat, obmat); /* pretend we are really this mat */
object_duplilist_recursive((ID *)id, scene, ob, lb, ob->obmat, level+1, animated);
- Mat4CpyMat4(ob->obmat, tmpmat);
+ copy_m4_m4(ob->obmat, tmpmat);
}
}
@@ -935,22 +931,22 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
if(psys_get_particle_state(&sim, a, &state, 0) == 0)
continue;
- QuatToMat4(state.rot, pamat);
+ quat_to_mat4( pamat,state.rot);
VECCOPY(pamat[3], state.co);
pamat[3][3]= 1.0f;
}
if(part->ren_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
- Mat4MulMat4(tmat, oblist[b]->obmat, pamat);
- Mat4MulFloat3((float *)tmat, size*scale);
+ mul_m4_m4m4(tmat, oblist[b]->obmat, pamat);
+ mul_mat3_m4_fl(tmat, size*scale);
if(par_space_mat)
- Mat4MulMat4(mat, tmat, par_space_mat);
+ mul_m4_m4m4(mat, tmat, par_space_mat);
else
- Mat4CpyMat4(mat, tmat);
+ copy_m4_m4(mat, tmat);
dob= new_dupli_object(lb, go->ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
- Mat4CpyMat4(dob->omat, obcopylist[b].obmat);
+ copy_m4_m4(dob->omat, obcopylist[b].obmat);
if(G.rendering)
psys_get_dupli_texture(par, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
@@ -962,21 +958,21 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
VECCOPY(vec, obmat[3]);
obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f;
- Mat4CpyMat4(mat, pamat);
+ copy_m4_m4(mat, pamat);
- Mat4MulMat4(tmat, obmat, mat);
- Mat4MulFloat3((float *)tmat, size*scale);
+ mul_m4_m4m4(tmat, obmat, mat);
+ mul_mat3_m4_fl(tmat, size*scale);
if(part->draw & PART_DRAW_GLOBAL_OB)
VECADD(tmat[3], tmat[3], vec);
if(par_space_mat)
- Mat4MulMat4(mat, tmat, par_space_mat);
+ mul_m4_m4m4(mat, tmat, par_space_mat);
else
- Mat4CpyMat4(mat, tmat);
+ copy_m4_m4(mat, tmat);
dob= new_dupli_object(lb, ob, mat, ob->lay, counter, OB_DUPLIPARTS, animated);
- Mat4CpyMat4(dob->omat, oldobmat);
+ copy_m4_m4(dob->omat, oldobmat);
if(G.rendering)
psys_get_dupli_texture(par, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
@@ -1037,7 +1033,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
/* simple preventing of too deep nested groups */
if(level>MAX_DUPLI_RECUR) return;
- Mat4CpyMat4(pmat, par->obmat);
+ copy_m4_m4(pmat, par->obmat);
/* in par the family name is stored, use this to find the other objects */
@@ -1062,9 +1058,9 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
vec[1]= fsize*(ct->yof - yof);
vec[2]= 0.0;
- Mat4MulVecfl(pmat, vec);
+ mul_m4_v3(pmat, vec);
- Mat4CpyMat4(obmat, par->obmat);
+ copy_m4_m4(obmat, par->obmat);
VECCOPY(obmat[3], vec);
new_dupli_object(lb, ob, obmat, par->lay, a, OB_DUPLIVERTS, animated);
@@ -1122,7 +1118,7 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
if (level==0) {
for(dob= duplilist->first; dob; dob= dob->next)
if(dob->type == OB_DUPLIGROUP)
- Mat4CpyMat4(dob->ob->obmat, dob->mat);
+ copy_m4_m4(dob->ob->obmat, dob->mat);
}
}
}
@@ -1143,7 +1139,7 @@ void free_object_duplilist(ListBase *lb)
for(dob= lb->first; dob; dob= dob->next) {
dob->ob->lay= dob->origlay;
- Mat4CpyMat4(dob->ob->obmat, dob->omat);
+ copy_m4_m4(dob->ob->obmat, dob->omat);
}
BLI_freelistN(lb);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 61e754ffbec..a6f733708c7 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -36,7 +36,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_dynstr.h"
#include "DNA_anim_types.h"
@@ -353,7 +353,7 @@ static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName
/* Fix all RNA-Paths in the AnimData block used by the given ID block
* NOTE: it is assumed that the structure we're replacing is <["><"]>
- * i.e. pose.pose_channels["Bone"]
+ * i.e. pose.bones["Bone"]
*/
void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, char *oldName, char *newName)
{
@@ -388,7 +388,7 @@ void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, c
/* Fix all RNA-Paths throughout the database (directly access the Global.main version)
* NOTE: it is assumed that the structure we're replacing is <["><"]>
- * i.e. pose.pose_channels["Bone"]
+ * i.e. pose.bones["Bone"]
*/
void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newName)
{
@@ -697,20 +697,26 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
switch (RNA_property_type(prop))
{
case PROP_BOOLEAN:
- if (RNA_property_array_length(&new_ptr, prop))
- RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value);
+ if (RNA_property_array_length(&new_ptr, prop)) {
+ if (RNA_property_editable_index(&new_ptr, prop, array_index))
+ RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value);
+ }
else
RNA_property_boolean_set(&new_ptr, prop, (int)value);
break;
case PROP_INT:
- if (RNA_property_array_length(&new_ptr, prop))
- RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
+ if (RNA_property_array_length(&new_ptr, prop)){
+ if (RNA_property_editable_index(&new_ptr, prop, array_index))
+ RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
+ }
else
RNA_property_int_set(&new_ptr, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(&new_ptr, prop))
- RNA_property_float_set_index(&new_ptr, prop, array_index, value);
+ if (RNA_property_array_length(&new_ptr, prop)) {
+ if (RNA_property_editable_index(&new_ptr, prop, array_index))
+ RNA_property_float_set_index(&new_ptr, prop, array_index, value);
+ }
else
RNA_property_float_set(&new_ptr, prop, value);
break;
@@ -1434,20 +1440,26 @@ void nladata_flush_channels (ListBase *channels)
switch (RNA_property_type(prop))
{
case PROP_BOOLEAN:
- if (RNA_property_array_length(ptr, prop))
- RNA_property_boolean_set_index(ptr, prop, array_index, (int)value);
+ if (RNA_property_array_length(ptr, prop)) {
+ if (RNA_property_editable_index(ptr, prop, array_index))
+ RNA_property_boolean_set_index(ptr, prop, array_index, (int)value);
+ }
else
RNA_property_boolean_set(ptr, prop, (int)value);
break;
case PROP_INT:
- if (RNA_property_array_length(ptr, prop))
- RNA_property_int_set_index(ptr, prop, array_index, (int)value);
+ if (RNA_property_array_length(ptr, prop)) {
+ if (RNA_property_editable_index(ptr, prop, array_index))
+ RNA_property_int_set_index(ptr, prop, array_index, (int)value);
+ }
else
RNA_property_int_set(ptr, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(ptr, prop))
- RNA_property_float_set_index(ptr, prop, array_index, value);
+ if (RNA_property_array_length(ptr, prop)) {
+ if (RNA_property_editable_index(ptr, prop, array_index))
+ RNA_property_float_set_index(ptr, prop, array_index, value);
+ }
else
RNA_property_float_set(ptr, prop, value);
break;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 25151714569..418c9f00596 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -34,9 +34,10 @@
#include "MEM_guardedalloc.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
+#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_action_types.h"
#include "DNA_curve_types.h"
@@ -49,6 +50,7 @@
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
+#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_anim.h"
@@ -127,6 +129,12 @@ void free_armature(bArmature *arm)
freeSketch(arm->sketch);
arm->sketch = NULL;
}
+
+ /* free animation data */
+ if (arm->adt) {
+ BKE_free_animdata(&arm->id);
+ arm->adt= NULL;
+ }
}
}
@@ -482,7 +490,7 @@ static void equalize_bezier(float *data, int desired)
pdist[0]= 0.0f;
for(a=0, fp= data; apose_mat[0]);
- scale[1]= VecLength(pchan->pose_mat[1]);
- scale[2]= VecLength(pchan->pose_mat[2]);
+ scale[0]= len_v3(pchan->pose_mat[0]);
+ scale[1]= len_v3(pchan->pose_mat[1]);
+ scale[2]= len_v3(pchan->pose_mat[2]);
if(fabs(scale[0] - scale[1]) > 1e-6f || fabs(scale[1] - scale[2]) > 1e-6f) {
- Mat4One(scalemat);
+ unit_m4(scalemat);
scalemat[0][0]= scale[0];
scalemat[1][1]= scale[1];
scalemat[2][2]= scale[2];
- Mat4Invert(iscalemat, scalemat);
+ invert_m4_m4(iscalemat, scalemat);
length *= scale[1];
doscale = 1;
@@ -564,15 +572,15 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
last point = (0, length, 0) */
if(rest) {
- Mat4Invert(imat, pchan->bone->arm_mat);
+ invert_m4_m4(imat, pchan->bone->arm_mat);
}
else if(doscale) {
- Mat4CpyMat4(posemat, pchan->pose_mat);
- Mat4Ortho(posemat);
- Mat4Invert(imat, posemat);
+ copy_m4_m4(posemat, pchan->pose_mat);
+ normalize_m4(posemat);
+ invert_m4_m4(imat, posemat);
}
else
- Mat4Invert(imat, pchan->pose_mat);
+ invert_m4_m4(imat, pchan->pose_mat);
if(prev) {
float difmat[4][4], result[3][3], imat3[3][3];
@@ -582,7 +590,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
VECCOPY(h1, prev->bone->arm_head)
else
VECCOPY(h1, prev->pose_head)
- Mat4MulVecfl(imat, h1);
+ mul_m4_v3(imat, h1);
if(prev->bone->segments>1) {
/* if previous bone is B-bone too, use average handle direction */
@@ -590,21 +598,21 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
roll1= 0.0f;
}
- Normalize(h1);
- VecMulf(h1, -hlength1);
+ normalize_v3(h1);
+ mul_v3_fl(h1, -hlength1);
if(prev->bone->segments==1) {
/* find the previous roll to interpolate */
if(rest)
- Mat4MulMat4(difmat, prev->bone->arm_mat, imat);
+ mul_m4_m4m4(difmat, prev->bone->arm_mat, imat);
else
- Mat4MulMat4(difmat, prev->pose_mat, imat);
- Mat3CpyMat4(result, difmat); // the desired rotation at beginning of next bone
+ mul_m4_m4m4(difmat, prev->pose_mat, imat);
+ copy_m3_m4(result, difmat); // the desired rotation at beginning of next bone
vec_roll_to_mat3(h1, 0.0f, mat3); // the result of vec_roll without roll
- Mat3Inv(imat3, mat3);
- Mat3MulMat3(mat3, result, imat3); // the matrix transforming vec_roll to desired roll
+ invert_m3_m3(imat3, mat3);
+ mul_m3_m3m3(mat3, result, imat3); // the matrix transforming vec_roll to desired roll
roll1= (float)atan2(mat3[2][0], mat3[2][2]);
}
@@ -621,28 +629,28 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
VECCOPY(h2, next->bone->arm_tail)
else
VECCOPY(h2, next->pose_tail)
- Mat4MulVecfl(imat, h2);
+ mul_m4_v3(imat, h2);
/* if next bone is B-bone too, use average handle direction */
if(next->bone->segments>1);
else h2[1]-= length;
- Normalize(h2);
+ normalize_v3(h2);
/* find the next roll to interpolate as well */
if(rest)
- Mat4MulMat4(difmat, next->bone->arm_mat, imat);
+ mul_m4_m4m4(difmat, next->bone->arm_mat, imat);
else
- Mat4MulMat4(difmat, next->pose_mat, imat);
- Mat3CpyMat4(result, difmat); // the desired rotation at beginning of next bone
+ mul_m4_m4m4(difmat, next->pose_mat, imat);
+ copy_m3_m4(result, difmat); // the desired rotation at beginning of next bone
vec_roll_to_mat3(h2, 0.0f, mat3); // the result of vec_roll without roll
- Mat3Inv(imat3, mat3);
- Mat3MulMat3(mat3, imat3, result); // the matrix transforming vec_roll to desired roll
+ invert_m3_m3(imat3, mat3);
+ mul_m3_m3m3(mat3, imat3, result); // the matrix transforming vec_roll to desired roll
roll2= (float)atan2(mat3[2][0], mat3[2][2]);
/* and only now negate handle */
- VecMulf(h2, -hlength2);
+ mul_v3_fl(h2, -hlength2);
}
else {
h2[0]= 0.0f; h2[1]= -hlength2; h2[2]= 0.0f;
@@ -662,15 +670,15 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan, int rest)
/* make transformation matrices for the segments for drawing */
for(a=0, fp= data[0]; asegments; a++, fp+=4) {
- VecSubf(h1, fp+4, fp);
+ sub_v3_v3v3(h1, fp+4, fp);
vec_roll_to_mat3(h1, fp[3], mat3); // fp[3] is roll
- Mat4CpyMat3(result_array[a].mat, mat3);
+ copy_m4_m3(result_array[a].mat, mat3);
VECCOPY(result_array[a].mat[3], fp);
if(doscale) {
/* correct for scaling when this matrix is used in scaled space */
- Mat4MulSerie(result_array[a].mat, iscalemat, result_array[a].mat,
+ mul_serie_m4(result_array[a].mat, iscalemat, result_array[a].mat,
scalemat, NULL, NULL, NULL, NULL, NULL);
}
}
@@ -701,26 +709,26 @@ static void pchan_b_bone_defmats(bPoseChannel *pchan, int use_quaternion, int re
/* first matrix is the inverse arm_mat, to bring points in local bone space
for finding out which segment it belongs to */
- Mat4Invert(b_bone_mats[0].mat, bone->arm_mat);
+ invert_m4_m4(b_bone_mats[0].mat, bone->arm_mat);
/* then we make the b_bone_mats:
- first transform to local bone space
- translate over the curve to the bbone mat space
- transform with b_bone matrix
- transform back into global space */
- Mat4One(tmat);
+ unit_m4(tmat);
for(a=0; asegments; a++) {
if(b_bone_rest)
- Mat4Invert(tmat, b_bone_rest[a].mat);
+ invert_m4_m4(tmat, b_bone_rest[a].mat);
else
tmat[3][1] = -a*(bone->length/(float)bone->segments);
- Mat4MulSerie(b_bone_mats[a+1].mat, pchan->chan_mat, bone->arm_mat,
+ mul_serie_m4(b_bone_mats[a+1].mat, pchan->chan_mat, bone->arm_mat,
b_bone[a].mat, tmat, b_bone_mats[0].mat, NULL, NULL, NULL);
if(use_quaternion)
- Mat4ToDQuat(bone->arm_mat, b_bone_mats[a+1].mat, &b_bone_dual_quats[a]);
+ mat4_to_dquat( &b_bone_dual_quats[a],bone->arm_mat, b_bone_mats[a+1].mat);
}
}
@@ -743,13 +751,13 @@ static void b_bone_deform(bPoseChannel *pchan, Bone *bone, float *co, DualQuat *
CLAMP(a, 0, bone->segments-1);
if(dq) {
- DQuatCpyDQuat(dq, &((DualQuat*)pchan->b_bone_dual_quats)[a]);
+ copy_dq_dq(dq, &((DualQuat*)pchan->b_bone_dual_quats)[a]);
}
else {
- Mat4MulVecfl(b_bone[a+1].mat, co);
+ mul_m4_v3(b_bone[a+1].mat, co);
if(defmat)
- Mat3CpyMat4(defmat, b_bone[a+1].mat);
+ copy_m3_m4(defmat, b_bone[a+1].mat);
}
}
@@ -761,10 +769,10 @@ float distfactor_to_bone (float vec[3], float b1[3], float b2[3], float rad1, fl
float pdelta[3];
float hsqr, a, l, rad;
- VecSubf (bdelta, b2, b1);
- l = Normalize (bdelta);
+ sub_v3_v3v3(bdelta, b2, b1);
+ l = normalize_v3(bdelta);
- VecSubf (pdelta, vec, b1);
+ sub_v3_v3v3(pdelta, vec, b1);
a = bdelta[0]*pdelta[0] + bdelta[1]*pdelta[1] + bdelta[2]*pdelta[2];
hsqr = ((pdelta[0]*pdelta[0]) + (pdelta[1]*pdelta[1]) + (pdelta[2]*pdelta[2]));
@@ -809,12 +817,12 @@ static void pchan_deform_mat_add(bPoseChannel *pchan, float weight, float bbonem
float wmat[3][3];
if(pchan->bone->segments>1)
- Mat3CpyMat3(wmat, bbonemat);
+ copy_m3_m3(wmat, bbonemat);
else
- Mat3CpyMat4(wmat, pchan->chan_mat);
+ copy_m3_m4(wmat, pchan->chan_mat);
- Mat3MulFloat((float*)wmat, weight);
- Mat3AddMat3(mat, mat, wmat);
+ mul_m3_fl(wmat, weight);
+ add_m3_m3m3(mat, mat, wmat);
}
static float dist_bone_deform(bPoseChannel *pchan, float *vec, DualQuat *dq, float mat[][3], float *co)
@@ -840,12 +848,12 @@ static float dist_bone_deform(bPoseChannel *pchan, float *vec, DualQuat *dq, flo
// applies on cop and bbonemat
b_bone_deform(pchan, bone, cop, NULL, (mat)?bbonemat:NULL);
else
- Mat4MulVecfl(pchan->chan_mat, cop);
+ mul_m4_v3(pchan->chan_mat, cop);
// Make this a delta from the base position
- VecSubf (cop, cop, co);
+ sub_v3_v3v3(cop, cop, co);
cop[0]*=fac; cop[1]*=fac; cop[2]*=fac;
- VecAddf (vec, vec, cop);
+ add_v3_v3v3(vec, vec, cop);
if(mat)
pchan_deform_mat_add(pchan, fac, bbonemat, mat);
@@ -853,10 +861,10 @@ static float dist_bone_deform(bPoseChannel *pchan, float *vec, DualQuat *dq, flo
else {
if(bone->segments>1) {
b_bone_deform(pchan, bone, cop, &bbonedq, NULL);
- DQuatAddWeighted(dq, &bbonedq, fac);
+ add_weighted_dq_dq(dq, &bbonedq, fac);
}
else
- DQuatAddWeighted(dq, pchan->dual_quat, fac);
+ add_weighted_dq_dq(dq, pchan->dual_quat, fac);
}
}
}
@@ -879,7 +887,7 @@ static void pchan_bone_deform(bPoseChannel *pchan, float weight, float *vec, Dua
// applies on cop and bbonemat
b_bone_deform(pchan, pchan->bone, cop, NULL, (mat)?bbonemat:NULL);
else
- Mat4MulVecfl(pchan->chan_mat, cop);
+ mul_m4_v3(pchan->chan_mat, cop);
vec[0]+=(cop[0]-co[0])*weight;
vec[1]+=(cop[1]-co[1])*weight;
@@ -891,10 +899,10 @@ static void pchan_bone_deform(bPoseChannel *pchan, float weight, float *vec, Dua
else {
if(pchan->bone->segments>1) {
b_bone_deform(pchan, pchan->bone, cop, &bbonedq, NULL);
- DQuatAddWeighted(dq, &bbonedq, weight);
+ add_weighted_dq_dq(dq, &bbonedq, weight);
}
else
- DQuatAddWeighted(dq, pchan->dual_quat, weight);
+ add_weighted_dq_dq(dq, pchan->dual_quat, weight);
}
(*contrib)+=weight;
@@ -923,10 +931,10 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
if(arm->edbo) return;
- Mat4Invert(obinv, target->obmat);
- Mat4CpyMat4(premat, target->obmat);
- Mat4MulMat4(postmat, armOb->obmat, obinv);
- Mat4Invert(premat, postmat);
+ invert_m4_m4(obinv, target->obmat);
+ copy_m4_m4(premat, target->obmat);
+ mul_m4_m4m4(postmat, armOb->obmat, obinv);
+ invert_m4_m4(premat, postmat);
/* bone defmats are already in the channels, chan_mat */
@@ -944,7 +952,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
if(use_quaternion) {
pchan->dual_quat= &dualquats[totchan++];
- Mat4ToDQuat(pchan->bone->arm_mat, pchan->chan_mat, pchan->dual_quat);
+ mat4_to_dquat( pchan->dual_quat,pchan->bone->arm_mat, pchan->chan_mat);
}
}
}
@@ -1013,7 +1021,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
vec= sumvec;
if(defMats) {
- Mat3Clr((float*)summat);
+ zero_m3(summat);
smat = summat;
}
}
@@ -1050,7 +1058,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
co= prevCos?prevCos[i]:vertexCos[i];
/* Apply the object's matrix */
- Mat4MulVecfl(premat, co);
+ mul_m4_v3(premat, co);
if(use_dverts && dvert && dvert->totweight) { // use weight groups ?
int deformed = 0;
@@ -1096,42 +1104,42 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
/* actually should be EPSILON? weight values and contrib can be like 10e-39 small */
if(contrib > 0.0001f) {
if(use_quaternion) {
- DQuatNormalize(dq, contrib);
+ normalize_dq(dq, contrib);
if(armature_weight != 1.0f) {
VECCOPY(dco, co);
- DQuatMulVecfl(dq, dco, (defMats)? summat: NULL);
- VecSubf(dco, dco, co);
- VecMulf(dco, armature_weight);
- VecAddf(co, co, dco);
+ mul_v3m3_dq( dco, (defMats)? summat: NULL,dq);
+ sub_v3_v3v3(dco, dco, co);
+ mul_v3_fl(dco, armature_weight);
+ add_v3_v3v3(co, co, dco);
}
else
- DQuatMulVecfl(dq, co, (defMats)? summat: NULL);
+ mul_v3m3_dq( co, (defMats)? summat: NULL,dq);
smat = summat;
}
else {
- VecMulf(vec, armature_weight/contrib);
- VecAddf(co, vec, co);
+ mul_v3_fl(vec, armature_weight/contrib);
+ add_v3_v3v3(co, vec, co);
}
if(defMats) {
float pre[3][3], post[3][3], tmpmat[3][3];
- Mat3CpyMat4(pre, premat);
- Mat3CpyMat4(post, postmat);
- Mat3CpyMat3(tmpmat, defMats[i]);
+ copy_m3_m4(pre, premat);
+ copy_m3_m4(post, postmat);
+ copy_m3_m3(tmpmat, defMats[i]);
if(!use_quaternion) /* quaternion already is scale corrected */
- Mat3MulFloat((float*)smat, armature_weight/contrib);
+ mul_m3_fl(smat, armature_weight/contrib);
- Mat3MulSerie(defMats[i], tmpmat, pre, smat, post,
+ mul_serie_m3(defMats[i], tmpmat, pre, smat, post,
NULL, NULL, NULL, NULL);
}
}
/* always, check above code */
- Mat4MulVecfl(postmat, co);
+ mul_m4_v3(postmat, co);
/* interpolate with previous modifier position using weight group */
@@ -1165,7 +1173,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm,
void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed)
{
- Mat4CpyMat4(M_accumulatedMatrix, bone->arm_mat);
+ copy_m4_m4(M_accumulatedMatrix, bone->arm_mat);
}
/* **************** Space to Space API ****************** */
@@ -1179,10 +1187,10 @@ void armature_mat_world_to_pose(Object *ob, float inmat[][4], float outmat[][4])
if (ob==NULL) return;
/* get inverse of (armature) object's matrix */
- Mat4Invert(obmat, ob->obmat);
+ invert_m4_m4(obmat, ob->obmat);
/* multiply given matrix by object's-inverse to find pose-space matrix */
- Mat4MulMat4(outmat, obmat, inmat);
+ mul_m4_m4m4(outmat, obmat, inmat);
}
/* Convert Wolrd-Space Location to Pose-Space Location
@@ -1195,7 +1203,7 @@ void armature_loc_world_to_pose(Object *ob, float *inloc, float *outloc)
float nLocMat[4][4];
/* build matrix for location */
- Mat4One(xLocMat);
+ unit_m4(xLocMat);
VECCOPY(xLocMat[3], inloc);
/* get bone-space cursor matrix and extract location */
@@ -1217,24 +1225,24 @@ void armature_mat_pose_to_bone(bPoseChannel *pchan, float inmat[][4], float outm
/* get the inverse matrix of the pchan's transforms */
if (pchan->rotmode)
- LocEulSizeToMat4(pc_trans, pchan->loc, pchan->eul, pchan->size);
+ loc_eul_size_to_mat4(pc_trans, pchan->loc, pchan->eul, pchan->size);
else
- LocQuatSizeToMat4(pc_trans, pchan->loc, pchan->quat, pchan->size);
- Mat4Invert(inv_trans, pc_trans);
+ loc_quat_size_to_mat4(pc_trans, pchan->loc, pchan->quat, pchan->size);
+ invert_m4_m4(inv_trans, pc_trans);
/* Remove the pchan's transforms from it's pose_mat.
* This should leave behind the effects of restpose +
* parenting + constraints
*/
- Mat4MulMat4(pc_posemat, inv_trans, pchan->pose_mat);
+ mul_m4_m4m4(pc_posemat, inv_trans, pchan->pose_mat);
/* get the inverse of the leftovers so that we can remove
* that component from the supplied matrix
*/
- Mat4Invert(inv_posemat, pc_posemat);
+ invert_m4_m4(inv_posemat, pc_posemat);
/* get the new matrix */
- Mat4MulMat4(outmat, inmat, inv_posemat);
+ mul_m4_m4m4(outmat, inmat, inv_posemat);
}
/* Convert Pose-Space Location to Bone-Space Location
@@ -1247,7 +1255,7 @@ void armature_loc_pose_to_bone(bPoseChannel *pchan, float *inloc, float *outloc)
float nLocMat[4][4];
/* build matrix for location */
- Mat4One(xLocMat);
+ unit_m4(xLocMat);
VECCOPY(xLocMat[3], inloc);
/* get bone-space cursor matrix and extract location */
@@ -1263,8 +1271,8 @@ void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float
{
float imat[4][4];
- Mat4Invert(imat, arm_mat);
- Mat4MulMat4(delta_mat, pose_mat, imat);
+ invert_m4_m4(imat, arm_mat);
+ mul_m4_m4m4(delta_mat, pose_mat, imat);
}
/* **************** Rotation Mode Conversions ****************************** */
@@ -1280,33 +1288,33 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa
if (newMode > 0) { /* to euler */
if (oldMode == ROT_MODE_AXISANGLE) {
/* axis-angle to euler */
- AxisAngleToEulO(axis, *angle, eul, newMode);
+ axis_angle_to_eulO( eul, newMode,axis, *angle);
}
else if (oldMode == ROT_MODE_QUAT) {
/* quat to euler */
- QuatToEulO(quat, eul, newMode);
+ quat_to_eulO( eul, newMode,quat);
}
/* else { no conversion needed } */
}
else if (newMode == ROT_MODE_QUAT) { /* to quat */
if (oldMode == ROT_MODE_AXISANGLE) {
/* axis angle to quat */
- AxisAngleToQuat(quat, axis, *angle);
+ axis_angle_to_quat(quat, axis, *angle);
}
else if (oldMode > 0) {
/* euler to quat */
- EulOToQuat(eul, oldMode, quat);
+ eulO_to_quat( quat,eul, oldMode);
}
/* else { no conversion needed } */
}
else if (newMode == ROT_MODE_AXISANGLE) { /* to axis-angle */
if (oldMode > 0) {
/* euler to axis angle */
- EulOToAxisAngle(eul, oldMode, axis, angle);
+ eulO_to_axis_angle( axis, angle,eul, oldMode);
}
else if (oldMode == ROT_MODE_QUAT) {
/* quat to axis angle */
- QuatToAxisAngle(quat, axis, angle);
+ quat_to_axis_angle( axis, angle,quat);
}
/* when converting to axis-angle, we need a special exception for the case when there is no axis */
@@ -1341,14 +1349,14 @@ void BKE_rotMode_change_values (float quat[4], float eul[3], float axis[3], floa
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll)
{
if (vec)
- VecCopyf(vec, mat[1]);
+ copy_v3_v3(vec, mat[1]);
if (roll) {
float vecmat[3][3], vecmatinv[3][3], rollmat[3][3];
vec_roll_to_mat3(mat[1], 0.0f, vecmat);
- Mat3Inv(vecmatinv, vecmat);
- Mat3MulMat3(rollmat, vecmatinv, mat);
+ invert_m3_m3(vecmatinv, vecmat);
+ mul_m3_m3m3(rollmat, vecmatinv, mat);
*roll= (float)atan2(rollmat[2][0], rollmat[2][2]);
}
@@ -1363,26 +1371,26 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
float rMatrix[3][3], bMatrix[3][3];
VECCOPY (nor, vec);
- Normalize (nor);
+ normalize_v3(nor);
/* Find Axis & Amount for bone matrix*/
- Crossf (axis,target,nor);
+ cross_v3_v3v3(axis,target,nor);
- if (Inpf(axis,axis) > 0.0000000000001) {
+ if (dot_v3v3(axis,axis) > 0.0000000000001) {
/* if nor is *not* a multiple of target ... */
- Normalize (axis);
+ normalize_v3(axis);
- theta= NormalizedVecAngle2(target, nor);
+ theta= angle_normalized_v3v3(target, nor);
/* Make Bone matrix*/
- VecRotToMat3(axis, theta, bMatrix);
+ vec_rot_to_mat3( bMatrix,axis, theta);
}
else {
/* if nor is a multiple of target ... */
float updown;
/* point same direction, or opposite? */
- updown = ( Inpf (target,nor) > 0 ) ? 1.0f : -1.0f;
+ updown = ( dot_v3v3(target,nor) > 0 ) ? 1.0f : -1.0f;
/* I think this should work ... */
bMatrix[0][0]=updown; bMatrix[0][1]=0.0; bMatrix[0][2]=0.0;
@@ -1391,10 +1399,10 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
}
/* Make Roll matrix*/
- VecRotToMat3(nor, roll, rMatrix);
+ vec_rot_to_mat3( rMatrix,nor, roll);
/* Combine and output result*/
- Mat3MulMat3 (mat, rMatrix, bMatrix);
+ mul_m3_m3m3(mat, rMatrix, bMatrix);
}
@@ -1405,10 +1413,10 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
float vec[3];
/* Bone Space */
- VecSubf (vec, bone->tail, bone->head);
+ sub_v3_v3v3(vec, bone->tail, bone->head);
vec_roll_to_mat3(vec, bone->roll, bone->bone_mat);
- bone->length= VecLenf(bone->head, bone->tail);
+ bone->length= len_v3v3(bone->head, bone->tail);
/* this is called on old file reading too... */
if(bone->xwidth==0.0) {
@@ -1421,7 +1429,7 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
float offs_bone[4][4]; // yoffs(b-1) + root(b) + bonemat(b)
/* bone transform itself */
- Mat4CpyMat3(offs_bone, bone->bone_mat);
+ copy_m4_m3(offs_bone, bone->bone_mat);
/* The bone's root offset (is in the parent's coordinate system) */
VECCOPY(offs_bone[3], bone->head);
@@ -1430,10 +1438,10 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
offs_bone[3][1]+= prevbone->length;
/* Compose the matrix for this bone */
- Mat4MulMat4(bone->arm_mat, offs_bone, prevbone->arm_mat);
+ mul_m4_m4m4(bone->arm_mat, offs_bone, prevbone->arm_mat);
}
else {
- Mat4CpyMat3(bone->arm_mat, bone->bone_mat);
+ copy_m4_m3(bone->arm_mat, bone->bone_mat);
VECCOPY(bone->arm_mat[3], bone->head);
}
@@ -1441,8 +1449,8 @@ void where_is_armature_bone(Bone *bone, Bone *prevbone)
VECCOPY(bone->arm_head, bone->arm_mat[3]);
/* tail is in current local coord system */
VECCOPY(vec, bone->arm_mat[1]);
- VecMulf(vec, bone->length);
- VecAddf(bone->arm_tail, bone->arm_head, vec);
+ mul_v3_fl(vec, bone->length);
+ add_v3_v3v3(bone->arm_tail, bone->arm_head, vec);
/* and the kiddies */
prevbone= bone;
@@ -1501,6 +1509,10 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
pchanw.child= pchan->child;
pchanw.path= NULL;
+ /* this is freed so copy a copy, else undo crashes */
+ if(pchanw.prop)
+ pchanw.prop= IDP_CopyProperty(pchanw.prop);
+
/* constraints - proxy constraints are flushed... local ones are added after
* 1. extract constraints not from proxy (CONSTRAINT_PROXY_LOCAL) from pchan's constraints
* 2. copy proxy-pchan's constraints on-to new
@@ -1530,8 +1542,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
}
/* free stuff from current channel */
- if (pchan->path) MEM_freeN(pchan->path);
- free_constraints(&pchan->constraints);
+ free_pose_channel(pchan);
/* the final copy */
*pchan= pchanw;
@@ -1586,9 +1597,7 @@ void armature_rebuild_pose(Object *ob, bArmature *arm)
for(pchan= pose->chanbase.first; pchan; pchan= next) {
next= pchan->next;
if(pchan->bone==NULL) {
- if(pchan->path)
- MEM_freeN(pchan->path);
- free_constraints(&pchan->constraints);
+ free_pose_channel(pchan);
BLI_freelinkN(&pose->chanbase, pchan);
}
}
@@ -1632,7 +1641,7 @@ typedef struct tSplineIK_Tree {
/* ----------- */
/* Tag the bones in the chain formed by the given bone for IK */
-static void splineik_init_tree_from_pchan(Object *ob, bPoseChannel *pchan_tip)
+static void splineik_init_tree_from_pchan(Scene *scene, Object *ob, bPoseChannel *pchan_tip)
{
bPoseChannel *pchan, *pchanRoot=NULL;
bPoseChannel *pchanChain[255];
@@ -1661,6 +1670,21 @@ static void splineik_init_tree_from_pchan(Object *ob, bPoseChannel *pchan_tip)
}
if (con == NULL)
return;
+
+ /* make sure that the constraint targets are ok
+ * - this is a workaround for a depsgraph bug...
+ */
+ if (ikData->tar) {
+ Curve *cu= ikData->tar->data;
+
+ /* note: when creating constraints that follow path, the curve gets the CU_PATH set now,
+ * currently for paths to work it needs to go through the bevlist/displist system (ton)
+ */
+
+ /* only happens on reload file, but violates depsgraph still... fix! */
+ if ((cu->path==NULL) || (cu->path->data==NULL))
+ makeDispListCurveTypes(scene, ikData->tar, 0);
+ }
/* find the root bone and the chain of bones from the root to the tip
* NOTE: this assumes that the bones are connected, but that may not be true...
@@ -1707,7 +1731,7 @@ static void splineik_init_tree_from_pchan(Object *ob, bPoseChannel *pchan_tip)
*/
if ((ikData->flag & CONSTRAINT_SPLINEIK_EVENSPLITS) || (totLength == 0.0f)) {
/* 1) equi-spaced joints */
- ikData->points[i]= segmentLen;
+ ikData->points[i]= ikData->points[i-1] - segmentLen;
}
else {
/* 2) to find this point on the curve, we take a step from the previous joint
@@ -1800,7 +1824,7 @@ static void splineik_init_tree(Scene *scene, Object *ob, float ctime)
/* find the tips of Spline IK chains, which are simply the bones which have been tagged as such */
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if (pchan->constflag & PCHAN_HAS_SPLINEIK)
- splineik_init_tree_from_pchan(ob, pchan);
+ splineik_init_tree_from_pchan(scene, ob, pchan);
}
}
@@ -1811,9 +1835,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
{
bSplineIKConstraint *ikData= tree->ikData;
float poseHead[3], poseTail[3], poseMat[4][4];
- float splineVec[3], scaleFac;
- float rad, radius=1.0f;
- float vec[4], dir[3];
+ float splineVec[3], scaleFac, radius=1.0f;
/* firstly, calculate the bone matrix the standard way, since this is needed for roll control */
where_is_pose_bone(scene, ob, pchan, ctime);
@@ -1821,32 +1843,49 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
VECCOPY(poseHead, pchan->pose_head);
VECCOPY(poseTail, pchan->pose_tail);
- /* step 1a: get xyz positions for the tail endpoint of the bone */
- if ( where_on_path(ikData->tar, tree->points[index], vec, dir, NULL, &rad) ) {
- /* convert the position to pose-space, then store it */
- Mat4MulVecfl(ob->imat, vec);
- VECCOPY(poseTail, vec);
+ /* step 1: determine the positions for the endpoints of the bone */
+ {
+ float vec[4], dir[3], rad;
+ float tailBlendFac= 1.0f;
- /* set the new radius */
- radius= rad;
- }
-
- /* step 1b: get xyz positions for the head endpoint of the bone */
- if ( where_on_path(ikData->tar, tree->points[index+1], vec, dir, NULL, &rad) ) {
- /* store the position, and convert it to pose space */
- Mat4MulVecfl(ob->imat, vec);
- VECCOPY(poseHead, vec);
+ /* determine if the bone should still be affected by SplineIK */
+ if (tree->points[index+1] >= 1.0f) {
+ /* spline doesn't affect the bone anymore, so done... */
+ pchan->flag |= POSE_DONE;
+ return;
+ }
+ else if ((tree->points[index] >= 1.0f) && (tree->points[index+1] < 1.0f)) {
+ /* blending factor depends on the amount of the bone still left on the chain */
+ tailBlendFac= (1.0f - tree->points[index+1]) / (tree->points[index] - tree->points[index+1]);
+ }
- /* set the new radius (it should be the average value) */
- radius = (radius+rad) / 2;
+ /* tail endpoint */
+ if ( where_on_path(ikData->tar, tree->points[index], vec, dir, NULL, &rad) ) {
+ /* convert the position to pose-space, then store it */
+ mul_m4_v3(ob->imat, vec);
+ interp_v3_v3v3(poseTail, pchan->pose_tail, vec, tailBlendFac);
+
+ /* set the new radius */
+ radius= rad;
+ }
+
+ /* head endpoint */
+ if ( where_on_path(ikData->tar, tree->points[index+1], vec, dir, NULL, &rad) ) {
+ /* store the position, and convert it to pose space */
+ mul_m4_v3(ob->imat, vec);
+ VECCOPY(poseHead, vec);
+
+ /* set the new radius (it should be the average value) */
+ radius = (radius+rad) / 2;
+ }
}
/* step 2: determine the implied transform from these endpoints
* - splineVec: the vector direction that the spline applies on the bone
* - scaleFac: the factor that the bone length is scaled by to get the desired amount
*/
- VecSubf(splineVec, poseTail, poseHead);
- scaleFac= VecLength(splineVec) / pchan->bone->length;
+ sub_v3_v3v3(splineVec, poseTail, poseHead);
+ scaleFac= len_v3(splineVec) / pchan->bone->length;
/* step 3: compute the shortest rotation needed to map from the bone rotation to the current axis
* - this uses the same method as is used for the Damped Track Constraint (see the code there for details)
@@ -1861,68 +1900,99 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
VECCOPY(rmat[0], pchan->pose_mat[0]);
VECCOPY(rmat[1], pchan->pose_mat[1]);
VECCOPY(rmat[2], pchan->pose_mat[2]);
- Mat3Ortho(rmat);
+ normalize_m3(rmat);
/* also, normalise the orientation imposed by the bone, now that we've extracted the scale factor */
- Normalize(splineVec);
+ normalize_v3(splineVec);
/* calculate smallest axis-angle rotation necessary for getting from the
* current orientation of the bone, to the spline-imposed direction
*/
- Crossf(raxis, rmat[1], splineVec);
+ cross_v3_v3v3(raxis, rmat[1], splineVec);
- rangle= Inpf(rmat[1], splineVec);
+ rangle= dot_v3v3(rmat[1], splineVec);
rangle= acos( MAX2(-1.0f, MIN2(1.0f, rangle)) );
/* construct rotation matrix from the axis-angle rotation found above
* - this call takes care to make sure that the axis provided is a unit vector first
*/
- AxisAngleToMat3(raxis, rangle, dmat);
+ axis_angle_to_mat3(dmat, raxis, rangle);
/* combine these rotations so that the y-axis of the bone is now aligned as the spline dictates,
* while still maintaining roll control from the existing bone animation
*/
- Mat3MulMat3(tmat, dmat, rmat); // m1, m3, m2
- Mat3Ortho(tmat); /* attempt to reduce shearing, though I doubt this'll really help too much now... */
- Mat4CpyMat3(poseMat, tmat);
+ mul_m3_m3m3(tmat, dmat, rmat); // m1, m3, m2
+ normalize_m3(tmat); /* attempt to reduce shearing, though I doubt this'll really help too much now... */
+ copy_m4_m3(poseMat, tmat);
}
/* step 4: set the scaling factors for the axes */
- // TODO: include a no-scale option?
{
/* only multiply the y-axis by the scaling factor to get nice volume-preservation */
- VecMulf(poseMat[1], scaleFac);
+ mul_v3_fl(poseMat[1], scaleFac);
/* set the scaling factors of the x and z axes from... */
switch (ikData->xzScaleMode) {
- case CONSTRAINT_SPLINEIK_XZS_RADIUS:
- {
- /* radius of curve */
- VecMulf(poseMat[0], radius);
- VecMulf(poseMat[2], radius);
- }
- break;
case CONSTRAINT_SPLINEIK_XZS_ORIGINAL:
{
/* original scales get used */
float scale;
/* x-axis scale */
- scale= VecLength(pchan->pose_mat[0]);
- VecMulf(poseMat[0], scale);
+ scale= len_v3(pchan->pose_mat[0]);
+ mul_v3_fl(poseMat[0], scale);
/* z-axis scale */
- scale= VecLength(pchan->pose_mat[2]);
- VecMulf(poseMat[2], scale);
+ scale= len_v3(pchan->pose_mat[2]);
+ mul_v3_fl(poseMat[2], scale);
+ }
+ break;
+ case CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC:
+ {
+ /* 'volume preservation' */
+ float scale;
+
+ /* calculate volume preservation factor which is
+ * basically the inverse of the y-scaling factor
+ */
+ if (fabs(scaleFac) != 0.0f) {
+ scale= 1.0 / fabs(scaleFac);
+
+ /* we need to clamp this within sensible values */
+ // NOTE: these should be fine for now, but should get sanitised in future
+ scale= MIN2( MAX2(scale, 0.0001) , 100000);
+ }
+ else
+ scale= 1.0f;
+
+ /* apply the scaling */
+ mul_v3_fl(poseMat[0], scale);
+ mul_v3_fl(poseMat[2], scale);
}
break;
}
+
+ /* finally, multiply the x and z scaling by the radius of the curve too,
+ * to allow automatic scales to get tweaked still
+ */
+ if ((ikData->flag & CONSTRAINT_SPLINEIK_NO_CURVERAD) == 0) {
+ mul_v3_fl(poseMat[0], radius);
+ mul_v3_fl(poseMat[2], radius);
+ }
}
- /* step 5: set the location of the bone in the matrix */
- VECCOPY(poseMat[3], poseHead);
+ /* step 5: set the location of the bone in the matrix
+ * - when the 'no-root' option is affected, the chain can retain
+ * the shape but be moved elsewhere
+ */
+ if (ikData->flag & CONSTRAINT_SPLINEIK_NO_ROOT) {
+ VECCOPY(poseMat[3], pchan->pose_head);
+ }
+ else {
+ VECCOPY(poseMat[3], poseHead);
+ }
/* finally, store the new transform */
- Mat4CpyMat4(pchan->pose_mat, poseMat);
+ copy_m4_m4(pchan->pose_mat, poseMat);
VECCOPY(pchan->pose_head, poseHead);
VECCOPY(pchan->pose_tail, poseTail);
@@ -1974,26 +2044,26 @@ void chan_calc_mat(bPoseChannel *chan)
float tmat[3][3];
/* get scaling matrix */
- SizeToMat3(chan->size, smat);
+ size_to_mat3( smat,chan->size);
/* rotations may either be quats, eulers (with various rotation orders), or axis-angle */
if (chan->rotmode > 0) {
/* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */
- EulOToMat3(chan->eul, chan->rotmode, rmat);
+ eulO_to_mat3( rmat,chan->eul, chan->rotmode);
}
else if (chan->rotmode == ROT_MODE_AXISANGLE) {
/* axis-angle - not really that great for 3D-changing orientations */
- AxisAngleToMat3(chan->rotAxis, chan->rotAngle, rmat);
+ axis_angle_to_mat3( rmat,chan->rotAxis, chan->rotAngle);
}
else {
/* quats are normalised before use to eliminate scaling issues */
- NormalQuat(chan->quat); // TODO: do this with local vars only!
- QuatToMat3(chan->quat, rmat);
+ normalize_qt(chan->quat); // TODO: do this with local vars only!
+ quat_to_mat3( rmat,chan->quat);
}
/* calculate matrix of bone (as 3x3 matrix, but then copy the 4x4) */
- Mat3MulMat3(tmat, rmat, smat);
- Mat4CpyMat3(chan->chan_mat, tmat);
+ mul_m3_m3m3(tmat, rmat, smat);
+ copy_m4_m3(chan->chan_mat, tmat);
/* prevent action channels breaking chains */
/* need to check for bone here, CONSTRAINT_TYPE_ACTION uses this call */
@@ -2057,8 +2127,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
float mat4[4][4], mat3[3][3];
curve_deform_vector(scene, amod->ob, armob, bone->arm_mat[3], pchan->pose_mat[3], mat3, amod->no_rot_axis);
- Mat4CpyMat4(mat4, pchan->pose_mat);
- Mat4MulMat34(pchan->pose_mat, mat3, mat4);
+ copy_m4_m4(mat4, pchan->pose_mat);
+ mul_m4_m3m4(pchan->pose_mat, mat3, mat4);
}
}
@@ -2075,8 +2145,8 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
/* make a copy of starting conditions */
VECCOPY(loc, pchan->pose_mat[3]);
- Mat4ToEul(pchan->pose_mat, eul);
- Mat4ToSize(pchan->pose_mat, size);
+ mat4_to_eul( eul,pchan->pose_mat);
+ mat4_to_size( size,pchan->pose_mat);
VECCOPY(eulo, eul);
VECCOPY(sizeo, size);
@@ -2086,14 +2156,14 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
nor[0] = BLI_gNoise(amod->noisesize, size[0]+ofs, size[1], size[2], 0, 0) - ofs;
nor[1] = BLI_gNoise(amod->noisesize, size[0], size[1]+ofs, size[2], 0, 0) - ofs;
nor[2] = BLI_gNoise(amod->noisesize, size[0], size[1], size[2]+ofs, 0, 0) - ofs;
- VecAddf(size, size, nor);
+ add_v3_v3v3(size, size, nor);
if (sizeo[0] != 0)
- VecMulf(pchan->pose_mat[0], size[0] / sizeo[0]);
+ mul_v3_fl(pchan->pose_mat[0], size[0] / sizeo[0]);
if (sizeo[1] != 0)
- VecMulf(pchan->pose_mat[1], size[1] / sizeo[1]);
+ mul_v3_fl(pchan->pose_mat[1], size[1] / sizeo[1]);
if (sizeo[2] != 0)
- VecMulf(pchan->pose_mat[2], size[2] / sizeo[2]);
+ mul_v3_fl(pchan->pose_mat[2], size[2] / sizeo[2]);
}
if (amod->channels & 2) {
/* for rotation */
@@ -2102,10 +2172,10 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
nor[2] = BLI_gNoise(amod->noisesize, eul[0], eul[1], eul[2]+ofs, 0, 0) - ofs;
compatible_eul(nor, eulo);
- VecAddf(eul, eul, nor);
+ add_v3_v3v3(eul, eul, nor);
compatible_eul(eul, eulo);
- LocEulSizeToMat4(pchan->pose_mat, loc, eul, size);
+ loc_eul_size_to_mat4(pchan->pose_mat, loc, eul, size);
}
if (amod->channels & 1) {
/* for location */
@@ -2113,7 +2183,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
nor[1] = BLI_gNoise(amod->noisesize, loc[0], loc[1]+ofs, loc[2], 0, 0) - ofs;
nor[2] = BLI_gNoise(amod->noisesize, loc[0], loc[1], loc[2]+ofs, 0, 0) - ofs;
- VecAddf(pchan->pose_mat[3], loc, nor);
+ add_v3_v3v3(pchan->pose_mat[3], loc, nor);
}
}
}
@@ -2148,7 +2218,7 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
float offs_bone[4][4]; // yoffs(b-1) + root(b) + bonemat(b)
/* bone transform itself */
- Mat4CpyMat3(offs_bone, bone->bone_mat);
+ copy_m4_m3(offs_bone, bone->bone_mat);
/* The bone's root offset (is in the parent's coordinate system) */
VECCOPY(offs_bone[3], bone->head);
@@ -2161,39 +2231,48 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
float tmat[4][4];
/* the rotation of the parent restposition */
- Mat4CpyMat4(tmat, parbone->arm_mat);
-
- /* the location of actual parent transform */
- VECCOPY(tmat[3], offs_bone[3]);
- offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
- Mat4MulVecfl(parchan->pose_mat, tmat[3]);
-
- Mat4MulSerie(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
+ copy_m4_m4(tmat, parbone->arm_mat);
+ mul_serie_m4(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
}
else if(bone->flag & BONE_NO_SCALE) {
float orthmat[4][4];
- /* get the official transform, but we only use the vector from it (optimize...) */
- Mat4MulSerie(pchan->pose_mat, parchan->pose_mat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
- VECCOPY(vec, pchan->pose_mat[3]);
-
- /* do this again, but with an ortho-parent matrix */
- Mat4CpyMat4(orthmat, parchan->pose_mat);
- Mat4Ortho(orthmat);
- Mat4MulSerie(pchan->pose_mat, orthmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
-
- /* copy correct transform */
- VECCOPY(pchan->pose_mat[3], vec);
+ /* do transform, with an ortho-parent matrix */
+ copy_m4_m4(orthmat, parchan->pose_mat);
+ normalize_m4(orthmat);
+ mul_serie_m4(pchan->pose_mat, orthmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
+ }
+ else
+ mul_serie_m4(pchan->pose_mat, parchan->pose_mat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
+
+ /* in these cases we need to compute location separately */
+ if(bone->flag & (BONE_HINGE|BONE_NO_SCALE|BONE_NO_LOCAL_LOCATION)) {
+ float bone_loc[3], chan_loc[3];
+
+ mul_v3_m4v3(bone_loc, parchan->pose_mat, offs_bone[3]);
+ copy_v3_v3(chan_loc, pchan->chan_mat[3]);
+
+ /* no local location is not transformed by bone matrix */
+ if(!(bone->flag & BONE_NO_LOCAL_LOCATION))
+ mul_mat3_m4_v3(offs_bone, chan_loc);
+
+ /* for hinge we use armature instead of pose mat */
+ if(bone->flag & BONE_HINGE) mul_mat3_m4_v3(parbone->arm_mat, chan_loc);
+ else mul_mat3_m4_v3(parchan->pose_mat, chan_loc);
+
+ add_v3_v3v3(pchan->pose_mat[3], bone_loc, chan_loc);
}
- else
- Mat4MulSerie(pchan->pose_mat, parchan->pose_mat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
}
else {
- Mat4MulMat4(pchan->pose_mat, pchan->chan_mat, bone->arm_mat);
+ mul_m4_m4m4(pchan->pose_mat, pchan->chan_mat, bone->arm_mat);
+
+ /* optional location without arm_mat rotation */
+ if(bone->flag & BONE_NO_LOCAL_LOCATION)
+ add_v3_v3v3(pchan->pose_mat[3], bone->arm_mat[3], pchan->chan_mat[3]);
/* only rootbones get the cyclic offset (unless user doesn't want that) */
if ((bone->flag & BONE_NO_CYCLICOFFSET) == 0)
- VecAddf(pchan->pose_mat[3], pchan->pose_mat[3], ob->pose->cyclic_offset);
+ add_v3_v3v3(pchan->pose_mat[3], pchan->pose_mat[3], ob->pose->cyclic_offset);
}
/* do NLA strip modifiers - i.e. curve follow */
@@ -2229,8 +2308,8 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
VECCOPY(pchan->pose_head, pchan->pose_mat[3]);
/* calculate tail */
VECCOPY(vec, pchan->pose_mat[1]);
- VecMulf(vec, bone->length);
- VecAddf(pchan->pose_tail, pchan->pose_head, vec);
+ mul_v3_fl(vec, bone->length);
+ add_v3_v3v3(pchan->pose_tail, pchan->pose_head, vec);
}
/* This only reads anim data from channels, and writes to channels */
@@ -2258,14 +2337,14 @@ void where_is_pose (Scene *scene, Object *ob)
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
bone= pchan->bone;
if(bone) {
- Mat4CpyMat4(pchan->pose_mat, bone->arm_mat);
+ copy_m4_m4(pchan->pose_mat, bone->arm_mat);
VECCOPY(pchan->pose_head, bone->arm_head);
VECCOPY(pchan->pose_tail, bone->arm_tail);
}
}
}
else {
- Mat4Invert(ob->imat, ob->obmat); // imat is needed
+ invert_m4_m4(ob->imat, ob->obmat); // imat is needed
/* 1. clear flags */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -2303,8 +2382,8 @@ void where_is_pose (Scene *scene, Object *ob)
/* calculating deform matrices */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if(pchan->bone) {
- Mat4Invert(imat, pchan->bone->arm_mat);
- Mat4MulMat4(pchan->chan_mat, imat, pchan->pose_mat);
+ invert_m4_m4(imat, pchan->bone->arm_mat);
+ mul_m4_m4m4(pchan->chan_mat, imat, pchan->pose_mat);
}
}
}
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 712fb13cfc0..389009cca76 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -43,7 +43,7 @@
#include "DNA_listBase.h"
#include "BLI_rand.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
#include "BLI_kdopbvh.h"
@@ -135,10 +135,10 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
/* estimate future location of target */
get_effector_data(eff, &efd, &epoint, 1);
- VecMulf(efd.vel, efd.distance / (val->max_speed * bbd->timestep));
- VecAddf(efd.loc, efd.loc, efd.vel);
- VecSubf(efd.vec_to_point, pa->prev_state.co, efd.loc);
- efd.distance = VecLength(efd.vec_to_point);
+ mul_v3_fl(efd.vel, efd.distance / (val->max_speed * bbd->timestep));
+ add_v3_v3v3(efd.loc, efd.loc, efd.vel);
+ sub_v3_v3v3(efd.vec_to_point, pa->prev_state.co, efd.loc);
+ efd.distance = len_v3(efd.vec_to_point);
}
if(rule->type == eBoidRuleType_Goal && boids->options & BOID_ALLOW_CLIMB && surface!=0.0f) {
@@ -152,17 +152,17 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
priority > 2.0f * gabr->fear_factor) {
/* detach from surface and try to fly away from danger */
VECCOPY(efd.vec_to_point, bpa->gravity);
- VecMulf(efd.vec_to_point, -1.0f);
+ mul_v3_fl(efd.vec_to_point, -1.0f);
}
VECCOPY(bbd->wanted_co, efd.vec_to_point);
- VecMulf(bbd->wanted_co, mul);
+ mul_v3_fl(bbd->wanted_co, mul);
bbd->wanted_speed = val->max_speed * priority;
/* with goals factor is approach velocity factor */
if(rule->type == eBoidRuleType_Goal && boids->landing_smoothness > 0.0f) {
- float len2 = 2.0f*VecLength(pa->prev_state.vel);
+ float len2 = 2.0f*len_v3(pa->prev_state.vel);
surface *= pa->size * boids->height;
@@ -198,12 +198,12 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
float radius = val->personal_space * pa->size, ray_dir[3];
VECCOPY(col.co1, pa->prev_state.co);
- VecAddf(col.co2, pa->prev_state.co, pa->prev_state.vel);
- VecSubf(ray_dir, col.co2, col.co1);
- VecMulf(ray_dir, acbr->look_ahead);
+ add_v3_v3v3(col.co2, pa->prev_state.co, pa->prev_state.vel);
+ sub_v3_v3v3(ray_dir, col.co2, col.co1);
+ mul_v3_fl(ray_dir, acbr->look_ahead);
col.t = 0.0f;
hit.index = -1;
- hit.dist = col.ray_len = VecLength(ray_dir);
+ hit.dist = col.ray_len = len_v3(ray_dir);
/* find out closest deflector object */
for(coll = bbd->sim->colliders->first; coll; coll=coll->next) {
@@ -224,9 +224,9 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
VECCOPY(bbd->wanted_co, col.nor);
- VecMulf(bbd->wanted_co, (1.0f - t) * val->personal_space * pa->size);
+ mul_v3_fl(bbd->wanted_co, (1.0f - t) * val->personal_space * pa->size);
- bbd->wanted_speed = sqrt(t) * VecLength(pa->prev_state.vel);
+ bbd->wanted_speed = sqrt(t) * len_v3(pa->prev_state.vel);
return 1;
}
@@ -235,39 +235,39 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
//check boids in own system
if(acbr->options & BRULE_ACOLL_WITH_BOIDS)
{
- neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * VecLength(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
+ neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
if(neighbors > 1) for(n=1; nprev_state.co);
VECCOPY(vel1, pa->prev_state.vel);
VECCOPY(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
VECCOPY(vel2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.vel);
- VecSubf(loc, co1, co2);
+ sub_v3_v3v3(loc, co1, co2);
- VecSubf(vec, vel1, vel2);
+ sub_v3_v3v3(vec, vel1, vel2);
- inp = Inpf(vec,vec);
+ inp = dot_v3v3(vec,vec);
/* velocities not parallel */
if(inp != 0.0f) {
- t = -Inpf(loc, vec)/inp;
+ t = -dot_v3v3(loc, vec)/inp;
/* cpa is not too far in the future so investigate further */
if(t > 0.0f && t < t_min) {
VECADDFAC(co1, co1, vel1, t);
VECADDFAC(co2, co2, vel2, t);
- VecSubf(vec, co2, co1);
+ sub_v3_v3v3(vec, co2, co1);
- len = Normalize(vec);
+ len = normalize_v3(vec);
/* distance of cpa is close enough */
if(len < 2.0f * val->personal_space * pa->size) {
t_min = t;
- VecMulf(vec, VecLength(vel1));
- VecMulf(vec, (2.0f - t)/2.0f);
- VecSubf(bbd->wanted_co, vel1, vec);
- bbd->wanted_speed = VecLength(bbd->wanted_co);
+ mul_v3_fl(vec, len_v3(vel1));
+ mul_v3_fl(vec, (2.0f - t)/2.0f);
+ sub_v3_v3v3(bbd->wanted_co, vel1, vec);
+ bbd->wanted_speed = len_v3(bbd->wanted_co);
ret = 1;
}
}
@@ -281,39 +281,39 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
ParticleSystem *epsys = psys_get_target_system(bbd->sim->ob, pt);
if(epsys) {
- neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * VecLength(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
+ neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
if(neighbors > 0) for(n=0; nprev_state.co);
VECCOPY(vel1, pa->prev_state.vel);
VECCOPY(co2, (epsys->particles + ptn[n].index)->prev_state.co);
VECCOPY(vel2, (epsys->particles + ptn[n].index)->prev_state.vel);
- VecSubf(loc, co1, co2);
+ sub_v3_v3v3(loc, co1, co2);
- VecSubf(vec, vel1, vel2);
+ sub_v3_v3v3(vec, vel1, vel2);
- inp = Inpf(vec,vec);
+ inp = dot_v3v3(vec,vec);
/* velocities not parallel */
if(inp != 0.0f) {
- t = -Inpf(loc, vec)/inp;
+ t = -dot_v3v3(loc, vec)/inp;
/* cpa is not too far in the future so investigate further */
if(t > 0.0f && t < t_min) {
VECADDFAC(co1, co1, vel1, t);
VECADDFAC(co2, co2, vel2, t);
- VecSubf(vec, co2, co1);
+ sub_v3_v3v3(vec, co2, co1);
- len = Normalize(vec);
+ len = normalize_v3(vec);
/* distance of cpa is close enough */
if(len < 2.0f * val->personal_space * pa->size) {
t_min = t;
- VecMulf(vec, VecLength(vel1));
- VecMulf(vec, (2.0f - t)/2.0f);
- VecSubf(bbd->wanted_co, vel1, vec);
- bbd->wanted_speed = VecLength(bbd->wanted_co);
+ mul_v3_fl(vec, len_v3(vel1));
+ mul_v3_fl(vec, (2.0f - t)/2.0f);
+ sub_v3_v3v3(bbd->wanted_co, vel1, vec);
+ bbd->wanted_speed = len_v3(bbd->wanted_co);
ret = 1;
}
}
@@ -340,9 +340,9 @@ static int rule_separate(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Pa
int ret = 0;
if(neighbors > 1 && ptn[1].dist!=0.0f) {
- VecSubf(vec, pa->prev_state.co, bbd->sim->psys->particles[ptn[1].index].state.co);
- VecMulf(vec, (2.0f * val->personal_space * pa->size - ptn[1].dist) / ptn[1].dist);
- VecAddf(bbd->wanted_co, bbd->wanted_co, vec);
+ sub_v3_v3v3(vec, pa->prev_state.co, bbd->sim->psys->particles[ptn[1].index].state.co);
+ mul_v3_fl(vec, (2.0f * val->personal_space * pa->size - ptn[1].dist) / ptn[1].dist);
+ add_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
bbd->wanted_speed = val->max_speed;
len = ptn[1].dist;
ret = 1;
@@ -357,9 +357,9 @@ static int rule_separate(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Pa
neighbors = BLI_kdtree_range_search(epsys->tree, 2.0f * val->personal_space * pa->size, pa->prev_state.co, NULL, &ptn);
if(neighbors > 0 && ptn[0].dist < len) {
- VecSubf(vec, pa->prev_state.co, ptn[0].co);
- VecMulf(vec, (2.0f * val->personal_space * pa->size - ptn[0].dist) / ptn[1].dist);
- VecAddf(bbd->wanted_co, bbd->wanted_co, vec);
+ sub_v3_v3v3(vec, pa->prev_state.co, ptn[0].co);
+ mul_v3_fl(vec, (2.0f * val->personal_space * pa->size - ptn[0].dist) / ptn[1].dist);
+ add_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
bbd->wanted_speed = val->max_speed;
len = ptn[0].dist;
ret = 1;
@@ -380,19 +380,19 @@ static int rule_flock(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
if(neighbors > 1) {
for(n=1; nsim->psys->particles[ptn[n].index].prev_state.co);
- VecAddf(vec, vec, bbd->sim->psys->particles[ptn[n].index].prev_state.vel);
+ add_v3_v3v3(loc, loc, bbd->sim->psys->particles[ptn[n].index].prev_state.co);
+ add_v3_v3v3(vec, vec, bbd->sim->psys->particles[ptn[n].index].prev_state.vel);
}
- VecMulf(loc, 1.0f/((float)neighbors - 1.0f));
- VecMulf(vec, 1.0f/((float)neighbors - 1.0f));
+ mul_v3_fl(loc, 1.0f/((float)neighbors - 1.0f));
+ mul_v3_fl(vec, 1.0f/((float)neighbors - 1.0f));
- VecSubf(loc, loc, pa->prev_state.co);
- VecSubf(vec, vec, pa->prev_state.vel);
+ sub_v3_v3v3(loc, loc, pa->prev_state.co);
+ sub_v3_v3v3(vec, vec, pa->prev_state.vel);
- VecAddf(bbd->wanted_co, bbd->wanted_co, vec);
- VecAddf(bbd->wanted_co, bbd->wanted_co, loc);
- bbd->wanted_speed = VecLength(bbd->wanted_co);
+ add_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
+ add_v3_v3v3(bbd->wanted_co, bbd->wanted_co, loc);
+ bbd->wanted_speed = len_v3(bbd->wanted_co);
ret = 1;
}
@@ -410,16 +410,16 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
float vec2[3], t;
/* first check we're not blocking the leader*/
- VecSubf(vec, flbr->loc, flbr->oloc);
- VecMulf(vec, 1.0f/bbd->timestep);
+ sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
+ mul_v3_fl(vec, 1.0f/bbd->timestep);
- VecSubf(loc, pa->prev_state.co, flbr->oloc);
+ sub_v3_v3v3(loc, pa->prev_state.co, flbr->oloc);
- mul = Inpf(vec, vec);
+ mul = dot_v3v3(vec, vec);
/* leader is not moving */
if(mul < 0.01) {
- len = VecLength(loc);
+ len = len_v3(loc);
/* too close to leader */
if(len < 2.0f * val->personal_space * pa->size) {
VECCOPY(bbd->wanted_co, loc);
@@ -428,16 +428,16 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
}
}
else {
- t = Inpf(loc, vec)/mul;
+ t = dot_v3v3(loc, vec)/mul;
/* possible blocking of leader in near future */
if(t > 0.0f && t < 3.0f) {
VECCOPY(vec2, vec);
- VecMulf(vec2, t);
+ mul_v3_fl(vec2, t);
- VecSubf(vec2, loc, vec2);
+ sub_v3_v3v3(vec2, loc, vec2);
- len = VecLength(vec2);
+ len = len_v3(vec2);
if(len < 2.0f * val->personal_space * pa->size) {
VECCOPY(bbd->wanted_co, vec2);
@@ -454,15 +454,15 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
}
else {
VECCOPY(loc, flbr->oloc);
- VecSubf(vec, flbr->loc, flbr->oloc);
- VecMulf(vec, 1.0/bbd->timestep);
+ sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
+ mul_v3_fl(vec, 1.0/bbd->timestep);
}
/* fac is seconds behind leader */
VECADDFAC(loc, loc, vec, -flbr->distance);
- VecSubf(bbd->wanted_co, loc, pa->prev_state.co);
- bbd->wanted_speed = VecLength(bbd->wanted_co);
+ sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co);
+ bbd->wanted_speed = len_v3(bbd->wanted_co);
ret = 1;
}
@@ -473,13 +473,13 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
for(i = 0; i< bbd->sim->psys->totpart; i+=n){
VECCOPY(vec, bbd->sim->psys->particles[i].prev_state.vel);
- VecSubf(loc, pa->prev_state.co, bbd->sim->psys->particles[i].prev_state.co);
+ sub_v3_v3v3(loc, pa->prev_state.co, bbd->sim->psys->particles[i].prev_state.co);
- mul = Inpf(vec, vec);
+ mul = dot_v3v3(vec, vec);
/* leader is not moving */
if(mul < 0.01) {
- len = VecLength(loc);
+ len = len_v3(loc);
/* too close to leader */
if(len < 2.0f * val->personal_space * pa->size) {
VECCOPY(bbd->wanted_co, loc);
@@ -488,16 +488,16 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
}
}
else {
- t = Inpf(loc, vec)/mul;
+ t = dot_v3v3(loc, vec)/mul;
/* possible blocking of leader in near future */
if(t > 0.0f && t < t_min) {
VECCOPY(vec2, vec);
- VecMulf(vec2, t);
+ mul_v3_fl(vec2, t);
- VecSubf(vec2, loc, vec2);
+ sub_v3_v3v3(vec2, loc, vec2);
- len = VecLength(vec2);
+ len = len_v3(vec2);
if(len < 2.0f * val->personal_space * pa->size) {
t_min = t;
@@ -524,8 +524,8 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
/* fac is seconds behind leader */
VECADDFAC(loc, loc, vec, -flbr->distance);
- VecSubf(bbd->wanted_co, loc, pa->prev_state.co);
- bbd->wanted_speed = VecLength(bbd->wanted_co);
+ sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co);
+ bbd->wanted_speed = len_v3(bbd->wanted_co);
ret = 1;
}
@@ -544,30 +544,30 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
bpa->wander[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
bpa->wander[2] += asbr->wander * (-1.0f + 2.0f * BLI_frand());
- Normalize(bpa->wander);
+ normalize_v3(bpa->wander);
VECCOPY(vec, bpa->wander);
- QuatMulVecf(pa->prev_state.rot, vec);
+ mul_qt_v3(pa->prev_state.rot, vec);
VECCOPY(bbd->wanted_co, pa->prev_state.ave);
- VecMulf(bbd->wanted_co, 1.1f);
+ mul_v3_fl(bbd->wanted_co, 1.1f);
- VecAddf(bbd->wanted_co, bbd->wanted_co, vec);
+ add_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
/* leveling */
if(asbr->level > 0.0f) {
- Projf(vec, bbd->wanted_co, bbd->sim->psys->part->acc);
- VecMulf(vec, asbr->level);
- VecSubf(bbd->wanted_co, bbd->wanted_co, vec);
+ project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->psys->part->acc);
+ mul_v3_fl(vec, asbr->level);
+ sub_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
}
}
else {
VECCOPY(bbd->wanted_co, pa->prev_state.ave);
/* may happen at birth */
- if(Inp2f(bbd->wanted_co,bbd->wanted_co)==0.0f) {
+ if(dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
bbd->wanted_co[0] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[1] = 2.0f*(0.5f - BLI_frand());
bbd->wanted_co[2] = 2.0f*(0.5f - BLI_frand());
@@ -575,9 +575,9 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
/* leveling */
if(asbr->level > 0.0f) {
- Projf(vec, bbd->wanted_co, bbd->sim->psys->part->acc);
- VecMulf(vec, asbr->level);
- VecSubf(bbd->wanted_co, bbd->wanted_co, vec);
+ project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->psys->part->acc);
+ mul_v3_fl(vec, asbr->level);
+ sub_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec);
}
}
@@ -641,20 +641,20 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
}
/* decide action if enemy presence found */
if(e_strength > 0.0f) {
- VecSubf(bbd->wanted_co, closest_enemy, pa->prev_state.co);
+ sub_v3_v3v3(bbd->wanted_co, closest_enemy, pa->prev_state.co);
/* attack if in range */
if(closest_dist <= bbd->part->boids->range + pa->size + enemy_pa->size) {
float damage = BLI_frand();
float enemy_dir[3] = {bbd->wanted_co[0],bbd->wanted_co[1],bbd->wanted_co[2]};
- Normalize(enemy_dir);
+ normalize_v3(enemy_dir);
/* fight mode */
bbd->wanted_speed = 0.0f;
/* must face enemy to fight */
- if(Inpf(pa->prev_state.ave, enemy_dir)>0.5f) {
+ if(dot_v3v3(pa->prev_state.ave, enemy_dir)>0.5f) {
bpa = enemy_pa->boid;
bpa->data.health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy);
}
@@ -669,7 +669,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
if(bpa->data.health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) {
/* decide to flee */
if(closest_dist < fbr->flee_distance * fbr->distance) {
- VecMulf(bbd->wanted_co, -1.0f);
+ mul_v3_fl(bbd->wanted_co, -1.0f);
bbd->wanted_speed = val->max_speed;
}
else { /* wait for better odds */
@@ -735,7 +735,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
/* take surface velocity into account */
closest_point_on_surface(surmd, pa->state.co, x, NULL, v);
- VecAddf(x, x, v);
+ add_v3_v3v3(x, x, v);
/* get actual position on surface */
closest_point_on_surface(surmd, x, ground_co, ground_nor, NULL);
@@ -754,12 +754,12 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
VECCOPY(col.co1, pa->state.co);
VECCOPY(col.co2, pa->state.co);
- VecAddf(col.co1, col.co1, zvec);
- VecSubf(col.co2, col.co2, zvec);
- VecSubf(ray_dir, col.co2, col.co1);
+ add_v3_v3v3(col.co1, col.co1, zvec);
+ sub_v3_v3v3(col.co2, col.co2, zvec);
+ sub_v3_v3v3(ray_dir, col.co2, col.co1);
col.t = 0.0f;
hit.index = -1;
- hit.dist = col.ray_len = VecLength(ray_dir);
+ hit.dist = col.ray_len = len_v3(ray_dir);
/* find out upmost deflector object */
for(coll = bbd->sim->colliders->first; coll; coll = coll->next){
@@ -772,9 +772,9 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
/* then use that object */
if(hit.index>=0) {
t = hit.dist/col.ray_len;
- VecLerpf(ground_co, col.co1, col.co2, t);
+ interp_v3_v3v3(ground_co, col.co1, col.co2, t);
VECCOPY(ground_nor, col.nor);
- Normalize(ground_nor);
+ normalize_v3(ground_nor);
return col.hit_ob;
}
else {
@@ -829,23 +829,23 @@ static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co,
/* gather apparent gravity */
VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0);
- Normalize(bpa->gravity);
+ normalize_v3(bpa->gravity);
/* raise boid it's size from surface */
- VecMulf(nor, pa->size * boids->height);
- VecAddf(pa->state.co, surface_co, nor);
+ mul_v3_fl(nor, pa->size * boids->height);
+ add_v3_v3v3(pa->state.co, surface_co, nor);
/* remove normal component from velocity */
- Projf(vel, pa->state.vel, surface_nor);
- VecSubf(pa->state.vel, pa->state.vel, vel);
+ project_v3_v3v3(vel, pa->state.vel, surface_nor);
+ sub_v3_v3v3(pa->state.vel, pa->state.vel, vel);
}
static float boid_goal_signed_dist(float *boid_co, float *goal_co, float *goal_nor)
{
float vec[3];
- VecSubf(vec, boid_co, goal_co);
+ sub_v3_v3v3(vec, boid_co, goal_co);
- return Inpf(vec, goal_nor);
+ return dot_v3v3(vec, goal_nor);
}
/* wanted_co is relative to boid location */
static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val, ParticleData *pa, float fuzziness)
@@ -859,7 +859,7 @@ static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val,
if(boid_rules[rule->type](rule, bbd, val, pa)==0)
return 0;
- if(fuzziness < 0.0f || VecLenCompare(bbd->wanted_co, pa->prev_state.vel, fuzziness * VecLength(pa->prev_state.vel))==0)
+ if(fuzziness < 0.0f || compare_len_v3v3(bbd->wanted_co, pa->prev_state.vel, fuzziness * len_v3(pa->prev_state.vel))==0)
return 1;
else
return 0;
@@ -943,7 +943,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
int n = 0;
for(rule = state->rules.first; rule; rule=rule->next) {
if(apply_boid_rule(bbd, rule, &val, pa, -1.0f)) {
- VecAddf(wanted_co, wanted_co, bbd->wanted_co);
+ add_v3_v3v3(wanted_co, wanted_co, bbd->wanted_co);
wanted_speed += bbd->wanted_speed;
n++;
bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f;
@@ -951,7 +951,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
}
if(n > 1) {
- VecMulf(wanted_co, 1.0f/(float)n);
+ mul_v3_fl(wanted_co, 1.0f/(float)n);
wanted_speed /= (float)n;
}
@@ -971,12 +971,12 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
float cvel[3], dir[3];
VECCOPY(dir, pa->prev_state.ave);
- Normalize2(dir);
+ normalize_v2(dir);
VECCOPY(cvel, bbd->wanted_co);
- Normalize2(cvel);
+ normalize_v2(cvel);
- if(Inp2f(cvel, dir) > 0.95 / mul)
+ if(dot_v2v2(cvel, dir) > 0.95 / mul)
bpa->data.mode = eBoidMode_Liftoff;
}
else if(val.jump_speed > 0.0f) {
@@ -990,20 +990,20 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
float len;
VECCOPY(dir, pa->prev_state.ave);
- Normalize2(dir);
+ normalize_v2(dir);
VECCOPY(cvel, bbd->wanted_co);
- Normalize2(cvel);
+ normalize_v2(cvel);
- len = Vec2Length(pa->prev_state.vel);
+ len = len_v2(pa->prev_state.vel);
/* first of all, are we going in a suitable direction? */
/* or at a suitably slow speed */
- if(Inp2f(cvel, dir) > 0.95f / mul || len <= state->rule_fuzziness) {
+ if(dot_v2v2(cvel, dir) > 0.95f / mul || len <= state->rule_fuzziness) {
/* try to reach goal at highest point of the parabolic path */
- cur_v = Vec2Length(pa->prev_state.vel);
+ cur_v = len_v2(pa->prev_state.vel);
z_v = sasqrt(-2.0f * bbd->part->acc[2] * bbd->wanted_co[2]);
- ground_v = Vec2Length(bbd->wanted_co)*sasqrt(-0.5f * bbd->part->acc[2] / bbd->wanted_co[2]);
+ ground_v = len_v2(bbd->wanted_co)*sasqrt(-0.5f * bbd->part->acc[2] / bbd->wanted_co[2]);
len = sasqrt((ground_v-cur_v)*(ground_v-cur_v) + z_v*z_v);
@@ -1014,11 +1014,11 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
VECCOPY(jump_v, dir);
jump_v[2] = z_v;
- VecMulf(jump_v, ground_v);
+ mul_v3_fl(jump_v, ground_v);
- Normalize(jump_v);
- VecMulf(jump_v, len);
- Vec2Addf(jump_v, jump_v, pa->prev_state.vel);
+ normalize_v3(jump_v);
+ mul_v3_fl(jump_v, len);
+ add_v2_v2v2(jump_v, jump_v, pa->prev_state.vel);
}
}
}
@@ -1103,7 +1103,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
VECCOPY(old_dir, pa->prev_state.ave);
VECCOPY(wanted_dir, bbd->wanted_co);
- new_speed = Normalize(wanted_dir);
+ new_speed = normalize_v3(wanted_dir);
/* first check if we have valid direction we want to go towards */
if(new_speed == 0.0f) {
@@ -1111,39 +1111,39 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
}
else {
float old_dir2[2], wanted_dir2[2], nor[3], angle;
- Vec2Copyf(old_dir2, old_dir);
- Normalize2(old_dir2);
- Vec2Copyf(wanted_dir2, wanted_dir);
- Normalize2(wanted_dir2);
+ copy_v2_v2(old_dir2, old_dir);
+ normalize_v2(old_dir2);
+ copy_v2_v2(wanted_dir2, wanted_dir);
+ normalize_v2(wanted_dir2);
/* choose random direction to turn if wanted velocity */
/* is directly behind regardless of z-coordinate */
- if(Inp2f(old_dir2, wanted_dir2) < -0.99f) {
+ if(dot_v2v2(old_dir2, wanted_dir2) < -0.99f) {
wanted_dir[0] = 2.0f*(0.5f - BLI_frand());
wanted_dir[1] = 2.0f*(0.5f - BLI_frand());
wanted_dir[2] = 2.0f*(0.5f - BLI_frand());
- Normalize(wanted_dir);
+ normalize_v3(wanted_dir);
}
/* constrain direction with maximum angular velocity */
- angle = saacos(Inpf(old_dir, wanted_dir));
+ angle = saacos(dot_v3v3(old_dir, wanted_dir));
angle = MIN2(angle, val.max_ave);
- Crossf(nor, old_dir, wanted_dir);
- VecRotToQuat(nor, angle, q);
+ cross_v3_v3v3(nor, old_dir, wanted_dir);
+ axis_angle_to_quat( q,nor, angle);
VECCOPY(new_dir, old_dir);
- QuatMulVecf(q, new_dir);
- Normalize(new_dir);
+ mul_qt_v3(q, new_dir);
+ normalize_v3(new_dir);
/* save direction in case resulting velocity too small */
- VecRotToQuat(nor, angle*dtime, q);
+ axis_angle_to_quat( q,nor, angle*dtime);
VECCOPY(pa->state.ave, old_dir);
- QuatMulVecf(q, pa->state.ave);
- Normalize(pa->state.ave);
+ mul_qt_v3(q, pa->state.ave);
+ normalize_v3(pa->state.ave);
}
/* constrain speed with maximum acceleration */
- old_speed = VecLength(pa->prev_state.vel);
+ old_speed = len_v3(pa->prev_state.vel);
if(bbd->wanted_speed < old_speed)
new_speed = MAX2(bbd->wanted_speed, old_speed - val.max_acc);
@@ -1152,11 +1152,11 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* combine direction and speed */
VECCOPY(new_vel, new_dir);
- VecMulf(new_vel, new_speed);
+ mul_v3_fl(new_vel, new_speed);
/* maintain minimum flying velocity if not landing */
if(level >= landing_level) {
- float len2 = Inp2f(new_vel,new_vel);
+ float len2 = dot_v2v2(new_vel,new_vel);
float root;
len2 = MAX2(len2, val.min_speed*val.min_speed);
@@ -1164,20 +1164,20 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
new_vel[2] = new_vel[2] < 0.0f ? -root : root;
- Normalize2(new_vel);
- Vec2Mulf(new_vel, sasqrt(len2));
+ normalize_v2(new_vel);
+ mul_v2_fl(new_vel, sasqrt(len2));
}
/* finally constrain speed to max speed */
- new_speed = Normalize(new_vel);
- VecMulf(new_vel, MIN2(new_speed, val.max_speed));
+ new_speed = normalize_v3(new_vel);
+ mul_v3_fl(new_vel, MIN2(new_speed, val.max_speed));
/* get acceleration from difference of velocities */
- VecSubf(acc, new_vel, pa->prev_state.vel);
+ sub_v3_v3v3(acc, new_vel, pa->prev_state.vel);
/* break acceleration to components */
- Projf(tan_acc, acc, pa->prev_state.ave);
- VecSubf(nor_acc, acc, tan_acc);
+ project_v3_v3v3(tan_acc, acc, pa->prev_state.ave);
+ sub_v3_v3v3(nor_acc, acc, tan_acc);
}
/* account for effectors */
@@ -1185,32 +1185,32 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
pdDoEffectors(bbd->sim->psys->effectors, bbd->sim->colliders, bbd->part->effector_weights, &epoint, force, NULL);
if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) {
- float length = Normalize(force);
+ float length = normalize_v3(force);
length = MAX2(0.0f, length - boids->land_stick_force);
- VecMulf(force, length);
+ mul_v3_fl(force, length);
}
- VecAddf(acc, acc, force);
+ add_v3_v3v3(acc, acc, force);
/* store smoothed acceleration for nice banking etc. */
VECADDFAC(bpa->data.acc, bpa->data.acc, acc, dtime);
- VecMulf(bpa->data.acc, 1.0f / (1.0f + dtime));
+ mul_v3_fl(bpa->data.acc, 1.0f / (1.0f + dtime));
/* integrate new location & velocity */
/* by regarding the acceleration as a force at this stage we*/
/* can get better control allthough it's a bit unphysical */
- VecMulf(acc, 1.0f/pa_mass);
+ mul_v3_fl(acc, 1.0f/pa_mass);
VECCOPY(dvec, acc);
- VecMulf(dvec, dtime*dtime*0.5f);
+ mul_v3_fl(dvec, dtime*dtime*0.5f);
VECCOPY(bvec, pa->prev_state.vel);
- VecMulf(bvec, dtime);
- VecAddf(dvec, dvec, bvec);
- VecAddf(pa->state.co, pa->state.co, dvec);
+ mul_v3_fl(bvec, dtime);
+ add_v3_v3v3(dvec, dvec, bvec);
+ add_v3_v3v3(pa->state.co, pa->state.co, dvec);
VECADDFAC(pa->state.vel, pa->state.vel, acc, dtime);
@@ -1224,9 +1224,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
float grav[3] = {0.0f, 0.0f, bbd->part->acc[2] < 0.0f ? -1.0f : 0.0f};
/* don't take forward acceleration into account (better banking) */
- if(Inpf(bpa->data.acc, pa->state.vel) > 0.0f) {
- Projf(dvec, bpa->data.acc, pa->state.vel);
- VecSubf(dvec, bpa->data.acc, dvec);
+ if(dot_v3v3(bpa->data.acc, pa->state.vel) > 0.0f) {
+ project_v3_v3v3(dvec, bpa->data.acc, pa->state.vel);
+ sub_v3_v3v3(dvec, bpa->data.acc, dvec);
}
else {
VECCOPY(dvec, bpa->data.acc);
@@ -1234,7 +1234,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* gather apparent gravity */
VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
- Normalize(bpa->gravity);
+ normalize_v3(bpa->gravity);
/* stick boid on goal when close enough */
if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) {
@@ -1257,7 +1257,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* gather apparent gravity */
VECADDFAC(bpa->gravity, bpa->gravity, grav, dtime);
- Normalize(bpa->gravity);
+ normalize_v3(bpa->gravity);
if(boids->options & BOID_ALLOW_LAND) {
/* stick boid on goal when close enough */
@@ -1289,15 +1289,15 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
///* gather apparent gravity to r_ve */
//VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0);
- //Normalize(pa->r_ve);
+ //normalize_v3(pa->r_ve);
///* raise boid it's size from surface */
- //VecMulf(nor, pa->size * boids->height);
- //VecAddf(pa->state.co, ground_co, nor);
+ //mul_v3_fl(nor, pa->size * boids->height);
+ //add_v3_v3v3(pa->state.co, ground_co, nor);
///* remove normal component from velocity */
- //Projf(v, pa->state.vel, ground_nor);
- //VecSubf(pa->state.vel, pa->state.vel, v);
+ //project_v3_v3v3(v, pa->state.vel, ground_nor);
+ //sub_v3_v3v3(pa->state.vel, pa->state.vel, v);
break;
}
case eBoidMode_OnLand:
@@ -1323,19 +1323,19 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* Don't take gravity's strength in to account, */
/* otherwise amount of banking is hard to control. */
VECCOPY(grav, ground_nor);
- VecMulf(grav, -1.0f);
+ mul_v3_fl(grav, -1.0f);
- Projf(dvec, bpa->data.acc, pa->state.vel);
- VecSubf(dvec, bpa->data.acc, dvec);
+ project_v3_v3v3(dvec, bpa->data.acc, pa->state.vel);
+ sub_v3_v3v3(dvec, bpa->data.acc, dvec);
/* gather apparent gravity */
VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
- Normalize(bpa->gravity);
+ normalize_v3(bpa->gravity);
}
else {
/* gather negative surface normal */
VECADDFAC(bpa->gravity, bpa->gravity, ground_nor, -1.0f);
- Normalize(bpa->gravity);
+ normalize_v3(bpa->gravity);
}
break;
}
@@ -1343,36 +1343,36 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* save direction to state.ave unless the boid is falling */
/* (boids can't effect their direction when falling) */
- if(bpa->data.mode!=eBoidMode_Falling && VecLength(pa->state.vel) > 0.1*pa->size) {
+ if(bpa->data.mode!=eBoidMode_Falling && len_v3(pa->state.vel) > 0.1*pa->size) {
VECCOPY(pa->state.ave, pa->state.vel);
- Normalize(pa->state.ave);
+ normalize_v3(pa->state.ave);
}
/* apply damping */
if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing))
- VecMulf(pa->state.vel, 1.0f - 0.2f*bbd->part->dampfac);
+ mul_v3_fl(pa->state.vel, 1.0f - 0.2f*bbd->part->dampfac);
/* calculate rotation matrix based on forward & down vectors */
if(bpa->data.mode == eBoidMode_InAir) {
VECCOPY(mat[0], pa->state.ave);
- Projf(dvec, bpa->gravity, pa->state.ave);
- VecSubf(mat[2], bpa->gravity, dvec);
- Normalize(mat[2]);
+ project_v3_v3v3(dvec, bpa->gravity, pa->state.ave);
+ sub_v3_v3v3(mat[2], bpa->gravity, dvec);
+ normalize_v3(mat[2]);
}
else {
- Projf(dvec, pa->state.ave, bpa->gravity);
- VecSubf(mat[0], pa->state.ave, dvec);
- Normalize(mat[0]);
+ project_v3_v3v3(dvec, pa->state.ave, bpa->gravity);
+ sub_v3_v3v3(mat[0], pa->state.ave, dvec);
+ normalize_v3(mat[0]);
VECCOPY(mat[2], bpa->gravity);
}
- VecMulf(mat[2], -1.0f);
- Crossf(mat[1], mat[2], mat[0]);
+ mul_v3_fl(mat[2], -1.0f);
+ cross_v3_v3v3(mat[1], mat[2], mat[0]);
/* apply rotation */
- Mat3ToQuat_is_ok(mat, q);
- QuatCopy(pa->state.rot, q);
+ mat3_to_quat_is_ok( q,mat);
+ copy_qt_qt(pa->state.rot, q);
}
BoidRule *boid_new_rule(int type)
diff --git a/source/blender/blenkernel/intern/booleanops.c b/source/blender/blenkernel/intern/booleanops.c
index 1f6457199fb..68e1f61a800 100644
--- a/source/blender/blenkernel/intern/booleanops.c
+++ b/source/blender/blenkernel/intern/booleanops.c
@@ -33,7 +33,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
@@ -104,7 +104,7 @@ static void VertexIt_Fill(CSG_IteratorPtr it, CSG_IVertex *vert)
float global_pos[3];
/* boolean happens in global space, transform both with obmat */
- VecMat4MulVecfl(
+ mul_v3_m4v3(
global_pos,
iterator->ob->obmat,
verts[iterator->pos].co
@@ -327,11 +327,11 @@ static void InterpCSGFace(
for (j = 0; j < nr; j++) {
// get coordinate into the space of the original mesh
if (mapmat)
- VecMat4MulVecfl(obco, mapmat, co[j]);
+ mul_v3_m4v3(obco, mapmat, co[j]);
else
- VecCopyf(obco, co[j]);
+ copy_v3_v3(obco, co[j]);
- InterpWeightsQ3Dfl(orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco, w[j]);
+ interp_weights_face_v3( w[j],orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco);
}
CustomData_interp(&orig_dm->faceData, &dm->faceData, &orig_index, NULL, (float*)w, 1, index);
@@ -375,7 +375,7 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
// we have to map the vertex coordinates back in the coordinate frame
// of the resulting object, since it was computed in world space
- VecMat4MulVecfl(mvert->co, parinv, csgvert.position);
+ mul_v3_m4v3(mvert->co, parinv, csgvert.position);
}
// a hash table to remap materials to indices
@@ -478,9 +478,9 @@ DerivedMesh *NewBooleanDerivedMesh_intern(
// we map the final object back into ob's local coordinate space. For this
// we need to compute the inverse transform from global to ob (inv_mat),
// and the transform from ob to ob_select for use in interpolation (map_mat)
- Mat4Invert(inv_mat, ob->obmat);
- Mat4MulMat4(map_mat, ob_select->obmat, inv_mat);
- Mat4Invert(inv_mat, ob_select->obmat);
+ invert_m4_m4(inv_mat, ob->obmat);
+ mul_m4_m4m4(map_mat, ob_select->obmat, inv_mat);
+ invert_m4_m4(inv_mat, ob_select->obmat);
{
// interface with the boolean module:
diff --git a/source/blender/blenkernel/intern/booleanops_mesh.c b/source/blender/blenkernel/intern/booleanops_mesh.c
index 14e32873dbd..15a3d042622 100644
--- a/source/blender/blenkernel/intern/booleanops_mesh.c
+++ b/source/blender/blenkernel/intern/booleanops_mesh.c
@@ -47,7 +47,7 @@
#include "BKE_library.h"
#include "BKE_material.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
/**
* Implementation of boolean ops mesh interface.
@@ -151,7 +151,7 @@ CSG_AddMeshToBlender(
if (mesh == NULL) return 0;
if (mesh->base == NULL) return 0;
- Mat4Invert(inv_mat,mesh->base->object->obmat);
+ invert_m4_m4(inv_mat,mesh->base->object->obmat);
// Create a new blender mesh object - using 'base' as
// a template for the new object.
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 115d31b587c..a9d72d93091 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -42,7 +42,7 @@
#include "RNA_access.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -83,7 +83,7 @@ Brush *add_brush(const char *name)
brush->clone.alpha= 0.5;
brush->sculpt_tool = SCULPT_TOOL_DRAW;
- brush_curve_preset(brush, BRUSH_PRESET_SHARP);
+ brush_curve_preset(brush, BRUSH_PRESET_SMOOTH);
/* enable fake user by default */
brush->id.flag |= LIB_FAKEUSER;
@@ -252,7 +252,7 @@ void brush_curve_preset(Brush *b, BrushCurvePreset preset)
if(preset == BRUSH_PRESET_SHARP)
cm->totpoint= 3;
if(preset == BRUSH_PRESET_SMOOTH)
- cm->totpoint= 6;
+ cm->totpoint= 4;
if(preset == BRUSH_PRESET_MAX)
cm->totpoint= 2;
@@ -271,16 +271,12 @@ void brush_curve_preset(Brush *b, BrushCurvePreset preset)
else if(preset == BRUSH_PRESET_SMOOTH) {
cm->curve[0].x= 0;
cm->curve[0].y= 1;
- cm->curve[1].x= 0.1;
- cm->curve[1].y= 0.97553;
- cm->curve[2].x= 0.3;
- cm->curve[2].y= 0.79389;
- cm->curve[3].x= 0.9;
- cm->curve[3].y= 0.02447;
- cm->curve[4].x= 0.7;
- cm->curve[4].y= 0.20611;
- cm->curve[5].x= 1;
- cm->curve[5].y= 0;
+ cm->curve[1].x= 0.25;
+ cm->curve[1].y= 0.92;
+ cm->curve[2].x= 0.75;
+ cm->curve[2].y= 0.08;
+ cm->curve[3].x= 1;
+ cm->curve[3].y= 0;
}
else if(preset == BRUSH_PRESET_MAX) {
cm->curve[0].x= 0;
@@ -845,8 +841,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
/* setup starting time, direction vector and accumulated time */
starttime= painter->accumtime;
- Vec2Subf(dmousepos, pos, painter->lastmousepos);
- len= Normalize2(dmousepos);
+ sub_v2_v2v2(dmousepos, pos, painter->lastmousepos);
+ len= normalize_v2(dmousepos);
painter->accumtime += curtime - painter->lasttime;
/* do paint op over unpainted time distance */
@@ -880,8 +876,8 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
/* setup starting distance, direction vector and accumulated distance */
startdistance= painter->accumdistance;
- Vec2Subf(dmousepos, pos, painter->lastmousepos);
- len= Normalize2(dmousepos);
+ sub_v2_v2v2(dmousepos, pos, painter->lastmousepos);
+ len= normalize_v2(dmousepos);
painter->accumdistance += len;
/* do paint op over unpainted distance */
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index f2526231d50..5945be51aac 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -45,7 +45,7 @@
#include "BKE_displist.h"
#include "BKE_global.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_linklist.h"
#include "MEM_guardedalloc.h"
@@ -55,7 +55,7 @@ static float ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, con
{
float dist;
- if(RayIntersectsTriangle((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL))
+ if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL))
return dist;
return FLT_MAX;
@@ -68,10 +68,10 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con
float p1[3];
float plane_normal[3], hit_point[3];
- CalcNormFloat((float*)v0, (float*)v1, (float*)v2, plane_normal);
+ normal_tri_v3( plane_normal,(float*)v0, (float*)v1, (float*)v2);
VECADDFAC( p1, ray->origin, ray->direction, m_dist);
- if(SweepingSphereIntersectsTriangleUV((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point))
+ if(isect_sweeping_sphere_tri_v3((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point))
{
return idist * m_dist;
}
@@ -384,9 +384,9 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
float w[3], x[3], y[3], z[3];
VECCOPY(w, v0);
VECCOPY(x, e0);
- VecMulf(x, S);
+ mul_v3_fl(x, S);
VECCOPY(y, e1);
- VecMulf(y, T);
+ mul_v3_fl(y, T);
VECADD(z, w, x);
VECADD(z, z, y);
//VECSUB(d, p, z);
@@ -430,7 +430,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co,
nearest->index = index;
nearest->dist = dist;
VECCOPY(nearest->co, nearest_tmp);
- CalcNormFloat(t0, t1, t2, nearest->no);
+ normal_tri_v3( nearest->no,t0, t1, t2);
}
t1 = t2;
@@ -469,7 +469,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
hit->dist = dist;
VECADDFAC(hit->co, ray->origin, ray->direction, dist);
- CalcNormFloat(t0, t1, t2, hit->no);
+ normal_tri_v3( hit->no,t0, t1, t2);
}
t1 = t2;
@@ -492,16 +492,17 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co,
t0 = vert[ edge->v1 ].co;
t1 = vert[ edge->v2 ].co;
- PclosestVL3Dfl(nearest_tmp, co, t0, t1);
- dist = VecLenf(nearest_tmp, co);
+ // NOTE: casts to "float*" here are due to co being "const float*"
+ closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
+ dist = len_v3v3(nearest_tmp, (float*)co);
if(dist < nearest->dist)
{
nearest->index = index;
nearest->dist = dist;
VECCOPY(nearest->co, nearest_tmp);
- VecSubf(nearest->no, t0, t1);
- Normalize(nearest->no);
+ sub_v3_v3v3(nearest->no, t0, t1);
+ normalize_v3(nearest->no);
}
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index e38bb00fe8d..30d1b65cc8b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -45,7 +45,7 @@
#include "BKE_multires.h"
#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
@@ -405,12 +405,9 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void *a
/* TODO make this better (cache facenormals as layer?) */
float nor[3];
if(mface->v4) {
- CalcNormFloat4(mvert[mface->v1].co, mvert[mface->v2].co,
- mvert[mface->v3].co, mvert[mface->v4].co,
- nor);
+ normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
} else {
- CalcNormFloat(mvert[mface->v1].co, mvert[mface->v2].co,
- mvert[mface->v3].co, nor);
+ normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
}
@@ -579,12 +576,9 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
else {
float nor[3];
if(mf->v4) {
- CalcNormFloat4(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, mv[mf->v4].co,
- nor);
+ normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
} else {
- CalcNormFloat(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, nor);
+ normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
}
@@ -754,12 +748,9 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else {
float nor[3];
if(mf->v4) {
- CalcNormFloat4(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, mv[mf->v4].co,
- nor);
+ normal_quad_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
} else {
- CalcNormFloat(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, nor);
+ normal_tri_v3( nor,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
}
glNormal3fv(nor);
}
@@ -929,12 +920,9 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
/* TODO ideally a normal layer should always be available */
float nor[3];
if(mface->v4) {
- CalcNormFloat4(mvert[mface->v1].co, mvert[mface->v2].co,
- mvert[mface->v3].co, mvert[mface->v4].co,
- nor);
+ normal_quad_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co, mvert[mface->v4].co);
} else {
- CalcNormFloat(mvert[mface->v1].co, mvert[mface->v2].co,
- mvert[mface->v3].co, nor);
+ normal_tri_v3( nor,mvert[mface->v1].co, mvert[mface->v2].co, mvert[mface->v3].co);
}
glNormal3fv(nor);
}
@@ -1271,18 +1259,16 @@ static void cdDM_foreachMappedFaceCenter(
orig = i;
VECCOPY(cent, mv[mf->v1].co);
- VecAddf(cent, cent, mv[mf->v2].co);
- VecAddf(cent, cent, mv[mf->v3].co);
+ add_v3_v3v3(cent, cent, mv[mf->v2].co);
+ add_v3_v3v3(cent, cent, mv[mf->v3].co);
if (mf->v4) {
- CalcNormFloat4(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, mv[mf->v4].co, no);
- VecAddf(cent, cent, mv[mf->v4].co);
- VecMulf(cent, 0.25f);
+ normal_quad_v3( no,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
+ add_v3_v3v3(cent, cent, mv[mf->v4].co);
+ mul_v3_fl(cent, 0.25f);
} else {
- CalcNormFloat(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, no);
- VecMulf(cent, 0.33333333333f);
+ normal_tri_v3( no,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
+ mul_v3_fl(cent, 0.33333333333f);
}
func(userData, orig, cent, no);
@@ -1630,26 +1616,24 @@ void CDDM_calc_normals(DerivedMesh *dm)
float *f_no = face_nors[i];
if(mf->v4)
- CalcNormFloat4(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, mv[mf->v4].co, f_no);
+ normal_quad_v3( f_no,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co, mv[mf->v4].co);
else
- CalcNormFloat(mv[mf->v1].co, mv[mf->v2].co,
- mv[mf->v3].co, f_no);
+ normal_tri_v3( f_no,mv[mf->v1].co, mv[mf->v2].co, mv[mf->v3].co);
- VecAddf(temp_nors[mf->v1], temp_nors[mf->v1], f_no);
- VecAddf(temp_nors[mf->v2], temp_nors[mf->v2], f_no);
- VecAddf(temp_nors[mf->v3], temp_nors[mf->v3], f_no);
+ add_v3_v3v3(temp_nors[mf->v1], temp_nors[mf->v1], f_no);
+ add_v3_v3v3(temp_nors[mf->v2], temp_nors[mf->v2], f_no);
+ add_v3_v3v3(temp_nors[mf->v3], temp_nors[mf->v3], f_no);
if(mf->v4)
- VecAddf(temp_nors[mf->v4], temp_nors[mf->v4], f_no);
+ add_v3_v3v3(temp_nors[mf->v4], temp_nors[mf->v4], f_no);
}
/* normalize vertex normals and assign */
for(i = 0; i < numVerts; i++, mv++) {
float *no = temp_nors[i];
- if (Normalize(no) == 0.0) {
+ if (normalize_v3(no) == 0.0) {
VECCOPY(no, mv->co);
- Normalize(no);
+ normalize_v3(no);
}
mv->no[0] = (short)(no[0] * 32767.0);
@@ -1860,7 +1844,7 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts
mvert = CustomData_get_layer(&orig->vertData, CD_MVERT);
mrdm->orco = MEM_callocN(sizeof(float) * 3 * orig->getNumVerts(orig), "multires orco");
for(i = 0; i < orig->getNumVerts(orig); ++i)
- VecCopyf(mrdm->orco[i], mvert[i].co);
+ copy_v3_v3(mrdm->orco[i], mvert[i].co);
}
else
DM_init(dm, numVerts, numEdges, numFaces);
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 74f88a77e63..6c4c7daea7f 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -131,6 +131,7 @@ void cloth_init ( ClothModifierData *clmd )
clmd->sim_parms->avg_spring_len = 0.0;
clmd->sim_parms->presets = 2; /* cotton as start setting */
clmd->sim_parms->timescale = 1.0f; /* speed factor, describes how fast cloth moves */
+ clmd->sim_parms->reset = 0;
clmd->coll_parms->self_friction = 5.0;
clmd->coll_parms->friction = 5.0;
@@ -403,7 +404,7 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
/* Get the current position. */
VECCOPY(verts->xconst, mvert[i].co);
- Mat4MulVecfl(ob->obmat, verts->xconst);
+ mul_m4_v3(ob->obmat, verts->xconst);
}
effectors = pdInitEffectors(clmd->scene, ob, NULL, clmd->sim_parms->effector_weights);
@@ -450,6 +451,18 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
cache->last_exact= 0;
return dm;
}
+
+ if(clmd->sim_parms->reset || (framenr == (startframe - clmd->sim_parms->preroll)))
+ {
+ clmd->sim_parms->reset = 0;
+ cache->flag |= PTCACHE_REDO_NEEDED;
+ BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
+ cache->simframe= 0;
+ cache->last_exact= 0;
+ cache->flag |= PTCACHE_SIMULATION_VALID;
+ cache->flag &= ~PTCACHE_REDO_NEEDED;
+ return result;
+ }
/* verify we still have the same number of vertices, if not do nothing.
* note that this should only happen if the number of vertices changes
@@ -468,7 +481,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame;
/* handle continuous simulation with the play button */
- if(BKE_ptcache_get_continue_physics()) {
+ if(BKE_ptcache_get_continue_physics() || ((clmd->sim_parms->preroll > 0) && (framenr > startframe - clmd->sim_parms->preroll) && (framenr < startframe))) {
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
cache->last_exact= 0;
@@ -503,7 +516,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
if(!do_init_cloth(ob, clmd, result, framenr))
return result;
- if(framenr == startframe) {
+ if((framenr == startframe) && (clmd->sim_parms->preroll == 0)) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
do_init_cloth(ob, clmd, result, framenr);
cache->simframe= framenr;
@@ -723,7 +736,7 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh *
if (clmd->clothObject) {
/* inverse matrix is not uptodate... */
- Mat4Invert (ob->imat, ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
mvert = CDDM_get_verts(dm);
numverts = dm->getNumVerts(dm);
@@ -731,7 +744,7 @@ static void cloth_to_object (Object *ob, ClothModifierData *clmd, DerivedMesh *
for (i = 0; i < numverts; i++)
{
VECCOPY (mvert[i].co, cloth->verts[i].x);
- Mat4MulVecfl (ob->imat, mvert[i].co); /* cloth is in global coords */
+ mul_m4_v3(ob->imat, mvert[i].co); /* cloth is in global coords */
}
}
}
@@ -867,7 +880,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
if(first)
{
VECCOPY ( verts->x, mvert[i].co );
- Mat4MulVecfl ( ob->obmat, verts->x );
+ mul_m4_v3( ob->obmat, verts->x );
}
/* no GUI interface yet */
@@ -884,7 +897,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
VECCOPY ( verts->xconst, verts->x );
VECCOPY ( verts->txold, verts->x );
VECCOPY ( verts->tx, verts->x );
- VecMulf ( verts->v, 0.0f );
+ mul_v3_fl( verts->v, 0.0f );
verts->impulse_count = 0;
VECCOPY ( verts->impulse, tnull );
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 8c664bc1a57..2ea54ac1f03 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -529,7 +529,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
// calculate tangential velocity
VECCOPY ( temp, collpair->normal );
- VecMulf ( temp, magrelVel );
+ mul_v3_fl( temp, magrelVel );
VECSUB ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
@@ -539,7 +539,7 @@ int cloth_collision_response_static ( ClothModifierData *clmd, CollisionModifier
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
{
- Normalize ( vrel_t_pre );
+ normalize_v3( vrel_t_pre );
impulse = magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 ); // 2.0 *
VECADDMUL ( cloth1->verts[collpair->ap1].impulse, vrel_t_pre, w1 * impulse );
@@ -681,7 +681,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
if ( distance <= ( epsilon1 + epsilon2 + ALMOST_ZERO ) )
{
VECCOPY ( collpair->normal, collpair->vector );
- Normalize ( collpair->normal );
+ normalize_v3( collpair->normal );
collpair->distance = distance;
collpair->flag = 0;
@@ -726,6 +726,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
return collpair;
}
+#if 0
static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionModifierData *collmd, CollPair *collpair, CollPair *collision_end )
{
int result = 0;
@@ -778,7 +779,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
// calculate tangential velocity
VECCOPY ( temp, collpair->normal );
- VecMulf ( temp, magrelVel );
+ mul_v3_fl( temp, magrelVel );
VECSUB ( vrel_t_pre, relativeVelocity, temp );
// Decrease in magnitude of relative tangential velocity due to coulomb friction
@@ -788,7 +789,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO )
{
- Normalize ( vrel_t_pre );
+ normalize_v3( vrel_t_pre );
impulse = 2.0 * magtangent / ( 1.0 + w1*w1 + w2*w2 + w3*w3 );
VECADDMUL ( cloth1->verts[collpair->ap1].impulse, vrel_t_pre, w1 * impulse );
@@ -834,6 +835,7 @@ static int cloth_collision_response_moving( ClothModifierData *clmd, CollisionMo
}
return result;
}
+#endif
static float projectPointOntoLine(float *p, float *a, float *b)
{
@@ -853,15 +855,15 @@ static void calculateEENormal(float *np1, float *np2, float *np3, float *np4,flo
// printf("l1: %f, l1: %f, l2: %f, l2: %f\n", line1[0], line1[1], line2[0], line2[1]);
- Crossf(out_normal, line1, line2);
+ cross_v3_v3v3(out_normal, line1, line2);
- length = Normalize(out_normal);
+ length = normalize_v3(out_normal);
if (length <= FLT_EPSILON)
{ // lines are collinear
VECSUB(out_normal, np2, np1);
- Normalize(out_normal);
+ normalize_v3(out_normal);
}
}
@@ -901,7 +903,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
VECSUB(line1, np12, np11);
VECSUB(line2, np22, np21);
- Crossf(cross, line1, line2);
+ cross_v3_v3v3(cross, line1, line2);
length = INPR(cross, cross);
if (length < FLT_EPSILON)
@@ -912,7 +914,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
*out_a1 = 0;
calculateEENormal(np11, np12, np21, np22, out_normal);
VECSUB(temp, np22, np21);
- VecMulf(temp, *out_a2);
+ mul_v3_fl(temp, *out_a2);
VECADD(temp2, temp, np21);
VECADD(temp2, temp2, np11);
return INPR(temp2, temp2);
@@ -928,7 +930,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// return (np22 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
VECSUB(temp, np12, np11);
- VecMulf(temp, *out_a1);
+ mul_v3_fl(temp, *out_a1);
VECADD(temp2, temp, np11);
VECSUB(temp2, np22, temp2);
return INPR(temp2, temp2);
@@ -943,7 +945,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// return (np21 - (np11 + (np12 - np11) * out_a1)).lengthSquared();
VECSUB(temp, np12, np11);
- VecMulf(temp, *out_a1);
+ mul_v3_fl(temp, *out_a1);
VECADD(temp2, temp, np11);
VECSUB(temp2, np21, temp2);
return INPR(temp2, temp2);
@@ -991,12 +993,12 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// p1= np11 + (np12 - np11) * out_a1;
VECSUB(temp, np12, np11);
- VecMulf(temp, *out_a1);
+ mul_v3_fl(temp, *out_a1);
VECADD(p1, np11, temp);
// p2 = np21 + (np22 - np21) * out_a2;
VECSUB(temp, np22, np21);
- VecMulf(temp, *out_a2);
+ mul_v3_fl(temp, *out_a2);
VECADD(p2, np21, temp);
calculateEENormal(np11, np12, np21, np22, out_normal);
@@ -1022,7 +1024,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// p1 = np11 + (np12 - np11) * out_a1;
VECSUB(temp, np12, np11);
- VecMulf(temp, *out_a1);
+ mul_v3_fl(temp, *out_a1);
VECADD(p1, np11, temp);
*out_a2 = projectPointOntoLine(p1, np21, np22);
@@ -1032,7 +1034,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// return (p1 - (np21 + (np22 - np21) * out_a2)).lengthSquared();
VECSUB(temp, np22, np21);
- VecMulf(temp, *out_a2);
+ mul_v3_fl(temp, *out_a2);
VECADD(temp, temp, np21);
VECSUB(temp, p1, temp);
return INPR(temp, temp);
@@ -1044,7 +1046,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// p2 = np21 + (np22 - np21) * out_a2;
VECSUB(temp, np22, np21);
- VecMulf(temp, *out_a2);
+ mul_v3_fl(temp, *out_a2);
VECADD(p2, np21, temp);
*out_a1 = projectPointOntoLine(p2, np11, np12);
@@ -1054,7 +1056,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
// return ((np11 + (np12 - np11) * out_a1) - p2).lengthSquared();
VECSUB(temp, np12, np11);
- VecMulf(temp, *out_a1);
+ mul_v3_fl(temp, *out_a1);
VECADD(temp, temp, np11);
VECSUB(temp, temp, p2);
return INPR(temp, temp);
@@ -1065,6 +1067,7 @@ static float edgedge_distance(float np11[3], float np12[3], float np21[3], float
return 0;
}
+#if 0
static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModifierData *collmd, CollPair *collpair )
{
EdgeCollPair edgecollpair;
@@ -1217,16 +1220,16 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
float desiredVn;
VECCOPY(vrel_1_to_2, verts1[edgecollpair.p11].tv);
- VecMulf(vrel_1_to_2, 1.0 - a);
+ mul_v3_fl(vrel_1_to_2, 1.0 - a);
VECCOPY(temp, verts1[edgecollpair.p12].tv);
- VecMulf(temp, a);
+ mul_v3_fl(temp, a);
VECADD(vrel_1_to_2, vrel_1_to_2, temp);
VECCOPY(temp, verts1[edgecollpair.p21].tv);
- VecMulf(temp, 1.0 - b);
+ mul_v3_fl(temp, 1.0 - b);
VECCOPY(temp2, verts1[edgecollpair.p22].tv);
- VecMulf(temp2, b);
+ mul_v3_fl(temp2, b);
VECADD(temp, temp, temp2);
VECSUB(vrel_1_to_2, vrel_1_to_2, temp);
@@ -1237,7 +1240,7 @@ static int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModi
if(out_normalVelocity < 0.0)
{
out_normalVelocity*= -1.0;
- VecNegf(out_normal);
+ negate_v3(out_normal);
}
*/
/* Inelastic repulsion impulse. */
@@ -1292,6 +1295,7 @@ static int cloth_collision_moving ( ClothModifierData *clmd, CollisionModifierDa
return 1;
}
+#endif
// return all collision objects in scene
@@ -1707,7 +1711,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
continue;
}
- length = Normalize ( temp );
+ length = normalize_v3( temp );
if ( length < mindistance )
{
@@ -1715,17 +1719,17 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
if ( cloth->verts [i].flags & CLOTH_VERT_FLAG_PINNED )
{
- VecMulf ( temp, -correction );
+ mul_v3_fl( temp, -correction );
VECADD ( verts[j].tx, verts[j].tx, temp );
}
else if ( cloth->verts [j].flags & CLOTH_VERT_FLAG_PINNED )
{
- VecMulf ( temp, correction );
+ mul_v3_fl( temp, correction );
VECADD ( verts[i].tx, verts[i].tx, temp );
}
else
{
- VecMulf ( temp, -correction*0.5 );
+ mul_v3_fl( temp, -correction*0.5 );
VECADD ( verts[j].tx, verts[j].tx, temp );
VECSUB ( verts[i].tx, verts[i].tx, temp );
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 8cd64ae2ece..f3448a60b5a 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -52,7 +52,7 @@
#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_threads.h"
#include "IMB_imbuf.h"
@@ -462,35 +462,35 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
if(bezt[0].h2==HD_AUTO) {
- hlen= VecLenf(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */
+ hlen= len_v3v3(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */
/* clip handle point */
VECCOPY(vec, bezt[1].vec[0]);
if(vec[0] < bezt[0].vec[1][0])
vec[0]= bezt[0].vec[1][0];
- VecSubf(vec, vec, bezt[0].vec[1]);
- nlen= VecLength(vec);
+ sub_v3_v3v3(vec, vec, bezt[0].vec[1]);
+ nlen= len_v3(vec);
if(nlen>FLT_EPSILON) {
- VecMulf(vec, hlen/nlen);
- VecAddf(bezt[0].vec[2], vec, bezt[0].vec[1]);
- VecSubf(bezt[0].vec[0], bezt[0].vec[1], vec);
+ mul_v3_fl(vec, hlen/nlen);
+ add_v3_v3v3(bezt[0].vec[2], vec, bezt[0].vec[1]);
+ sub_v3_v3v3(bezt[0].vec[0], bezt[0].vec[1], vec);
}
}
a= cuma->totpoint-1;
if(bezt[a].h2==HD_AUTO) {
- hlen= VecLenf(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */
+ hlen= len_v3v3(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */
/* clip handle point */
VECCOPY(vec, bezt[a-1].vec[2]);
if(vec[0] > bezt[a].vec[1][0])
vec[0]= bezt[a].vec[1][0];
- VecSubf(vec, vec, bezt[a].vec[1]);
- nlen= VecLength(vec);
+ sub_v3_v3v3(vec, vec, bezt[a].vec[1]);
+ nlen= len_v3(vec);
if(nlen>FLT_EPSILON) {
- VecMulf(vec, hlen/nlen);
- VecAddf(bezt[a].vec[0], vec, bezt[a].vec[1]);
- VecSubf(bezt[a].vec[2], bezt[a].vec[1], vec);
+ mul_v3_fl(vec, hlen/nlen);
+ add_v3_v3v3(bezt[a].vec[0], vec, bezt[a].vec[1]);
+ sub_v3_v3v3(bezt[a].vec[2], bezt[a].vec[1], vec);
}
}
}
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index a319838a56f..0f3213cbc5d 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -36,7 +36,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_editVert.h"
#include "DNA_armature_types.h"
@@ -122,12 +122,12 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
cob->ob = ob;
cob->type = datatype;
cob->rotOrder = EULER_ORDER_DEFAULT; // TODO: when objects have rotation order too, use that
- Mat4CpyMat4(cob->matrix, ob->obmat);
+ copy_m4_m4(cob->matrix, ob->obmat);
}
else
- Mat4One(cob->matrix);
+ unit_m4(cob->matrix);
- Mat4CpyMat4(cob->startmat, cob->matrix);
+ copy_m4_m4(cob->startmat, cob->matrix);
}
break;
case CONSTRAINT_OBTYPE_BONE:
@@ -148,18 +148,18 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata,
}
/* matrix in world-space */
- Mat4MulMat4(cob->matrix, cob->pchan->pose_mat, ob->obmat);
+ mul_m4_m4m4(cob->matrix, cob->pchan->pose_mat, ob->obmat);
}
else
- Mat4One(cob->matrix);
+ unit_m4(cob->matrix);
- Mat4CpyMat4(cob->startmat, cob->matrix);
+ copy_m4_m4(cob->startmat, cob->matrix);
}
break;
default: /* other types not yet handled */
- Mat4One(cob->matrix);
- Mat4One(cob->startmat);
+ unit_m4(cob->matrix);
+ unit_m4(cob->startmat);
break;
}
@@ -176,8 +176,8 @@ void constraints_clear_evalob (bConstraintOb *cob)
return;
/* calculate delta of constraints evaluation */
- Mat4Invert(imat, cob->startmat);
- Mat4MulMat4(delta, imat, cob->matrix);
+ invert_m4_m4(imat, cob->startmat);
+ mul_m4_m4m4(delta, imat, cob->matrix);
/* copy matrices back to source */
switch (cob->type) {
@@ -186,10 +186,10 @@ void constraints_clear_evalob (bConstraintOb *cob)
/* cob->ob might not exist! */
if (cob->ob) {
/* copy new ob-matrix back to owner */
- Mat4CpyMat4(cob->ob->obmat, cob->matrix);
+ copy_m4_m4(cob->ob->obmat, cob->matrix);
/* copy inverse of delta back to owner */
- Mat4Invert(cob->ob->constinv, delta);
+ invert_m4_m4(cob->ob->constinv, delta);
}
}
break;
@@ -198,10 +198,10 @@ void constraints_clear_evalob (bConstraintOb *cob)
/* cob->ob or cob->pchan might not exist */
if (cob->ob && cob->pchan) {
/* copy new pose-matrix back to owner */
- Mat4MulMat4(cob->pchan->pose_mat, cob->matrix, cob->ob->imat);
+ mul_m4_m4m4(cob->pchan->pose_mat, cob->matrix, cob->ob->imat);
/* copy inverse of delta back to owner */
- Mat4Invert(cob->pchan->constinv, delta);
+ invert_m4_m4(cob->pchan->constinv, delta);
}
}
break;
@@ -235,9 +235,9 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
case CONSTRAINT_SPACE_WORLD: /* ---------- FROM WORLDSPACE ---------- */
{
/* world to pose */
- Mat4Invert(imat, ob->obmat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, imat);
+ invert_m4_m4(imat, ob->obmat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, imat);
/* use pose-space as stepping stone for other spaces... */
if (ELEM(to, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_PARLOCAL)) {
@@ -250,8 +250,8 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
{
/* pose to world */
if (to == CONSTRAINT_SPACE_WORLD) {
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, ob->obmat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, ob->obmat);
}
/* pose to local */
else if (to == CONSTRAINT_SPACE_LOCAL) {
@@ -260,7 +260,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
float offs_bone[4][4];
/* construct offs_bone the same way it is done in armature.c */
- Mat4CpyMat3(offs_bone, pchan->bone->bone_mat);
+ copy_m4_m3(offs_bone, pchan->bone->bone_mat);
VECCOPY(offs_bone[3], pchan->bone->head);
offs_bone[3][1]+= pchan->bone->parent->length;
@@ -269,37 +269,37 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
float tmat[4][4];
/* the rotation of the parent restposition */
- Mat4CpyMat4(tmat, pchan->bone->parent->arm_mat);
+ copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
/* the location of actual parent transform */
VECCOPY(tmat[3], offs_bone[3]);
offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
- Mat4MulVecfl(pchan->parent->pose_mat, tmat[3]);
+ mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
- Mat4MulMat4(diff_mat, offs_bone, tmat);
- Mat4Invert(imat, diff_mat);
+ mul_m4_m4m4(diff_mat, offs_bone, tmat);
+ invert_m4_m4(imat, diff_mat);
}
else {
/* pose_mat = par_pose_mat * bone_mat * chan_mat */
- Mat4MulMat4(diff_mat, offs_bone, pchan->parent->pose_mat);
- Mat4Invert(imat, diff_mat);
+ mul_m4_m4m4(diff_mat, offs_bone, pchan->parent->pose_mat);
+ invert_m4_m4(imat, diff_mat);
}
}
else {
/* pose_mat = chan_mat * arm_mat */
- Mat4Invert(imat, pchan->bone->arm_mat);
+ invert_m4_m4(imat, pchan->bone->arm_mat);
}
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, imat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, imat);
}
}
/* pose to local with parent */
else if (to == CONSTRAINT_SPACE_PARLOCAL) {
if (pchan->bone) {
- Mat4Invert(imat, pchan->bone->arm_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, imat);
+ invert_m4_m4(imat, pchan->bone->arm_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, imat);
}
}
}
@@ -313,7 +313,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
float offs_bone[4][4];
/* construct offs_bone the same way it is done in armature.c */
- Mat4CpyMat3(offs_bone, pchan->bone->bone_mat);
+ copy_m4_m3(offs_bone, pchan->bone->bone_mat);
VECCOPY(offs_bone[3], pchan->bone->head);
offs_bone[3][1]+= pchan->bone->parent->length;
@@ -322,29 +322,29 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
float tmat[4][4];
/* the rotation of the parent restposition */
- Mat4CpyMat4(tmat, pchan->bone->parent->arm_mat);
+ copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
/* the location of actual parent transform */
VECCOPY(tmat[3], offs_bone[3]);
offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f;
- Mat4MulVecfl(pchan->parent->pose_mat, tmat[3]);
+ mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
- Mat4MulMat4(diff_mat, offs_bone, tmat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, diff_mat);
+ mul_m4_m4m4(diff_mat, offs_bone, tmat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, diff_mat);
}
else {
/* pose_mat = par_pose_mat * bone_mat * chan_mat */
- Mat4MulMat4(diff_mat, offs_bone, pchan->parent->pose_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, diff_mat);
+ mul_m4_m4m4(diff_mat, offs_bone, pchan->parent->pose_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, diff_mat);
}
}
else {
- Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
+ copy_m4_m4(diff_mat, pchan->bone->arm_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, diff_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, diff_mat);
}
}
@@ -359,9 +359,9 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
{
/* local + parent to pose */
if (pchan->bone) {
- Mat4CpyMat4(diff_mat, pchan->bone->arm_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, diff_mat, tempmat);
+ copy_m4_m4(diff_mat, pchan->bone->arm_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, diff_mat, tempmat);
}
/* use pose-space as stepping stone for other spaces */
@@ -379,19 +379,19 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4
/* check if object has a parent - otherwise this won't work */
if (ob->parent) {
/* 'subtract' parent's effects from owner */
- Mat4MulMat4(diff_mat, ob->parentinv, ob->parent->obmat);
- Mat4Invert(imat, diff_mat);
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(mat, tempmat, imat);
+ mul_m4_m4m4(diff_mat, ob->parentinv, ob->parent->obmat);
+ invert_m4_m4(imat, diff_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(mat, tempmat, imat);
}
}
else if (from==CONSTRAINT_SPACE_LOCAL && to==CONSTRAINT_SPACE_WORLD) {
/* check that object has a parent - otherwise this won't work */
if (ob->parent) {
/* 'add' parent's effect back to owner */
- Mat4CpyMat4(tempmat, mat);
- Mat4MulMat4(diff_mat, ob->parentinv, ob->parent->obmat);
- Mat4MulMat4(mat, tempmat, diff_mat);
+ copy_m4_m4(tempmat, mat);
+ mul_m4_m4m4(diff_mat, ob->parentinv, ob->parent->obmat);
+ mul_m4_m4m4(mat, tempmat, diff_mat);
}
}
}
@@ -412,7 +412,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
short freeDM = 0;
/* initialize target matrix using target matrix */
- Mat4CpyMat4(mat, ob->obmat);
+ copy_m4_m4(mat, ob->obmat);
/* get index of vertex group */
dgroup = get_named_vertexgroup_num(ob, substring);
@@ -454,8 +454,8 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
if (dvert[i].dw[j].def_nr == dgroup) {
dm->getVertCo(dm, i, co);
dm->getVertNo(dm, i, nor);
- VecAddf(vec, vec, co);
- VecAddf(normal, normal, nor);
+ add_v3_v3v3(vec, vec, co);
+ add_v3_v3v3(normal, normal, nor);
count++;
break;
}
@@ -466,8 +466,8 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
/* calculate averages of normal and coordinates */
if (count > 0) {
- VecMulf(vec, 1.0f / count);
- VecMulf(normal, 1.0f / count);
+ mul_v3_fl(vec, 1.0f / count);
+ mul_v3_fl(normal, 1.0f / count);
}
@@ -476,25 +476,25 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f
* calc_manipulator_stats, V3D_MANIP_NORMAL case
*/
/* we need the transpose of the inverse for a normal... */
- Mat3CpyMat4(imat, ob->obmat);
+ copy_m3_m4(imat, ob->obmat);
- Mat3Inv(tmat, imat);
- Mat3Transp(tmat);
- Mat3MulVecfl(tmat, normal);
+ invert_m3_m3(tmat, imat);
+ transpose_m3(tmat);
+ mul_m3_v3(tmat, normal);
- Normalize(normal);
+ normalize_v3(normal);
VECCOPY(plane, tmat[1]);
VECCOPY(tmat[2], normal);
- Crossf(tmat[0], normal, plane);
- Crossf(tmat[1], tmat[2], tmat[0]);
+ cross_v3_v3v3(tmat[0], normal, plane);
+ cross_v3_v3v3(tmat[1], tmat[2], tmat[0]);
- Mat4CpyMat3(mat, tmat);
- Mat4Ortho(mat);
+ copy_m4_m3(mat, tmat);
+ normalize_m4(mat);
/* apply the average coordinate as the new location */
- VecMat4MulVecfl(tvec, ob->obmat, vec);
+ mul_v3_m4v3(tvec, ob->obmat, vec);
VECCOPY(mat[3], tvec);
}
}
@@ -522,7 +522,7 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][
int i, n;
/* initialize target matrix using target matrix */
- Mat4CpyMat4(mat, ob->obmat);
+ copy_m4_m4(mat, ob->obmat);
/* get index of vertex group */
dgroup = get_named_vertexgroup_num(ob, substring);
@@ -542,7 +542,7 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][
else
memcpy(tvec, bp->vec, 3*sizeof(float));
- VecAddf(vec, vec, tvec);
+ add_v3_v3v3(vec, vec, tvec);
grouped++;
break;
@@ -556,8 +556,8 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][
/* find average location, then multiply by ob->obmat to find world-space location */
if (grouped)
- VecMulf(vec, 1.0f / grouped);
- VecMat4MulVecfl(tvec, ob->obmat, vec);
+ mul_v3_fl(vec, 1.0f / grouped);
+ mul_v3_m4v3(tvec, ob->obmat, vec);
/* copy new location to matrix */
VECCOPY(mat[3], tvec);
@@ -569,7 +569,7 @@ static void constraint_target_to_mat4 (Scene *scene, Object *ob, char *substring
{
/* Case OBJECT */
if (!strlen(substring)) {
- Mat4CpyMat4(mat, ob->obmat);
+ copy_m4_m4(mat, ob->obmat);
constraint_mat_convertspace(ob, NULL, mat, from, to);
}
/* Case VERTEXGROUP */
@@ -601,23 +601,23 @@ static void constraint_target_to_mat4 (Scene *scene, Object *ob, char *substring
*/
if (headtail < 0.000001) {
/* skip length interpolation if set to head */
- Mat4MulMat4(mat, pchan->pose_mat, ob->obmat);
+ mul_m4_m4m4(mat, pchan->pose_mat, ob->obmat);
}
else {
float tempmat[4][4], loc[3];
/* interpolate along length of bone */
- VecLerpf(loc, pchan->pose_head, pchan->pose_tail, headtail);
+ interp_v3_v3v3(loc, pchan->pose_head, pchan->pose_tail, headtail);
/* use interpolated distance for subtarget */
- Mat4CpyMat4(tempmat, pchan->pose_mat);
- VecCopyf(tempmat[3], loc);
+ copy_m4_m4(tempmat, pchan->pose_mat);
+ copy_v3_v3(tempmat[3], loc);
- Mat4MulMat4(mat, tempmat, ob->obmat);
+ mul_m4_m4m4(mat, tempmat, ob->obmat);
}
}
else
- Mat4CpyMat4(mat, ob->obmat);
+ copy_m4_m4(mat, ob->obmat);
/* convert matrix space as required */
constraint_mat_convertspace(ob, pchan, mat, from, to);
@@ -666,7 +666,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
if (VALID_CONS_TARGET(ct))
constraint_target_to_mat4(cob->scene, ct->tar, ct->subtarget, ct->matrix, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
else if (ct)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
/* This following macro should be used for all standard single-target *_get_tars functions
@@ -772,7 +772,7 @@ static void childof_new_data (void *cdata)
data->flag = (CHILDOF_LOCX | CHILDOF_LOCY | CHILDOF_LOCZ |
CHILDOF_ROTX |CHILDOF_ROTY | CHILDOF_ROTZ |
CHILDOF_SIZEX | CHILDOF_SIZEY | CHILDOF_SIZEZ);
- Mat4One(data->invmat);
+ unit_m4(data->invmat);
}
static int childof_get_tars (bConstraint *con, ListBase *list)
@@ -813,16 +813,16 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float loco[3], eulo[3], sizo[3];
/* get offset (parent-inverse) matrix */
- Mat4CpyMat4(invmat, data->invmat);
+ copy_m4_m4(invmat, data->invmat);
/* extract components of both matrices */
VECCOPY(loc, ct->matrix[3]);
- Mat4ToEulO(ct->matrix, eul, ct->rotOrder);
- Mat4ToSize(ct->matrix, size);
+ mat4_to_eulO( eul, ct->rotOrder,ct->matrix);
+ mat4_to_size( size,ct->matrix);
VECCOPY(loco, invmat[3]);
- Mat4ToEulO(invmat, eulo, cob->rotOrder);
- Mat4ToSize(invmat, sizo);
+ mat4_to_eulO( eulo, cob->rotOrder,invmat);
+ mat4_to_size( sizo,invmat);
/* disable channels not enabled */
if (!(data->flag & CHILDOF_LOCX)) loc[0]= loco[0]= 0.0f;
@@ -836,19 +836,19 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
if (!(data->flag & CHILDOF_SIZEZ)) size[2]= sizo[2]= 1.0f;
/* make new target mat and offset mat */
- LocEulOSizeToMat4(ct->matrix, loc, eul, size, ct->rotOrder);
- LocEulOSizeToMat4(invmat, loco, eulo, sizo, cob->rotOrder);
+ loc_eulO_size_to_mat4(ct->matrix, loc, eul, size, ct->rotOrder);
+ loc_eulO_size_to_mat4(invmat, loco, eulo, sizo, cob->rotOrder);
/* multiply target (parent matrix) by offset (parent inverse) to get
* the effect of the parent that will be exherted on the owner
*/
- Mat4MulMat4(parmat, invmat, ct->matrix);
+ mul_m4_m4m4(parmat, invmat, ct->matrix);
/* now multiply the parent matrix by the owner matrix to get the
* the effect of this constraint (i.e. owner is 'parented' to parent)
*/
- Mat4CpyMat4(tempmat, cob->matrix);
- Mat4MulMat4(cob->matrix, tempmat, parmat);
+ copy_m4_m4(tempmat, cob->matrix);
+ mul_m4_m4m4(cob->matrix, tempmat, parmat);
}
}
@@ -929,14 +929,14 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
float neg = -1;
int right_index;
- VecCopyf(n, vec);
- if (Normalize(n) == 0.0) {
+ copy_v3_v3(n, vec);
+ if (normalize_v3(n) == 0.0) {
n[0] = 0.0;
n[1] = 0.0;
n[2] = 1.0;
}
if (axis > 2) axis -= 3;
- else VecNegf(n);
+ else negate_v3(n);
/* n specifies the transformation of the track axis */
if (flags & TARGET_Z_UP) {
@@ -953,19 +953,19 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
}
/* project the up vector onto the plane specified by n */
- Projf(proj, u, n); /* first u onto n... */
- VecSubf(proj, u, proj); /* then onto the plane */
+ project_v3_v3v3(proj, u, n); /* first u onto n... */
+ sub_v3_v3v3(proj, u, proj); /* then onto the plane */
/* proj specifies the transformation of the up axis */
- if (Normalize(proj) == 0.0) { /* degenerate projection */
+ if (normalize_v3(proj) == 0.0) { /* degenerate projection */
proj[0] = 0.0;
proj[1] = 1.0;
proj[2] = 0.0;
}
/* Normalized cross product of n and proj specifies transformation of the right axis */
- Crossf(right, proj, n);
- Normalize(right);
+ cross_v3_v3v3(right, proj, n);
+ normalize_v3(right);
if (axis != upflag) {
right_index = 3 - axis - upflag;
@@ -1005,7 +1005,7 @@ static void trackto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float tmat[4][4];
/* Get size property, since ob->size is only the object's own relative size, not its global one */
- Mat4ToSize(cob->matrix, size);
+ mat4_to_size( size,cob->matrix);
/* Clear the object's rotation */
cob->matrix[0][0]=size[0];
@@ -1021,13 +1021,13 @@ static void trackto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* targetmat[2] instead of ownermat[2] is passed to vectomat
* for backwards compatability it seems... (Aligorith)
*/
- VecSubf(vec, cob->matrix[3], ct->matrix[3]);
+ sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
vectomat(vec, ct->matrix[2],
(short)data->reserved1, (short)data->reserved2,
data->flags, totmat);
- Mat4CpyMat4(tmat, cob->matrix);
- Mat4MulMat34(cob->matrix, totmat, tmat);
+ copy_m4_m4(tmat, cob->matrix);
+ mul_m4_m3m4(cob->matrix, totmat, tmat);
}
}
@@ -1098,19 +1098,19 @@ static void kinematic_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstra
Object *ob= cob->ob;
if (ob == NULL) {
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
else {
float vec[3];
/* move grabtarget into world space */
VECCOPY(vec, data->grabtarget);
- Mat4MulVecfl(ob->obmat, vec);
- Mat4CpyMat4(ct->matrix, ob->obmat);
+ mul_m4_v3(ob->obmat, vec);
+ copy_m4_m4(ct->matrix, ob->obmat);
VECCOPY(ct->matrix[3], vec);
}
}
else
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
}
@@ -1177,8 +1177,8 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
float totmat[4][4];
float curvetime;
- Mat4One(totmat);
- Mat4One(ct->matrix);
+ unit_m4(totmat);
+ unit_m4(ct->matrix);
/* note: when creating constraints that follow path, the curve gets the CU_PATH set now,
* currently for paths to work it needs to go through the bevlist/displist system (ton)
@@ -1212,34 +1212,34 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
if ( where_on_path(ct->tar, curvetime, vec, dir, NULL, &radius) ) {
if (data->followflag & FOLLOWPATH_FOLLOW) {
- vectoquat(dir, (short) data->trackflag, (short) data->upflag, quat);
+ vec_to_quat( quat,dir, (short) data->trackflag, (short) data->upflag);
- Normalize(dir);
+ normalize_v3(dir);
q[0]= (float)cos(0.5*vec[3]);
x1= (float)sin(0.5*vec[3]);
q[1]= -x1*dir[0];
q[2]= -x1*dir[1];
q[3]= -x1*dir[2];
- QuatMul(quat, q, quat);
+ mul_qt_qtqt(quat, q, quat);
- QuatToMat4(quat, totmat);
+ quat_to_mat4( totmat,quat);
}
if (data->followflag & FOLLOWPATH_RADIUS) {
float tmat[4][4], rmat[4][4];
- Mat4Scale(tmat, radius);
- Mat4MulMat4(rmat, totmat, tmat);
- Mat4CpyMat4(totmat, rmat);
+ scale_m4_fl(tmat, radius);
+ mul_m4_m4m4(rmat, totmat, tmat);
+ copy_m4_m4(totmat, rmat);
}
VECCOPY(totmat[3], vec);
- Mat4MulSerie(ct->matrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
+ mul_serie_m4(ct->matrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
}
}
}
else if (ct)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
@@ -1254,25 +1254,25 @@ static void followpath_evaluate (bConstraint *con, bConstraintOb *cob, ListBase
/* get Object local transform (loc/rot/size) to determine transformation from path */
//object_to_mat4(ob, obmat);
- Mat4CpyMat4(obmat, cob->matrix); // FIXME!!!
+ copy_m4_m4(obmat, cob->matrix); // FIXME!!!
/* get scaling of object before applying constraint */
- Mat4ToSize(cob->matrix, size);
+ mat4_to_size( size,cob->matrix);
/* apply targetmat - containing location on path, and rotation */
- Mat4MulSerie(cob->matrix, ct->matrix, obmat, NULL, NULL, NULL, NULL, NULL, NULL);
+ mul_serie_m4(cob->matrix, ct->matrix, obmat, NULL, NULL, NULL, NULL, NULL, NULL);
/* un-apply scaling caused by path */
if ((data->followflag & FOLLOWPATH_RADIUS)==0) { /* XXX - assume that scale correction means that radius will have some scale error in it - Campbell */
float obsize[3];
- Mat4ToSize(cob->matrix, obsize);
+ mat4_to_size( obsize,cob->matrix);
if (obsize[0])
- VecMulf(cob->matrix[0], size[0] / obsize[0]);
+ mul_v3_fl(cob->matrix[0], size[0] / obsize[0]);
if (obsize[1])
- VecMulf(cob->matrix[1], size[1] / obsize[1]);
+ mul_v3_fl(cob->matrix[1], size[1] / obsize[1]);
if (obsize[2])
- VecMulf(cob->matrix[2], size[2] / obsize[2]);
+ mul_v3_fl(cob->matrix[2], size[2] / obsize[2]);
}
}
}
@@ -1350,9 +1350,9 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
float size[3];
VECCOPY(loc, cob->matrix[3]);
- Mat4ToSize(cob->matrix, size);
+ mat4_to_size( size,cob->matrix);
- Mat4ToEulO(cob->matrix, eul, cob->rotOrder);
+ mat4_to_eulO( eul, cob->rotOrder,cob->matrix);
/* eulers: radians to degrees! */
eul[0] = (float)(eul[0] / M_PI * 180);
@@ -1387,7 +1387,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
eul[1] = (float)(eul[1] / 180 * M_PI);
eul[2] = (float)(eul[2] / 180 * M_PI);
- LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
+ loc_eulO_size_to_mat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
static bConstraintTypeInfo CTI_ROTLIMIT = {
@@ -1413,8 +1413,8 @@ static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
bSizeLimitConstraint *data = con->data;
float obsize[3], size[3];
- Mat4ToSize(cob->matrix, size);
- Mat4ToSize(cob->matrix, obsize);
+ mat4_to_size( size,cob->matrix);
+ mat4_to_size( obsize,cob->matrix);
if (data->flag & LIMIT_XMIN) {
if (size[0] < data->xmin)
@@ -1442,11 +1442,11 @@ static void sizelimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
}
if (obsize[0])
- VecMulf(cob->matrix[0], size[0]/obsize[0]);
+ mul_v3_fl(cob->matrix[0], size[0]/obsize[0]);
if (obsize[1])
- VecMulf(cob->matrix[1], size[1]/obsize[1]);
+ mul_v3_fl(cob->matrix[1], size[1]/obsize[1]);
if (obsize[2])
- VecMulf(cob->matrix[2], size[2]/obsize[2]);
+ mul_v3_fl(cob->matrix[2], size[2]/obsize[2]);
}
static bConstraintTypeInfo CTI_SIZELIMIT = {
@@ -1592,17 +1592,17 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float size[3];
VECCOPY(loc, cob->matrix[3]);
- Mat4ToSize(cob->matrix, size);
+ mat4_to_size( size,cob->matrix);
/* to allow compatible rotations, must get both rotations in the order of the owner... */
- Mat4ToEulO(ct->matrix, eul, cob->rotOrder);
- Mat4ToEulO(cob->matrix, obeul, cob->rotOrder);
+ mat4_to_eulO( eul, cob->rotOrder,ct->matrix);
+ mat4_to_eulO( obeul, cob->rotOrder,cob->matrix);
if ((data->flag & ROTLIKE_X)==0)
eul[0] = obeul[0];
else {
if (data->flag & ROTLIKE_OFFSET)
- eulerO_rot(eul, obeul[0], 'x', cob->rotOrder);
+ rotate_eulO(eul, cob->rotOrder, 'x', obeul[0]);
if (data->flag & ROTLIKE_X_INVERT)
eul[0] *= -1;
@@ -1612,7 +1612,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
eul[1] = obeul[1];
else {
if (data->flag & ROTLIKE_OFFSET)
- eulerO_rot(eul, obeul[1], 'y', cob->rotOrder);
+ rotate_eulO(eul, cob->rotOrder, 'y', obeul[1]);
if (data->flag & ROTLIKE_Y_INVERT)
eul[1] *= -1;
@@ -1622,14 +1622,14 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
eul[2] = obeul[2];
else {
if (data->flag & ROTLIKE_OFFSET)
- eulerO_rot(eul, obeul[2], 'z', cob->rotOrder);
+ rotate_eulO(eul, cob->rotOrder, 'z', obeul[2]);
if (data->flag & ROTLIKE_Z_INVERT)
eul[2] *= -1;
}
compatible_eul(eul, obeul);
- LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
+ loc_eulO_size_to_mat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
}
@@ -1691,32 +1691,32 @@ static void sizelike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
if (VALID_CONS_TARGET(ct)) {
float obsize[3], size[3];
- Mat4ToSize(ct->matrix, size);
- Mat4ToSize(cob->matrix, obsize);
+ mat4_to_size( size,ct->matrix);
+ mat4_to_size( obsize,cob->matrix);
if ((data->flag & SIZELIKE_X) && (obsize[0] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[0] += (obsize[0] - 1.0f);
- VecMulf(cob->matrix[0], size[0] / obsize[0]);
+ mul_v3_fl(cob->matrix[0], size[0] / obsize[0]);
}
else
- VecMulf(cob->matrix[0], size[0] / obsize[0]);
+ mul_v3_fl(cob->matrix[0], size[0] / obsize[0]);
}
if ((data->flag & SIZELIKE_Y) && (obsize[1] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[1] += (obsize[1] - 1.0f);
- VecMulf(cob->matrix[1], size[1] / obsize[1]);
+ mul_v3_fl(cob->matrix[1], size[1] / obsize[1]);
}
else
- VecMulf(cob->matrix[1], size[1] / obsize[1]);
+ mul_v3_fl(cob->matrix[1], size[1] / obsize[1]);
}
if ((data->flag & SIZELIKE_Z) && (obsize[2] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[2] += (obsize[2] - 1.0f);
- VecMulf(cob->matrix[2], size[2] / obsize[2]);
+ mul_v3_fl(cob->matrix[2], size[2] / obsize[2]);
}
else
- VecMulf(cob->matrix[2], size[2] / obsize[2]);
+ mul_v3_fl(cob->matrix[2], size[2] / obsize[2]);
}
}
}
@@ -1817,7 +1817,7 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
#endif
}
else if (ct)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
static void pycon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
@@ -1912,7 +1912,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
short axis;
/* initialise return matrix */
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
/* get the transform matrix of the target */
constraint_target_to_mat4(cob->scene, ct->tar, ct->subtarget, tempmat, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
@@ -1925,7 +1925,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
*/
if (data->type < 10) {
/* extract rotation (is in whatever space target should be in) */
- Mat4ToEul(tempmat, vec);
+ mat4_to_eul(vec, tempmat);
vec[0] *= (float)(180.0/M_PI);
vec[1] *= (float)(180.0/M_PI);
vec[2] *= (float)(180.0/M_PI);
@@ -1933,7 +1933,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
}
else if (data->type < 20) {
/* extract scaling (is in whatever space target should be in) */
- Mat4ToSize(tempmat, vec);
+ mat4_to_size(vec, tempmat);
axis= data->type - 10;
}
else {
@@ -1945,7 +1945,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
/* Target defines the animation */
s = (vec[axis]-data->min) / (data->max-data->min);
CLAMP(s, 0, 1);
- t = ( s * (data->end-data->start)) + data->start;
+ t = (s * (data->end-data->start)) + data->start;
if (G.f & G_DEBUG)
printf("do Action Constraint %s - Ob %s Pchan %s \n", con->name, cob->ob->id.name+2, (cob->pchan)?cob->pchan->name:NULL);
@@ -1959,16 +1959,20 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
/* make a temporary pose and evaluate using that */
pose = MEM_callocN(sizeof(bPose), "pose");
- /* make a copy of the bone of interest in the temp pose before evaluating action, so that it can get set */
+ /* make a copy of the bone of interest in the temp pose before evaluating action, so that it can get set
+ * - we need to manually copy over a few settings, including rotation order, otherwise this fails
+ */
pchan = cob->pchan;
+
tchan= verify_pose_channel(pose, pchan->name);
+ tchan->rotmode= pchan->rotmode;
/* evaluate action using workob (it will only set the PoseChannel in question) */
what_does_obaction(cob->scene, cob->ob, &workob, pose, data->act, pchan->name, t);
/* convert animation to matrices for use here */
chan_calc_mat(tchan);
- Mat4CpyMat4(ct->matrix, tchan->chan_mat);
+ copy_m4_m4(ct->matrix, tchan->chan_mat);
/* Clean up */
free_pose(pose);
@@ -1998,8 +2002,8 @@ static void actcon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
/* Nice and simple... we just need to multiply the matrices, as the get_target_matrix
* function has already taken care of everything else.
*/
- Mat4CpyMat4(temp, cob->matrix);
- Mat4MulMat4(cob->matrix, ct->matrix, temp);
+ copy_m4_m4(temp, cob->matrix);
+ mul_m4_m4m4(cob->matrix, ct->matrix, temp);
}
}
@@ -2068,7 +2072,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
float mdet;
/* Vector object -> target */
- VecSubf(vec, ct->matrix[3], cob->matrix[3]);
+ sub_v3_v3v3(vec, ct->matrix[3], cob->matrix[3]);
switch (data->lockflag){
case LOCK_X: /* LOCK X */
{
@@ -2076,71 +2080,71 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case TRACK_Y: /* LOCK X TRACK Y */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[0]);
- VecSubf(totmat[1], vec, vec2);
- Normalize(totmat[1]);
+ project_v3_v3v3(vec2, vec, cob->matrix[0]);
+ sub_v3_v3v3(totmat[1], vec, vec2);
+ normalize_v3(totmat[1]);
/* the x axis is fixed */
totmat[0][0] = cob->matrix[0][0];
totmat[0][1] = cob->matrix[0][1];
totmat[0][2] = cob->matrix[0][2];
- Normalize(totmat[0]);
+ normalize_v3(totmat[0]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[2], totmat[0], totmat[1]);
+ cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
}
break;
case TRACK_Z: /* LOCK X TRACK Z */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[0]);
- VecSubf(totmat[2], vec, vec2);
- Normalize(totmat[2]);
+ project_v3_v3v3(vec2, vec, cob->matrix[0]);
+ sub_v3_v3v3(totmat[2], vec, vec2);
+ normalize_v3(totmat[2]);
/* the x axis is fixed */
totmat[0][0] = cob->matrix[0][0];
totmat[0][1] = cob->matrix[0][1];
totmat[0][2] = cob->matrix[0][2];
- Normalize(totmat[0]);
+ normalize_v3(totmat[0]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[1], totmat[2], totmat[0]);
+ cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
}
break;
case TRACK_nY: /* LOCK X TRACK -Y */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[0]);
- VecSubf(totmat[1], vec, vec2);
- Normalize(totmat[1]);
- VecNegf(totmat[1]);
+ project_v3_v3v3(vec2, vec, cob->matrix[0]);
+ sub_v3_v3v3(totmat[1], vec, vec2);
+ normalize_v3(totmat[1]);
+ negate_v3(totmat[1]);
/* the x axis is fixed */
totmat[0][0] = cob->matrix[0][0];
totmat[0][1] = cob->matrix[0][1];
totmat[0][2] = cob->matrix[0][2];
- Normalize(totmat[0]);
+ normalize_v3(totmat[0]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[2], totmat[0], totmat[1]);
+ cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
}
break;
case TRACK_nZ: /* LOCK X TRACK -Z */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[0]);
- VecSubf(totmat[2], vec, vec2);
- Normalize(totmat[2]);
- VecNegf(totmat[2]);
+ project_v3_v3v3(vec2, vec, cob->matrix[0]);
+ sub_v3_v3v3(totmat[2], vec, vec2);
+ normalize_v3(totmat[2]);
+ negate_v3(totmat[2]);
/* the x axis is fixed */
totmat[0][0] = cob->matrix[0][0];
totmat[0][1] = cob->matrix[0][1];
totmat[0][2] = cob->matrix[0][2];
- Normalize(totmat[0]);
+ normalize_v3(totmat[0]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[1], totmat[2], totmat[0]);
+ cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
}
break;
default:
@@ -2159,71 +2163,71 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case TRACK_X: /* LOCK Y TRACK X */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[1]);
- VecSubf(totmat[0], vec, vec2);
- Normalize(totmat[0]);
+ project_v3_v3v3(vec2, vec, cob->matrix[1]);
+ sub_v3_v3v3(totmat[0], vec, vec2);
+ normalize_v3(totmat[0]);
/* the y axis is fixed */
totmat[1][0] = cob->matrix[1][0];
totmat[1][1] = cob->matrix[1][1];
totmat[1][2] = cob->matrix[1][2];
- Normalize(totmat[1]);
+ normalize_v3(totmat[1]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[2], totmat[0], totmat[1]);
+ cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
}
break;
case TRACK_Z: /* LOCK Y TRACK Z */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[1]);
- VecSubf(totmat[2], vec, vec2);
- Normalize(totmat[2]);
+ project_v3_v3v3(vec2, vec, cob->matrix[1]);
+ sub_v3_v3v3(totmat[2], vec, vec2);
+ normalize_v3(totmat[2]);
/* the y axis is fixed */
totmat[1][0] = cob->matrix[1][0];
totmat[1][1] = cob->matrix[1][1];
totmat[1][2] = cob->matrix[1][2];
- Normalize(totmat[1]);
+ normalize_v3(totmat[1]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[0], totmat[1], totmat[2]);
+ cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
}
break;
case TRACK_nX: /* LOCK Y TRACK -X */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[1]);
- VecSubf(totmat[0], vec, vec2);
- Normalize(totmat[0]);
- VecNegf(totmat[0]);
+ project_v3_v3v3(vec2, vec, cob->matrix[1]);
+ sub_v3_v3v3(totmat[0], vec, vec2);
+ normalize_v3(totmat[0]);
+ negate_v3(totmat[0]);
/* the y axis is fixed */
totmat[1][0] = cob->matrix[1][0];
totmat[1][1] = cob->matrix[1][1];
totmat[1][2] = cob->matrix[1][2];
- Normalize(totmat[1]);
+ normalize_v3(totmat[1]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[2], totmat[0], totmat[1]);
+ cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
}
break;
case TRACK_nZ: /* LOCK Y TRACK -Z */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[1]);
- VecSubf(totmat[2], vec, vec2);
- Normalize(totmat[2]);
- VecNegf(totmat[2]);
+ project_v3_v3v3(vec2, vec, cob->matrix[1]);
+ sub_v3_v3v3(totmat[2], vec, vec2);
+ normalize_v3(totmat[2]);
+ negate_v3(totmat[2]);
/* the y axis is fixed */
totmat[1][0] = cob->matrix[1][0];
totmat[1][1] = cob->matrix[1][1];
totmat[1][2] = cob->matrix[1][2];
- Normalize(totmat[1]);
+ normalize_v3(totmat[1]);
/* the z axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[0], totmat[1], totmat[2]);
+ cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
}
break;
default:
@@ -2242,71 +2246,71 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case TRACK_X: /* LOCK Z TRACK X */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[2]);
- VecSubf(totmat[0], vec, vec2);
- Normalize(totmat[0]);
+ project_v3_v3v3(vec2, vec, cob->matrix[2]);
+ sub_v3_v3v3(totmat[0], vec, vec2);
+ normalize_v3(totmat[0]);
/* the z axis is fixed */
totmat[2][0] = cob->matrix[2][0];
totmat[2][1] = cob->matrix[2][1];
totmat[2][2] = cob->matrix[2][2];
- Normalize(totmat[2]);
+ normalize_v3(totmat[2]);
/* the x axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[1], totmat[2], totmat[0]);
+ cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
}
break;
case TRACK_Y: /* LOCK Z TRACK Y */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[2]);
- VecSubf(totmat[1], vec, vec2);
- Normalize(totmat[1]);
+ project_v3_v3v3(vec2, vec, cob->matrix[2]);
+ sub_v3_v3v3(totmat[1], vec, vec2);
+ normalize_v3(totmat[1]);
/* the z axis is fixed */
totmat[2][0] = cob->matrix[2][0];
totmat[2][1] = cob->matrix[2][1];
totmat[2][2] = cob->matrix[2][2];
- Normalize(totmat[2]);
+ normalize_v3(totmat[2]);
/* the x axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[0], totmat[1], totmat[2]);
+ cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
}
break;
case TRACK_nX: /* LOCK Z TRACK -X */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[2]);
- VecSubf(totmat[0], vec, vec2);
- Normalize(totmat[0]);
- VecNegf(totmat[0]);
+ project_v3_v3v3(vec2, vec, cob->matrix[2]);
+ sub_v3_v3v3(totmat[0], vec, vec2);
+ normalize_v3(totmat[0]);
+ negate_v3(totmat[0]);
/* the z axis is fixed */
totmat[2][0] = cob->matrix[2][0];
totmat[2][1] = cob->matrix[2][1];
totmat[2][2] = cob->matrix[2][2];
- Normalize(totmat[2]);
+ normalize_v3(totmat[2]);
/* the x axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[1], totmat[2], totmat[0]);
+ cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
}
break;
case TRACK_nY: /* LOCK Z TRACK -Y */
{
/* Projection of Vector on the plane */
- Projf(vec2, vec, cob->matrix[2]);
- VecSubf(totmat[1], vec, vec2);
- Normalize(totmat[1]);
- VecNegf(totmat[1]);
+ project_v3_v3v3(vec2, vec, cob->matrix[2]);
+ sub_v3_v3v3(totmat[1], vec, vec2);
+ normalize_v3(totmat[1]);
+ negate_v3(totmat[1]);
/* the z axis is fixed */
totmat[2][0] = cob->matrix[2][0];
totmat[2][1] = cob->matrix[2][1];
totmat[2][2] = cob->matrix[2][2];
- Normalize(totmat[2]);
+ normalize_v3(totmat[2]);
/* the x axis gets mapped onto a third orthogonal vector */
- Crossf(totmat[0], totmat[1], totmat[2]);
+ cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
}
break;
default:
@@ -2331,18 +2335,18 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
tmpmat[0][0] = cob->matrix[0][0];tmpmat[0][1] = cob->matrix[0][1];tmpmat[0][2] = cob->matrix[0][2];
tmpmat[1][0] = cob->matrix[1][0];tmpmat[1][1] = cob->matrix[1][1];tmpmat[1][2] = cob->matrix[1][2];
tmpmat[2][0] = cob->matrix[2][0];tmpmat[2][1] = cob->matrix[2][1];tmpmat[2][2] = cob->matrix[2][2];
- Normalize(tmpmat[0]);
- Normalize(tmpmat[1]);
- Normalize(tmpmat[2]);
- Mat3Inv(invmat, tmpmat);
- Mat3MulMat3(tmpmat, totmat, invmat);
+ normalize_v3(tmpmat[0]);
+ normalize_v3(tmpmat[1]);
+ normalize_v3(tmpmat[2]);
+ invert_m3_m3(invmat, tmpmat);
+ mul_m3_m3m3(tmpmat, totmat, invmat);
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
totmat[1][0] = tmpmat[1][0];totmat[1][1] = tmpmat[1][1];totmat[1][2] = tmpmat[1][2];
totmat[2][0] = tmpmat[2][0];totmat[2][1] = tmpmat[2][1];totmat[2][2] = tmpmat[2][2];
- Mat4CpyMat4(tmat, cob->matrix);
+ copy_m4_m4(tmat, cob->matrix);
- mdet = Det3x3( totmat[0][0],totmat[0][1],totmat[0][2],
+ mdet = determinant_m3( totmat[0][0],totmat[0][1],totmat[0][2],
totmat[1][0],totmat[1][1],totmat[1][2],
totmat[2][0],totmat[2][1],totmat[2][2]);
if (mdet==0) {
@@ -2352,7 +2356,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
}
/* apply out transformaton to the object */
- Mat4MulMat34(cob->matrix, totmat, tmat);
+ mul_m4_m3m4(cob->matrix, totmat, tmat);
}
}
@@ -2417,7 +2421,7 @@ static void distlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
short clamp_surf= 0;
/* calculate our current distance from the target */
- dist= VecLenf(cob->matrix[3], ct->matrix[3]);
+ dist= len_v3v3(cob->matrix[3], ct->matrix[3]);
/* set distance (flag is only set when user demands it) */
if (data->dist == 0)
@@ -2464,7 +2468,7 @@ static void distlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* clamp to 'surface' (i.e. move owner so that dist == data->dist) */
if (clamp_surf) {
/* simply interpolate along line formed by target -> owner */
- VecLerpf(dvec, ct->matrix[3], cob->matrix[3], sfac);
+ interp_v3_v3v3(dvec, ct->matrix[3], cob->matrix[3], sfac);
/* copy new vector onto owner */
VECCOPY(cob->matrix[3], dvec);
@@ -2538,27 +2542,27 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
float dist;
/* store scaling before destroying obmat */
- Mat4ToSize(cob->matrix, size);
+ mat4_to_size( size,cob->matrix);
/* store X orientation before destroying obmat */
xx[0] = cob->matrix[0][0];
xx[1] = cob->matrix[0][1];
xx[2] = cob->matrix[0][2];
- Normalize(xx);
+ normalize_v3(xx);
/* store Z orientation before destroying obmat */
zz[0] = cob->matrix[2][0];
zz[1] = cob->matrix[2][1];
zz[2] = cob->matrix[2][2];
- Normalize(zz);
+ normalize_v3(zz);
- VecSubf(vec, cob->matrix[3], ct->matrix[3]);
+ sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
vec[0] /= size[0];
vec[1] /= size[1];
vec[2] /= size[2];
- dist = Normalize(vec);
- //dist = VecLenf( ob->obmat[3], targetmat[3]);
+ dist = normalize_v3(vec);
+ //dist = len_v3v3( ob->obmat[3], targetmat[3]);
/* data->orglength==0 occurs on first run, and after 'R' button is clicked */
if (data->orglength == 0)
@@ -2601,8 +2605,8 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
cob->matrix[2][1]=0;
cob->matrix[2][2]=size[2]*scale[2];
- VecSubf(vec, cob->matrix[3], ct->matrix[3]);
- Normalize(vec);
+ sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
+ normalize_v3(vec);
/* new Y aligns object target connection*/
totmat[1][0] = -vec[0];
@@ -2612,8 +2616,8 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case PLANE_X:
/* build new Z vector */
/* othogonal to "new Y" "old X! plane */
- Crossf(orth, vec, xx);
- Normalize(orth);
+ cross_v3_v3v3(orth, vec, xx);
+ normalize_v3(orth);
/* new Z*/
totmat[2][0] = orth[0];
@@ -2621,8 +2625,8 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
totmat[2][2] = orth[2];
/* we decided to keep X plane*/
- Crossf(xx, orth, vec);
- Normalize(xx);
+ cross_v3_v3v3(xx, orth, vec);
+ normalize_v3(xx);
totmat[0][0] = xx[0];
totmat[0][1] = xx[1];
totmat[0][2] = xx[2];
@@ -2630,8 +2634,8 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
case PLANE_Z:
/* build new X vector */
/* othogonal to "new Y" "old Z! plane */
- Crossf(orth, vec, zz);
- Normalize(orth);
+ cross_v3_v3v3(orth, vec, zz);
+ normalize_v3(orth);
/* new X */
totmat[0][0] = -orth[0];
@@ -2639,16 +2643,16 @@ static void stretchto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
totmat[0][2] = -orth[2];
/* we decided to keep Z */
- Crossf(zz, orth, vec);
- Normalize(zz);
+ cross_v3_v3v3(zz, orth, vec);
+ normalize_v3(zz);
totmat[2][0] = zz[0];
totmat[2][1] = zz[1];
totmat[2][2] = zz[2];
break;
} /* switch (data->plane) */
- Mat4CpyMat4(tmat, cob->matrix);
- Mat4MulMat34(cob->matrix, totmat, tmat);
+ copy_m4_m4(tmat, cob->matrix);
+ mul_m4_m3m4(cob->matrix, totmat, tmat);
}
}
@@ -2716,15 +2720,15 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
float val1, val2;
int index;
- Mat4CpyMat4(obmat, cob->matrix);
- Mat4CpyMat4(tarmat, ct->matrix);
+ copy_m4_m4(obmat, cob->matrix);
+ copy_m4_m4(tarmat, ct->matrix);
if (data->flag & MINMAX_USEROT) {
/* take rotation of target into account by doing the transaction in target's localspace */
- Mat4Invert(imat, tarmat);
- Mat4MulMat4(tmat, obmat, imat);
- Mat4CpyMat4(obmat, tmat);
- Mat4One(tarmat);
+ invert_m4_m4(imat, tarmat);
+ mul_m4_m4m4(tmat, obmat, imat);
+ copy_m4_m4(obmat, tmat);
+ unit_m4(tarmat);
}
switch (data->minmaxflag) {
@@ -2775,8 +2779,8 @@ static void minmax_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *tar
}
if (data->flag & MINMAX_USEROT) {
/* get out of localspace */
- Mat4MulMat4(tmat, obmat, ct->matrix);
- Mat4CpyMat4(cob->matrix, tmat);
+ mul_m4_m4m4(tmat, obmat, ct->matrix);
+ copy_m4_m4(cob->matrix, tmat);
}
else {
VECCOPY(cob->matrix[3], obmat[3]);
@@ -2900,7 +2904,7 @@ static void clampto_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
* might end up calling this...
*/
if (ct)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets)
@@ -2914,8 +2918,8 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
float obmat[4][4], targetMatrix[4][4], ownLoc[3];
float curveMin[3], curveMax[3];
- Mat4CpyMat4(obmat, cob->matrix);
- Mat4One(targetMatrix);
+ copy_m4_m4(obmat, cob->matrix);
+ unit_m4(targetMatrix);
VECCOPY(ownLoc, obmat[3]);
INIT_MINMAX(curveMin, curveMax)
@@ -2931,7 +2935,7 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* 1. determine which axis to sample on? */
if (data->flag == CLAMPTO_AUTO) {
float size[3];
- VecSubf(size, curveMax, curveMin);
+ sub_v3_v3v3(size, curveMax, curveMin);
/* find axis along which the bounding box has the greatest
* extent. Otherwise, default to the x-axis, as that is quite
@@ -3004,10 +3008,10 @@ static void clampto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
/* 3. position on curve */
if (where_on_path(ct->tar, curvetime, vec, dir, NULL, NULL) ) {
- Mat4One(totmat);
+ unit_m4(totmat);
VECCOPY(totmat[3], vec);
- Mat4MulSerie(targetMatrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
+ mul_serie_m4(targetMatrix, ct->tar->obmat, totmat, NULL, NULL, NULL, NULL, NULL, NULL);
}
}
@@ -3082,22 +3086,22 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
/* obtain target effect */
switch (data->from) {
case 2: /* scale */
- Mat4ToSize(ct->matrix, dvec);
+ mat4_to_size( dvec,ct->matrix);
break;
case 1: /* rotation (convert to degrees first) */
- Mat4ToEulO(ct->matrix, dvec, cob->rotOrder);
+ mat4_to_eulO( dvec, cob->rotOrder,ct->matrix);
for (i=0; i<3; i++)
dvec[i] = (float)(dvec[i] / M_PI * 180);
break;
default: /* location */
- VecCopyf(dvec, ct->matrix[3]);
+ copy_v3_v3(dvec, ct->matrix[3]);
break;
}
/* extract components of owner's matrix */
VECCOPY(loc, cob->matrix[3]);
- Mat4ToEulO(cob->matrix, eul, cob->rotOrder);
- Mat4ToSize(cob->matrix, size);
+ mat4_to_eulO( eul, cob->rotOrder,cob->matrix);
+ mat4_to_size( size,cob->matrix);
/* determine where in range current transforms lie */
if (data->expo) {
@@ -3146,12 +3150,12 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
loc[i]= (data->to_min[i] + (sval[(int)data->map[i]] * (data->to_max[i] - data->to_min[i])));
/* add original location back on (so that it can still be moved) */
- VecAddf(loc, cob->matrix[3], loc);
+ add_v3_v3v3(loc, cob->matrix[3], loc);
break;
}
/* apply to matrix */
- LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder);
+ loc_eulO_size_to_mat4(cob->matrix, loc, eul, size, cob->rotOrder);
}
}
@@ -3223,7 +3227,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
hit.index = -1;
hit.dist = 100000.0f; //TODO should use FLT_MAX.. but normal projection doenst yet supports it
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
if(target != NULL)
{
@@ -3249,8 +3253,8 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
BLI_bvhtree_find_nearest(treeData.tree, co, &nearest, treeData.nearest_callback, &treeData);
- dist = VecLenf(co, nearest.co);
- VecLerpf(co, co, nearest.co, (dist - scon->dist)/dist); /* linear interpolation */
+ dist = len_v3v3(co, nearest.co);
+ interp_v3_v3v3(co, co, nearest.co, (dist - scon->dist)/dist); /* linear interpolation */
space_transform_invert(&transform, co);
break;
@@ -3265,7 +3269,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
break;
}
- Normalize(no);
+ normalize_v3(no);
bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6);
@@ -3295,7 +3299,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
}
/* co is in local object coordinates, change it to global and update target position */
- VecMat4MulVecfl(co, cob->matrix, co);
+ mul_v3_m4v3(co, cob->matrix, co);
VECCOPY(ct->matrix[3], co);
}
}
@@ -3379,23 +3383,23 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
float rmat[3][3], tmat[4][4];
/* find the (unit) direction that the axis we're interested in currently points
- * - Mat4Mul3Vecfl() only takes the 3x3 (rotation+scaling) components of the 4x4 matrix
+ * - mul_mat3_m4_v3() only takes the 3x3 (rotation+scaling) components of the 4x4 matrix
* - the normalisation step at the end should take care of any unwanted scaling
* left over in the 3x3 matrix we used
*/
VECCOPY(obvec, track_dir_vecs[data->trackflag]);
- Mat4Mul3Vecfl(cob->matrix, obvec);
+ mul_mat3_m4_v3(cob->matrix, obvec);
- if (Normalize(obvec) == 0.0f) {
+ if (normalize_v3(obvec) == 0.0f) {
/* exceptional case - just use the track vector as appropriate */
VECCOPY(obvec, track_dir_vecs[data->trackflag]);
}
/* find the (unit) direction vector going from the owner to the target */
VECCOPY(obloc, cob->matrix[3]);
- VecSubf(tarvec, ct->matrix[3], obloc);
+ sub_v3_v3v3(tarvec, ct->matrix[3], obloc);
- if (Normalize(tarvec) == 0.0f) {
+ if (normalize_v3(tarvec) == 0.0f) {
/* the target is sitting on the owner, so just make them use the same direction vectors */
// FIXME: or would it be better to use the pure direction vector?
VECCOPY(tarvec, obvec);
@@ -3410,23 +3414,23 @@ static void damptrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *
* - the min/max wrappers around (obvec . tarvec) result (stored temporarily in rangle)
* are used to ensure that the smallest angle is chosen
*/
- Crossf(raxis, obvec, tarvec);
+ cross_v3_v3v3(raxis, obvec, tarvec);
- rangle= Inpf(obvec, tarvec);
+ rangle= dot_v3v3(obvec, tarvec);
rangle= acos( MAX2(-1.0f, MIN2(1.0f, rangle)) );
/* construct rotation matrix from the axis-angle rotation found above
* - this call takes care to make sure that the axis provided is a unit vector first
*/
- AxisAngleToMat3(raxis, rangle, rmat);
+ axis_angle_to_mat3( rmat,raxis, rangle);
/* rotate the owner in the way defined by this rotation matrix, then reapply the location since
* we may have destroyed that in the process of multiplying the matrix
*/
- Mat4One(tmat);
- Mat4MulMat34(tmat, rmat, cob->matrix); // m1, m3, m2
+ unit_m4(tmat);
+ mul_m4_m3m4(tmat, rmat, cob->matrix); // m1, m3, m2
- Mat4CpyMat4(cob->matrix, tmat);
+ copy_m4_m4(cob->matrix, tmat);
VECCOPY(cob->matrix[3], obloc);
}
}
@@ -3510,7 +3514,7 @@ static void splineik_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrai
* might end up calling this...
*/
if (ct)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
static bConstraintTypeInfo CTI_SPLINEIK = {
@@ -3636,6 +3640,121 @@ void free_constraints (ListBase *list)
BLI_freelistN(list);
}
+
+/* Remove the specified constraint from the given constraint stack */
+int remove_constraint (ListBase *list, bConstraint *con)
+{
+ if (con) {
+ free_constraint_data(con);
+ BLI_freelinkN(list, con);
+ return 1;
+ }
+ else
+ return 0;
+}
+
+/* Remove the nth constraint from the given constraint stack */
+int remove_constraint_index (ListBase *list, int index)
+{
+ bConstraint *con= BLI_findlink(list, index);
+
+ if (con)
+ return remove_constraint(list, con);
+ else
+ return 0;
+}
+
+/* ......... */
+
+/* Creates a new constraint, initialises its data, and returns it */
+static bConstraint *add_new_constraint_internal (const char *name, short type)
+{
+ bConstraint *con= MEM_callocN(sizeof(bConstraint), "Constraint");
+ bConstraintTypeInfo *cti= get_constraint_typeinfo(type);
+ const char *newName;
+
+ /* Set up a generic constraint datablock */
+ con->type = type;
+ con->flag |= CONSTRAINT_EXPAND;
+ con->enforce = 1.0f;
+
+ /* Determine a basic name, and info */
+ if (cti) {
+ /* initialise constraint data */
+ con->data = MEM_callocN(cti->size, cti->structName);
+
+ /* only constraints that change any settings need this */
+ if (cti->new_data)
+ cti->new_data(con->data);
+
+ /* if no name is provided, use the type of the constraint as the name */
+ newName= (name && name[0]) ? name : cti->name;
+ }
+ else {
+ /* if no name is provided, use the generic "Const" name */
+ // NOTE: any constraint type that gets here really shouldn't get added...
+ newName= (name && name[0]) ? name : "Const";
+ }
+
+ /* copy the name */
+ BLI_strncpy(con->name, newName, sizeof(con->name));
+
+ /* return the new constraint */
+ return con;
+}
+
+/* if pchan is not NULL then assume we're adding a pose constraint */
+static bConstraint *add_new_constraint (Object *ob, bPoseChannel *pchan, const char *name, short type)
+{
+ bConstraint *con;
+ ListBase *list;
+
+ /* add the constraint */
+ con= add_new_constraint_internal(name, type);
+
+ /* find the constraint stack - bone or object? */
+ list = (pchan) ? (&pchan->constraints) : (&ob->constraints);
+
+ if (list) {
+ /* add new constraint to end of list of constraints before ensuring that it has a unique name
+ * (otherwise unique-naming code will fail, since it assumes element exists in list)
+ */
+ BLI_addtail(list, con);
+ unique_constraint_name(con, list);
+
+ /* if the target list is a list on some PoseChannel belonging to a proxy-protected
+ * Armature layer, we must tag newly added constraints with a flag which allows them
+ * to persist after proxy syncing has been done
+ */
+ if (proxylocked_constraints_owner(ob, pchan))
+ con->flag |= CONSTRAINT_PROXY_LOCAL;
+
+ /* make this constraint the active one */
+ constraints_set_active(list, con);
+ }
+
+ return con;
+}
+
+/* ......... */
+
+/* Add new constraint for the given bone */
+bConstraint *add_pose_constraint (Object *ob, bPoseChannel *pchan, const char *name, short type)
+{
+ if (pchan == NULL)
+ return NULL;
+
+ return add_new_constraint(ob, pchan, name, type);
+}
+
+/* Add new constraint for the given object */
+bConstraint *add_ob_constraint(Object *ob, const char *name, short type)
+{
+ return add_new_constraint(ob, NULL, name, type);
+}
+
+/* ......... */
+
/* Reassign links that constraints have to other data (called during file loading?) */
void relink_constraints (ListBase *conlist)
{
@@ -3666,8 +3785,10 @@ void relink_constraints (ListBase *conlist)
}
}
+/* ......... */
+
/* duplicate all of the constraints in a constraint stack */
-void copy_constraints (ListBase *dst, ListBase *src)
+void copy_constraints (ListBase *dst, const ListBase *src)
{
bConstraint *con, *srccon;
@@ -3680,6 +3801,7 @@ void copy_constraints (ListBase *dst, ListBase *src)
/* make a new copy of the constraint's data */
con->data = MEM_dupallocN(con->data);
+ // NOTE: depreceated... old animation system
id_us_plus((ID *)con->ipo);
/* only do specific constraints if required */
@@ -3688,6 +3810,8 @@ void copy_constraints (ListBase *dst, ListBase *src)
}
}
+/* ......... */
+
/* finds the 'active' constraint in a constraint stack */
bConstraint *constraints_get_active (ListBase *list)
{
@@ -3705,6 +3829,19 @@ bConstraint *constraints_get_active (ListBase *list)
return NULL;
}
+/* Set the given constraint as the active one (clearing all the others) */
+void constraints_set_active (ListBase *list, bConstraint *con)
+{
+ bConstraint *c;
+
+ for (c= list->first; c; c= c->next) {
+ if (c == con)
+ c->flag |= CONSTRAINT_ACTIVE;
+ else
+ c->flag &= ~CONSTRAINT_ACTIVE;
+ }
+}
+
/* -------- Constraints and Proxies ------- */
/* Rescue all constraints tagged as being CONSTRAINT_PROXY_LOCAL (i.e. added to bone that's proxy-synced in this file) */
@@ -3772,12 +3909,12 @@ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n,
cob->ob= (Object *)ownerdata;
cob->pchan= NULL;
if (cob->ob) {
- Mat4CpyMat4(cob->matrix, cob->ob->obmat);
- Mat4CpyMat4(cob->startmat, cob->matrix);
+ copy_m4_m4(cob->matrix, cob->ob->obmat);
+ copy_m4_m4(cob->startmat, cob->matrix);
}
else {
- Mat4One(cob->matrix);
- Mat4One(cob->startmat);
+ unit_m4(cob->matrix);
+ unit_m4(cob->startmat);
}
}
break;
@@ -3786,12 +3923,12 @@ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n,
cob->ob= NULL; /* this might not work at all :/ */
cob->pchan= (bPoseChannel *)ownerdata;
if (cob->pchan) {
- Mat4CpyMat4(cob->matrix, cob->pchan->pose_mat);
- Mat4CpyMat4(cob->startmat, cob->matrix);
+ copy_m4_m4(cob->matrix, cob->pchan->pose_mat);
+ copy_m4_m4(cob->startmat, cob->matrix);
}
else {
- Mat4One(cob->matrix);
- Mat4One(cob->startmat);
+ unit_m4(cob->matrix);
+ unit_m4(cob->startmat);
}
}
break;
@@ -3808,7 +3945,7 @@ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n,
if (ct) {
if (cti->get_target_matrix)
cti->get_target_matrix(con, cob, ct, ctime);
- Mat4CpyMat4(mat, ct->matrix);
+ copy_m4_m4(mat, ct->matrix);
}
/* free targets + 'constraint-ob' */
@@ -3818,7 +3955,7 @@ void get_constraint_target_matrix (struct Scene *scene, bConstraint *con, int n,
}
else {
/* invalid constraint - perhaps... */
- Mat4One(mat);
+ unit_m4(mat);
}
}
@@ -3861,7 +3998,7 @@ void solve_constraints (ListBase *conlist, bConstraintOb *cob, float ctime)
/* move owner matrix into right space */
constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, CONSTRAINT_SPACE_WORLD, con->ownspace);
- Mat4CpyMat4(oldmat, cob->matrix);
+ copy_m4_m4(oldmat, cob->matrix);
/* prepare targets for constraint solving */
if (cti->get_constraint_targets) {
@@ -3882,7 +4019,7 @@ void solve_constraints (ListBase *conlist, bConstraintOb *cob, float ctime)
}
else {
for (ct= targets.first; ct; ct= ct->next)
- Mat4One(ct->matrix);
+ unit_m4(ct->matrix);
}
}
@@ -3899,21 +4036,21 @@ void solve_constraints (ListBase *conlist, bConstraintOb *cob, float ctime)
/* Interpolate the enforcement, to blend result of constraint into final owner transform */
/* 1. Remove effects of original matrix from constraint solution ==> delta */
- Mat4Invert(imat, oldmat);
- Mat4CpyMat4(solution, cob->matrix);
- Mat4MulMat4(delta, solution, imat);
+ invert_m4_m4(imat, oldmat);
+ copy_m4_m4(solution, cob->matrix);
+ mul_m4_m4m4(delta, solution, imat);
/* 2. If constraint influence is not full strength, then interpolate
* identity_matrix --> delta_matrix to get the effect the constraint actually exerts
*/
if (enf < 1.0) {
float identity[4][4];
- Mat4One(identity);
- Mat4BlendMat4(delta, identity, delta, enf);
+ unit_m4(identity);
+ blend_m4_m4m4(delta, identity, delta, enf);
}
/* 3. Now multiply the delta by the matrix in use before the evaluation */
- Mat4MulMat4(cob->matrix, delta, oldmat);
+ mul_m4_m4m4(cob->matrix, delta, oldmat);
/* move owner back into worldspace for next constraint/other business */
if ((con->flag & CONSTRAINT_SPACEONCE) == 0)
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 7f2872c0797..fc1ef4aede9 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -46,6 +46,8 @@
#include "BKE_screen.h"
#include "BKE_global.h"
+#include "BPY_extern.h"
+
#include
/* struct */
@@ -408,16 +410,26 @@ struct bContextDataResult {
static int ctx_data_get(bContext *C, const char *member, bContextDataResult *result)
{
int done= 0, recursion= C->data.recursion;
+ int ret= 0;
memset(result, 0, sizeof(bContextDataResult));
if(CTX_py_dict_get(C)) {
- return bpy_context_get(C, member, result);
+ return BPY_context_get(C, member, result);
+// if (BPY_context_get(C, member, result))
+// return 1;
}
/* we check recursion to ensure that we do not get infinite
* loops requesting data from ourselfs in a context callback */
- if(!done && recursion < 1 && C->wm.store) {
+
+ /* Ok, this looks evil...
+ * if(ret) done= -(-ret | -done);
+ *
+ * Values in order of importance
+ * (0, -1, 1) - Where 1 is highest priority
+ * */
+ if(done!=1 && recursion < 1 && C->wm.store) {
bContextStoreEntry *entry;
C->data.recursion= 1;
@@ -429,21 +441,28 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
}
}
}
- if(!done && recursion < 2 && C->wm.region) {
+ if(done!=1 && recursion < 2 && C->wm.region) {
C->data.recursion= 2;
- if(C->wm.region->type && C->wm.region->type->context)
- done= C->wm.region->type->context(C, member, result);
+ if(C->wm.region->type && C->wm.region->type->context) {
+ ret = C->wm.region->type->context(C, member, result);
+ if(ret) done= -(-ret | -done);
+
+ }
}
- if(!done && recursion < 3 && C->wm.area) {
+ if(done!=1 && recursion < 3 && C->wm.area) {
C->data.recursion= 3;
- if(C->wm.area->type && C->wm.area->type->context)
- done= C->wm.area->type->context(C, member, result);
+ if(C->wm.area->type && C->wm.area->type->context) {
+ ret = C->wm.area->type->context(C, member, result);
+ if(ret) done= -(-ret | -done);
+ }
}
- if(!done && recursion < 4 && C->wm.screen) {
+ if(done!=1 && recursion < 4 && C->wm.screen) {
bContextDataCallback cb= C->wm.screen->context;
C->data.recursion= 4;
- if(cb)
- done= cb(C, member, result);
+ if(cb) {
+ ret = cb(C, member, result);
+ if(ret) done= -(-ret | -done);
+ }
}
C->data.recursion= recursion;
@@ -455,7 +474,7 @@ static void *ctx_data_pointer_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(C && ctx_data_get((bContext*)C, member, &result))
+ if(C && ctx_data_get((bContext*)C, member, &result)==1)
return result.ptr.data;
return NULL;
@@ -465,7 +484,7 @@ static int ctx_data_pointer_verify(const bContext *C, const char *member, void *
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)) {
+ if(ctx_data_get((bContext*)C, member, &result)==1) {
*pointer= result.ptr.data;
return 1;
}
@@ -479,7 +498,7 @@ static int ctx_data_collection_get(const bContext *C, const char *member, ListBa
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)) {
+ if(ctx_data_get((bContext*)C, member, &result)==1) {
*list= result.list;
return 1;
}
@@ -494,7 +513,7 @@ PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result))
+ if(ctx_data_get((bContext*)C, member, &result)==1)
return result.ptr;
else
return PointerRNA_NULL;
@@ -514,7 +533,7 @@ ListBase CTX_data_collection_get(const bContext *C, const char *member)
{
bContextDataResult result;
- if(ctx_data_get((bContext*)C, member, &result)) {
+ if(ctx_data_get((bContext*)C, member, &result)==1) {
return result.list;
}
else {
@@ -524,11 +543,13 @@ ListBase CTX_data_collection_get(const bContext *C, const char *member)
}
}
-void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb)
+/* 1:found, -1:found but not set, 0:not found */
+int CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb)
{
bContextDataResult result;
+ int ret= ctx_data_get((bContext*)C, member, &result);
- if(ctx_data_get((bContext*)C, member, &result)) {
+ if(ret==1) {
*r_ptr= result.ptr;
*r_lb= result.list;
}
@@ -536,6 +557,8 @@ void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, List
memset(r_ptr, 0, sizeof(*r_ptr));
memset(r_lb, 0, sizeof(*r_lb));
}
+
+ return ret;
}
static void data_dir_add(ListBase *lb, const char *member)
@@ -855,18 +878,18 @@ int CTX_data_editable_bones(const bContext *C, ListBase *list)
return ctx_data_collection_get(C, "editable_bones", list);
}
-struct bPoseChannel *CTX_data_active_pchan(const bContext *C)
+struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C)
{
- return ctx_data_pointer_get(C, "active_pchan");
+ return ctx_data_pointer_get(C, "active_pose_bone");
}
-int CTX_data_selected_pchans(const bContext *C, ListBase *list)
+int CTX_data_selected_pose_bones(const bContext *C, ListBase *list)
{
- return ctx_data_collection_get(C, "selected_pchans", list);
+ return ctx_data_collection_get(C, "selected_pose_bones", list);
}
-int CTX_data_visible_pchans(const bContext *C, ListBase *list)
+int CTX_data_visible_pose_bones(const bContext *C, ListBase *list)
{
- return ctx_data_collection_get(C, "visible_pchans", list);
+ return ctx_data_collection_get(C, "visible_pose_bones", list);
}
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 1410e5d29c2..75759733cad 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -40,7 +40,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "DNA_object_types.h"
#include "DNA_curve_types.h"
@@ -992,7 +992,7 @@ static void forward_diff_bezier_cotangent(float *p0, float *p1, float *p2, float
for(i=0; i<3; i++) {
p[i]= (-6*t + 6)*p0[i] + (18*t - 12)*p1[i] + (-18*t + 6)*p2[i] + (6*t)*p3[i];
}
- Normalize(p);
+ normalize_v3(p);
p = (float *)(((char *)p)+stride);
}
}
@@ -1569,7 +1569,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
/* correct non-cyclic cases by copying direction and rotation
* values onto the first & last end-points */
-static void bevel_list_cyclic_fix(BevList *bl)
+static void bevel_list_cyclic_fix_3D(BevList *bl)
{
BevPoint *bevp, *bevp1;
@@ -1598,7 +1598,7 @@ static void bevel_list_calc_bisect(BevList *bl)
nr= bl->nr;
while(nr--) {
/* totally simple */
- VecBisect3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
+ bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
bevp0= bevp1;
bevp1= bevp2;
@@ -1616,8 +1616,8 @@ static void bevel_list_flip_tangents(BevList *bl)
nr= bl->nr;
while(nr--) {
- if(RAD2DEG(VecAngle2(bevp0->tan, bevp1->tan)) > 90)
- VecNegf(bevp1->tan);
+ if(RAD2DEG(angle_v2v2(bevp0->tan, bevp1->tan)) > 90)
+ negate_v3(bevp1->tan);
bevp0= bevp1;
bevp1= bevp2;
@@ -1637,9 +1637,9 @@ static void bevel_list_apply_tilt(BevList *bl)
nr= bl->nr;
while(nr--) {
- AxisAngleToQuat(q, bevp1->dir, bevp1->alfa);
- QuatMul(bevp1->quat, q, bevp1->quat);
- NormalQuat(bevp1->quat);
+ axis_angle_to_quat(q, bevp1->dir, bevp1->alfa);
+ mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
+ normalize_qt(bevp1->quat);
bevp0= bevp1;
bevp1= bevp2;
@@ -1683,18 +1683,18 @@ static void bevel_list_smooth(BevList *bl, int smooth_iter)
while(nr--) {
/* interpolate quats */
float zaxis[3] = {0,0,1}, cross[3], q2[4];
- QuatInterpol(q, bevp0_quat, bevp2->quat, 0.5);
- NormalQuat(q);
+ interp_qt_qtqt(q, bevp0_quat, bevp2->quat, 0.5);
+ normalize_qt(q);
- QuatMulVecf(q, zaxis);
- Crossf(cross, zaxis, bevp1->dir);
- AxisAngleToQuat(q2, cross, NormalizedVecAngle2(zaxis, bevp1->dir));
- NormalQuat(q2);
+ mul_qt_v3(q, zaxis);
+ cross_v3_v3v3(cross, zaxis, bevp1->dir);
+ axis_angle_to_quat(q2, cross, angle_normalized_v3v3(zaxis, bevp1->dir));
+ normalize_qt(q2);
QUATCOPY(bevp0_quat, bevp1->quat);
- QuatMul(q, q2, q);
- QuatInterpol(bevp1->quat, bevp1->quat, q, 0.5);
- NormalQuat(bevp1->quat);
+ mul_qt_qtqt(q, q2, q);
+ interp_qt_qtqt(bevp1->quat, bevp1->quat, q, 0.5);
+ normalize_qt(bevp1->quat);
bevp0= bevp1;
@@ -1716,8 +1716,8 @@ static void make_bevel_list_3D_zup(BevList *bl)
nr= bl->nr;
while(nr--) {
/* totally simple */
- VecBisect3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
- vectoquat(bevp1->dir, 5, 1, bevp1->quat);
+ bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
+ vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
bevp0= bevp1;
bevp1= bevp2;
@@ -1743,15 +1743,15 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
while(nr--) {
if(nr+4 > bl->nr) { /* first time and second time, otherwise first point adjusts last */
- vectoquat(bevp1->dir, 5, 1, bevp1->quat);
+ vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
}
else {
- float angle= NormalizedVecAngle2(bevp0->dir, bevp1->dir);
+ float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir);
if(angle > 0.0f) { /* otherwise we can keep as is */
- Crossf(cross_tmp, bevp0->dir, bevp1->dir);
- AxisAngleToQuat(q, cross_tmp, angle);
- QuatMul(bevp1->quat, q, bevp0->quat);
+ cross_v3_v3v3(cross_tmp, bevp0->dir, bevp1->dir);
+ axis_angle_to_quat(q, cross_tmp, angle);
+ mul_qt_qtqt(bevp1->quat, q, bevp0->quat);
}
else {
QUATCOPY(bevp1->quat, bevp0->quat);
@@ -1788,26 +1788,26 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
bevp_last--;
/* quats and vec's are normalized, should not need to re-normalize */
- QuatMulVecf(bevp_first->quat, vec_1);
- QuatMulVecf(bevp_last->quat, vec_2);
- Normalize(vec_1);
- Normalize(vec_2);
+ mul_qt_v3(bevp_first->quat, vec_1);
+ mul_qt_v3(bevp_last->quat, vec_2);
+ normalize_v3(vec_1);
+ normalize_v3(vec_2);
/* align the vector, can avoid this and it looks 98% OK but
* better to align the angle quat roll's before comparing */
{
- Crossf(cross_tmp, bevp_last->dir, bevp_first->dir);
- angle = NormalizedVecAngle2(bevp_first->dir, bevp_last->dir);
- AxisAngleToQuat(q, cross_tmp, angle);
- QuatMulVecf(q, vec_2);
+ cross_v3_v3v3(cross_tmp, bevp_last->dir, bevp_first->dir);
+ angle = angle_normalized_v3v3(bevp_first->dir, bevp_last->dir);
+ axis_angle_to_quat(q, cross_tmp, angle);
+ mul_qt_v3(q, vec_2);
}
- angle= NormalizedVecAngle2(vec_1, vec_2);
+ angle= angle_normalized_v3v3(vec_1, vec_2);
/* flip rotation if needs be */
- Crossf(cross_tmp, vec_1, vec_2);
- Normalize(cross_tmp);
- if(NormalizedVecAngle2(bevp_first->dir, cross_tmp) < 90/(180.0/M_PI))
+ cross_v3_v3v3(cross_tmp, vec_1, vec_2);
+ normalize_v3(cross_tmp);
+ if(angle_normalized_v3v3(bevp_first->dir, cross_tmp) < 90/(180.0/M_PI))
angle = -angle;
bevp2= (BevPoint *)(bl+1);
@@ -1818,8 +1818,8 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl)
while(nr--) {
ang_fac= angle * (1.0f-((float)nr/bl->nr)); /* also works */
- AxisAngleToQuat(q, bevp1->dir, ang_fac);
- QuatMul(bevp1->quat, q, bevp1->quat);
+ axis_angle_to_quat(q, bevp1->dir, ang_fac);
+ mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
bevp0= bevp1;
bevp1= bevp2;
@@ -1837,7 +1837,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
bevel_list_calc_bisect(bl);
if(bl->poly== -1) /* check its not cyclic */
- bevel_list_cyclic_fix(bl); // XXX - run this now so tangents will be right before doing the flipping
+ bevel_list_cyclic_fix_3D(bl); // XXX - run this now so tangents will be right before doing the flipping
bevel_list_flip_tangents(bl);
/* correct the tangents */
@@ -1848,9 +1848,9 @@ static void make_bevel_list_3D_tangent(BevList *bl)
nr= bl->nr;
while(nr--) {
- Crossf(cross_tmp, bevp1->tan, bevp1->dir);
- Crossf(bevp1->tan, cross_tmp, bevp1->dir);
- Normalize(bevp1->tan);
+ cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
+ cross_v3_v3v3(bevp1->tan, cross_tmp, bevp1->dir);
+ normalize_v3(bevp1->tan);
bevp0= bevp1;
bevp1= bevp2;
@@ -1872,9 +1872,9 @@ static void make_bevel_list_3D_tangent(BevList *bl)
float cross_tmp[3];
float zero[3] = {0,0,0};
- Crossf(cross_tmp, bevp1->tan, bevp1->dir);
- Normalize(cross_tmp);
- triatoquat(zero, cross_tmp, bevp1->tan, bevp1->quat); /* XXX - could be faster */
+ cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
+ normalize_v3(cross_tmp);
+ tri_to_quat( bevp1->quat,zero, cross_tmp, bevp1->tan); /* XXX - could be faster */
bevp0= bevp1;
bevp1= bevp2;
@@ -1896,7 +1896,7 @@ static void make_bevel_list_3D(BevList *bl, int smooth_iter, int twist_mode)
}
if(bl->poly== -1) /* check its not cyclic */
- bevel_list_cyclic_fix(bl);
+ bevel_list_cyclic_fix_3D(bl);
if(smooth_iter)
bevel_list_smooth(bl, smooth_iter);
@@ -1906,6 +1906,29 @@ static void make_bevel_list_3D(BevList *bl, int smooth_iter, int twist_mode)
+/* only for 2 points */
+static void make_bevel_list_segment_3D(BevList *bl)
+{
+ float q[4];
+
+ BevPoint *bevp2= (BevPoint *)(bl+1);
+ BevPoint *bevp1= bevp2+1;
+
+ /* simple quat/dir */
+ sub_v3_v3v3(bevp1->dir, bevp1->vec, bevp2->vec);
+ normalize_v3(bevp1->dir);
+
+ vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+
+ axis_angle_to_quat(q, bevp1->dir, bevp1->alfa);
+ mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
+ normalize_qt(bevp1->quat);
+ VECCOPY(bevp2->dir, bevp1->dir);
+ QUATCOPY(bevp2->quat, bevp1->quat);
+}
+
+
+
void makeBevelList(Object *ob)
{
/*
@@ -2213,7 +2236,9 @@ void makeBevelList(Object *ob)
}
/* STEP 4: 2D-COSINES or 3D ORIENTATION */
- if((cu->flag & CU_3D)==0) { /* 3D */
+ if((cu->flag & CU_3D)==0) {
+ /* note: bevp->dir and bevp->quat are not needed for beveling but are
+ * used when making a path from a 2D curve, therefor they need to be set - Campbell */
bl= cu->bev.first;
while(bl) {
@@ -2230,6 +2255,9 @@ void makeBevelList(Object *ob)
calc_bevel_sin_cos(x1, y1, -x1, -y1, &(bevp1->sina), &(bevp1->cosa));
bevp2->sina= bevp1->sina;
bevp2->cosa= bevp1->cosa;
+
+ /* fill in dir & quat */
+ make_bevel_list_segment_3D(bl);
}
else {
bevp2= (BevPoint *)(bl+1);
@@ -2245,6 +2273,12 @@ void makeBevelList(Object *ob)
calc_bevel_sin_cos(x1, y1, x2, y2, &(bevp1->sina), &(bevp1->cosa));
+ /* from: make_bevel_list_3D_zup, could call but avoid a second loop.
+ * no need for tricky tilt calculation as with 3D curves */
+ bisect_v3_v3v3v3(bevp1->dir, bevp0->vec, bevp1->vec, bevp2->vec);
+ vec_to_quat( bevp1->quat,bevp1->dir, 5, 1);
+ /* done with inline make_bevel_list_3D_zup */
+
bevp0= bevp1;
bevp1= bevp2;
bevp2++;
@@ -2261,6 +2295,9 @@ void makeBevelList(Object *ob)
bevp1= bevp-1;
bevp->sina= bevp1->sina;
bevp->cosa= bevp1->cosa;
+
+ /* correct for the dir/quat, see above why its needed */
+ bevel_list_cyclic_fix_3D(bl);
}
}
bl= bl->next;
@@ -2274,22 +2311,7 @@ void makeBevelList(Object *ob)
/* do nothing */
}
else if(bl->nr==2) { /* 2 pnt, treat separate */
- float q[4];
-
- bevp2= (BevPoint *)(bl+1);
- bevp1= bevp2+1;
-
- /* simple quat/dir */
- VecSubf(bevp1->dir, bevp1->vec, bevp2->vec);
- Normalize(bevp1->dir);
-
- vectoquat(bevp1->dir, 5, 1, bevp1->quat);
-
- AxisAngleToQuat(q, bevp1->dir, bevp1->alfa);
- QuatMul(bevp1->quat, q, bevp1->quat);
- NormalQuat(bevp1->quat);
- VECCOPY(bevp2->dir, bevp1->dir);
- QUATCOPY(bevp2->quat, bevp1->quat);
+ make_bevel_list_segment_3D(bl);
}
else {
make_bevel_list_3D(bl, (int)(resolu*cu->twist_smooth), cu->twist_mode);
@@ -2421,10 +2443,10 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
if(leftviolate || rightviolate) { /* align left handle */
float h1[3], h2[3];
- VecSubf(h1, p2-3, p2);
- VecSubf(h2, p2, p2+3);
- len1= Normalize(h1);
- len2= Normalize(h2);
+ sub_v3_v3v3(h1, p2-3, p2);
+ sub_v3_v3v3(h2, p2, p2+3);
+ len1= normalize_v3(h1);
+ len2= normalize_v3(h2);
vz= INPR(h1, h2);
@@ -2460,8 +2482,8 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
*(p2+5)= *(p2+2)+dz1;
}
- len2= VecLenf(p2, p2+3);
- len1= VecLenf(p2, p2-3);
+ len2= len_v3v3(p2, p2+3);
+ len1= len_v3v3(p2, p2-3);
if(len1==0.0) len1=1.0;
if(len2==0.0) len2=1.0;
@@ -2588,18 +2610,18 @@ void autocalchandlesNurb(Nurb *nu, int flag)
if(flag==0 || (bezt1->f1 & flag) ) {
bezt1->h1= 0;
/* distance too short: vectorhandle */
- if( VecLenf( bezt1->vec[1], bezt0->vec[1] ) < 0.0001) {
+ if( len_v3v3( bezt1->vec[1], bezt0->vec[1] ) < 0.0001) {
bezt1->h1= HD_VECT;
leftsmall= 1;
}
else {
/* aligned handle? */
- if(DistVL2Dfl(bezt1->vec[1], bezt1->vec[0], bezt1->vec[2]) < 0.0001) {
+ if(dist_to_line_v2(bezt1->vec[1], bezt1->vec[0], bezt1->vec[2]) < 0.0001) {
align= 1;
bezt1->h1= HD_ALIGN;
}
/* or vector handle? */
- if(DistVL2Dfl(bezt1->vec[0], bezt1->vec[1], bezt0->vec[1]) < 0.0001)
+ if(dist_to_line_v2(bezt1->vec[0], bezt1->vec[1], bezt0->vec[1]) < 0.0001)
bezt1->h1= HD_VECT;
}
@@ -2608,7 +2630,7 @@ void autocalchandlesNurb(Nurb *nu, int flag)
if(flag==0 || (bezt1->f3 & flag) ) {
bezt1->h2= 0;
/* distance too short: vectorhandle */
- if( VecLenf( bezt1->vec[1], bezt2->vec[1] ) < 0.0001) {
+ if( len_v3v3( bezt1->vec[1], bezt2->vec[1] ) < 0.0001) {
bezt1->h2= HD_VECT;
rightsmall= 1;
}
@@ -2617,7 +2639,7 @@ void autocalchandlesNurb(Nurb *nu, int flag)
if(align) bezt1->h2= HD_ALIGN;
/* or vector handle? */
- if(DistVL2Dfl(bezt1->vec[2], bezt1->vec[1], bezt2->vec[1]) < 0.0001)
+ if(dist_to_line_v2(bezt1->vec[2], bezt1->vec[1], bezt2->vec[1]) < 0.0001)
bezt1->h2= HD_VECT;
}
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 28aaadea9c3..7b754025b6c 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -34,7 +34,7 @@
#include "BKE_customdata.h"
#include "BKE_utildefines.h" // CLAMP
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_mempool.h"
@@ -410,21 +410,21 @@ static void mdisps_bilinear(float out[3], float (*disps)[3], int st, float u, fl
vrat = v - y;
uopp = 1 - urat;
- VecCopyf(d[0], disps[y * st + x]);
- VecCopyf(d[1], disps[y * st + x2]);
- VecCopyf(d[2], disps[y2 * st + x]);
- VecCopyf(d[3], disps[y2 * st + x2]);
- VecMulf(d[0], uopp);
- VecMulf(d[1], urat);
- VecMulf(d[2], uopp);
- VecMulf(d[3], urat);
+ copy_v3_v3(d[0], disps[y * st + x]);
+ copy_v3_v3(d[1], disps[y * st + x2]);
+ copy_v3_v3(d[2], disps[y2 * st + x]);
+ copy_v3_v3(d[3], disps[y2 * st + x2]);
+ mul_v3_fl(d[0], uopp);
+ mul_v3_fl(d[1], urat);
+ mul_v3_fl(d[2], uopp);
+ mul_v3_fl(d[3], urat);
- VecAddf(d2[0], d[0], d[1]);
- VecAddf(d2[1], d[2], d[3]);
- VecMulf(d2[0], 1 - vrat);
- VecMulf(d2[1], vrat);
+ add_v3_v3v3(d2[0], d[0], d[1]);
+ add_v3_v3v3(d2[1], d[2], d[3]);
+ mul_v3_fl(d2[0], 1 - vrat);
+ mul_v3_fl(d2[1], vrat);
- VecAddf(out, d2[0], d2[1]);
+ add_v3_v3v3(out, d2[0], d2[1]);
}
static void layerSwap_mdisps(void *data, int *ci)
@@ -440,7 +440,7 @@ static void layerSwap_mdisps(void *data, int *ci)
for(y = 0; y < st; ++y) {
for(x = 0; x < st; ++x) {
- VecCopyf(d[(st - y - 1) * st + (st - x - 1)], s->disps[y * st + x]);
+ copy_v3_v3(d[(st - y - 1) * st + (st - x - 1)], s->disps[y * st + x]);
}
}
@@ -462,7 +462,7 @@ static void layerInterp_mdisps(void **sources, float *weights, float *sub_weight
/* Initialize the destination */
for(i = 0; i < d->totdisp; ++i) {
float z[3] = {0,0,0};
- VecCopyf(d->disps[i], z);
+ copy_v3_v3(d->disps[i], z);
}
/* For now, some restrictions on the input */
@@ -493,7 +493,7 @@ static void layerInterp_mdisps(void **sources, float *weights, float *sub_weight
float srcdisp[3];
mdisps_bilinear(srcdisp, s->disps, st, mid3[0], mid3[1]);
- VecCopyf(d->disps[y * st + x], srcdisp);
+ copy_v3_v3(d->disps[y * st + x], srcdisp);
}
}
}
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index b7949a6e06f..c1e45243bb5 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -59,7 +59,7 @@
#include "BKE_mesh.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#ifdef HAVE_CONFIG_H
#include
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 36568ee5667..302b81f2a04 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -34,7 +34,7 @@
#endif
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "DNA_anim_types.h"
#include "DNA_action_types.h"
@@ -327,7 +327,7 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
node1 = dag_get_node(dag, dtar->id);
/* check if bone... */
- if ((ob->type==OB_ARMATURE) && dtar->rna_path && strstr(dtar->rna_path, "pose.pose_channels["))
+ if ((ob->type==OB_ARMATURE) && dtar->rna_path && strstr(dtar->rna_path, "pose.bones["))
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Driver");
/* check if ob data */
else if (dtar->rna_path && strstr(dtar->rna_path, "data."))
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 64af08d6f6a..48fb283c404 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -56,7 +56,7 @@
#include "DNA_key_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_edgehash.h"
@@ -220,12 +220,12 @@ void addnormalsDispList(Object *ob, ListBase *lb)
for(; bnr; b++) {
- CalcNormFloat4(v1, v3, v4, v2, nor);
+ normal_quad_v3( nor,v1, v3, v4, v2);
- VecAddf(n1, n1, nor);
- VecAddf(n2, n2, nor);
- VecAddf(n3, n3, nor);
- VecAddf(n4, n4, nor);
+ add_v3_v3v3(n1, n1, nor);
+ add_v3_v3v3(n2, n2, nor);
+ add_v3_v3v3(n3, n3, nor);
+ add_v3_v3v3(n4, n4, nor);
v2= v1; v1+= 3;
v4= v3; v3+= 3;
@@ -236,7 +236,7 @@ void addnormalsDispList(Object *ob, ListBase *lb)
a= dl->parts*dl->nr;
v1= ndata;
while(a--) {
- Normalize(v1);
+ normalize_v3(v1);
v1+= 3;
}
}
@@ -475,11 +475,11 @@ static void init_fastshade_for_ob(Render *re, Object *ob, int *need_orco_r, floa
init_fastshade_shadeinput(re);
RE_DataBase_GetView(re, tmat);
- Mat4MulMat4(mat, ob->obmat, tmat);
+ mul_m4_m4m4(mat, ob->obmat, tmat);
- Mat4Invert(tmat, mat);
- Mat3CpyMat4(imat, tmat);
- if(ob->transflag & OB_NEG_SCALE) Mat3MulFloat((float *)imat, -1.0);
+ invert_m4_m4(tmat, mat);
+ copy_m3_m4(imat, tmat);
+ if(ob->transflag & OB_NEG_SCALE) mul_m3_fl(imat, -1.0);
if (need_orco_r) *need_orco_r= 0;
for(a=0; atotcol; a++) {
@@ -563,7 +563,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
vn[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
vn[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
vn[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalize(vn);
+ normalize_v3(vn);
}
for (i=0; iv4)
- CalcNormFloat4(mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co, nor);
+ normal_quad_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, mvert[mf->v4].co);
else
- CalcNormFloat(mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co, nor);
+ normal_tri_v3( nor,mvert[mf->v1].co, mvert[mf->v2].co, mvert[mf->v3].co);
}
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
- Normalize(n1);
+ normalize_v3(n1);
for (j=0; jflag & ME_SMOOTH)?&vnors[3*vidx[j]]:n1;
VECCOPY(vec, mv->co);
- Mat4MulVecfl(mat, vec);
+ mul_m4_v3(mat, vec);
vec[0]+= 0.001*vn[0];
vec[1]+= 0.001*vn[1];
vec[2]+= 0.001*vn[2];
@@ -708,14 +708,14 @@ void shadeDispList(Scene *scene, Base *base)
n1[0]= imat[0][0]*dl->nors[0]+imat[0][1]*dl->nors[1]+imat[0][2]*dl->nors[2];
n1[1]= imat[1][0]*dl->nors[0]+imat[1][1]*dl->nors[1]+imat[1][2]*dl->nors[2];
n1[2]= imat[2][0]*dl->nors[0]+imat[2][1]*dl->nors[1]+imat[2][2]*dl->nors[2];
- Normalize(n1);
+ normalize_v3(n1);
fp= dl->verts;
a= dl->nr;
while(a--) {
VECCOPY(vec, fp);
- Mat4MulVecfl(mat, vec);
+ mul_m4_v3(mat, vec);
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
@@ -731,12 +731,12 @@ void shadeDispList(Scene *scene, Base *base)
while(a--) {
VECCOPY(vec, fp);
- Mat4MulVecfl(mat, vec);
+ mul_m4_v3(mat, vec);
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
- Normalize(n1);
+ normalize_v3(n1);
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
@@ -769,13 +769,13 @@ void shadeDispList(Scene *scene, Base *base)
a= dl->nr;
while(a--) {
VECCOPY(vec, fp);
- Mat4MulVecfl(mat, vec);
+ mul_m4_v3(mat, vec);
/* transpose ! */
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
- Normalize(n1);
+ normalize_v3(n1);
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
@@ -1612,7 +1612,7 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
vec[1]= fp1[2];
vec[2]= 0.0;
- QuatMulVecf(bevp->quat, vec);
+ mul_qt_v3(bevp->quat, vec);
data[0]= bevp->vec[0] + fac*vec[0];
data[1]= bevp->vec[1] + fac*vec[1];
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 9b648e2c05c..6d63553396d 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -52,7 +52,7 @@
#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_jitter.h"
#include "BLI_listbase.h"
@@ -221,8 +221,8 @@ static void precalculate_effector(EffectorCache *eff)
if(cu->path && cu->path->data) {
where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius);
- Mat4MulVecfl(eff->ob->obmat, eff->guide_loc);
- Mat4Mul3Vecfl(eff->ob->obmat, eff->guide_dir);
+ mul_m4_v3(eff->ob->obmat, eff->guide_loc);
+ mul_mat3_m4_v3(eff->ob->obmat, eff->guide_dir);
}
}
}
@@ -433,8 +433,8 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
return visibility;
VECCOPY(norm, efd->vec_to_point);
- VecNegf(norm);
- len = Normalize(norm);
+ negate_v3(norm);
+ len = normalize_v3(norm);
// check all collision objects
for(col = colls->first; col; col = col->next)
@@ -520,7 +520,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *poi
float falloff = weights ? weights->weight[0] * weights->weight[eff->pd->forcefield] : 1.0f;
float fac, r_fac;
- fac = Inpf(efd->nor, efd->vec_to_point2);
+ fac = dot_v3v3(efd->nor, efd->vec_to_point2);
if(eff->pd->zdir == PFIELD_Z_POS && fac < 0.0f)
falloff=0.0f;
@@ -537,7 +537,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *poi
break;
VECADDFAC(temp, efd->vec_to_point, efd->nor, -fac);
- r_fac= VecLength(temp);
+ r_fac= len_v3(temp);
falloff*= falloff_func_rad(eff->pd, r_fac);
break;
case PFIELD_FALL_CONE:
@@ -545,7 +545,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *poi
if(falloff == 0.0f)
break;
- r_fac=saacos(fac/VecLength(efd->vec_to_point))*180.0f/(float)M_PI;
+ r_fac=saacos(fac/len_v3(efd->vec_to_point))*180.0f/(float)M_PI;
falloff*= falloff_func_rad(eff->pd, r_fac);
break;
@@ -574,12 +574,12 @@ int closest_point_on_surface(SurfaceModifierData *surmd, float *co, float *surfa
MFace *mface = CDDM_get_face(surmd->dm, nearest.index);
VECCOPY(surface_vel, surmd->v[mface->v1].co);
- VecAddf(surface_vel, surface_vel, surmd->v[mface->v2].co);
- VecAddf(surface_vel, surface_vel, surmd->v[mface->v3].co);
+ add_v3_v3v3(surface_vel, surface_vel, surmd->v[mface->v2].co);
+ add_v3_v3v3(surface_vel, surface_vel, surmd->v[mface->v3].co);
if(mface->v4)
- VecAddf(surface_vel, surface_vel, surmd->v[mface->v4].co);
+ add_v3_v3v3(surface_vel, surface_vel, surmd->v[mface->v4].co);
- VecMulf(surface_vel, mface->v4 ? 0.25f : 0.333f);
+ mul_v3_fl(surface_vel, mface->v4 ? 0.25f : 0.333f);
}
return 1;
}
@@ -596,9 +596,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
float vec[3];
/* using velocity corrected location allows for easier sliding over effector surface */
- VecCopyf(vec, point->vel);
- VecMulf(vec, point->vel_to_frame);
- VecAddf(vec, vec, point->loc);
+ copy_v3_v3(vec, point->vel);
+ mul_v3_fl(vec, point->vel_to_frame);
+ add_v3_v3v3(vec, vec, point->loc);
ret = closest_point_on_surface(eff->surmd, vec, efd->loc, efd->nor, real_velocity ? efd->vel : NULL);
@@ -612,10 +612,10 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
dm->getVertCo(dm, *efd->index, efd->loc);
dm->getVertNo(dm, *efd->index, efd->nor);
- Mat4MulVecfl(eff->ob->obmat, efd->loc);
- Mat4Mul3Vecfl(eff->ob->obmat, efd->nor);
+ mul_m4_v3(eff->ob->obmat, efd->loc);
+ mul_mat3_m4_v3(eff->ob->obmat, efd->nor);
- Normalize(efd->nor);
+ normalize_v3(efd->nor);
efd->size = 0.0f;
@@ -660,15 +660,15 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* use z-axis as normal*/
VECCOPY(efd->nor, ob->obmat[2]);
- Normalize(efd->nor);
+ normalize_v3(efd->nor);
/* for vortex the shape chooses between old / new force */
if(eff->pd->shape == PFIELD_SHAPE_PLANE) {
/* efd->loc is closes point on effector xy-plane */
float temp[3];
- VecSubf(temp, point->loc, ob->obmat[3]);
- Projf(efd->loc, temp, efd->nor);
- VecSubf(efd->loc, point->loc, efd->loc);
+ sub_v3_v3v3(temp, point->loc, ob->obmat[3]);
+ project_v3_v3v3(efd->loc, temp, efd->nor);
+ sub_v3_v3v3(efd->loc, point->loc, efd->loc);
}
else {
VECCOPY(efd->loc, ob->obmat[3]);
@@ -679,7 +679,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
where_is_object_time(eff->scene, ob, cfra - 1.0);
- VecSubf(efd->vel, efd->vel, ob->obmat[3]);
+ sub_v3_v3v3(efd->vel, efd->vel, ob->obmat[3]);
}
*eff->ob = obcopy;
@@ -690,8 +690,8 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
}
if(ret) {
- VecSubf(efd->vec_to_point, point->loc, efd->loc);
- efd->distance = VecLength(efd->vec_to_point);
+ sub_v3_v3v3(efd->vec_to_point, point->loc, efd->loc);
+ efd->distance = len_v3(efd->vec_to_point);
if(eff->flag & PE_USE_NORMAL_DATA) {
VECCOPY(efd->vec_to_point2, efd->vec_to_point);
@@ -699,9 +699,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
}
else {
/* for some effectors we need the object center every time */
- VecSubf(efd->vec_to_point2, point->loc, eff->ob->obmat[3]);
+ sub_v3_v3v3(efd->vec_to_point2, point->loc, eff->ob->obmat[3]);
VECCOPY(efd->nor2, eff->ob->obmat[2]);
- Normalize(efd->nor2);
+ normalize_v3(efd->nor2);
}
}
@@ -764,12 +764,12 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
VECCOPY(tex_co,point->loc);
if(eff->pd->flag & PFIELD_TEX_2D) {
- float fac=-Inpf(tex_co, efd->nor);
+ float fac=-dot_v3v3(tex_co, efd->nor);
VECADDFAC(tex_co, tex_co, efd->nor, fac);
}
if(eff->pd->flag & PFIELD_TEX_OBJECT) {
- Mat4Mul3Vecfl(eff->ob->obmat, tex_co);
+ mul_mat3_m4_v3(eff->ob->obmat, tex_co);
}
hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 1, result);
@@ -815,11 +815,11 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
}
if(eff->pd->flag & PFIELD_TEX_2D){
- float fac = -Inpf(force, efd->nor);
+ float fac = -dot_v3v3(force, efd->nor);
VECADDFAC(force, force, efd->nor, fac);
}
- VecAddf(total_force, total_force, force);
+ add_v3_v3v3(total_force, total_force, force);
}
void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
{
@@ -844,51 +844,51 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *
switch(pd->forcefield){
case PFIELD_WIND:
VECCOPY(force, efd->nor);
- VecMulf(force, strength * efd->falloff);
+ mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_FORCE:
- Normalize(force);
- VecMulf(force, strength * efd->falloff);
+ normalize_v3(force);
+ mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_VORTEX:
/* old vortex force */
if(pd->shape == PFIELD_SHAPE_POINT) {
- Crossf(force, efd->nor, efd->vec_to_point);
- Normalize(force);
- VecMulf(force, strength * efd->distance * efd->falloff);
+ cross_v3_v3v3(force, efd->nor, efd->vec_to_point);
+ normalize_v3(force);
+ mul_v3_fl(force, strength * efd->distance * efd->falloff);
}
else {
/* new vortex force */
- Crossf(temp, efd->nor2, efd->vec_to_point2);
- VecMulf(temp, strength * efd->falloff);
+ cross_v3_v3v3(temp, efd->nor2, efd->vec_to_point2);
+ mul_v3_fl(temp, strength * efd->falloff);
- Crossf(force, efd->nor2, temp);
- VecMulf(force, strength * efd->falloff);
+ cross_v3_v3v3(force, efd->nor2, temp);
+ mul_v3_fl(force, strength * efd->falloff);
VECADDFAC(temp, temp, point->vel, -point->vel_to_sec);
- VecAddf(force, force, temp);
+ add_v3_v3v3(force, force, temp);
}
break;
case PFIELD_MAGNET:
if(eff->pd->shape == PFIELD_SHAPE_POINT)
/* magnetic field of a moving charge */
- Crossf(temp, efd->nor, efd->vec_to_point);
+ cross_v3_v3v3(temp, efd->nor, efd->vec_to_point);
else
- VecCopyf(temp, efd->nor);
+ copy_v3_v3(temp, efd->nor);
- Normalize(temp);
- VecMulf(temp, strength * efd->falloff);
- Crossf(force, point->vel, temp);
- VecMulf(force, point->vel_to_sec);
+ normalize_v3(temp);
+ mul_v3_fl(temp, strength * efd->falloff);
+ cross_v3_v3v3(force, point->vel, temp);
+ mul_v3_fl(force, point->vel_to_sec);
break;
case PFIELD_HARMONIC:
- VecMulf(force, -strength * efd->falloff);
- VecCopyf(temp, point->vel);
- VecMulf(temp, -damp * 2.0f * (float)sqrt(fabs(strength)) * point->vel_to_sec);
- VecAddf(force, force, temp);
+ mul_v3_fl(force, -strength * efd->falloff);
+ copy_v3_v3(temp, point->vel);
+ mul_v3_fl(temp, -damp * 2.0f * (float)sqrt(fabs(strength)) * point->vel_to_sec);
+ add_v3_v3v3(force, force, temp);
break;
case PFIELD_CHARGE:
- VecMulf(force, point->charge * strength * efd->falloff);
+ mul_v3_fl(force, point->charge * strength * efd->falloff);
break;
case PFIELD_LENNARDJ:
fac = pow((efd->size + point->size) / efd->distance, 6.0);
@@ -898,7 +898,7 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *
/* limit the repulsive term drastically to avoid huge forces */
fac = ((fac>2.0) ? 2.0 : fac);
- VecMulf(force, strength * fac);
+ mul_v3_fl(force, strength * fac);
break;
case PFIELD_BOID:
/* Boid field is handled completely in boids code. */
@@ -913,16 +913,16 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *
force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2,0,2);
force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2,0,2);
force[2] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[2], temp[0], temp[1], 2,0,2);
- VecMulf(force, strength * efd->falloff);
+ mul_v3_fl(force, strength * efd->falloff);
break;
case PFIELD_DRAG:
VECCOPY(force, point->vel);
- fac = Normalize(force) * point->vel_to_sec;
+ fac = normalize_v3(force) * point->vel_to_sec;
strength = MIN2(strength, 2.0f);
damp = MIN2(damp, 2.0f);
- VecMulf(force, -efd->falloff * fac * (strength * fac + damp));
+ mul_v3_fl(force, -efd->falloff * fac * (strength * fac + damp));
break;
}
@@ -937,12 +937,12 @@ void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *
if(pd->flag & PFIELD_DO_ROTATION && point->ave && point->rot) {
float xvec[3] = {1.0f, 0.0f, 0.0f};
float dave[3];
- QuatMulVecf(point->rot, xvec);
- Crossf(dave, xvec, force);
+ mul_qt_v3(point->rot, xvec);
+ cross_v3_v3v3(dave, xvec, force);
if(pd->f_flow != 0.0f) {
VECADDFAC(dave, dave, point->ave, -pd->f_flow * efd->falloff);
}
- VecAddf(point->ave, point->ave, dave);
+ add_v3_v3v3(point->ave, point->ave, dave);
}
}
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index 8827897a509..48a05c2f6a7 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -64,7 +64,7 @@
#include "BKE_utildefines.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BKE_blender.h"
@@ -180,7 +180,7 @@ static void mesh_add_normals_flags(Mesh *me)
v3= me->mvert+mface->v3;
v4= me->mvert+mface->v4;
- CalcNormFloat(v1->co, v2->co, v3->co, nor);
+ normal_tri_v3( nor,v1->co, v2->co, v3->co);
sno[0]= 32767.0*nor[0];
sno[1]= 32767.0*nor[1];
sno[2]= 32767.0*nor[2];
@@ -1249,7 +1249,7 @@ static void read_inventor(Scene *scene, char *str, struct ListBase *listb)
VECCOPY(bp->vec, data);
if(coordtype==4) {
bp->vec[3]= data[3];
- VecMulf(bp->vec, 1.0f/data[3]);
+ mul_v3_fl(bp->vec, 1.0f/data[3]);
}
else bp->vec[3]= 1.0;
data+= coordtype;
@@ -1837,7 +1837,7 @@ static void write_vert_stl(Object *ob, MVert *verts, int index, FILE *fpSTL)
float vert[3];
VECCOPY(vert, verts[(index)].co);
- Mat4MulVecfl(ob->obmat, vert);
+ mul_m4_v3(ob->obmat, vert);
if (ENDIAN_ORDER==B_ENDIAN) {
SWITCH_INT(vert[0]);
@@ -2174,7 +2174,7 @@ static void write_camera_vrml(FILE *fp, Object *ob)
Camera *cam;
if(ob==0) return;
- Mat4Invert(ob->imat, ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
fprintf(fp, "\tMatrixTransform {\n");
@@ -3031,10 +3031,10 @@ static void dxf_read_line(Scene *scene, int noob) {
mvert= &me->mvert[(me->totvert-2)];
- VecSubf(mvert->co, cent, vcenter);
+ sub_v3_v3v3(mvert->co, cent, vcenter);
mvert++;
if (vspace) { VECCOPY(mvert->co, epoint);
- } else VecSubf(mvert->co, epoint, vcenter);
+ } else sub_v3_v3v3(mvert->co, epoint, vcenter);
mface= &(((MFace*)me->mface)[me->totface-1]);
mface->v1= me->totvert-2;
@@ -3237,7 +3237,7 @@ static void dxf_read_ellipse(Scene *scene, int noob)
if (vspace) {
VECCOPY(mvert->co, epoint);
} else {
- VecSubf(mvert->co, epoint, vcenter);
+ sub_v3_v3v3(mvert->co, epoint, vcenter);
}
if (v > 0) {
@@ -3360,7 +3360,7 @@ static void dxf_read_arc(Scene *scene, int noob)
if (vspace) {
VECCOPY(mvert->co, epoint);
} else {
- VecSubf(mvert->co, epoint, vcenter);
+ sub_v3_v3v3(mvert->co, epoint, vcenter);
}
if (v > 0) {
@@ -3470,7 +3470,7 @@ static void dxf_read_polyline(Scene *scene, int noob) {
mvert= &me->mvert[me->totvert-1];
if (vspace) { VECCOPY(mvert->co, vert);
- } else VecSubf(mvert->co, vert, vcenter);
+ } else sub_v3_v3v3(mvert->co, vert, vcenter);
}
/* make edges */
@@ -3556,7 +3556,7 @@ static void dxf_read_polyline(Scene *scene, int noob) {
mvert= &me->mvert[(me->totvert-1)];
if (vspace) { VECCOPY(mvert->co, vert);
- } else VecSubf(mvert->co, vert, vcenter);
+ } else sub_v3_v3v3(mvert->co, vert, vcenter);
} else if (vflags & 128) {
if(vids[2]==0) {
@@ -3687,7 +3687,7 @@ static void dxf_read_lwpolyline(Scene *scene, int noob) {
if (vspace) {
VECCOPY(mvert->co, vert);
} else {
- VecSubf(mvert->co, vert, vcenter);
+ sub_v3_v3v3(mvert->co, vert, vcenter);
}
if (v > 0) {
@@ -3859,20 +3859,20 @@ static void dxf_read_3dface(Scene *scene, int noob)
ftmp=NULL;
mvert= &me->mvert[(me->totvert-nverts)];
- VecSubf(mvert->co, cent, vcenter);
+ sub_v3_v3v3(mvert->co, cent, vcenter);
mvert++;
if (vspace) { VECCOPY(mvert->co, vert2);
- } else VecSubf(mvert->co, vert2, vcenter);
+ } else sub_v3_v3v3(mvert->co, vert2, vcenter);
mvert++;
if (vspace) { VECCOPY(mvert->co, vert3);
- } else VecSubf(mvert->co, vert3, vcenter);
+ } else sub_v3_v3v3(mvert->co, vert3, vcenter);
if (nverts==4) {
mvert++;
if (vspace) { VECCOPY(mvert->co, vert4);
- } else VecSubf(mvert->co, vert4, vcenter);
+ } else sub_v3_v3v3(mvert->co, vert4, vcenter);
}
mface= &(((MFace*)me->mface)[me->totface-1]);
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 0ecd1fe912b..0623a5cbe5e 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -43,10 +43,12 @@
#include "DNA_anim_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_noise.h"
#include "BKE_fcurve.h"
+#include "BKE_animsys.h"
+
#include "BKE_curve.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
@@ -177,6 +179,49 @@ void copy_fcurves (ListBase *dst, ListBase *src)
/* --------------------- Finding -------------------------- */
+FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, char *prop_name, int index)
+{
+ /* anim vars */
+ AnimData *adt;
+ FCurve *fcu= NULL;
+
+ /* rna vars */
+ PointerRNA ptr;
+ PropertyRNA *prop;
+ char *path;
+
+ adt= BKE_animdata_from_id(id);
+
+ /* only use the current action ??? */
+ if(adt==NULL || adt->action==NULL)
+ return NULL;
+
+ RNA_pointer_create(id, type, data, &ptr);
+ prop = RNA_struct_find_property(&ptr, prop_name);
+
+ if(prop) {
+ path= RNA_path_from_ID_to_property(&ptr, prop);
+
+ if(path) {
+ /* animation takes priority over drivers */
+ if(adt->action && adt->action->curves.first)
+ fcu= list_find_fcurve(&adt->action->curves, path, index);
+
+ /* if not animated, check if driven */
+#if 0
+ if(!fcu && (adt->drivers.first)) {
+ fcu= list_find_fcurve(&adt->drivers, path, but->rnaindex);
+ }
+#endif
+
+ MEM_freeN(path);
+ }
+ }
+
+ return fcu;
+}
+
+
/* Find the F-Curve affecting the given RNA-access path + index, in the list of F-Curves provided */
FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array_index)
{
@@ -686,6 +731,9 @@ DriverTarget *driver_add_new_target (ChannelDriver *driver)
dtar= MEM_callocN(sizeof(DriverTarget), "DriverTarget");
BLI_addtail(&driver->targets, dtar);
+ /* make the default ID-type ID_OB, since most driver targets refer to objects */
+ dtar->idtype= ID_OB;
+
/* give the target a 'unique' name */
strcpy(dtar->name, "var");
BLI_uniquename(&driver->targets, dtar, "var", '_', offsetof(DriverTarget, name), 64);
@@ -774,7 +822,7 @@ float driver_get_target_value (ChannelDriver *driver, DriverTarget *dtar)
}
/* get property to read from, and get value as appropriate */
- if (RNA_path_resolve(&id_ptr, path, &ptr, &prop)) {
+ if (RNA_path_resolve_full(&id_ptr, path, &ptr, &prop, &index)) {
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
if (RNA_property_array_length(&ptr, prop))
@@ -801,8 +849,13 @@ float driver_get_target_value (ChannelDriver *driver, DriverTarget *dtar)
break;
}
}
- else if (G.f & G_DEBUG)
- printf("Driver Evaluation Error: cannot resolve target for %s -> %s \n", id->name, path);
+ else {
+ if (G.f & G_DEBUG)
+ printf("Driver Evaluation Error: cannot resolve target for %s -> %s \n", id->name, path);
+
+ driver->flag |= DRIVER_FLAG_INVALID;
+ return 0.0f;
+ }
return value;
}
@@ -831,7 +884,7 @@ static void driver_get_target_pchans2 (ChannelDriver *driver, bPoseChannel **pch
/* resolve path so that we have pointer to the right posechannel */
if (RNA_path_resolve(&id_ptr, dtar->rna_path, &ptr, &prop)) {
/* is pointer valid (i.e. pointing to an actual posechannel */
- if ((ptr.type == &RNA_PoseChannel) && (ptr.data)) {
+ if ((ptr.type == &RNA_PoseBone) && (ptr.data)) {
/* first or second target? */
if (i)
*pchan1= ptr.data;
@@ -924,11 +977,11 @@ static float evaluate_driver (ChannelDriver *driver, float evaltime)
}
/* use the final posed locations */
- Mat4ToQuat(pchan->pose_mat, q1);
- Mat4ToQuat(pchan2->pose_mat, q2);
+ mat4_to_quat(q1, pchan->pose_mat);
+ mat4_to_quat(q2, pchan2->pose_mat);
- QuatInv(q1);
- QuatMul(quat, q1, q2);
+ invert_qt(q1);
+ mul_qt_qtqt(quat, q1, q2);
angle = 2.0f * (saacos(quat[0]));
angle= ABS(angle);
@@ -1017,13 +1070,13 @@ static int findzero (float x, float q0, float q1, float q2, float q3, float *o)
if (d > 0.0) {
t= sqrt(d);
- o[0]= (float)(Sqrt3d(-q+t) + Sqrt3d(-q-t) - a);
+ o[0]= (float)(sqrt3d(-q+t) + sqrt3d(-q-t) - a);
if ((o[0] >= SMALL) && (o[0] <= 1.000001)) return 1;
else return 0;
}
else if (d == 0.0) {
- t= Sqrt3d(-q);
+ t= sqrt3d(-q);
o[0]= (float)(2*t - a);
if ((o[0] >= SMALL) && (o[0] <= 1.000001)) nr++;
diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c
index aa163b821c8..9453c2a0ad1 100644
--- a/source/blender/blenkernel/intern/fluidsim.c
+++ b/source/blender/blenkernel/intern/fluidsim.c
@@ -40,7 +40,7 @@
#include "DNA_particle_types.h"
#include "DNA_scene_types.h" // N_T
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BKE_cdderivedmesh.h"
@@ -563,13 +563,13 @@ void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4],
float vec[3];
VECCOPY(vec, mvert[0].co);
- Mat4MulVecfl(obmat, vec);
+ mul_m4_v3(obmat, vec);
bbsx = vec[0]; bbsy = vec[1]; bbsz = vec[2];
bbex = vec[0]; bbey = vec[1]; bbez = vec[2];
for(i = 1; i < totvert; i++) {
VECCOPY(vec, mvert[i].co);
- Mat4MulVecfl(obmat, vec);
+ mul_m4_v3(obmat, vec);
if(vec[0] < bbsx){ bbsx= vec[0]; }
if(vec[1] < bbsy){ bbsy= vec[1]; }
@@ -626,7 +626,7 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob,
verts = MEM_callocN( totvert*3*sizeof(float), "elbeemmesh_vertices");
for(i=0; iobmat, &verts[i*3]); }
+ if(useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); }
}
*vertices = verts;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 4e79f6238b5..877c6d6b62e 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -41,7 +41,7 @@
#include "DNA_anim_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_noise.h"
#include "BKE_fcurve.h"
@@ -53,6 +53,8 @@
#include "RNA_access.h"
#include "RNA_types.h"
+#include "AUD_C-API.h"
+
#ifndef DISABLE_PYTHON
#include "BPY_extern.h" /* for BPY_pydriver_eval() */
#endif
@@ -871,6 +873,96 @@ static FModifierTypeInfo FMI_LIMITS = {
fcm_limits_evaluate /* evaluate */
};
+/* Sound F-Curve Modifier --------------------------- */
+
+static void fcm_sound_new_data (void *mdata)
+{
+ FMod_Sound *data= (FMod_Sound *)mdata;
+
+ /* defaults */
+ data->strength= 1.0f;
+ data->delay = 0.0f;
+ data->modification = FCM_SOUND_MODIF_REPLACE;
+ data->sound = NULL;
+}
+
+static void fcm_sound_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime)
+{
+ FMod_Sound *data= (FMod_Sound *)fcm->data;
+ float amplitude;
+
+ AUD_Device *device;
+ AUD_Sound *limiter;
+ AUD_SoundInfo info;
+
+ // XXX fixme - need to get in terms of time instead of frames to be really useful
+// evaltime = FRA2TIME(evaltime);
+ evaltime -= data->delay;
+
+ /* sound-system cannot cope with negative times/frames */
+ if (evaltime < 0.0f)
+ return;
+ /* must have a sound with a cache so that this can be used */
+ if (ELEM(NULL, data->sound, data->sound->cache))
+ return;
+
+ /* examine this snippet of the wave, and extract the amplitude from it */
+ info = AUD_getInfo(data->sound->cache);
+ info.specs.channels = 1;
+ info.specs.format = AUD_FORMAT_FLOAT32;
+ device = AUD_openReadDevice(info.specs);
+ limiter = AUD_limitSound(data->sound->cache, evaltime, evaltime + 1);
+ AUD_playDevice(device, limiter);
+ AUD_unload(limiter);
+ AUD_readDevice(device, (sample_t*)&litude, 1);
+ AUD_closeReadDevice(device);
+
+ /* combine the amplitude with existing motion data */
+ switch (data->modification) {
+ case FCM_SOUND_MODIF_ADD:
+ *cvalue= *cvalue + amplitude * data->strength;
+ break;
+ case FCM_SOUND_MODIF_SUBTRACT:
+ *cvalue= *cvalue - amplitude * data->strength;
+ break;
+ case FCM_SOUND_MODIF_MULTIPLY:
+ *cvalue= *cvalue * amplitude * data->strength;
+ break;
+ case FCM_SOUND_MODIF_REPLACE:
+ default:
+ *cvalue= *cvalue + amplitude * data->strength;
+ break;
+ }
+}
+
+static float fcm_sound_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime)
+{
+ FMod_Sound *data= (FMod_Sound *)fcm->data;
+
+ /* check for the time delay */
+// evaltime = FRA2TIME(evaltime);
+ if(evaltime < data->delay)
+ return data->delay;
+
+ /* modifier doesn't change time */
+ return evaltime;
+}
+
+static FModifierTypeInfo FMI_SOUND = {
+ FMODIFIER_TYPE_SOUND, /* type */
+ sizeof(FMod_Sound), /* size */
+ FMI_TYPE_REPLACE_VALUES, /* action type */
+ 0, /* requirements */
+ "Sound", /* name */
+ "FMod_Sound", /* struct name */
+ NULL, /* free data */
+ NULL, /* copy data */
+ fcm_sound_new_data, /* new data */
+ NULL, /* verify */
+ fcm_sound_time, /* evaluate time */
+ fcm_sound_evaluate /* evaluate */
+};
+
/* F-Curve Modifier API --------------------------- */
/* All of the F-Curve Modifier api functions use FModifierTypeInfo structs to carry out
* and operations that involve F-Curve modifier specific code.
@@ -892,6 +984,7 @@ static void fmods_init_typeinfo ()
fmodifiersTypeInfo[6]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented
fmodifiersTypeInfo[7]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */
fmodifiersTypeInfo[8]= &FMI_LIMITS; /* Limits F-Curve Modifier */
+ fmodifiersTypeInfo[9]= &FMI_SOUND; /* Sound F-Curve Modifier */
}
/* This function should be used for getting the appropriate type-info when only
@@ -992,13 +1085,13 @@ void copy_fmodifiers (ListBase *dst, ListBase *src)
}
/* Remove and free the given F-Modifier from the given stack */
-void remove_fmodifier (ListBase *modifiers, FModifier *fcm)
+int remove_fmodifier (ListBase *modifiers, FModifier *fcm)
{
FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
/* sanity check */
if (fcm == NULL)
- return;
+ return 0;
/* free modifier's special data (stored inside fcm->data) */
if (fcm->data) {
@@ -1010,15 +1103,25 @@ void remove_fmodifier (ListBase *modifiers, FModifier *fcm)
}
/* remove modifier from stack */
- if (modifiers)
+ if (modifiers) {
BLI_freelinkN(modifiers, fcm);
+ return 1;
+ }
else {
// XXX this case can probably be removed some day, as it shouldn't happen...
printf("remove_fmodifier() - no modifier stack given \n");
MEM_freeN(fcm);
+ return 0;
}
}
+/* Remove and free the nth F-Modifier from the given stack */
+int remove_fmodifier_index (ListBase *modifiers, int index)
+{
+ FModifier *fcm= BLI_findlink(modifiers, index);
+ return remove_fmodifier(modifiers, fcm);
+}
+
/* Remove all of a given F-Curve's modifiers */
void free_fmodifiers (ListBase *modifiers)
{
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 4e05bf45d3d..e2dccf02b40 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -41,7 +41,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_vfontdata.h"
@@ -968,12 +968,12 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
float minx, maxx, miny, maxy;
float timeofs, sizefac;
- Mat4Invert(imat, ob->obmat);
- Mat3CpyMat4(imat3, imat);
+ invert_m4_m4(imat, ob->obmat);
+ copy_m3_m4(imat3, imat);
- Mat3CpyMat4(cmat, cu->textoncurve->obmat);
- Mat3MulMat3(cmat, cmat, imat3);
- sizefac= Normalize(cmat[0])/cu->fsize;
+ copy_m3_m4(cmat, cu->textoncurve->obmat);
+ mul_m3_m3m3(cmat, cmat, imat3);
+ sizefac= normalize_v3(cmat[0])/cu->fsize;
minx=miny= 1.0e20f;
maxx=maxy= -1.0e20f;
@@ -1042,7 +1042,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
where_on_path(cu->textoncurve, ctime, vec, tvec, NULL, NULL);
where_on_path(cu->textoncurve, ctime+dtime, tvec, rotvec, NULL, NULL);
- VecMulf(vec, sizefac);
+ mul_v3_fl(vec, sizefac);
ct->rot= (float)(M_PI-atan2(rotvec[1], rotvec[0]));
@@ -1196,7 +1196,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
vecyo[0] = ct->xof;
vecyo[1] = ct->yof;
vecyo[2] = 0;
- Mat4MulVecfl(ob->obmat, vecyo);
+ mul_m4_v3(ob->obmat, vecyo);
VECCOPY(ob->loc, vecyo);
outta = 1;
cu->sepchar = 0;
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 43c4137e73e..5023d87cef8 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -36,7 +36,7 @@
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "DNA_listBase.h"
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 6bb47bc0f0f..3ab02a576d0 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -51,6 +51,7 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
+#include "BKE_scene.h" /* object_in_scene */
#ifdef HAVE_CONFIG_H
#include
@@ -95,7 +96,7 @@ void unlink_group(Group *group)
/* ensure objects are not in this group */
for(; base; base= base->next) {
- if(rem_from_group(group, base->object) && find_group(base->object, NULL)==NULL) {
+ if(rem_from_group(group, base->object, sce, base) && find_group(base->object, NULL)==NULL) {
base->object->flag &= ~OB_FROMGROUP;
base->flag &= ~OB_FROMGROUP;
}
@@ -153,15 +154,15 @@ Group *copy_group(Group *group)
}
/* external */
-void add_to_group(Group *group, Object *ob)
+static int add_to_group_internal(Group *group, Object *ob)
{
GroupObject *go;
- if(group==NULL || ob==NULL) return;
+ if(group==NULL || ob==NULL) return 0;
/* check if the object has been added already */
for(go= group->gobject.first; go; go= go->next) {
- if(go->ob==ob) return;
+ if(go->ob==ob) return 0;
}
go= MEM_callocN(sizeof(GroupObject), "groupobject");
@@ -169,10 +170,31 @@ void add_to_group(Group *group, Object *ob)
go->ob= ob;
+ return 1;
+}
+
+int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
+{
+ if(add_to_group_internal(group, object)) {
+ if((object->flag & OB_FROMGROUP)==0) {
+
+ if(scene && base==NULL)
+ base= object_in_scene(object, scene);
+
+ object->flag |= OB_FROMGROUP;
+
+ if(base)
+ base->flag |= OB_FROMGROUP;
+ }
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
/* also used for ob==NULL */
-int rem_from_group(Group *group, Object *ob)
+static int rem_from_group_internal(Group *group, Object *ob)
{
GroupObject *go, *gon;
int removed = 0;
@@ -192,6 +214,26 @@ int rem_from_group(Group *group, Object *ob)
return removed;
}
+int rem_from_group(Group *group, Object *object, Scene *scene, Base *base)
+{
+ if(rem_from_group_internal(group, object)) {
+
+ if(find_group(object, NULL) == NULL) {
+ if(scene && base==NULL)
+ base= object_in_scene(object, scene);
+
+ object->flag &= ~OB_FROMGROUP;
+
+ if(base)
+ base->flag &= ~OB_FROMGROUP;
+ }
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
int object_in_group(Object *ob, Group *group)
{
GroupObject *go;
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 3cff82f522a..7e081982f24 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -442,7 +442,7 @@ void IDP_RemFromGroup(IDProperty *group, IDProperty *prop)
BLI_remlink(&group->data.group, prop);
}
-IDProperty *IDP_GetPropertyFromGroup(IDProperty *prop, char *name)
+IDProperty *IDP_GetPropertyFromGroup(IDProperty *prop, const char *name)
{
IDProperty *loop;
for (loop=prop->data.group.first; loop; loop=loop->next) {
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index efe53f6f8ef..0452b38a2e5 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -61,7 +61,7 @@
#include "DNA_sequence_types.h"
#include "DNA_userdef_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index de215ae4af9..f2b737fa3c2 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -297,6 +297,7 @@ DO_INLINE void sub_lfvector_lfvector(float (*to)[3], float (*fLongVectorA)[3], f
///////////////////////////
// 3x3 matrix
///////////////////////////
+#if 0
/* printf 3x3 matrix on console: for debug output */
static void print_fmatrix(float m3[3][3])
{
@@ -304,6 +305,7 @@ static void print_fmatrix(float m3[3][3])
printf("%f\t%f\t%f\n",m3[1][0],m3[1][1],m3[1][2]);
printf("%f\t%f\t%f\n\n",m3[2][0],m3[2][1],m3[2][2]);
}
+#endif
/* copy 3x3 matrix */
DO_INLINE void cp_fmatrix(float to[3][3], float from[3][3])
@@ -972,6 +974,7 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
}
}
+#if 0
/*
// version 1.3
static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, fmatrix3x3 *P, fmatrix3x3 *Pinv)
@@ -1143,6 +1146,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
return iterationsV[i], verts[i].xconst, verts[i].xold);
- // VecMulf(id->V[i], clmd->sim_parms->stepsPerFrame);
+ // mul_v3_fl(id->V[i], clmd->sim_parms->stepsPerFrame);
}
}
}
@@ -1725,7 +1729,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
VECCOPY(id->Xnew[i], verts[i].tx);
VECCOPY(id->Vnew[i], verts[i].tv);
- VecMulf(id->Vnew[i], clmd->sim_parms->stepsPerFrame);
+ mul_v3_fl(id->Vnew[i], clmd->sim_parms->stepsPerFrame);
}
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 5dc26143533..6fc3fc547df 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -70,7 +70,7 @@
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_dynstr.h"
#include "BKE_utildefines.h"
@@ -885,6 +885,17 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
case ID_SEQ: /* sequencer strip */
//SEQ_FAC1:
+ switch (adrcode) {
+ case SEQ_FAC1:
+ propname= "effect_fader";
+ break;
+ case SEQ_FAC_SPEED:
+ propname= "speed_fader";
+ break;
+ case SEQ_FAC_OPACITY:
+ propname= "blend_opacity";
+ break;
+ }
// poin= &(seq->facf0); // XXX this doesn't seem to be included anywhere in sequencer RNA...
break;
@@ -919,11 +930,11 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
/* append preceeding bits to path */
if ((actname && actname[0]) && (constname && constname[0])) {
/* Constraint in Pose-Channel */
- sprintf(buf, "pose.pose_channels[\"%s\"].constraints[\"%s\"]", actname, constname);
+ sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
}
else if (actname && actname[0]) {
/* Pose-Channel */
- sprintf(buf, "pose.pose_channels[\"%s\"]", actname);
+ sprintf(buf, "pose.bones[\"%s\"]", actname);
}
else if (constname && constname[0]) {
/* Constraint in Object */
@@ -1604,6 +1615,7 @@ void do_versions_ipos_to_animato(Main *main)
ListBase drivers = {NULL, NULL};
ID *id;
AnimData *adt;
+ Scene *scene;
if (main == NULL) {
printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
@@ -1781,6 +1793,51 @@ void do_versions_ipos_to_animato(Main *main)
}
}
+ /* sequence strips */
+ for(scene = main->scene.first; scene; scene = scene->id.next) {
+ if(scene->ed && scene->ed->seqbasep) {
+ Sequence * seq;
+
+ for(seq = scene->ed->seqbasep->first;
+ seq; seq = seq->next) {
+ short adrcode = SEQ_FAC1;
+
+ if (G.f & G_DEBUG)
+ printf("\tconverting sequence strip %s \n", seq->name+2);
+
+ if (!seq->ipo || !seq->ipo->curve.first) {
+ seq->flag |=
+ SEQ_USE_EFFECT_DEFAULT_FADE;
+ continue;
+ }
+
+ /* patch adrcode, so that we can map
+ to different DNA variables later
+ (semi-hack (tm) )
+ */
+ switch(seq->type) {
+ case SEQ_IMAGE:
+ case SEQ_META:
+ case SEQ_SCENE:
+ case SEQ_MOVIE:
+ case SEQ_COLOR:
+ adrcode = SEQ_FAC_OPACITY;
+ break;
+ case SEQ_SPEED:
+ adrcode = SEQ_FAC_SPEED;
+ break;
+ }
+ ((IpoCurve*) seq->ipo->curve.first)
+ ->adrcode = adrcode;
+ ipo_to_animdata((ID*) seq, seq->ipo,
+ NULL, NULL);
+ seq->ipo->id.us--;
+ seq->ipo = NULL;
+ }
+ }
+ }
+
+
/* textures */
for (id= main->tex.first; id; id= id->next) {
Tex *te= (Tex *)id;
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 61f51d61e0b..c7b79756263 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1192,11 +1192,11 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, int tot)
#endif // XXX old animation system
flag= setkeys(ctime, &key->block, k, t, 0);
-
+
if(flag==0)
- ; /* do_key(a, a+step, tot, (char *)out, key, k, t, 0); */
+ do_key(a, a+step, tot, (char *)out, key, actkb, k, t, 0);
else
- ; /* cp_key(a, a+step, tot, (char *)out, key, k[2],0); */
+ cp_key(a, a+step, tot, (char *)out, key, actkb, k[2], NULL, 0);
}
}
else {
@@ -1395,6 +1395,49 @@ Key *ob_get_key(Object *ob)
return NULL;
}
+KeyBlock *add_keyblock(Scene *scene, Key *key)
+{
+ KeyBlock *kb;
+ float curpos= -0.1;
+ int tot;
+
+ kb= key->block.last;
+ if(kb) curpos= kb->pos;
+
+ kb= MEM_callocN(sizeof(KeyBlock), "Keyblock");
+ BLI_addtail(&key->block, kb);
+ kb->type= KEY_CARDINAL;
+
+ tot= BLI_countlist(&key->block);
+ if(tot==1) strcpy(kb->name, "Basis");
+ else sprintf(kb->name, "Key %d", tot-1);
+
+ // XXX this is old anim system stuff? (i.e. the 'index' of the shapekey)
+ kb->adrcode= tot-1;
+
+ key->totkey++;
+ if(key->totkey==1) key->refkey= kb;
+
+ kb->slidermin= 0.0f;
+ kb->slidermax= 1.0f;
+
+ // XXX kb->pos is the confusing old horizontal-line RVK crap in old IPO Editor...
+ if(key->type == KEY_RELATIVE)
+ kb->pos= curpos+0.1;
+ else {
+#if 0 // XXX old animation system
+ curpos= bsystem_time(scene, 0, (float)CFRA, 0.0);
+ if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) {
+ curpos /= 100.0;
+ }
+ kb->pos= curpos;
+
+ sort_keys(key);
+#endif // XXX old animation system
+ }
+ return kb;
+}
+
/* only the active keyblock */
KeyBlock *ob_get_keyblock(Object *ob)
{
@@ -1408,6 +1451,16 @@ KeyBlock *ob_get_keyblock(Object *ob)
return NULL;
}
+KeyBlock *ob_get_reference_keyblock(Object *ob)
+{
+ Key *key= ob_get_key(ob);
+
+ if (key)
+ return key->refkey;
+
+ return NULL;
+}
+
/* get the appropriate KeyBlock given an index */
KeyBlock *key_get_keyblock(Key *key, int index)
{
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index c53101299c6..dc548edbb25 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -39,7 +39,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "DNA_armature_types.h"
#include "DNA_mesh_types.h"
@@ -155,10 +155,10 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
/* prevent using deformed locations */
freedisplist(<Ob->disp);
- Mat4CpyMat4(mat, ltOb->obmat);
- Mat4One(ltOb->obmat);
+ copy_m4_m4(mat, ltOb->obmat);
+ unit_m4(ltOb->obmat);
lattice_deform_verts(ltOb, NULL, NULL, vertexCos, uNew*vNew*wNew, NULL);
- Mat4CpyMat4(ltOb->obmat, mat);
+ copy_m4_m4(ltOb->obmat, mat);
lt->typeu = typeu;
lt->typev = typev;
@@ -310,18 +310,18 @@ void init_latt_deform(Object *oblatt, Object *ob)
/* for example with a particle system: ob==0 */
if(ob==NULL) {
/* in deformspace, calc matrix */
- Mat4Invert(lt->latmat, oblatt->obmat);
+ invert_m4_m4(lt->latmat, oblatt->obmat);
/* back: put in deform array */
- Mat4Invert(imat, lt->latmat);
+ invert_m4_m4(imat, lt->latmat);
}
else {
/* in deformspace, calc matrix */
- Mat4Invert(imat, oblatt->obmat);
- Mat4MulMat4(lt->latmat, ob->obmat, imat);
+ invert_m4_m4(imat, oblatt->obmat);
+ mul_m4_m4m4(lt->latmat, ob->obmat, imat);
/* back: put in deform array */
- Mat4Invert(imat, lt->latmat);
+ invert_m4_m4(imat, lt->latmat);
}
for(w=0,fw=lt->fw; wpntsw; w++,fw+=lt->dw) {
@@ -337,7 +337,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
fp[2] = bp->vec[2] - fw;
}
- Mat4Mul3Vecfl(imat, fp);
+ mul_mat3_m4_v3(imat, fp);
}
}
}
@@ -356,7 +356,7 @@ void calc_latt_deform(Object *ob, float *co, float weight)
/* co is in local coords, treat with latmat */
VECCOPY(vec, co);
- Mat4MulVecfl(lt->latmat, vec);
+ mul_m4_v3(lt->latmat, vec);
/* u v w coords */
@@ -456,15 +456,15 @@ typedef struct {
static void init_curve_deform(Object *par, Object *ob, CurveDeform *cd, int dloc)
{
- Mat4Invert(ob->imat, ob->obmat);
- Mat4MulMat4(cd->objectspace, par->obmat, ob->imat);
- Mat4Invert(cd->curvespace, cd->objectspace);
- Mat3CpyMat4(cd->objectspace3, cd->objectspace);
+ invert_m4_m4(ob->imat, ob->obmat);
+ mul_m4_m4m4(cd->objectspace, par->obmat, ob->imat);
+ invert_m4_m4(cd->curvespace, cd->objectspace);
+ copy_m3_m4(cd->objectspace3, cd->objectspace);
// offset vector for 'no smear'
if(dloc) {
- Mat4Invert(par->imat, par->obmat);
- VecMat4MulVecfl(cd->dloc, par->imat, ob->obmat[3]);
+ invert_m4_m4(par->imat, par->obmat);
+ mul_v3_m4v3(cd->dloc, par->imat, ob->obmat[3]);
}
else cd->dloc[0]=cd->dloc[1]=cd->dloc[2]= 0.0f;
@@ -497,15 +497,15 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir,
float dvec[3];
if(ctime < 0.0) {
- VecSubf(dvec, path->data[1].vec, path->data[0].vec);
- VecMulf(dvec, ctime*(float)path->len);
+ sub_v3_v3v3(dvec, path->data[1].vec, path->data[0].vec);
+ mul_v3_fl(dvec, ctime*(float)path->len);
VECADD(vec, vec, dvec);
if(quat) QUATCOPY(quat, path->data[0].quat);
if(radius) *radius= path->data[0].radius;
}
else if(ctime > 1.0) {
- VecSubf(dvec, path->data[path->len-1].vec, path->data[path->len-2].vec);
- VecMulf(dvec, (ctime-1.0)*(float)path->len);
+ sub_v3_v3v3(dvec, path->data[path->len-1].vec, path->data[path->len-2].vec);
+ mul_v3_fl(dvec, (ctime-1.0)*(float)path->len);
VECADD(vec, vec, dvec);
if(quat) QUATCOPY(quat, path->data[path->len-1].quat);
if(radius) *radius= path->data[path->len-1].radius;
@@ -570,28 +570,28 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
dir[cd->no_rot_axis-1]= 0.0f;
/* -1 for compatibility with old track defines */
- vectoquat(dir, axis-1, upflag, quat);
+ vec_to_quat( quat,dir, axis-1, upflag);
/* the tilt */
if(loc[3]!=0.0) {
- Normalize(dir);
+ normalize_v3(dir);
q[0]= (float)cos(0.5*loc[3]);
fac= (float)sin(0.5*loc[3]);
q[1]= -fac*dir[0];
q[2]= -fac*dir[1];
q[3]= -fac*dir[2];
- QuatMul(quat, q, quat);
+ mul_qt_qtqt(quat, q, quat);
}
#endif
- static float q_x90d[4] = {0.70710676908493, 0.70710676908493, 0.0, 0.0}; // float rot_axis[3]= {1,0,0}; AxisAngleToQuat(q, rot_axis, 90 * (M_PI / 180));
- static float q_y90d[4] = {0.70710676908493, 0.0, 0.70710676908493, 0.0}; // float rot_axis[3]= {0,1,0}; AxisAngleToQuat(q, rot_axis, 90 * (M_PI / 180));
- static float q_z90d[4] = {0.70710676908493, 0.0, 0.0, 0.70710676908493}; // float rot_axis[3]= {0,0,2}; AxisAngleToQuat(q, rot_axis, 90 * (M_PI / 180));
+ static float q_x90d[4] = {0.70710676908493, 0.70710676908493, 0.0, 0.0}; // float rot_axis[3]= {1,0,0}; axis_angle_to_quat(q, rot_axis, 90 * (M_PI / 180));
+ static float q_y90d[4] = {0.70710676908493, 0.0, 0.70710676908493, 0.0}; // float rot_axis[3]= {0,1,0}; axis_angle_to_quat(q, rot_axis, 90 * (M_PI / 180));
+ static float q_z90d[4] = {0.70710676908493, 0.0, 0.0, 0.70710676908493}; // float rot_axis[3]= {0,0,2}; axis_angle_to_quat(q, rot_axis, 90 * (M_PI / 180));
- static float q_nx90d[4] = {0.70710676908493, -0.70710676908493, 0.0, 0.0}; // float rot_axis[3]= {1,0,0}; AxisAngleToQuat(q, rot_axis, -90 * (M_PI / 180));
- static float q_ny90d[4] = {0.70710676908493, 0.0, -0.70710676908493, 0.0}; // float rot_axis[3]= {0,1,0}; AxisAngleToQuat(q, rot_axis, -90 * (M_PI / 180));
- static float q_nz90d[4] = {0.70710676908493, 0.0, 0.0, -0.70710676908493}; // float rot_axis[3]= {0,0,2}; AxisAngleToQuat(q, rot_axis, -90 * (M_PI / 180));
+ static float q_nx90d[4] = {0.70710676908493, -0.70710676908493, 0.0, 0.0}; // float rot_axis[3]= {1,0,0}; axis_angle_to_quat(q, rot_axis, -90 * (M_PI / 180));
+ static float q_ny90d[4] = {0.70710676908493, 0.0, -0.70710676908493, 0.0}; // float rot_axis[3]= {0,1,0}; axis_angle_to_quat(q, rot_axis, -90 * (M_PI / 180));
+ static float q_nz90d[4] = {0.70710676908493, 0.0, 0.0, -0.70710676908493}; // float rot_axis[3]= {0,0,2}; axis_angle_to_quat(q, rot_axis, -90 * (M_PI / 180));
if(cd->no_rot_axis) { /* set by caller */
@@ -602,12 +602,12 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
VECCOPY(dir_flat, dir);
dir_flat[cd->no_rot_axis-1]= 0.0f;
- Normalize(dir);
- Normalize(dir_flat);
+ normalize_v3(dir);
+ normalize_v3(dir_flat);
- RotationBetweenVectorsToQuat(q, dir, dir_flat); /* Could this be done faster? */
+ rotation_between_vecs_to_quat(q, dir, dir_flat); /* Could this be done faster? */
- QuatMul(new_quat, q, new_quat);
+ mul_qt_qtqt(new_quat, q, new_quat);
}
@@ -624,14 +624,14 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
switch(axis) {
case MOD_CURVE_POSX:
- QuatMul(quat, new_quat, q_y90d);
+ mul_qt_qtqt(quat, new_quat, q_y90d);
cent[0]= 0.0;
cent[1]= co[2];
cent[2]= co[1];
break;
case MOD_CURVE_NEGX:
- QuatMul(quat, new_quat, q_ny90d);
+ mul_qt_qtqt(quat, new_quat, q_ny90d);
cent[0]= 0.0;
cent[1]= -co[1];
@@ -639,28 +639,28 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
break;
case MOD_CURVE_POSY:
- QuatMul(quat, new_quat, q_x90d);
+ mul_qt_qtqt(quat, new_quat, q_x90d);
cent[0]= co[2];
cent[1]= 0.0;
cent[2]= -co[0];
break;
case MOD_CURVE_NEGY:
- QuatMul(quat, new_quat, q_nx90d);
+ mul_qt_qtqt(quat, new_quat, q_nx90d);
cent[0]= -co[0];
cent[1]= 0.0;
cent[2]= -co[2];
break;
case MOD_CURVE_POSZ:
- QuatMul(quat, new_quat, q_z90d);
+ mul_qt_qtqt(quat, new_quat, q_z90d);
cent[0]= co[1];
cent[1]= -co[0];
cent[2]= 0.0;
break;
case MOD_CURVE_NEGZ:
- QuatMul(quat, new_quat, q_nz90d);
+ mul_qt_qtqt(quat, new_quat, q_nz90d);
cent[0]= co[0];
cent[1]= -co[1];
@@ -670,11 +670,11 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
/* scale if enabled */
if(cu->flag & CU_PATH_RADIUS)
- VecMulf(cent, radius);
+ mul_v3_fl(cent, radius);
/* local rotation */
- NormalQuat(quat);
- QuatMulVecf(quat, cent);
+ normalize_qt(quat);
+ mul_qt_v3(quat, cent);
/* translation */
VECADD(co, cent, loc);
@@ -739,7 +739,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
for(j = 0; j < dvert->totweight; j++) {
if(dvert->dw[j].def_nr == index) {
- Mat4MulVecfl(cd.curvespace, vertexCos[a]);
+ mul_m4_v3(cd.curvespace, vertexCos[a]);
DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
break;
}
@@ -754,9 +754,9 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
if(dvert->dw[j].def_nr == index) {
VECCOPY(vec, vertexCos[a]);
calc_curve_deform(scene, cuOb, vec, defaxis, &cd, NULL);
- VecLerpf(vertexCos[a], vertexCos[a], vec,
+ interp_v3_v3v3(vertexCos[a], vertexCos[a], vec,
dvert->dw[j].weight);
- Mat4MulVecfl(cd.objectspace, vertexCos[a]);
+ mul_m4_v3(cd.objectspace, vertexCos[a]);
break;
}
}
@@ -766,13 +766,13 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
INIT_MINMAX(cd.dmin, cd.dmax);
for(a = 0; a < numVerts; a++) {
- Mat4MulVecfl(cd.curvespace, vertexCos[a]);
+ mul_m4_v3(cd.curvespace, vertexCos[a]);
DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
}
for(a = 0; a < numVerts; a++) {
calc_curve_deform(scene, cuOb, vertexCos[a], defaxis, &cd, NULL);
- Mat4MulVecfl(cd.objectspace, vertexCos[a]);
+ mul_m4_v3(cd.objectspace, vertexCos[a]);
}
}
cu->flag = flag;
@@ -787,7 +787,7 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco
float quat[4];
if(cuOb->type != OB_CURVE) {
- Mat3One(mat);
+ unit_m3(mat);
return;
}
@@ -797,18 +797,18 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco
VECCOPY(cd.dmin, orco);
VECCOPY(cd.dmax, orco);
- Mat4MulVecfl(cd.curvespace, vec);
+ mul_m4_v3(cd.curvespace, vec);
if(calc_curve_deform(scene, cuOb, vec, target->trackflag+1, &cd, quat)) {
float qmat[3][3];
- QuatToMat3(quat, qmat);
- Mat3MulMat3(mat, qmat, cd.objectspace3);
+ quat_to_mat3( qmat,quat);
+ mul_m3_m3m3(mat, qmat, cd.objectspace3);
}
else
- Mat3One(mat);
+ unit_m3(mat);
- Mat4MulVecfl(cd.objectspace, vec);
+ mul_m4_v3(cd.objectspace, vec);
}
@@ -939,7 +939,7 @@ void outside_lattice(Lattice *lt)
bp->vec[1]+= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1];
bp->vec[2]+= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2];
- VecMulf(bp->vec, 0.3333333f);
+ mul_v3_fl(bp->vec, 0.3333333f);
}
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index c2260e1e761..a3e0ab04991 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -46,7 +46,7 @@
#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_animsys.h"
#include "BKE_blender.h"
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 3ca7dac4bc9..d731ab4230b 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -47,7 +47,7 @@
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_utildefines.h"
@@ -436,7 +436,7 @@ Object *find_basis_mball(Scene *scene, Object *basis)
void calc_mballco(MetaElem *ml, float *vec)
{
if(ml->mat) {
- Mat4MulVecfl((float ( * )[4])ml->mat, vec);
+ mul_m4_v3((float ( * )[4])ml->mat, vec);
}
}
@@ -448,7 +448,7 @@ float densfunc(MetaElem *ball, float x, float y, float z)
vec[0]= x;
vec[1]= y;
vec[2]= z;
- Mat4MulVecfl((float ( * )[4])ball->imat, vec);
+ mul_m4_v3((float ( * )[4])ball->imat, vec);
dx= vec[0];
dy= vec[1];
dz= vec[2];
@@ -1508,8 +1508,8 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
int a, obnr, zero_size=0;
char obname[32];
- Mat4CpyMat4(obmat, ob->obmat); /* to cope with duplicators from next_object */
- Mat4Invert(obinv, ob->obmat);
+ copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from next_object */
+ invert_m4_m4(obinv, ob->obmat);
a= 0;
splitIDname(ob->id.name+2, obname, &obnr);
@@ -1581,15 +1581,15 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
if(ml->s > 10.0) ml->s = 10.0;
/* Rotation of MetaElem is stored in quat */
- QuatToMat4(ml->quat, temp3);
+ quat_to_mat4( temp3,ml->quat);
/* Translation of MetaElem */
- Mat4One(temp2);
+ unit_m4(temp2);
temp2[3][0]= ml->x;
temp2[3][1]= ml->y;
temp2[3][2]= ml->z;
- Mat4MulMat4(temp1, temp3, temp2);
+ mul_m4_m4m4(temp1, temp3, temp2);
/* make a copy because of duplicates */
mainb[a]= new_pgn_element(sizeof(MetaElem));
@@ -1600,12 +1600,12 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
imat= new_pgn_element(4*4*sizeof(float));
/* mat is the matrix to transform from mball into the basis-mball */
- Mat4Invert(obinv, obmat);
- Mat4MulMat4(temp2, bob->obmat, obinv);
+ invert_m4_m4(obinv, obmat);
+ mul_m4_m4m4(temp2, bob->obmat, obinv);
/* MetaBall transformation */
- Mat4MulMat4(mat, temp1, temp2);
+ mul_m4_m4m4(mat, temp1, temp2);
- Mat4Invert(imat,mat);
+ invert_m4_m4(imat,mat);
mainb[a]->rad2= ml->rad*ml->rad;
@@ -1648,7 +1648,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
/* transformation of Metalem bb */
for(i=0; i<8; i++)
- Mat4MulVecfl((float ( * )[4])mat, mainb[a]->bb->vec[i]);
+ mul_m4_v3((float ( * )[4])mat, mainb[a]->bb->vec[i]);
/* find max and min of transformed bb */
for(i=0; i<8; i++){
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 6ef557ca879..d5c597b802c 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -70,7 +70,7 @@
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_edgehash.h"
@@ -1086,7 +1086,7 @@ void mesh_to_curve(Scene *scene, Object *ob)
/* add points */
vl= polyline.first;
for (i=0, bp=nu->bp; i < totpoly; i++, bp++, vl=(VertLink *)vl->next) {
- VecCopyf(bp->vec, mverts[vl->index].co);
+ copy_v3_v3(bp->vec, mverts[vl->index].co);
bp->f1= SELECT;
bp->radius = bp->weight = 1.0;
}
@@ -1146,23 +1146,23 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces,
float *f_no= &fnors[i*3];
if (mf->v4)
- CalcNormFloat4(mverts[mf->v1].co, mverts[mf->v2].co, mverts[mf->v3].co, mverts[mf->v4].co, f_no);
+ normal_quad_v3( f_no,mverts[mf->v1].co, mverts[mf->v2].co, mverts[mf->v3].co, mverts[mf->v4].co);
else
- CalcNormFloat(mverts[mf->v1].co, mverts[mf->v2].co, mverts[mf->v3].co, f_no);
+ normal_tri_v3( f_no,mverts[mf->v1].co, mverts[mf->v2].co, mverts[mf->v3].co);
- VecAddf(tnorms[mf->v1], tnorms[mf->v1], f_no);
- VecAddf(tnorms[mf->v2], tnorms[mf->v2], f_no);
- VecAddf(tnorms[mf->v3], tnorms[mf->v3], f_no);
+ add_v3_v3v3(tnorms[mf->v1], tnorms[mf->v1], f_no);
+ add_v3_v3v3(tnorms[mf->v2], tnorms[mf->v2], f_no);
+ add_v3_v3v3(tnorms[mf->v3], tnorms[mf->v3], f_no);
if (mf->v4)
- VecAddf(tnorms[mf->v4], tnorms[mf->v4], f_no);
+ add_v3_v3v3(tnorms[mf->v4], tnorms[mf->v4], f_no);
}
for (i=0; ico);
- Normalize(no);
+ normalize_v3(no);
}
mv->no[0]= (short)(no[0]*32767.0);
@@ -1262,7 +1262,7 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned
next= iterv->next;
uv2= (tf+iterv->f)->uv[iterv->tfindex];
- Vec2Subf(uvdiff, uv2, uv);
+ sub_v2_v2v2(uvdiff, uv2, uv);
if(fabs(uv[0]-uv2[0]) < limit[0] && fabs(uv[1]-uv2[1]) < limit[1]) {
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 1f4f69bd376..56aab7d2ba9 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -41,7 +41,7 @@
#include "float.h"
#include "ctype.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdopbvh.h"
#include "BLI_kdtree.h"
@@ -1187,7 +1187,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
if(amd->end_cap && amd->end_cap != ob)
end_cap = amd->end_cap->derivedFinal;
- Mat4One(offset);
+ unit_m4(offset);
indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm),
"indexmap");
@@ -1197,7 +1197,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
maxVerts = dm->getNumVerts(dm);
if(amd->offset_type & MOD_ARR_OFF_CONST)
- VecAddf(offset[3], offset[3], amd->offset);
+ add_v3_v3v3(offset[3], offset[3], amd->offset);
if(amd->offset_type & MOD_ARR_OFF_RELATIVE) {
for(j = 0; j < 3; j++)
offset[3][j] += amd->scale[j] * vertarray_size(src_mvert,
@@ -1209,14 +1209,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
float result_mat[4][4];
if(ob)
- Mat4Invert(obinv, ob->obmat);
+ invert_m4_m4(obinv, ob->obmat);
else
- Mat4One(obinv);
+ unit_m4(obinv);
- Mat4MulSerie(result_mat, offset,
+ mul_serie_m4(result_mat, offset,
obinv, amd->offset_ob->obmat,
NULL, NULL, NULL, NULL, NULL);
- Mat4CpyMat4(offset, result_mat);
+ copy_m4_m4(offset, result_mat);
}
if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
@@ -1226,7 +1226,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
float scale;
object_to_mat3(amd->curve_ob, tmp_mat);
- scale = Mat3ToScalef(tmp_mat);
+ scale = mat3_to_scale(tmp_mat);
if(!cu->path) {
cu->flag |= CU_PATH; // needed for path & bevlist
@@ -1241,7 +1241,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
prescribed length */
if(amd->fit_type == MOD_ARR_FITLENGTH
|| amd->fit_type == MOD_ARR_FITCURVE) {
- float dist = sqrt(Inpf(offset[3], offset[3]));
+ float dist = sqrt(dot_v3v3(offset[3], offset[3]));
if(dist > 1e-6f)
/* this gives length = first copy start to last copy end
@@ -1274,11 +1274,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces);
/* calculate the offset matrix of the final copy (for merging) */
- Mat4One(final_offset);
+ unit_m4(final_offset);
for(j=0; j < count - 1; j++) {
- Mat4MulMat4(tmp_mat, final_offset, offset);
- Mat4CpyMat4(final_offset, tmp_mat);
+ mul_m4_m4m4(tmp_mat, final_offset, offset);
+ copy_m4_m4(final_offset, tmp_mat);
}
numVerts = numEdges = numFaces = 0;
@@ -1314,7 +1314,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
if((count > 1) && (amd->flags & MOD_ARR_MERGE)) {
float tmp_co[3];
VECCOPY(tmp_co, mv->co);
- Mat4MulVecfl(offset, tmp_co);
+ mul_m4_v3(offset, tmp_co);
for(j = 0; j < maxVerts; j++) {
/* if vertex already merged, don't use it */
@@ -1322,15 +1322,15 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
inMV = &src_mvert[j];
/* if this vert is within merge limit, merge */
- if(VecLenCompare(tmp_co, inMV->co, amd->merge_dist)) {
+ if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist)) {
indexMap[i].merge = j;
/* test for merging with final copy of merge target */
if(amd->flags & MOD_ARR_MERGEFINAL) {
VECCOPY(tmp_co, inMV->co);
inMV = &src_mvert[i];
- Mat4MulVecfl(final_offset, tmp_co);
- if(VecLenCompare(tmp_co, inMV->co, amd->merge_dist))
+ mul_m4_v3(final_offset, tmp_co);
+ if(compare_len_v3v3(tmp_co, inMV->co, amd->merge_dist))
indexMap[i].merge_final = 1;
}
break;
@@ -1347,7 +1347,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
*mv2 = *mv;
numVerts++;
- Mat4MulVecfl(offset, co);
+ mul_m4_v3(offset, co);
VECCOPY(mv2->co, co);
}
} else if(indexMap[i].merge != i && indexMap[i].merge_final) {
@@ -1504,7 +1504,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
cap_medge = start_cap->getEdgeArray(start_cap);
cap_mface = start_cap->getFaceArray(start_cap);
- Mat4Invert(startoffset, offset);
+ invert_m4_m4(startoffset, offset);
vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
"arrayModifier_doArray vert_map");
@@ -1520,12 +1520,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
int j;
VECCOPY(tmp_co, mv->co);
- Mat4MulVecfl(startoffset, tmp_co);
+ mul_m4_v3(startoffset, tmp_co);
for(j = 0; j < maxVerts; j++) {
in_mv = &src_mvert[j];
/* if this vert is within merge limit, merge */
- if(VecLenCompare(tmp_co, in_mv->co, amd->merge_dist)) {
+ if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
vert_map[i] = calc_mapping(indexMap, j, 0);
merged = 1;
break;
@@ -1536,7 +1536,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
if(!merged) {
DM_copy_vert_data(start_cap, result, i, numVerts, 1);
mvert[numVerts] = *mv;
- Mat4MulVecfl(startoffset, mvert[numVerts].co);
+ mul_m4_v3(startoffset, mvert[numVerts].co);
origindex[numVerts] = ORIGINDEX_NONE;
vert_map[i] = numVerts;
@@ -1605,7 +1605,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
cap_medge = end_cap->getEdgeArray(end_cap);
cap_mface = end_cap->getFaceArray(end_cap);
- Mat4MulMat4(endoffset, final_offset, offset);
+ mul_m4_m4m4(endoffset, final_offset, offset);
vert_map = MEM_callocN(sizeof(*vert_map) * capVerts,
"arrayModifier_doArray vert_map");
@@ -1621,12 +1621,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
int j;
VECCOPY(tmp_co, mv->co);
- Mat4MulVecfl(offset, tmp_co);
+ mul_m4_v3(offset, tmp_co);
for(j = 0; j < maxVerts; j++) {
in_mv = &src_mvert[j];
/* if this vert is within merge limit, merge */
- if(VecLenCompare(tmp_co, in_mv->co, amd->merge_dist)) {
+ if(compare_len_v3v3(tmp_co, in_mv->co, amd->merge_dist)) {
vert_map[i] = calc_mapping(indexMap, j, count - 1);
merged = 1;
break;
@@ -1637,7 +1637,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
if(!merged) {
DM_copy_vert_data(end_cap, result, i, numVerts, 1);
mvert[numVerts] = *mv;
- Mat4MulVecfl(endoffset, mvert[numVerts].co);
+ mul_m4_v3(endoffset, mvert[numVerts].co);
origindex[numVerts] = ORIGINDEX_NONE;
vert_map[i] = numVerts;
@@ -1921,9 +1921,9 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
if (mmd->mirror_ob) {
float obinv[4][4];
- Mat4Invert(obinv, mmd->mirror_ob->obmat);
- Mat4MulMat4(mtx, ob->obmat, obinv);
- Mat4Invert(imtx, mtx);
+ invert_m4_m4(obinv, mmd->mirror_ob->obmat);
+ mul_m4_m4m4(mtx, ob->obmat, obinv);
+ invert_m4_m4(imtx, mtx);
}
for(i = 0; i < maxVerts; i++) {
@@ -1934,10 +1934,10 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
dm->getVert(dm, i, &inMV);
- VecCopyf(co, inMV.co);
+ copy_v3_v3(co, inMV.co);
if (mmd->mirror_ob) {
- VecMat4MulVecfl(co, mtx, co);
+ mul_v3_m4v3(co, mtx, co);
}
isShared = ABS(co[axis])<=tolerance;
@@ -1955,9 +1955,9 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
if(isShared) {
co[axis] = 0;
if (mmd->mirror_ob) {
- VecMat4MulVecfl(co, imtx, co);
+ mul_v3_m4v3(co, imtx, co);
}
- VecCopyf(mv->co, co);
+ copy_v3_v3(mv->co, co);
mv->flag |= ME_VERT_MERGED;
} else {
@@ -1969,9 +1969,9 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
co[axis] = -co[axis];
if (mmd->mirror_ob) {
- VecMat4MulVecfl(co, imtx, co);
+ mul_v3_m4v3(co, imtx, co);
}
- VecCopyf(mv2->co, co);
+ copy_v3_v3(mv2->co, co);
if (mmd->flag & MOD_MIR_VGROUP){
dvert = DM_get_vert_data(result, numVerts, CD_MDEFORMVERT);
@@ -2477,12 +2477,12 @@ static SmoothMesh *smoothmesh_from_derivedmesh(DerivedMesh *dm)
if(face->edges[2]->verts[1]->oldIndex == mf.v3) face->flip[2] = 1;
face->edges[3] = BLI_edgehash_lookup(edges, mf.v4, mf.v1);
if(face->edges[3]->verts[1]->oldIndex == mf.v4) face->flip[3] = 1;
- CalcNormFloat4(v1.co, v2.co, v3.co, v4.co, face->normal);
+ normal_quad_v3( face->normal,v1.co, v2.co, v3.co, v4.co);
} else {
face->edges[2] = BLI_edgehash_lookup(edges, mf.v3, mf.v1);
if(face->edges[2]->verts[1]->oldIndex == mf.v3) face->flip[2] = 1;
face->edges[3] = NULL;
- CalcNormFloat(v1.co, v2.co, v3.co, face->normal);
+ normal_tri_v3( face->normal,v1.co, v2.co, v3.co);
}
for(j = 0; j < SMOOTHFACE_MAX_EDGES && face->edges[j]; j++) {
@@ -3179,7 +3179,7 @@ static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle,
/* we know the edge has 2 faces, so check the angle */
SmoothFace *face1 = edge->faces->link;
SmoothFace *face2 = edge->faces->next->link;
- float edge_angle_cos = Inpf(face1->normal,
+ float edge_angle_cos = dot_v3v3(face1->normal,
face2->normal);
if(edge_angle_cos < threshold) {
@@ -3575,7 +3575,7 @@ static void get_texture_coords(DisplaceModifierData *dmd, Object *ob,
if(texmapping == MOD_DISP_MAP_OBJECT) {
if(dmd->map_object)
- Mat4Invert(mapob_imat, dmd->map_object->obmat);
+ invert_m4_m4(mapob_imat, dmd->map_object->obmat);
else /* if there is no map object, default to local */
texmapping = MOD_DISP_MAP_LOCAL;
}
@@ -3641,12 +3641,12 @@ static void get_texture_coords(DisplaceModifierData *dmd, Object *ob,
break;
case MOD_DISP_MAP_GLOBAL:
VECCOPY(*texco, *co);
- Mat4MulVecfl(ob->obmat, *texco);
+ mul_m4_v3(ob->obmat, *texco);
break;
case MOD_DISP_MAP_OBJECT:
VECCOPY(*texco, *co);
- Mat4MulVecfl(ob->obmat, *texco);
- Mat4MulVecfl(mapob_imat, *texco);
+ mul_m4_v3(ob->obmat, *texco);
+ mul_m4_v3(mapob_imat, *texco);
break;
}
}
@@ -3917,7 +3917,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
/* convert coords to world space */
for(i = 0, co = coords; i < numVerts; ++i, ++co)
- Mat4MulVecfl(ob->obmat, *co);
+ mul_m4_v3(ob->obmat, *co);
/* calculate a projection matrix and normal for each projector */
for(i = 0; i < num_projectors; ++i) {
@@ -3925,7 +3925,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
float offsetmat[4][4];
Camera *cam = NULL;
/* calculate projection matrix */
- Mat4Invert(projectors[i].projmat, projectors[i].ob->obmat);
+ invert_m4_m4(projectors[i].projmat, projectors[i].ob->obmat);
if(projectors[i].ob->type == OB_CAMERA) {
cam = (Camera *)projectors[i].ob->data;
@@ -3947,9 +3947,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
xmin = -xmax;
ymin = -ymax;
- i_window(xmin, xmax, ymin, ymax,
- cam->clipsta, cam->clipend, perspmat);
- Mat4MulMat4(tmpmat, projectors[i].projmat, perspmat);
+ perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ mul_m4_m4m4(tmpmat, projectors[i].projmat, perspmat);
} else if(cam->type == CAM_ORTHO) {
float orthomat[4][4];
float xmax;
@@ -3967,16 +3966,15 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
xmin = -xmax;
ymin = -ymax;
- i_ortho(xmin, xmax, ymin, ymax,
- cam->clipsta, cam->clipend, orthomat);
- Mat4MulMat4(tmpmat, projectors[i].projmat, orthomat);
+ orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ mul_m4_m4m4(tmpmat, projectors[i].projmat, orthomat);
}
} else {
- Mat4CpyMat4(tmpmat, projectors[i].projmat);
+ copy_m4_m4(tmpmat, projectors[i].projmat);
}
- Mat4One(offsetmat);
- Mat4MulFloat3(offsetmat[0], 0.5);
+ unit_m4(offsetmat);
+ mul_mat3_m4_fl(offsetmat, 0.5);
offsetmat[3][0] = offsetmat[3][1] = offsetmat[3][2] = 0.5;
if (cam) {
@@ -3992,19 +3990,19 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
}
- Mat4MulMat4(projectors[i].projmat, tmpmat, offsetmat);
+ mul_m4_m4m4(projectors[i].projmat, tmpmat, offsetmat);
/* calculate worldspace projector normal (for best projector test) */
projectors[i].normal[0] = 0;
projectors[i].normal[1] = 0;
projectors[i].normal[2] = 1;
- Mat4Mul3Vecfl(projectors[i].ob->obmat, projectors[i].normal);
+ mul_mat3_m4_v3(projectors[i].ob->obmat, projectors[i].normal);
}
/* if only one projector, project coords to UVs */
if(num_projectors == 1)
for(i = 0, co = coords; i < numVerts; ++i, ++co)
- Mat4MulVec3Project(projectors[0].projmat, *co);
+ mul_project_m4_v4(projectors[0].projmat, *co);
mface = dm->getFaceArray(dm);
numFaces = dm->getNumFaces(dm);
@@ -4041,19 +4039,19 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
/* get the untransformed face normal */
if(mf->v4) {
VECCOPY(co4, coords[mf->v4]);
- CalcNormFloat4(co1, co2, co3, co4, face_no);
+ normal_quad_v3( face_no,co1, co2, co3, co4);
} else {
- CalcNormFloat(co1, co2, co3, face_no);
+ normal_tri_v3( face_no,co1, co2, co3);
}
/* find the projector which the face points at most directly
* (projector normal with largest dot product is best)
*/
- best_dot = Inpf(projectors[0].normal, face_no);
+ best_dot = dot_v3v3(projectors[0].normal, face_no);
best_projector = &projectors[0];
for(j = 1; j < num_projectors; ++j) {
- float tmp_dot = Inpf(projectors[j].normal,
+ float tmp_dot = dot_v3v3(projectors[j].normal,
face_no);
if(tmp_dot > best_dot) {
best_dot = tmp_dot;
@@ -4061,11 +4059,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
}
- Mat4MulVec3Project(best_projector->projmat, co1);
- Mat4MulVec3Project(best_projector->projmat, co2);
- Mat4MulVec3Project(best_projector->projmat, co3);
+ mul_project_m4_v4(best_projector->projmat, co1);
+ mul_project_m4_v4(best_projector->projmat, co2);
+ mul_project_m4_v4(best_projector->projmat, co3);
if(mf->v4)
- Mat4MulVec3Project(best_projector->projmat, co4);
+ mul_project_m4_v4(best_projector->projmat, co4);
/* apply transformed coords as UVs */
tface->uv[0][0] = co1[0];
@@ -4360,11 +4358,11 @@ static void smoothModifier_do(
if (uctmp[idx1] < 255) {
uctmp[idx1]++;
- VecAddf(v1, v1, fvec);
+ add_v3_v3v3(v1, v1, fvec);
}
if (uctmp[idx2] < 255) {
uctmp[idx2]++;
- VecAddf(v2, v2, fvec);
+ add_v3_v3v3(v2, v2, fvec);
}
}
@@ -4578,14 +4576,14 @@ static void castModifier_sphere_do(
* we use its location, transformed to ob's local space */
if (ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4Invert(ctrl_ob->imat, ctrl_ob->obmat);
- Mat4MulMat4(mat, ob->obmat, ctrl_ob->imat);
- Mat4Invert(imat, mat);
+ invert_m4_m4(ctrl_ob->imat, ctrl_ob->obmat);
+ mul_m4_m4m4(mat, ob->obmat, ctrl_ob->imat);
+ invert_m4_m4(imat, mat);
}
- Mat4Invert(ob->imat, ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
VECCOPY(center, ctrl_ob->obmat[3]);
- Mat4MulVecfl(ob->imat, center);
+ mul_m4_v3(ob->imat, center);
}
/* now we check which options the user wants */
@@ -4620,7 +4618,7 @@ static void castModifier_sphere_do(
if(len <= 0) {
for (i = 0; i < numVerts; i++) {
- len += VecLenf(center, vertexCos[i]);
+ len += len_v3v3(center, vertexCos[i]);
}
len /= numVerts;
@@ -4642,9 +4640,9 @@ static void castModifier_sphere_do(
VECCOPY(tmp_co, vertexCos[i]);
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(mat, tmp_co);
+ mul_m4_v3(mat, tmp_co);
} else {
- VecSubf(tmp_co, tmp_co, center);
+ sub_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4654,7 +4652,7 @@ static void castModifier_sphere_do(
vec[2] = 0.0f;
if (has_radius) {
- if (VecLength(vec) > cmd->radius) continue;
+ if (len_v3(vec) > cmd->radius) continue;
}
for (j = 0; j < dvert[i].totweight; ++j) {
@@ -4668,7 +4666,7 @@ static void castModifier_sphere_do(
fac = fac_orig * dw->weight;
facm = 1.0f - fac;
- Normalize(vec);
+ normalize_v3(vec);
if (flag & MOD_CAST_X)
tmp_co[0] = fac*vec[0]*len + facm*tmp_co[0];
@@ -4679,9 +4677,9 @@ static void castModifier_sphere_do(
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(imat, tmp_co);
+ mul_m4_v3(imat, tmp_co);
} else {
- VecAddf(tmp_co, tmp_co, center);
+ add_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4697,9 +4695,9 @@ static void castModifier_sphere_do(
VECCOPY(tmp_co, vertexCos[i]);
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(mat, tmp_co);
+ mul_m4_v3(mat, tmp_co);
} else {
- VecSubf(tmp_co, tmp_co, center);
+ sub_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4709,10 +4707,10 @@ static void castModifier_sphere_do(
vec[2] = 0.0f;
if (has_radius) {
- if (VecLength(vec) > cmd->radius) continue;
+ if (len_v3(vec) > cmd->radius) continue;
}
- Normalize(vec);
+ normalize_v3(vec);
if (flag & MOD_CAST_X)
tmp_co[0] = fac*vec[0]*len + facm*tmp_co[0];
@@ -4723,9 +4721,9 @@ static void castModifier_sphere_do(
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(imat, tmp_co);
+ mul_m4_v3(imat, tmp_co);
} else {
- VecAddf(tmp_co, tmp_co, center);
+ add_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4780,14 +4778,14 @@ static void castModifier_cuboid_do(
if (ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4Invert(ctrl_ob->imat, ctrl_ob->obmat);
- Mat4MulMat4(mat, ob->obmat, ctrl_ob->imat);
- Mat4Invert(imat, mat);
+ invert_m4_m4(ctrl_ob->imat, ctrl_ob->obmat);
+ mul_m4_m4m4(mat, ob->obmat, ctrl_ob->imat);
+ invert_m4_m4(imat, mat);
}
- Mat4Invert(ob->imat, ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
VECCOPY(center, ctrl_ob->obmat[3]);
- Mat4MulVecfl(ob->imat, center);
+ mul_m4_v3(ob->imat, center);
}
if((flag & MOD_CAST_SIZE_FROM_RADIUS) && has_radius) {
@@ -4816,7 +4814,7 @@ static void castModifier_cuboid_do(
DO_MINMAX(center, min, max);
for (i = 0; i < numVerts; i++) {
- VecSubf(vec, vertexCos[i], center);
+ sub_v3_v3v3(vec, vertexCos[i], center);
DO_MINMAX(vec, min, max);
}
}
@@ -4859,9 +4857,9 @@ static void castModifier_cuboid_do(
VECCOPY(tmp_co, vertexCos[i]);
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(mat, tmp_co);
+ mul_m4_v3(mat, tmp_co);
} else {
- VecSubf(tmp_co, tmp_co, center);
+ sub_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4897,7 +4895,7 @@ static void castModifier_cuboid_do(
if (tmp_co[2] > 0.0f) octant += 4;
/* apex is the bb's vertex at the chosen octant */
- VecCopyf(apex, bb[octant]);
+ copy_v3_v3(apex, bb[octant]);
/* find which bb plane is closest to this vertex ... */
d[0] = tmp_co[0] / apex[0];
@@ -4935,9 +4933,9 @@ static void castModifier_cuboid_do(
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(imat, tmp_co);
+ mul_m4_v3(imat, tmp_co);
} else {
- VecAddf(tmp_co, tmp_co, center);
+ add_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4955,9 +4953,9 @@ static void castModifier_cuboid_do(
VECCOPY(tmp_co, vertexCos[i]);
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(mat, tmp_co);
+ mul_m4_v3(mat, tmp_co);
} else {
- VecSubf(tmp_co, tmp_co, center);
+ sub_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -4972,7 +4970,7 @@ static void castModifier_cuboid_do(
if (tmp_co[1] > 0.0f) octant += 2;
if (tmp_co[2] > 0.0f) octant += 4;
- VecCopyf(apex, bb[octant]);
+ copy_v3_v3(apex, bb[octant]);
d[0] = tmp_co[0] / apex[0];
d[1] = tmp_co[1] / apex[1];
@@ -5003,9 +5001,9 @@ static void castModifier_cuboid_do(
if(ctrl_ob) {
if(flag & MOD_CAST_USE_OB_TRANSFORM) {
- Mat4MulVecfl(imat, tmp_co);
+ mul_m4_v3(imat, tmp_co);
} else {
- VecAddf(tmp_co, tmp_co, center);
+ add_v3_v3v3(tmp_co, tmp_co, center);
}
}
@@ -5170,7 +5168,7 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob,
if(texmapping == MOD_WAV_MAP_OBJECT) {
if(wmd->map_object)
- Mat4Invert(wmd->map_object->imat, wmd->map_object->obmat);
+ invert_m4_m4(wmd->map_object->imat, wmd->map_object->obmat);
else /* if there is no map object, default to local */
texmapping = MOD_WAV_MAP_LOCAL;
}
@@ -5236,12 +5234,12 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob,
break;
case MOD_WAV_MAP_GLOBAL:
VECCOPY(*texco, *co);
- Mat4MulVecfl(ob->obmat, *texco);
+ mul_m4_v3(ob->obmat, *texco);
break;
case MOD_WAV_MAP_OBJECT:
VECCOPY(*texco, *co);
- Mat4MulVecfl(ob->obmat, *texco);
- Mat4MulVecfl(wmd->map_object->imat, *texco);
+ mul_m4_v3(ob->obmat, *texco);
+ mul_m4_v3(wmd->map_object->imat, *texco);
break;
}
}
@@ -5267,8 +5265,8 @@ static void waveModifier_do(WaveModifierData *md,
if(wmd->objectcenter){
float mat[4][4];
/* get the control object's location in local coordinates */
- Mat4Invert(ob->imat, ob->obmat);
- Mat4MulMat4(mat, wmd->objectcenter->obmat, ob->imat);
+ invert_m4_m4(ob->imat, ob->obmat);
+ mul_m4_m4m4(mat, wmd->objectcenter->obmat, ob->imat);
wmd->startx = mat[3][0];
wmd->starty = mat[3][1];
@@ -5657,14 +5655,14 @@ static void hookModifier_deformVerts(
/* get world-space matrix of target, corrected for the space the verts are in */
if (hmd->subtarget[0] && pchan) {
/* bone target if there's a matching pose-channel */
- Mat4MulMat4(dmat, pchan->pose_mat, hmd->object->obmat);
+ mul_m4_m4m4(dmat, pchan->pose_mat, hmd->object->obmat);
}
else {
/* just object target */
- Mat4CpyMat4(dmat, hmd->object->obmat);
+ copy_m4_m4(dmat, hmd->object->obmat);
}
- Mat4Invert(ob->imat, ob->obmat);
- Mat4MulSerie(mat, ob->imat, dmat, hmd->parentinv,
+ invert_m4_m4(ob->imat, ob->obmat);
+ mul_serie_m4(mat, ob->imat, dmat, hmd->parentinv,
NULL, NULL, NULL, NULL, NULL);
/* vertex indices? */
@@ -5694,29 +5692,29 @@ static void hookModifier_deformVerts(
if(orig_index == index) {
co = vertexCos[j];
if(hmd->falloff != 0.0) {
- float len = VecLenf(co, hmd->cent);
+ float len = len_v3v3(co, hmd->cent);
if(len > hmd->falloff) fac = 0.0;
else if(len > 0.0)
fac *= sqrt(1.0 - len / hmd->falloff);
}
if(fac != 0.0) {
- VecMat4MulVecfl(vec, mat, co);
- VecLerpf(co, co, vec, fac);
+ mul_v3_m4v3(vec, mat, co);
+ interp_v3_v3v3(co, co, vec, fac);
}
}
}
} else {
if(hmd->falloff != 0.0) {
- float len = VecLenf(co, hmd->cent);
+ float len = len_v3v3(co, hmd->cent);
if(len > hmd->falloff) fac = 0.0;
else if(len > 0.0)
fac *= sqrt(1.0 - len / hmd->falloff);
}
if(fac != 0.0) {
- VecMat4MulVecfl(vec, mat, co);
- VecLerpf(co, co, vec, fac);
+ mul_v3_m4v3(vec, mat, co);
+ interp_v3_v3v3(co, co, vec, fac);
}
}
}
@@ -5755,14 +5753,14 @@ static void hookModifier_deformVerts(
float *co = vertexCos[i];
if(hmd->falloff != 0.0) {
- float len = VecLenf(co, hmd->cent);
+ float len = len_v3v3(co, hmd->cent);
if(len > hmd->falloff) fac = 0.0;
else if(len > 0.0)
fac *= sqrt(1.0 - len / hmd->falloff);
}
- VecMat4MulVecfl(vec, mat, co);
- VecLerpf(co, co, vec, fac);
+ mul_v3_m4v3(vec, mat, co);
+ interp_v3_v3v3(co, co, vec, fac);
}
}
}
@@ -6010,7 +6008,7 @@ static void collisionModifier_initData(ModifierData *md)
collmd->current_x = NULL;
collmd->current_xnew = NULL;
collmd->current_v = NULL;
- collmd->time = -1;
+ collmd->time = -1000;
collmd->numverts = 0;
collmd->bvhtree = NULL;
}
@@ -6041,7 +6039,7 @@ static void collisionModifier_freeData(ModifierData *md)
collmd->current_x = NULL;
collmd->current_xnew = NULL;
collmd->current_v = NULL;
- collmd->time = -1;
+ collmd->time = -1000;
collmd->numverts = 0;
collmd->bvhtree = NULL;
collmd->mfaces = NULL;
@@ -6091,14 +6089,14 @@ static void collisionModifier_deformVerts(
if(collmd->x && (numverts != collmd->numverts))
collisionModifier_freeData((ModifierData *)collmd);
- if(collmd->time == -1) // first time
+ if(collmd->time == -1000) // first time
{
collmd->x = dm->dupVertArray(dm); // frame start position
for ( i = 0; i < numverts; i++ )
{
// we save global positions
- Mat4MulVecfl ( ob->obmat, collmd->x[i].co );
+ mul_m4_v3( ob->obmat, collmd->x[i].co );
}
collmd->xnew = MEM_dupallocN(collmd->x); // frame end position
@@ -6128,7 +6126,7 @@ static void collisionModifier_deformVerts(
for ( i = 0; i < numverts; i++ )
{
// we save global positions
- Mat4MulVecfl ( ob->obmat, collmd->xnew[i].co );
+ mul_m4_v3( ob->obmat, collmd->xnew[i].co );
}
memcpy(collmd->current_xnew, collmd->x, numverts*sizeof(MVert));
@@ -6274,14 +6272,14 @@ static void surfaceModifier_deformVerts(
/* convert to global coordinates and calculate velocity */
for(i = 0, x = surmd->x, v = surmd->v; idm, i)->co;
- Mat4MulVecfl(ob->obmat, vec);
+ mul_m4_v3(ob->obmat, vec);
if(init)
v->co[0] = v->co[1] = v->co[2] = 0.0f;
else
- VecSubf(v->co, vec, x->co);
+ sub_v3_v3v3(v->co, vec, x->co);
- VecCopyf(x->co, vec);
+ copy_v3_v3(x->co, vec);
}
surmd->cfra = md->scene->r.cfra;
@@ -6715,7 +6713,7 @@ static DerivedMesh * particleInstanceModifier_applyModifier(
psys_get_particle_on_path(&sim, first_particle + i/totvert, &state,1);
- Normalize(state.vel);
+ normalize_v3(state.vel);
/* TODO: incremental rotations somehow */
if(state.vel[axis] < -0.9999 || state.vel[axis] > 0.9999) {
@@ -6726,10 +6724,10 @@ static DerivedMesh * particleInstanceModifier_applyModifier(
float temp[3] = {0.0f,0.0f,0.0f};
temp[axis] = 1.0f;
- Crossf(cross, temp, state.vel);
+ cross_v3_v3v3(cross, temp, state.vel);
/* state.vel[axis] is the only component surviving from a dot product with the axis */
- VecRotToQuat(cross,saacos(state.vel[axis]),state.rot);
+ axis_angle_to_quat(state.rot,cross,saacos(state.vel[axis]));
}
}
@@ -6738,9 +6736,9 @@ static DerivedMesh * particleInstanceModifier_applyModifier(
psys_get_particle_state(&sim, first_particle + i/totvert, &state,1);
}
- QuatMulVecf(state.rot,mv->co);
+ mul_qt_v3(state.rot,mv->co);
if(pimd->flag & eParticleInstanceFlag_UseSize)
- VecMulf(mv->co, size[i/totvert]);
+ mul_v3_fl(mv->co, size[i/totvert]);
VECADD(mv->co,mv->co,state.co);
}
@@ -6903,14 +6901,14 @@ static void explodeModifier_createFacepa(ExplodeModifierData *emd,
/* set face-particle-indexes to nearest particle to face center */
for(i=0,fa=mface; iv1].co,mvert[fa->v2].co);
- VecAddf(center,center,mvert[fa->v3].co);
+ add_v3_v3v3(center,mvert[fa->v1].co,mvert[fa->v2].co);
+ add_v3_v3v3(center,center,mvert[fa->v3].co);
if(fa->v4){
- VecAddf(center,center,mvert[fa->v4].co);
- VecMulf(center,0.25);
+ add_v3_v3v3(center,center,mvert[fa->v4].co);
+ mul_v3_fl(center,0.25);
}
else
- VecMulf(center,0.3333f);
+ mul_v3_fl(center,0.3333f);
p= BLI_kdtree_find_nearest(tree,center,NULL,NULL);
@@ -7082,7 +7080,7 @@ static DerivedMesh * explodeModifier_splitEdges(ExplodeModifierData *emd, Derive
mv=CDDM_get_vert(splitdm,i);
VECADD(dupve->co,dupve->co,mv->co);
- VecMulf(dupve->co,0.5);
+ mul_v3_fl(dupve->co,0.5);
}
BLI_edgehashIterator_free(ehi);
@@ -7298,7 +7296,7 @@ static DerivedMesh * explodeModifier_splitEdges(ExplodeModifierData *emd, Derive
VECADD(dupve->co,dupve->co,mv->co);
mv=CDDM_get_vert(splitdm,mf->v4);
VECADD(dupve->co,dupve->co,mv->co);
- VecMulf(dupve->co,0.25);
+ mul_v3_fl(dupve->co,0.25);
df1=CDDM_get_face(splitdm,curdupface);
@@ -7474,7 +7472,7 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd,
/*dupvert= CDDM_get_verts(explode);*/
/* getting back to object space */
- Mat4Invert(imat,ob->obmat);
+ invert_m4_m4(imat,ob->obmat);
psmd->psys->lattice = psys_get_lattice(&sim);
@@ -7501,23 +7499,23 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd,
/* get particle state */
psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc0,nor,0,0,0,0);
- Mat4MulVecfl(ob->obmat,loc0);
+ mul_m4_v3(ob->obmat,loc0);
state.time=cfra;
psys_get_particle_state(&sim, i, &state, 1);
vertco=CDDM_get_vert(explode,v)->co;
- Mat4MulVecfl(ob->obmat,vertco);
+ mul_m4_v3(ob->obmat,vertco);
VECSUB(vertco,vertco,loc0);
/* apply rotation, size & location */
- QuatMulVecf(state.rot,vertco);
- VecMulf(vertco,pa->size);
+ mul_qt_v3(state.rot,vertco);
+ mul_v3_fl(vertco,pa->size);
VECADD(vertco,vertco,state.co);
- Mat4MulVecfl(imat,vertco);
+ mul_m4_v3(imat,vertco);
}
}
BLI_edgehashIterator_free(ehi);
@@ -7883,11 +7881,11 @@ static void meshdeformModifier_do(
return;
/* compute matrices to go in and out of cage object space */
- Mat4Invert(imat, mmd->object->obmat);
- Mat4MulMat4(cagemat, ob->obmat, imat);
- Mat4MulMat4(cmat, cagemat, mmd->bindmat);
- Mat4Invert(iobmat, cmat);
- Mat3CpyMat4(icagemat, iobmat);
+ invert_m4_m4(imat, mmd->object->obmat);
+ mul_m4_m4m4(cagemat, ob->obmat, imat);
+ mul_m4_m4m4(cmat, cagemat, mmd->bindmat);
+ invert_m4_m4(iobmat, cmat);
+ copy_m3_m4(icagemat, iobmat);
/* bind weights if needed */
if(!mmd->bindcos) {
@@ -7896,7 +7894,7 @@ static void meshdeformModifier_do(
/* progress bar redraw can make this recursive .. */
if(!recursive) {
recursive = 1;
- mmd->bindfunc(md->scene, mmd, (float*)vertexCos, numVerts, cagemat);
+ mmd->bindfunc(md->scene, dm, mmd, (float*)vertexCos, numVerts, cagemat);
recursive = 0;
}
}
@@ -7921,7 +7919,7 @@ static void meshdeformModifier_do(
VECCOPY(co, cagemvert[a].co);
if(G.rt != 527) {
- Mat4MulVecfl(mmd->bindmat, co);
+ mul_m4_v3(mmd->bindmat, co);
/* compute difference with world space bind coord */
VECSUB(dco[a], co, bindcos[a]);
}
@@ -7975,7 +7973,7 @@ static void meshdeformModifier_do(
if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {
/* transform coordinate into cage's local space */
VECCOPY(co, vertexCos[b]);
- Mat4MulVecfl(cagemat, co);
+ mul_m4_v3(cagemat, co);
totweight= meshdeform_dynamic_bind(mmd, dco, co);
}
else {
@@ -7992,8 +7990,8 @@ static void meshdeformModifier_do(
}
if(totweight > 0.0f) {
- VecMulf(co, fac/totweight);
- Mat3MulVecfl(icagemat, co);
+ mul_v3_fl(co, fac/totweight);
+ mul_m3_v3(icagemat, co);
if(G.rt != 527)
VECADD(vertexCos[b], vertexCos[b], co)
else
@@ -8084,7 +8082,7 @@ static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob,
int i;
MVert *dst = CDDM_get_verts(final);
for(i = 0; i < mmd->undo_verts_tot; ++i) {
- VecCopyf(dst[i].co, mmd->undo_verts[i].co);
+ copy_v3_v3(dst[i].co, mmd->undo_verts[i].co);
}
CDDM_calc_normals(final);
@@ -8365,10 +8363,10 @@ static void shapekeyModifier_deformMatricesEM(
int a;
if(kb && kb->totelem==numVerts && kb!=key->refkey) {
- Mat3Scale(scale, kb->curval);
+ scale_m3_fl(scale, kb->curval);
for(a=0; atype);
+ return ( mti->type == eModifierTypeType_OnlyDeform || mti->type == eModifierTypeType_Nonconstructive);
+}
+
void modifier_setError(ModifierData *md, char *format, ...)
{
char buffer[2048];
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index e1a51a05ca4..47b2914b0f5 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -37,7 +37,7 @@
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BKE_cdderivedmesh.h"
@@ -164,7 +164,7 @@ int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src
int i;
for(i = 0; i < src_me->totvert; ++i)
- VecCopyf(mvert[i].co, src_me->mvert[i].co);
+ copy_v3_v3(mvert[i].co, src_me->mvert[i].co);
mrdm->needsFree = 1;
MultiresDM_mark_as_modified(mrdm);
mrdm->release(mrdm);
@@ -178,9 +178,9 @@ int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src
static void Mat3FromColVecs(float mat[][3], float v1[3], float v2[3], float v3[3])
{
- VecCopyf(mat[0], v1);
- VecCopyf(mat[1], v2);
- VecCopyf(mat[2], v3);
+ copy_v3_v3(mat[0], v1);
+ copy_v3_v3(mat[1], v2);
+ copy_v3_v3(mat[2], v3);
}
static DerivedMesh *multires_subdisp_pre(DerivedMesh *mrdm, int distance, int simple)
@@ -233,7 +233,7 @@ static void multires_subdisp(DerivedMesh *orig, Object *ob, DerivedMesh *final,
if(!addverts) {
for(i = 0; i < totvert; ++i) {
float z[3] = {0,0,0};
- VecCopyf(mvd[i].co, z);
+ copy_v3_v3(mvd[i].co, z);
}
}
@@ -424,7 +424,7 @@ void multiresModifier_del_levels(struct MultiresModifierData *mmd, struct Object
for(j = 0, y = 0; y < st; y += skip) {
for(x = 0; x < st; x += skip) {
- VecCopyf(disps[j], mdisps[i].disps[y * st + x]);
+ copy_v3_v3(disps[j], mdisps[i].disps[y * st + x]);
++j;
}
}
@@ -998,27 +998,27 @@ static void calc_disp_mat(MultiresDisplacer *d, float mat[3][3])
if(u < 0) {
u = multires_index_at_loc(d->face_index, d->x - 1, d->y, d, &d->edges_primary);
- VecSubf(t1, base->co, d->subco[u].co);
+ sub_v3_v3v3(t1, base->co, d->subco[u].co);
}
else
- VecSubf(t1, d->subco[u].co, base->co);
+ sub_v3_v3v3(t1, d->subco[u].co, base->co);
if(v < 0) {
v = multires_index_at_loc(d->face_index, d->x, d->y - 1, d, &d->edges_primary);
- VecSubf(t2, base->co, d->subco[v].co);
+ sub_v3_v3v3(t2, base->co, d->subco[v].co);
}
else
- VecSubf(t2, d->subco[v].co, base->co);
+ sub_v3_v3v3(t2, d->subco[v].co, base->co);
//printf("uu=%d, vv=%d\n", u, v);
- Normalize(t1);
- Normalize(t2);
+ normalize_v3(t1);
+ normalize_v3(t2);
Mat3FromColVecs(mat, t1, t2, norm);
if(d->invert) {
- Mat3Inv(inv, mat);
- Mat3CpyMat3(mat, inv);
+ invert_m3_m3(inv, mat);
+ copy_m3_m3(mat, inv);
}
}
@@ -1033,23 +1033,23 @@ static void multires_displace(MultiresDisplacer *d, float co[3])
data = d->grid->disps[(d->y * d->spacing) * d->disp_st + (d->x * d->spacing)];
if(d->invert)
- VecSubf(disp, co, subco->co);
+ sub_v3_v3v3(disp, co, subco->co);
else
- VecCopyf(disp, data);
+ copy_v3_v3(disp, data);
/* Apply ts matrix to displacement */
calc_disp_mat(d, mat);
- Mat3MulVecfl(mat, disp);
+ mul_m3_v3(mat, disp);
if(d->invert) {
- VecCopyf(data, disp);
+ copy_v3_v3(data, disp);
}
else {
if(d->type == 4 || d->type == 5)
- VecMulf(disp, d->weight);
- VecAddf(co, co, disp);
+ mul_v3_fl(disp, d->weight);
+ add_v3_v3v3(co, co, disp);
}
if(d->type == 2) {
@@ -1200,7 +1200,7 @@ static void multiresModifier_update(DerivedMesh *dm)
/* Subtract the original vertex cos from the new vertex cos */
verts_new = CDDM_get_verts(dm);
for(i = 0; i < dm->getNumVerts(dm); ++i)
- VecSubf(verts_new[i].co, verts_new[i].co, cur_lvl_orig_verts[i].co);
+ sub_v3_v3v3(verts_new[i].co, verts_new[i].co, cur_lvl_orig_verts[i].co);
final = multires_subdisp_pre(dm, totlvl - lvl, 0);
@@ -1579,7 +1579,7 @@ void multires_load_old(DerivedMesh *dm, Multires *mr)
/* Transfer verts */
for(i = 0; i < totvert; ++i)
- VecCopyf(vdst[i].co, vsrc[vvmap[i]].co);
+ copy_v3_v3(vdst[i].co, vsrc[vvmap[i]].co);
MEM_freeN(vvmap);
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index f6d6bb14b7e..a27c3b6494b 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -32,6 +32,7 @@
#endif
#include
+#include
#include
#include "DNA_ID.h"
@@ -53,7 +54,7 @@
#include "BKE_text.h"
#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
@@ -903,7 +904,11 @@ void nodeAddSockets(bNode *node, bNodeType *ntype)
}
}
}
-
+/* Find the first available, non-duplicate name for a given node */
+void nodeUniqueName(bNodeTree *ntree, bNode *node)
+{
+ BLI_uniquename(&ntree->nodes, node, "Node", '.', offsetof(bNode, name), 32);
+}
bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id)
{
@@ -937,6 +942,9 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id)
}
else
BLI_strncpy(node->name, ntype->name, NODE_MAXSTR);
+
+ nodeUniqueName(ntree, node);
+
node->type= ntype->type;
node->flag= NODE_SELECT|ntype->flag;
node->width= ntype->width;
@@ -989,6 +997,8 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal)
bNodeSocket *sock, *oldsock;
*nnode= *node;
+ nodeUniqueName(ntree, nnode);
+
BLI_addtail(&ntree->nodes, nnode);
BLI_duplicatelist(&nnode->inputs, &node->inputs);
@@ -1062,6 +1072,11 @@ bNodeTree *ntreeAddTree(int type)
return ntree;
}
+/* Warning: this function gets called during some rather unexpected times
+ * - internal_select is only 1 when used for duplicating selected nodes (i.e. Shift-D duplicate operator)
+ * - this gets called when executing compositing updates (for threaded previews)
+ * - when the nodetree datablock needs to be copied (i.e. when users get copied)
+ */
bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
{
bNodeTree *newtree;
@@ -1093,10 +1108,9 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
if(internal_select==0 || (node->flag & NODE_SELECT)) {
nnode= nodeCopyNode(newtree, node, internal_select); /* sets node->new */
if(internal_select) {
- node->flag &= ~NODE_SELECT;
+ node->flag &= ~(NODE_SELECT|NODE_ACTIVE);
nnode->flag |= NODE_SELECT;
}
- node->flag &= ~NODE_ACTIVE;
/* deselect original sockets */
for(sock= node->inputs.first; sock; sock= sock->next) {
@@ -1661,7 +1675,9 @@ void ntreeSocketUseFlags(bNodeTree *ntree)
/* tag all thats in use */
for(link= ntree->links.first; link; link= link->next) {
- link->fromsock->flag |= SOCK_IN_USE;
+
+ if(link->fromsock) // FIXME, see below
+ link->fromsock->flag |= SOCK_IN_USE;
if(link->tosock) // FIXME This can be NULL, when dragging a new link in the UI, should probably copy the node tree for preview render - campbell
link->tosock->flag |= SOCK_IN_USE;
}
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ba8d41f54bb..73a1d2023a2 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -70,7 +70,7 @@
#include "DNA_world_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BKE_utildefines.h"
@@ -622,7 +622,7 @@ void unlink_object(Scene *scene, Object *ob)
/* groups */
group= G.main->group.first;
while(group) {
- rem_from_group(group, ob);
+ rem_from_group(group, ob, NULL, NULL);
group= group->id.next;
}
@@ -740,13 +740,13 @@ float dof_camera(Object *ob)
return 0.0f;
if (cam->dof_ob) {
/* too simple, better to return the distance on the view axis only
- * return VecLenf(ob->obmat[3], cam->dof_ob->obmat[3]); */
+ * return len_v3v3(ob->obmat[3], cam->dof_ob->obmat[3]); */
float mat[4][4], obmat[4][4];
- Mat4CpyMat4(obmat, ob->obmat);
- Mat4Ortho(obmat);
- Mat4Invert(ob->imat, obmat);
- Mat4MulMat4(mat, cam->dof_ob->obmat, ob->imat);
+ copy_m4_m4(obmat, ob->obmat);
+ normalize_m4(obmat);
+ invert_m4_m4(ob->imat, obmat);
+ mul_m4_m4m4(mat, cam->dof_ob->obmat, ob->imat);
return (float)fabs(mat[3][2]);
}
return cam->YF_dofdist;
@@ -965,8 +965,8 @@ Object *add_only_object(int type, char *name)
/* ob->transflag= OB_QUAT; */
#if 0 /* not used yet */
- QuatOne(ob->quat);
- QuatOne(ob->dquat);
+ unit_qt(ob->quat);
+ unit_qt(ob->dquat);
#endif
ob->col[0]= ob->col[1]= ob->col[2]= 1.0;
@@ -976,9 +976,9 @@ Object *add_only_object(int type, char *name)
ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0;
ob->size[0]= ob->size[1]= ob->size[2]= 1.0;
- Mat4One(ob->constinv);
- Mat4One(ob->parentinv);
- Mat4One(ob->obmat);
+ unit_m4(ob->constinv);
+ unit_m4(ob->parentinv);
+ unit_m4(ob->obmat);
ob->dt= OB_SHADED;
ob->empty_drawtype= OB_ARROWS;
ob->empty_drawsize= 1.0;
@@ -1044,6 +1044,10 @@ Object *add_object(struct Scene *scene, int type)
ob->rotmode= ROT_MODE_EUL;
/* axis-angle must not have a 0,0,0 axis, so set y-axis as default... */
ob->rotAxis[1]= ob->drotAxis[1]= 1.0f;
+ /* quaternions should be 1,0,0,0 by default.... */
+ ob->quat[0]= 1.0f;
+ /* rotation locks should be 4D for 4 component rotations by default... */
+ ob->protectflag = OB_LOCK_ROT4D;
base= scene_add_base(scene, ob);
scene_select_base(scene, base);
@@ -1464,7 +1468,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
}
ob->parent= target->parent; /* libdata */
- Mat4CpyMat4(ob->parentinv, target->parentinv);
+ copy_m4_m4(ob->parentinv, target->parentinv);
/* copy animdata stuff - drivers only for now... */
if ((target->adt) && (target->adt->drivers.first)) {
@@ -1588,7 +1592,7 @@ void object_scale_to_mat3(Object *ob, float mat[][3])
vec[0]= ob->size[0]+ob->dsize[0];
vec[1]= ob->size[1]+ob->dsize[1];
vec[2]= ob->size[2]+ob->dsize[2];
- SizeToMat3(vec, mat);
+ size_to_mat3( mat,vec);
}
// TODO: this should take rotation orders into account later...
@@ -1599,29 +1603,29 @@ void object_rot_to_mat3(Object *ob, float mat[][3])
/* initialise the delta-rotation matrix, which will get (pre)multiplied
* with the rotation matrix to yield the appropriate rotation
*/
- Mat3One(dmat);
+ unit_m3(dmat);
/* rotations may either be quats, eulers (with various rotation orders), or axis-angle */
if (ob->rotmode > 0) {
/* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */
- EulOToMat3(ob->rot, ob->rotmode, rmat);
- EulOToMat3(ob->drot, ob->rotmode, dmat);
+ eulO_to_mat3( rmat,ob->rot, ob->rotmode);
+ eulO_to_mat3( dmat,ob->drot, ob->rotmode);
}
else if (ob->rotmode == ROT_MODE_AXISANGLE) {
/* axis-angle - not really that great for 3D-changing orientations */
- AxisAngleToMat3(ob->rotAxis, ob->rotAngle, rmat);
- AxisAngleToMat3(ob->drotAxis, ob->drotAngle, dmat);
+ axis_angle_to_mat3( rmat,ob->rotAxis, ob->rotAngle);
+ axis_angle_to_mat3( dmat,ob->drotAxis, ob->drotAngle);
}
else {
/* quats are normalised before use to eliminate scaling issues */
- NormalQuat(ob->quat);
- QuatToMat3(ob->quat, rmat);
- QuatToMat3(ob->dquat, dmat);
+ normalize_qt(ob->quat);
+ quat_to_mat3( rmat,ob->quat);
+ quat_to_mat3( dmat,ob->dquat);
}
/* combine these rotations */
// XXX is this correct? if errors, change the order of multiplication...
- Mat3MulMat3(mat, dmat, rmat);
+ mul_m3_m3m3(mat, dmat, rmat);
}
void object_to_mat3(Object *ob, float mat[][3]) /* no parent */
@@ -1635,7 +1639,7 @@ void object_to_mat3(Object *ob, float mat[][3]) /* no parent */
/* rot */
object_rot_to_mat3(ob, rmat);
- Mat3MulMat3(mat, rmat, smat);
+ mul_m3_m3m3(mat, rmat, smat);
}
void object_to_mat4(Object *ob, float mat[][4])
@@ -1644,7 +1648,7 @@ void object_to_mat4(Object *ob, float mat[][4])
object_to_mat3(ob, tmat);
- Mat4CpyMat3(mat, tmat);
+ copy_m4_m3(mat, tmat);
mat[3][0]= ob->loc[0] + ob->dloc[0];
mat[3][1]= ob->loc[1] + ob->dloc[1];
@@ -1659,7 +1663,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
float q[4], vec[4], dir[3], quat[4], radius, x1, ctime;
float timeoffs = 0.0, sf_orig = 0.0;
- Mat4One(mat);
+ unit_m4(mat);
cu= par->data;
if(cu->path==NULL || cu->path->data==NULL) /* only happens on reload file, but violates depsgraph still... fix! */
@@ -1707,25 +1711,25 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
if( where_on_path(par, ctime, vec, dir, NULL, &radius) ) {
if(cu->flag & CU_FOLLOW) {
- vectoquat(dir, ob->trackflag, ob->upflag, quat);
+ vec_to_quat( quat,dir, ob->trackflag, ob->upflag);
/* the tilt */
- Normalize(dir);
+ normalize_v3(dir);
q[0]= (float)cos(0.5*vec[3]);
x1= (float)sin(0.5*vec[3]);
q[1]= -x1*dir[0];
q[2]= -x1*dir[1];
q[3]= -x1*dir[2];
- QuatMul(quat, q, quat);
+ mul_qt_qtqt(quat, q, quat);
- QuatToMat4(quat, mat);
+ quat_to_mat4( mat,quat);
}
if(cu->flag & CU_PATH_RADIUS) {
float tmat[4][4], rmat[4][4];
- Mat4Scale(tmat, radius);
- Mat4MulMat4(rmat, mat, tmat);
- Mat4CpyMat4(mat, rmat);
+ scale_m4_fl(tmat, radius);
+ mul_m4_m4m4(rmat, mat, tmat);
+ copy_m4_m4(mat, rmat);
}
VECCOPY(mat[3], vec);
@@ -1739,7 +1743,7 @@ static void ob_parbone(Object *ob, Object *par, float mat[][4])
float vec[3];
if (par->type!=OB_ARMATURE) {
- Mat4One(mat);
+ unit_m4(mat);
return;
}
@@ -1747,17 +1751,17 @@ static void ob_parbone(Object *ob, Object *par, float mat[][4])
pchan= get_pose_channel(par->pose, ob->parsubstr);
if (!pchan){
printf ("Object %s with Bone parent: bone %s doesn't exist\n", ob->id.name+2, ob->parsubstr);
- Mat4One(mat);
+ unit_m4(mat);
return;
}
/* get bone transform */
- Mat4CpyMat4(mat, pchan->pose_mat);
+ copy_m4_m4(mat, pchan->pose_mat);
/* but for backwards compatibility, the child has to move to the tail */
VECCOPY(vec, mat[1]);
- VecMulf(vec, pchan->bone->length);
- VecAddf(mat[3], mat[3], vec);
+ mul_v3_fl(vec, pchan->bone->length);
+ add_v3_v3v3(mat[3], mat[3], vec);
}
static void give_parvert(Object *par, int nr, float *vec)
@@ -1794,7 +1798,7 @@ static void give_parvert(Object *par, int nr, float *vec)
for(i = 0; i < numVerts; ++i, ++index) {
if(*index == nr) {
dm->getVertCo(dm, i, co);
- VecAddf(vec, vec, co);
+ add_v3_v3v3(vec, vec, co);
count++;
}
}
@@ -1802,7 +1806,7 @@ static void give_parvert(Object *par, int nr, float *vec)
if (count==0) {
/* keep as 0,0,0 */
} else if(count > 0) {
- VecMulf(vec, 1.0f / count);
+ mul_v3_fl(vec, 1.0f / count);
} else {
/* use first index if its out of range */
dm->getVertCo(dm, 0, vec);
@@ -1886,7 +1890,7 @@ static void ob_parvert3(Object *ob, Object *par, float mat[][4])
float cmat[3][3], v1[3], v2[3], v3[3], q[4];
/* in local ob space */
- Mat4One(mat);
+ unit_m4(mat);
if (ELEM4(par->type, OB_MESH, OB_SURF, OB_CURVE, OB_LATTICE)) {
@@ -1894,17 +1898,17 @@ static void ob_parvert3(Object *ob, Object *par, float mat[][4])
give_parvert(par, ob->par2, v2);
give_parvert(par, ob->par3, v3);
- triatoquat(v1, v2, v3, q);
- QuatToMat3(q, cmat);
- Mat4CpyMat3(mat, cmat);
+ tri_to_quat( q,v1, v2, v3);
+ quat_to_mat3( cmat,q);
+ copy_m4_m3(mat, cmat);
if(ob->type==OB_CURVE) {
VECCOPY(mat[3], v1);
}
else {
- VecAddf(mat[3], v1, v2);
- VecAddf(mat[3], mat[3], v3);
- VecMulf(mat[3], 0.3333333f);
+ add_v3_v3v3(mat[3], v1, v2);
+ add_v3_v3v3(mat[3], mat[3], v3);
+ mul_v3_fl(mat[3], 0.3333333f);
}
}
}
@@ -1992,8 +1996,8 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
}
/* set negative scale flag in object */
- Crossf(vec, ob->obmat[0], ob->obmat[1]);
- if( Inpf(vec, ob->obmat[2]) < 0.0 ) ob->transflag |= OB_NEG_SCALE;
+ cross_v3_v3v3(vec, ob->obmat[0], ob->obmat[1]);
+ if( dot_v3v3(vec, ob->obmat[2]) < 0.0 ) ob->transflag |= OB_NEG_SCALE;
else ob->transflag &= ~OB_NEG_SCALE;
}
@@ -2007,7 +2011,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
object_to_mat4(ob, locmat);
- if(ob->partype & PARSLOW) Mat4CpyMat4(slowmat, obmat);
+ if(ob->partype & PARSLOW) copy_m4_m4(slowmat, obmat);
switch(ob->partype & PARTYPE) {
case PAROBJECT:
@@ -2019,43 +2023,43 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
}
}
- if(ok) Mat4MulSerie(totmat, par->obmat, tmat,
+ if(ok) mul_serie_m4(totmat, par->obmat, tmat,
NULL, NULL, NULL, NULL, NULL, NULL);
- else Mat4CpyMat4(totmat, par->obmat);
+ else copy_m4_m4(totmat, par->obmat);
break;
case PARBONE:
ob_parbone(ob, par, tmat);
- Mat4MulSerie(totmat, par->obmat, tmat,
+ mul_serie_m4(totmat, par->obmat, tmat,
NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PARVERT1:
- Mat4One(totmat);
+ unit_m4(totmat);
if (simul){
VECCOPY(totmat[3], par->obmat[3]);
}
else{
give_parvert(par, ob->par1, vec);
- VecMat4MulVecfl(totmat[3], par->obmat, vec);
+ mul_v3_m4v3(totmat[3], par->obmat, vec);
}
break;
case PARVERT3:
ob_parvert3(ob, par, tmat);
- Mat4MulSerie(totmat, par->obmat, tmat,
+ mul_serie_m4(totmat, par->obmat, tmat,
NULL, NULL, NULL, NULL, NULL, NULL);
break;
case PARSKEL:
- Mat4CpyMat4(totmat, par->obmat);
+ copy_m4_m4(totmat, par->obmat);
break;
}
// total
- Mat4MulSerie(tmat, totmat, ob->parentinv,
+ mul_serie_m4(tmat, totmat, ob->parentinv,
NULL, NULL, NULL, NULL, NULL, NULL);
- Mat4MulSerie(obmat, tmat, locmat,
+ mul_serie_m4(obmat, tmat, locmat,
NULL, NULL, NULL, NULL, NULL, NULL);
if (simul) {
@@ -2063,7 +2067,7 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[
}
else{
// external usable originmat
- Mat3CpyMat4(originmat, tmat);
+ copy_m3_m4(originmat, tmat);
// origin, voor help line
if( (ob->partype & 15)==PARSKEL ) {
@@ -2082,9 +2086,9 @@ void solve_tracking (Object *ob, float targetmat[][4])
float totmat[3][3];
float tmat[4][4];
- VecSubf(vec, ob->obmat[3], targetmat[3]);
- vectoquat(vec, ob->trackflag, ob->upflag, quat);
- QuatToMat3(quat, totmat);
+ sub_v3_v3v3(vec, ob->obmat[3], targetmat[3]);
+ vec_to_quat( quat,vec, ob->trackflag, ob->upflag);
+ quat_to_mat3( totmat,quat);
if(ob->parent && (ob->transflag & OB_POWERTRACK)) {
/* 'temporal' : clear parent info */
@@ -2097,9 +2101,9 @@ void solve_tracking (Object *ob, float targetmat[][4])
tmat[3][2]= ob->obmat[3][2];
tmat[3][3]= ob->obmat[3][3];
}
- else Mat4CpyMat4(tmat, ob->obmat);
+ else copy_m4_m4(tmat, ob->obmat);
- Mat4MulMat34(ob->obmat, totmat, tmat);
+ mul_m4_m3m4(ob->obmat, totmat, tmat);
}
@@ -2171,9 +2175,9 @@ void what_does_parent(Scene *scene, Object *ob, Object *workob)
{
clear_workob(workob);
- Mat4One(workob->obmat);
- Mat4One(workob->parentinv);
- Mat4One(workob->constinv);
+ unit_m4(workob->obmat);
+ unit_m4(workob->parentinv);
+ unit_m4(workob->constinv);
workob->parent= ob->parent;
workob->track= ob->track;
@@ -2261,7 +2265,7 @@ void minmax_object(Object *ob, float *min, float *max)
bb= *(cu->bb);
for(a=0; a<8; a++) {
- Mat4MulVecfl(ob->obmat, bb.vec[a]);
+ mul_m4_v3(ob->obmat, bb.vec[a]);
DO_MINMAX(bb.vec[a], min, max);
}
break;
@@ -2270,10 +2274,10 @@ void minmax_object(Object *ob, float *min, float *max)
bPoseChannel *pchan;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
VECCOPY(vec, pchan->pose_head);
- Mat4MulVecfl(ob->obmat, vec);
+ mul_m4_v3(ob->obmat, vec);
DO_MINMAX(vec, min, max);
VECCOPY(vec, pchan->pose_tail);
- Mat4MulVecfl(ob->obmat, vec);
+ mul_m4_v3(ob->obmat, vec);
DO_MINMAX(vec, min, max);
}
break;
@@ -2286,7 +2290,7 @@ void minmax_object(Object *ob, float *min, float *max)
bb = *mesh_get_bb(ob);
for(a=0; a<8; a++) {
- Mat4MulVecfl(ob->obmat, bb.vec[a]);
+ mul_m4_v3(ob->obmat, bb.vec[a]);
DO_MINMAX(bb.vec[a], min, max);
}
}
@@ -2298,11 +2302,11 @@ void minmax_object(Object *ob, float *min, float *max)
DO_MINMAX(ob->obmat[3], min, max);
VECCOPY(vec, ob->obmat[3]);
- VecAddf(vec, vec, ob->size);
+ add_v3_v3v3(vec, vec, ob->size);
DO_MINMAX(vec, min, max);
VECCOPY(vec, ob->obmat[3]);
- VecSubf(vec, vec, ob->size);
+ sub_v3_v3v3(vec, vec, ob->size);
DO_MINMAX(vec, min, max);
break;
}
@@ -2353,17 +2357,20 @@ void object_handle_update(Scene *scene, Object *ob)
// printf("ob proxy copy, lib ob %s proxy %s\n", ob->id.name, ob->proxy_from->id.name);
if(ob->proxy_from->proxy_group) {/* transform proxy into group space */
Object *obg= ob->proxy_from->proxy_group;
- Mat4Invert(obg->imat, obg->obmat);
- Mat4MulMat4(ob->obmat, ob->proxy_from->obmat, obg->imat);
+ invert_m4_m4(obg->imat, obg->obmat);
+ mul_m4_m4m4(ob->obmat, ob->proxy_from->obmat, obg->imat);
}
else
- Mat4CpyMat4(ob->obmat, ob->proxy_from->obmat);
+ copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
}
else
where_is_object(scene, ob);
}
if(ob->recalc & OB_RECALC_DATA) {
+ ID *data_id= (ID *)ob->data;
+ AnimData *adt= BKE_animdata_from_id(data_id);
+ float ctime= (float)scene->r.cfra; // XXX this is bad...
if (G.f & G_DEBUG)
printf("recalcdata %s\n", ob->id.name+2);
@@ -2386,10 +2393,6 @@ void object_handle_update(Scene *scene, Object *ob)
makeDispListCurveTypes(scene, ob, 0);
}
else if(ELEM(ob->type, OB_CAMERA, OB_LAMP)) {
- ID *data_id= (ID *)ob->data;
- AnimData *adt= BKE_animdata_from_id(data_id);
- float ctime= (float)scene->r.cfra; // XXX this is bad...
-
/* evaluate drivers */
BKE_animsys_evaluate_animdata(data_id, adt, ctime, ADT_RECALC_DRIVERS);
}
@@ -2402,6 +2405,9 @@ void object_handle_update(Scene *scene, Object *ob)
if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
armature_rebuild_pose(ob, ob->data);
+ /* evaluate drivers */
+ BKE_animsys_evaluate_animdata(data_id, adt, ctime, ADT_RECALC_DRIVERS);
+
if(ob->id.lib && ob->proxy_from) {
copy_pose_result(ob->pose, ob->proxy_from->pose);
// printf("pose proxy copy, lib ob %s proxy %s\n", ob->id.name, ob->proxy_from->id.name);
@@ -2538,7 +2544,7 @@ int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3
v1 = triangle_indexes[i][0];
v2 = triangle_indexes[i][1];
v3 = triangle_indexes[i][2];
- result = RayIntersectsTriangle(ray_start, ray_normal, bb->vec[v1], bb->vec[v2], bb->vec[v3], &lambda, NULL);
+ result = isect_ray_tri_v3(ray_start, ray_normal, bb->vec[v1], bb->vec[v2], bb->vec[v3], &lambda, NULL);
}
return result;
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 3dfe3966e2f..27fcfa8b9cb 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -161,7 +161,7 @@ void paint_brush_slot_remove(Paint *p)
int paint_facesel_test(Object *ob)
{
- return (ob && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
+ return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
}
void paint_init(Paint *p, const char col[3])
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 24d6b229297..bb2f4128891 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -51,7 +51,7 @@
#include "DNA_smoke_types.h"
#include "DNA_texture_types.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_kdtree.h"
@@ -618,12 +618,12 @@ static float psys_render_projected_area(ParticleSystem *psys, float *center, flo
/* transform to view space */
VECCOPY(co, center);
co[3]= 1.0f;
- Mat4MulVec4fl(data->viewmat, co);
+ mul_m4_v4(data->viewmat, co);
/* compute two vectors orthogonal to view vector */
VECCOPY(view, co);
- Normalize(view);
- VecOrthoBasisf(view, ortho1, ortho2);
+ normalize_v3(view);
+ ortho_basis_v3v3_v3( ortho1, ortho2,view);
/* compute on screen minification */
w= co[2]*data->winmat[2][3] + data->winmat[3][3];
@@ -637,7 +637,7 @@ static float psys_render_projected_area(ParticleSystem *psys, float *center, flo
/* viewport of the screen test */
/* project point on screen */
- Mat4MulVec4fl(data->winmat, co);
+ mul_m4_v4(data->winmat, co);
if(co[3] != 0.0f) {
co[0]= 0.5f*data->winx*(1.0f + co[0]/co[3]);
co[1]= 0.5f*data->winy*(1.0f + co[1]/co[3]);
@@ -698,9 +698,9 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float
psys->pathcachebufs.first = psys->pathcachebufs.last = NULL;
psys->childcachebufs.first = psys->childcachebufs.last = NULL;
- Mat4CpyMat4(data->winmat, winmat);
- Mat4MulMat4(data->viewmat, ob->obmat, viewmat);
- Mat4MulMat4(data->mat, data->viewmat, winmat);
+ copy_m4_m4(data->winmat, winmat);
+ mul_m4_m4m4(data->viewmat, ob->obmat, viewmat);
+ mul_m4_m4m4(data->mat, data->viewmat, winmat);
data->winx= winx;
data->winy= winy;
@@ -828,11 +828,11 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
if(mf->v4) {
VECCOPY(co4, mvert[mf->v4].co);
VECADD(facecenter[b], facecenter[b], co4);
- facearea[b] += AreaQ3Dfl(co1, co2, co3, co4);
+ facearea[b] += area_quad_v3(co1, co2, co3, co4);
facetotvert[b] += 4;
}
else {
- facearea[b] += AreaT3Dfl(co1, co2, co3);
+ facearea[b] += area_tri_v3(co1, co2, co3);
facetotvert[b] += 3;
}
}
@@ -840,7 +840,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
for(a=0; a 0)
- VecMulf(facecenter[a], 1.0f/facetotvert[a]);
+ mul_v3_fl(facecenter[a], 1.0f/facetotvert[a]);
/* for conversion from BU area / pixel area to reference screen size */
mesh_get_texspace(me, 0, 0, size);
@@ -1007,7 +1007,7 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
float t[4];
if(type<0) {
- VecfCubicInterpol(keys[1].co, keys[1].vel, keys[2].co, keys[2].vel, dt, result->co, result->vel);
+ interp_cubic_v3( result->co, result->vel,keys[1].co, keys[1].vel, keys[2].co, keys[2].vel, dt);
}
else {
key_curve_position_weights(dt, t, type);
@@ -1280,9 +1280,9 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
/* convert velocity to timestep size */
if(pind->keyed || pind->cache || point_vel){
- VecMulf(keys[1].vel, dfra / frs_sec);
- VecMulf(keys[2].vel, dfra / frs_sec);
- QuatInterpol(result->rot,keys[1].rot,keys[2].rot,keytime);
+ mul_v3_fl(keys[1].vel, dfra / frs_sec);
+ mul_v3_fl(keys[2].vel, dfra / frs_sec);
+ interp_qt_qtqt(result->rot,keys[1].rot,keys[2].rot,keytime);
}
/* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/
@@ -1292,7 +1292,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
/* the velocity needs to be converted back from cubic interpolation */
if(pind->keyed || pind->cache || point_vel)
- VecMulf(result->vel, frs_sec / dfra);
+ mul_v3_fl(result->vel, frs_sec / dfra);
}
/************************************************/
/* Particles on a dm */
@@ -1312,14 +1312,14 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
VECCOPY(n1,(mvert+mface->v1)->no);
VECCOPY(n2,(mvert+mface->v2)->no);
VECCOPY(n3,(mvert+mface->v3)->no);
- Normalize(n1);
- Normalize(n2);
- Normalize(n3);
+ normalize_v3(n1);
+ normalize_v3(n2);
+ normalize_v3(n3);
if(mface->v4) {
v4= (mvert+mface->v4)->co;
VECCOPY(n4,(mvert+mface->v4)->no);
- Normalize(n4);
+ normalize_v3(n4);
vec[0]= w[0]*v1[0] + w[1]*v2[0] + w[2]*v3[0] + w[3]*v4[0];
vec[1]= w[0]*v1[1] + w[1]*v2[1] + w[2]*v3[1] + w[3]*v4[1];
@@ -1332,7 +1332,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
nor[2]= w[0]*n1[2] + w[1]*n2[2] + w[2]*n3[2] + w[3]*n4[2];
}
else
- CalcNormFloat4(v1,v2,v3,v4,nor);
+ normal_quad_v3(nor,v1,v2,v3,v4);
}
}
else {
@@ -1347,7 +1347,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
nor[2]= w[0]*n1[2] + w[1]*n2[2] + w[2]*n3[2];
}
else
- CalcNormFloat(v1,v2,v3,nor);
+ normal_tri_v3(nor,v1,v2,v3);
}
}
@@ -1361,11 +1361,11 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
}
else{
uv1= tuv[0]; uv2= tuv[1]; uv3= tuv[2]; uv4= tuv[3];
- spheremap(v1[0], v1[1], v1[2], uv1, uv1+1);
- spheremap(v2[0], v2[1], v2[2], uv2, uv2+1);
- spheremap(v3[0], v3[1], v3[2], uv3, uv3+1);
+ map_to_sphere( uv1, uv1+1,v1[0], v1[1], v1[2]);
+ map_to_sphere( uv2, uv2+1,v2[0], v2[1], v2[2]);
+ map_to_sphere( uv3, uv3+1,v3[0], v3[1], v3[2]);
if(v4)
- spheremap(v4[0], v4[1], v4[2], uv4, uv4+1);
+ map_to_sphere( uv4, uv4+1,v4[0], v4[1], v4[2]);
}
if(v4){
@@ -1375,8 +1375,8 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
t1= uv3[1] - uv1[1];
t2= uv4[1] - uv1[1];
- VecSubf(e1, v3, v1);
- VecSubf(e2, v4, v1);
+ sub_v3_v3v3(e1, v3, v1);
+ sub_v3_v3v3(e2, v4, v1);
}
else{
s1= uv2[0] - uv1[0];
@@ -1385,8 +1385,8 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
t1= uv2[1] - uv1[1];
t2= uv3[1] - uv1[1];
- VecSubf(e1, v2, v1);
- VecSubf(e2, v3, v1);
+ sub_v3_v3v3(e1, v2, v1);
+ sub_v3_v3v3(e2, v3, v1);
}
vtan[0] = (s1*e2[0] - s2*e1[0]);
@@ -1411,7 +1411,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
orco[2]= w[0]*o1[2] + w[1]*o2[2] + w[2]*o3[2] + w[3]*o4[2];
if(ornor)
- CalcNormFloat4(o1, o2, o3, o4, ornor);
+ normal_quad_v3( ornor,o1, o2, o3, o4);
}
else {
orco[0]= w[0]*o1[0] + w[1]*o2[0] + w[2]*o3[0];
@@ -1419,7 +1419,7 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
orco[2]= w[0]*o1[2] + w[1]*o2[2] + w[2]*o3[2];
if(ornor)
- CalcNormFloat(o1, o2, o3, ornor);
+ normal_tri_v3( ornor,o1, o2, o3);
}
}
else {
@@ -1517,10 +1517,10 @@ static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, float *w, float
if(quad) {
v[3][0]= osface->uv[3][0]; v[3][1]= osface->uv[3][1]; v[3][2]= 0.0f;
- MeanValueWeights(v, 4, co, neww);
+ interp_weights_poly_v3( neww,v, 4, co);
}
else {
- MeanValueWeights(v, 3, co, neww);
+ interp_weights_poly_v3( neww,v, 3, co);
neww[3]= 0.0f;
}
}
@@ -1566,10 +1566,10 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float *
/* check that this intersects - Its possible this misses :/ -
* could also check its not between */
if(quad) {
- if(IsectPQ2Df(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
+ if(isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
return findex;
}
- else if(IsectPT2Df(uv, faceuv[0], faceuv[1], faceuv[2]))
+ else if(isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
return findex;
}
}
@@ -1582,10 +1582,10 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float *
/* check that this intersects - Its possible this misses :/ -
* could also check its not between */
if(quad) {
- if(IsectPQ2Df(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
+ if(isect_point_quad_v2(uv, faceuv[0], faceuv[1], faceuv[2], faceuv[3]))
return findex;
}
- else if(IsectPT2Df(uv, faceuv[0], faceuv[1], faceuv[2]))
+ else if(isect_point_tri_v2(uv, faceuv[0], faceuv[1], faceuv[2]))
return findex;
}
}
@@ -1678,7 +1678,7 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
if(nor) {
dm->getVertNo(dm,mapindex,nor);
- Normalize(nor);
+ normalize_v3(nor);
}
if(orco)
@@ -1686,7 +1686,7 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
if(ornor) {
dm->getVertNo(dm,mapindex,nor);
- Normalize(nor);
+ normalize_v3(nor);
}
if(utan && vtan) {
@@ -1711,8 +1711,8 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
if(nor)
VECCOPY(nor,tmpnor);
- Normalize(tmpnor);
- VecMulf(tmpnor,-foffset);
+ normalize_v3(tmpnor);
+ mul_v3_fl(tmpnor,-foffset);
VECADD(vec,vec,tmpnor);
}
else
@@ -1835,42 +1835,42 @@ static void do_prekink(ParticleKey *state, ParticleKey *par, float *par_rot, flo
if(par_rot)
QUATCOPY(q2,par_rot)
else
- vectoquat(par->vel,axis,(axis+1)%3, q2);
- QuatMulVecf(q2,vec);
- VecMulf(vec,amplitude);
+ vec_to_quat( q2,par->vel,axis,(axis+1)%3);
+ mul_qt_v3(q2,vec);
+ mul_v3_fl(vec,amplitude);
VECADD(state->co,state->co,vec);
VECSUB(vec,state->co,par->co);
if(t!=0.0)
- VecRotToQuat(par->vel,t,q1);
+ axis_angle_to_quat(q1,par->vel,t);
- QuatMulVecf(q1,vec);
+ mul_qt_v3(q1,vec);
VECADD(state->co,par->co,vec);
break;
case PART_KINK_RADIAL:
VECSUB(vec,state->co,par->co);
- Normalize(vec);
- VecMulf(vec,amplitude*(float)sin(t));
+ normalize_v3(vec);
+ mul_v3_fl(vec,amplitude*(float)sin(t));
VECADD(state->co,state->co,vec);
break;
case PART_KINK_WAVE:
vec[axis]=1.0;
if(obmat)
- Mat4Mul3Vecfl(obmat,vec);
+ mul_mat3_m4_v3(obmat,vec);
if(par_rot)
- QuatMulVecf(par_rot,vec);
+ mul_qt_v3(par_rot,vec);
- Projf(q1,vec,par->vel);
+ project_v3_v3v3(q1,vec,par->vel);
VECSUB(vec,vec,q1);
- Normalize(vec);
+ normalize_v3(vec);
- VecMulf(vec,amplitude*(float)sin(t));
+ mul_v3_fl(vec,amplitude*(float)sin(t));
VECADD(state->co,state->co,vec);
break;
@@ -1884,46 +1884,46 @@ static void do_prekink(ParticleKey *state, ParticleKey *par, float *par_rot, flo
if(par_rot)
QUATCOPY(q2,par_rot)
else
- vectoquat(par->vel,axis,(axis+1)%3,q2);
- QuatMulVecf(q2,y_vec);
- QuatMulVecf(q2,z_vec);
+ vec_to_quat(q2,par->vel,axis,(axis+1)%3);
+ mul_qt_v3(q2,y_vec);
+ mul_qt_v3(q2,z_vec);
VECSUB(vec_from_par,state->co,par->co);
VECCOPY(vec_one,vec_from_par);
- radius=Normalize(vec_one);
+ radius=normalize_v3(vec_one);
- inp_y=Inpf(y_vec,vec_one);
- inp_z=Inpf(z_vec,vec_one);
+ inp_y=dot_v3v3(y_vec,vec_one);
+ inp_z=dot_v3v3(z_vec,vec_one);
if(inp_y>0.5){
VECCOPY(state_co,y_vec);
- VecMulf(y_vec,amplitude*(float)cos(t));
- VecMulf(z_vec,amplitude/2.0f*(float)sin(2.0f*t));
+ mul_v3_fl(y_vec,amplitude*(float)cos(t));
+ mul_v3_fl(z_vec,amplitude/2.0f*(float)sin(2.0f*t));
}
else if(inp_z>0.0){
VECCOPY(state_co,z_vec);
- VecMulf(state_co,(float)sin(M_PI/3.0f));
+ mul_v3_fl(state_co,(float)sin(M_PI/3.0f));
VECADDFAC(state_co,state_co,y_vec,-0.5f);
- VecMulf(y_vec,-amplitude*(float)cos(t + M_PI/3.0f));
- VecMulf(z_vec,amplitude/2.0f*(float)cos(2.0f*t + M_PI/6.0f));
+ mul_v3_fl(y_vec,-amplitude*(float)cos(t + M_PI/3.0f));
+ mul_v3_fl(z_vec,amplitude/2.0f*(float)cos(2.0f*t + M_PI/6.0f));
}
else{
VECCOPY(state_co,z_vec);
- VecMulf(state_co,-(float)sin(M_PI/3.0f));
+ mul_v3_fl(state_co,-(float)sin(M_PI/3.0f));
VECADDFAC(state_co,state_co,y_vec,-0.5f);
- VecMulf(y_vec,amplitude*(float)-sin(t+M_PI/6.0f));
- VecMulf(z_vec,amplitude/2.0f*(float)-sin(2.0f*t+M_PI/3.0f));
+ mul_v3_fl(y_vec,amplitude*(float)-sin(t+M_PI/6.0f));
+ mul_v3_fl(z_vec,amplitude/2.0f*(float)-sin(2.0f*t+M_PI/3.0f));
}
- VecMulf(state_co,amplitude);
+ mul_v3_fl(state_co,amplitude);
VECADD(state_co,state_co,par->co);
VECSUB(vec_from_par,state->co,state_co);
- length=Normalize(vec_from_par);
- VecMulf(vec_from_par,MIN2(length,amplitude/2.0f));
+ length=normalize_v3(vec_from_par);
+ mul_v3_fl(vec_from_par,MIN2(length,amplitude/2.0f));
VECADD(state_co,par->co,y_vec);
VECADD(state_co,state_co,z_vec);
@@ -1934,7 +1934,7 @@ static void do_prekink(ParticleKey *state, ParticleKey *par, float *par_rot, flo
if(tco,state->co,state_co,shape);
+ interp_v3_v3v3(state->co,state->co,state_co,shape);
}
else{
VECCOPY(state->co,state_co);
@@ -1958,7 +1958,7 @@ static void do_clump(ParticleKey *state, ParticleKey *par, float time, float clu
clump = -clumpfac*pa_clump*(float)pow(1.0-(double)time,(double)cpow);
else
clump = clumpfac*pa_clump*(float)pow((double)time,(double)cpow);
- VecLerpf(state->co,state->co,par->co,clump);
+ interp_v3_v3v3(state->co,state->co,par->co,clump);
}
}
void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
@@ -1990,7 +1990,7 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
VECSUB(efd.vec_to_point, state.co, eff->guide_loc);
VECCOPY(efd.nor, eff->guide_dir);
- efd.distance = VecLength(efd.vec_to_point);
+ efd.distance = len_v3(efd.vec_to_point);
VECCOPY(data->vec_to_point, efd.vec_to_point);
data->strength = effector_falloff(eff, &efd, &point, weights);
@@ -2037,33 +2037,33 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
return 0;
}
- Mat4MulVecfl(eff->ob->obmat, guidevec);
- Mat4Mul3Vecfl(eff->ob->obmat, guidedir);
+ mul_m4_v3(eff->ob->obmat, guidevec);
+ mul_mat3_m4_v3(eff->ob->obmat, guidedir);
- Normalize(guidedir);
+ normalize_v3(guidedir);
VECCOPY(vec_to_point, data->vec_to_point);
if(guidetime != 0.0){
/* curve direction */
- Crossf(temp, eff->guide_dir, guidedir);
- angle = Inpf(eff->guide_dir, guidedir)/(VecLength(eff->guide_dir));
+ cross_v3_v3v3(temp, eff->guide_dir, guidedir);
+ angle = dot_v3v3(eff->guide_dir, guidedir)/(len_v3(eff->guide_dir));
angle = saacos(angle);
- VecRotToQuat(temp, angle, rot2);
- QuatMulVecf(rot2, vec_to_point);
+ axis_angle_to_quat( rot2,temp, angle);
+ mul_qt_v3(rot2, vec_to_point);
/* curve tilt */
- VecRotToQuat(guidedir, guidevec[3] - eff->guide_loc[3], rot2);
- QuatMulVecf(rot2, vec_to_point);
+ axis_angle_to_quat( rot2,guidedir, guidevec[3] - eff->guide_loc[3]);
+ mul_qt_v3(rot2, vec_to_point);
}
/* curve taper */
if(cu->taperobj)
- VecMulf(vec_to_point, calc_taper(eff->scene, cu->taperobj, (int)(data->strength*guidetime*100.0), 100));
+ mul_v3_fl(vec_to_point, calc_taper(eff->scene, cu->taperobj, (int)(data->strength*guidetime*100.0), 100));
else{ /* curve size*/
if(cu->flag & CU_PATH_RADIUS) {
- VecMulf(vec_to_point, radius);
+ mul_v3_fl(vec_to_point, radius);
}
}
par.co[0] = par.co[1] = par.co[2] = 0.0f;
@@ -2081,13 +2081,13 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
if(totstrength != 0.0){
if(totstrength > 1.0)
- VecMulf(effect, 1.0f / totstrength);
+ mul_v3_fl(effect, 1.0f / totstrength);
CLAMP(totstrength, 0.0, 1.0);
//VECADD(effect,effect,pa_zero);
- VecLerpf(state->co, state->co, effect, totstrength);
+ interp_v3_v3v3(state->co, state->co, effect, totstrength);
- Normalize(veffect);
- VecMulf(veffect, VecLength(state->vel));
+ normalize_v3(veffect);
+ mul_v3_fl(veffect, len_v3(state->vel));
VECCOPY(state->vel, veffect);
return 1;
}
@@ -2102,7 +2102,7 @@ static void do_rough(float *loc, float mat[4][4], float t, float fac, float size
if((float)fabs((float)(-1.5+loc[0]+loc[1]+loc[2]))<1.5f*thres) return;
VECCOPY(rco,loc);
- VecMulf(rco,t);
+ mul_v3_fl(rco,t);
rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2,0,2);
rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2,0,2);
rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2,0,2);
@@ -2117,10 +2117,10 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float
float roughfac;
roughfac=fac*(float)pow((double)t,shape);
- Vec2Copyf(rough,loc);
+ copy_v2_v2(rough,loc);
rough[0]=-1.0f+2.0f*rough[0];
rough[1]=-1.0f+2.0f*rough[1];
- Vec2Mulf(rough,roughfac);
+ mul_v2_fl(rough,roughfac);
VECADDFAC(state->co,state->co,mat[0],rough[0]);
VECADDFAC(state->co,state->co,mat[1],rough[1]);
@@ -2142,23 +2142,23 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
pd_point_from_particle(sim, sim->psys->particles+i, &eff_key, &epoint);
pdDoEffectors(sim->psys->effectors, sim->colliders, sim->psys->part->effector_weights, &epoint, force, NULL);
- VecMulf(force, effector*pow((float)k / (float)steps, 100.0f * sim->psys->part->eff_hair) / (float)steps);
+ mul_v3_fl(force, effector*pow((float)k / (float)steps, 100.0f * sim->psys->part->eff_hair) / (float)steps);
- VecAddf(force, force, vec);
+ add_v3_v3v3(force, force, vec);
- Normalize(force);
+ normalize_v3(force);
VECADDFAC(ca->co, (ca-1)->co, force, *length);
if(k < steps) {
- VecSubf(vec, (ca+1)->co, ca->co);
- *length = VecLength(vec);
+ sub_v3_v3v3(vec, (ca+1)->co, ca->co);
+ *length = len_v3(vec);
}
}
static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec)
{
if(*cur_length + length > max_length){
- VecMulf(dvec, (max_length - *cur_length) / length);
+ mul_v3_fl(dvec, (max_length - *cur_length) / length);
VECADD(state->co, (state - 1)->co, dvec);
keys->steps = k;
/* something over the maximum step value */
@@ -2172,13 +2172,13 @@ static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *st
static void offset_child(ChildParticle *cpa, ParticleKey *par, ParticleKey *child, float flat, float radius)
{
VECCOPY(child->co,cpa->fuv);
- VecMulf(child->co,radius);
+ mul_v3_fl(child->co,radius);
child->co[0]*=flat;
VECCOPY(child->vel,par->vel);
- QuatMulVecf(par->rot,child->co);
+ mul_qt_v3(par->rot,child->co);
QUATCOPY(child->rot,par->rot);
@@ -2247,14 +2247,14 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
return;
if(ma->mode & MA_STR_SURFDIFF) {
- Crossf(cross, surfnor, nor);
- Crossf(nstrand, nor, cross);
+ cross_v3_v3v3(cross, surfnor, nor);
+ cross_v3_v3v3(nstrand, nor, cross);
blend= INPR(nstrand, surfnor);
CLAMP(blend, 0.0f, 1.0f);
- VecLerpf(vnor, nstrand, surfnor, blend);
- Normalize(vnor);
+ interp_v3_v3v3(vnor, nstrand, surfnor, blend);
+ normalize_v3(vnor);
}
else
VECCOPY(vnor, nor)
@@ -2262,8 +2262,8 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
if(ma->strand_surfnor > 0.0f) {
if(ma->strand_surfnor > surfdist) {
blend= (ma->strand_surfnor - surfdist)/ma->strand_surfnor;
- VecLerpf(vnor, vnor, surfnor, blend);
- Normalize(vnor);
+ interp_v3_v3v3(vnor, vnor, surfnor, blend);
+ normalize_v3(vnor);
}
}
@@ -2440,7 +2440,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
if(part->path_start==0.0f) {
/* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */
VECCOPY(cpa_1st,co);
- Mat4MulVecfl(ob->obmat,cpa_1st);
+ mul_m4_v3(ob->obmat,cpa_1st);
}
pa = psys->particles + cpa->parent;
@@ -2538,8 +2538,8 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
do_path_effectors(&ctx->sim, cpa->pa[0], state, k, ctx->steps, keys->co, ptex.effector, 0.0f, ctx->cfra, &eff_length, eff_vec);
}
else {
- VecSubf(eff_vec,(state+1)->co,state->co);
- eff_length= VecLength(eff_vec);
+ sub_v3_v3v3(eff_vec,(state+1)->co,state->co);
+ eff_length= len_v3(eff_vec);
}
}
}
@@ -2599,17 +2599,17 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
// }
// if(itotpart)
- // VecLerpf(state->co, (pcache[i] + k)->co, state->co, branchfac);
+ // interp_v3_v3v3(state->co, (pcache[i] + k)->co, state->co, branchfac);
// else
// /* this is not threadsafe, but should only happen for
// * branching particles particles, which are not threaded */
- // VecLerpf(state->co, (cache[i - psys->totpart] + k)->co, state->co, branchfac);
+ // interp_v3_v3v3(state->co, (cache[i - psys->totpart] + k)->co, state->co, branchfac);
//}
/* we have to correct velocity because of kink & clump */
if(k>1){
VECSUB((state-1)->vel,state->co,(state-2)->co);
- VecMulf((state-1)->vel,0.5);
+ mul_v3_fl((state-1)->vel,0.5);
if(ctx->ma && (part->draw & PART_DRAW_MAT_COL))
get_strand_normal(ctx->ma, ornor, cur_length, (state-1)->vel);
@@ -2841,9 +2841,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/* dynamic hair is in object space */
/* keyed and baked are allready in global space */
if(hair_dm)
- Mat4MulVecfl(sim->ob->obmat, result.co);
+ mul_m4_v3(sim->ob->obmat, result.co);
else if(!keyed && !baked && !(psys->flag & PSYS_GLOBAL_HAIR))
- Mat4MulVecfl(hairmat, result.co);
+ mul_m4_v3(hairmat, result.co);
VECCOPY(ca->co, result.co);
VECCOPY(ca->col, col);
@@ -2851,8 +2851,8 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/*--modify paths and calculate rotation & velocity--*/
- VecSubf(vec,(cache[p]+1)->co,cache[p]->co);
- length = VecLength(vec);
+ sub_v3_v3v3(vec,(cache[p]+1)->co,cache[p]->co);
+ length = len_v3(vec);
effector= 1.0f;
if(vg_effector)
@@ -2882,7 +2882,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/* calculate initial tangent for incremental rotations */
VECSUB(tangent, ca->co, (ca - 1)->co);
VECCOPY(prev_tangent, tangent);
- Normalize(prev_tangent);
+ normalize_v3(prev_tangent);
/* First rotation is based on emitting face orientation. */
/* This is way better than having flipping rotations resulting */
@@ -2890,13 +2890,13 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
/* It's not an ideal solution though since it disregards the */
/* initial tangent, but taking that in to account will allow */
/* the possibility of flipping again. -jahka */
- Mat3ToQuat_is_ok(rotmat, (ca-1)->rot);
+ mat3_to_quat_is_ok( (ca-1)->rot,rotmat);
}
else {
VECSUB(tangent, ca->co, (ca - 1)->co);
- Normalize(tangent);
+ normalize_v3(tangent);
- cosangle= Inpf(tangent, prev_tangent);
+ cosangle= dot_v3v3(tangent, prev_tangent);
/* note we do the comparison on cosangle instead of
* angle, since floating point accuracy makes it give
@@ -2906,9 +2906,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
}
else {
angle= saacos(cosangle);
- Crossf(normal, prev_tangent, tangent);
- VecRotToQuat(normal, angle, q);
- QuatMul((ca - 1)->rot, q, (ca - 2)->rot);
+ cross_v3_v3v3(normal, prev_tangent, tangent);
+ axis_angle_to_quat( q,normal, angle);
+ mul_qt_qtqt((ca - 1)->rot, q, (ca - 2)->rot);
}
VECCOPY(prev_tangent, tangent);
@@ -3034,7 +3034,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* non-hair points are allready in global space */
if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
- Mat4MulVecfl(hairmat, result.co);
+ mul_m4_v3(hairmat, result.co);
/* create rotations for proper creation of children */
if(k) {
@@ -3044,7 +3044,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* calculate initial tangent for incremental rotations */
VECSUB(tangent, ca->co, (ca - 1)->co);
VECCOPY(prev_tangent, tangent);
- Normalize(prev_tangent);
+ normalize_v3(prev_tangent);
/* First rotation is based on emitting face orientation. */
/* This is way better than having flipping rotations resulting */
@@ -3052,13 +3052,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* It's not an ideal solution though since it disregards the */
/* initial tangent, but taking that in to account will allow */
/* the possibility of flipping again. -jahka */
- Mat3ToQuat_is_ok(rotmat, (ca-1)->rot);
+ mat3_to_quat_is_ok( (ca-1)->rot,rotmat);
}
else {
VECSUB(tangent, ca->co, (ca - 1)->co);
- Normalize(tangent);
+ normalize_v3(tangent);
- cosangle= Inpf(tangent, prev_tangent);
+ cosangle= dot_v3v3(tangent, prev_tangent);
/* note we do the comparison on cosangle instead of
* angle, since floating point accuracy makes it give
@@ -3068,9 +3068,9 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
else {
angle= saacos(cosangle);
- Crossf(normal, prev_tangent, tangent);
- VecRotToQuat(normal, angle, q);
- QuatMul((ca - 1)->rot, q, (ca - 2)->rot);
+ cross_v3_v3v3(normal, prev_tangent, tangent);
+ axis_angle_to_quat( q,normal, angle);
+ mul_qt_qtqt((ca - 1)->rot, q, (ca - 2)->rot);
}
VECCOPY(prev_tangent, tangent);
@@ -3094,13 +3094,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
}
else{
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
- VecLerpf(ca->col, sel_col, nosel_col, keytime);
+ interp_v3_v3v3(ca->col, sel_col, nosel_col, keytime);
}
}
else{
if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
- VecLerpf(ca->col, nosel_col, sel_col, keytime);
+ interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime);
}
else{
VECCOPY(ca->col, nosel_col);
@@ -3144,12 +3144,12 @@ static void key_from_object(Object *ob, ParticleKey *key){
VECADD(key->vel,key->vel,key->co);
- Mat4MulVecfl(ob->obmat,key->co);
- Mat4MulVecfl(ob->obmat,key->vel);
- Mat4ToQuat(ob->obmat,q);
+ mul_m4_v3(ob->obmat,key->co);
+ mul_m4_v3(ob->obmat,key->vel);
+ mat4_to_quat(q,ob->obmat);
VECSUB(key->vel,key->vel,key->co);
- QuatMul(key->rot,q,key->rot);
+ mul_qt_qtqt(key->rot,q,key->rot);
}
#endif
@@ -3161,7 +3161,7 @@ static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat
mat[3][3]= 1.0f;
/* first axis is the normal */
- CalcNormFloat(v1, v2, v3, mat[2]);
+ normal_tri_v3( mat[2],v1, v2, v3);
/* second axis along (1, 0) in uv space */
if(uv) {
@@ -3180,18 +3180,18 @@ static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat
mat[1][0]= w1*(v2[0] - v1[0]) + w2*(v3[0] - v1[0]);
mat[1][1]= w1*(v2[1] - v1[1]) + w2*(v3[1] - v1[1]);
mat[1][2]= w1*(v2[2] - v1[2]) + w2*(v3[2] - v1[2]);
- Normalize(mat[1]);
+ normalize_v3(mat[1]);
}
else
mat[1][0]= mat[1][1]= mat[1][2]= 0.0f;
}
else {
- VecSubf(mat[1], v2, v1);
- Normalize(mat[1]);
+ sub_v3_v3v3(mat[1], v2, v1);
+ normalize_v3(mat[1]);
}
/* third as a cross product */
- Crossf(mat[0], mat[1], mat[2]);
+ cross_v3_v3v3(mat[0], mat[1], mat[2]);
}
static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float mat[][4], int orco)
@@ -3203,7 +3203,7 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
int i = pa->num_dmcache==DMCACHE_NOTFOUND ? pa->num : pa->num_dmcache;
- if (i==-1 || i >= dm->getNumFaces(dm)) { Mat4One(mat); return; }
+ if (i==-1 || i >= dm->getNumFaces(dm)) { unit_m4(mat); return; }
mface=dm->getFaceData(dm,i,CD_MFACE);
osface=dm->getFaceData(dm,i,CD_ORIGSPACE);
@@ -3252,8 +3252,8 @@ void psys_vec_rot_to_face(DerivedMesh *dm, ParticleData *pa, float *vec)
float mat[4][4];
psys_face_mat(0, dm, pa, mat, 0);
- Mat4Transp(mat); /* cheap inverse for rotation matrix */
- Mat4Mul3Vecfl(mat, vec);
+ transpose_m4(mat); /* cheap inverse for rotation matrix */
+ mul_mat3_m4_v3(mat, vec);
}
void psys_mat_hair_to_global(Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
@@ -3262,20 +3262,20 @@ void psys_mat_hair_to_global(Object *ob, DerivedMesh *dm, short from, ParticleDa
psys_mat_hair_to_object(ob, dm, from, pa, facemat);
- Mat4MulMat4(hairmat, facemat, ob->obmat);
+ mul_m4_m4m4(hairmat, facemat, ob->obmat);
}
/************************************************/
/* ParticleSettings handling */
/************************************************/
-void object_add_particle_system(Scene *scene, Object *ob)
+ModifierData *object_add_particle_system(Scene *scene, Object *ob, char *name)
{
ParticleSystem *psys;
ModifierData *md;
ParticleSystemModifierData *psmd;
if(!ob || ob->type != OB_MESH)
- return;
+ return NULL;
psys = ob->particlesystem.first;
for(; psys; psys=psys->next)
@@ -3293,7 +3293,11 @@ void object_add_particle_system(Scene *scene, Object *ob)
strcpy(psys->name, "ParticleSystem");
md= modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
+
+ if(name) BLI_strncpy(md->name, name, sizeof(md->name));
+ else sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
+ modifier_unique_name(&ob->modifiers, md);
+
psmd= (ParticleSystemModifierData*) md;
psmd->psys=psys;
BLI_addtail(&ob->modifiers, md);
@@ -3304,6 +3308,8 @@ void object_add_particle_system(Scene *scene, Object *ob)
DAG_scene_sort(scene);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
+
+ return md;
}
void object_remove_particle_system(Scene *scene, Object *ob)
{
@@ -3849,8 +3855,8 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
if(!keyed && !cached) {
if((pa->flag & PARS_REKEY)==0) {
psys_mat_hair_to_global(sim->ob, sim->psmd->dm, part->from, pa, hairmat);
- Mat4MulVecfl(hairmat, state->co);
- Mat4Mul3Vecfl(hairmat, state->vel);
+ mul_m4_v3(hairmat, state->co);
+ mul_mat3_m4_v3(hairmat, state->vel);
if(sim->psys->effectors && (part->flag & PART_CHILD_GUIDE)==0) {
do_guides(sim->psys->effectors, state, p, state->time);
@@ -3863,7 +3869,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
}
}
else if(totchild){
- //Mat4Invert(imat,ob->obmat);
+ //invert_m4_m4(imat,ob->obmat);
cpa=psys->child+p-totpart;
@@ -3902,7 +3908,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */
//VECCOPY(cpa_1st,co);
- //Mat4MulVecfl(ob->obmat,cpa_1st);
+ //mul_m4_v3(ob->obmat,cpa_1st);
pa = psys->particles + cpa->parent;
@@ -3979,22 +3985,22 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
/* try to estimate correct velocity */
if(vel){
ParticleKey tstate;
- float length = VecLength(state->vel);
+ float length = len_v3(state->vel);
if(t>=0.001f){
tstate.time=t-0.001f;
psys_get_particle_on_path(sim,p,&tstate,0);
VECSUB(state->vel,state->co,tstate.co);
- Normalize(state->vel);
+ normalize_v3(state->vel);
}
else{
tstate.time=t+0.001f;
psys_get_particle_on_path(sim,p,&tstate,0);
VECSUB(state->vel,tstate.co,state->co);
- Normalize(state->vel);
+ normalize_v3(state->vel);
}
- VecMulf(state->vel, length);
+ mul_v3_fl(state->vel, length);
}
}
}
@@ -4101,16 +4107,16 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
keytime = (state->time - keys[1].time) / dfra;
/* convert velocity to timestep size */
- VecMulf(keys[1].vel, dfra * timestep);
- VecMulf(keys[2].vel, dfra * timestep);
+ mul_v3_fl(keys[1].vel, dfra * timestep);
+ mul_v3_fl(keys[2].vel, dfra * timestep);
psys_interpolate_particle(-1, keys, keytime, state, 1);
/* convert back to real velocity */
- VecMulf(state->vel, 1.0f / (dfra * timestep));
+ mul_v3_fl(state->vel, 1.0f / (dfra * timestep));
- VecLerpf(state->ave, keys[1].ave, keys[2].ave, keytime);
- QuatInterpol(state->rot, keys[1].rot, keys[2].rot, keytime);
+ interp_v3_v3v3(state->ave, keys[1].ave, keys[2].ave, keytime);
+ interp_qt_qtqt(state->rot, keys[1].rot, keys[2].rot, keytime);
}
}
else {
@@ -4184,8 +4190,8 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
float loc[3], nor[3], vec[3], side[3], len, obrotmat[4][4], qmat[4][4];
float xvec[3] = {-1.0, 0.0, 0.0}, q[4];
- VecSubf(vec, (cache+cache->steps-1)->co, cache->co);
- len= Normalize(vec);
+ sub_v3_v3v3(vec, (cache+cache->steps-1)->co, cache->co);
+ len= normalize_v3(vec);
if(pa)
psys_particle_on_emitter(psmd,sim->psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc,nor,0,0,0,0);
@@ -4198,17 +4204,17 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
if(!pa)
pa= psys->particles+cpa->pa[0];
- vectoquat(xvec, ob->trackflag, ob->upflag, q);
- QuatToMat4(q, obrotmat);
+ vec_to_quat( q,xvec, ob->trackflag, ob->upflag);
+ quat_to_mat4( obrotmat,q);
obrotmat[3][3]= 1.0f;
- QuatToMat4(pa->state.rot, qmat);
- Mat4MulMat4(mat, obrotmat, qmat);
+ quat_to_mat4( qmat,pa->state.rot);
+ mul_m4_m4m4(mat, obrotmat, qmat);
}
else {
/* make sure that we get a proper side vector */
- if(fabs(Inpf(nor,vec))>0.999999) {
- if(fabs(Inpf(nor,xvec))>0.999999) {
+ if(fabs(dot_v3v3(nor,vec))>0.999999) {
+ if(fabs(dot_v3v3(nor,xvec))>0.999999) {
nor[0] = 0.0f;
nor[1] = 1.0f;
nor[2] = 0.0f;
@@ -4219,11 +4225,11 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
nor[2] = 0.0f;
}
}
- Crossf(side, nor, vec);
- Normalize(side);
- Crossf(nor, vec, side);
+ cross_v3_v3v3(side, nor, vec);
+ normalize_v3(side);
+ cross_v3_v3v3(nor, vec, side);
- Mat4One(mat);
+ unit_m4(mat);
VECCOPY(mat[0], vec);
VECCOPY(mat[1], side);
VECCOPY(mat[2], nor);
@@ -4244,62 +4250,62 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
if(bb->lock && (bb->align == PART_BB_VIEW)) {
VECCOPY(xvec, bb->ob->obmat[0]);
- Normalize(xvec);
+ normalize_v3(xvec);
VECCOPY(yvec, bb->ob->obmat[1]);
- Normalize(yvec);
+ normalize_v3(yvec);
VECCOPY(zvec, bb->ob->obmat[2]);
- Normalize(zvec);
+ normalize_v3(zvec);
}
else if(bb->align == PART_BB_VEL) {
float temp[3];
VECCOPY(temp, bb->vel);
- Normalize(temp);
+ normalize_v3(temp);
VECSUB(zvec, bb->ob->obmat[3], bb->vec);
if(bb->lock) {
- float fac = -Inpf(zvec, temp);
+ float fac = -dot_v3v3(zvec, temp);
VECADDFAC(zvec, zvec, temp, fac);
}
- Normalize(zvec);
+ normalize_v3(zvec);
- Crossf(xvec,temp,zvec);
- Normalize(xvec);
+ cross_v3_v3v3(xvec,temp,zvec);
+ normalize_v3(xvec);
- Crossf(yvec,zvec,xvec);
+ cross_v3_v3v3(yvec,zvec,xvec);
}
else {
VECSUB(zvec, bb->ob->obmat[3], bb->vec);
if(bb->lock)
zvec[bb->align] = 0.0f;
- Normalize(zvec);
+ normalize_v3(zvec);
if(bb->align < PART_BB_VIEW)
- Crossf(xvec, onevec, zvec);
+ cross_v3_v3v3(xvec, onevec, zvec);
else
- Crossf(xvec, bb->ob->obmat[1], zvec);
- Normalize(xvec);
+ cross_v3_v3v3(xvec, bb->ob->obmat[1], zvec);
+ normalize_v3(xvec);
- Crossf(yvec,zvec,xvec);
+ cross_v3_v3v3(yvec,zvec,xvec);
}
VECCOPY(tvec, xvec);
VECCOPY(tvec2, yvec);
- VecMulf(xvec, cos(bb->tilt * (float)M_PI));
- VecMulf(tvec2, sin(bb->tilt * (float)M_PI));
+ mul_v3_fl(xvec, cos(bb->tilt * (float)M_PI));
+ mul_v3_fl(tvec2, sin(bb->tilt * (float)M_PI));
VECADD(xvec, xvec, tvec2);
- VecMulf(yvec, cos(bb->tilt * (float)M_PI));
- VecMulf(tvec, -sin(bb->tilt * (float)M_PI));
+ mul_v3_fl(yvec, cos(bb->tilt * (float)M_PI));
+ mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI));
VECADD(yvec, yvec, tvec);
- VecMulf(xvec, bb->size);
- VecMulf(yvec, bb->size);
+ mul_v3_fl(xvec, bb->size);
+ mul_v3_fl(yvec, bb->size);
VECADDFAC(center, bb->vec, xvec, bb->offset[0]);
VECADDFAC(center, center, yvec, bb->offset[1]);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index d66c990cbe1..809b5f2090c 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -54,7 +54,7 @@
#include "BLI_rand.h"
#include "BLI_jitter.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_kdtree.h"
#include "BLI_kdopbvh.h"
@@ -405,7 +405,7 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
min[2]-=d/2.0f;
for(i=0,mv=mvert; ico,min);
+ sub_v3_v3v3(vec,mv->co,min);
vec[0]/=delta[0];
vec[1]/=delta[1];
vec[2]/=delta[2];
@@ -447,7 +447,7 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
VECCOPY(v2,mvert[mface->v2].co);
VECCOPY(v3,mvert[mface->v3].co);
- if(AxialLineIntersectsTriangle(a,co1, co2, v2, v3, v1, &lambda)){
+ if(isect_axial_line_tri_v3(a,co1, co2, v2, v3, v1, &lambda)){
if(from==PART_FROM_FACE)
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
else /* store number of intersections */
@@ -457,7 +457,7 @@ static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
if(mface->v4){
VECCOPY(v4,mvert[mface->v4].co);
- if(AxialLineIntersectsTriangle(a,co1, co2, v4, v1, v3, &lambda)){
+ if(isect_axial_line_tri_v3(a,co1, co2, v4, v1, v3, &lambda)){
if(from==PART_FROM_FACE)
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
else
@@ -577,10 +577,10 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
if(quad) {
vert[3][0]= 0.0f; vert[3][1]= 1.0f; vert[3][2]= 0.0f;
- MeanValueWeights(vert, 4, co, w);
+ interp_weights_poly_v3( w,vert, 4, co);
}
else {
- MeanValueWeights(vert, 3, co, w);
+ interp_weights_poly_v3( w,vert, 3, co);
w[3]= 0.0f;
}
}
@@ -669,8 +669,8 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
psys_interpolate_face(mvert,mface,0,0,pa->fuv,co1,nor,0,0,0,0);
- Normalize(nor);
- VecMulf(nor,-100.0);
+ normalize_v3(nor);
+ mul_v3_fl(nor,-100.0);
VECADD(co2,co1,nor);
@@ -684,7 +684,7 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
v2=mvert[mface->v2].co;
v3=mvert[mface->v3].co;
- if(LineIntersectsTriangle(co1, co2, v2, v3, v1, &cur_d, 0)){
+ if(isect_line_tri_v3(co1, co2, v2, v3, v1, &cur_d, 0)){
if(cur_dfoffset=cur_d*50.0f; /* to the middle of volume */
@@ -694,7 +694,7 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
if(mface->v4){
v4=mvert[mface->v4].co;
- if(LineIntersectsTriangle(co1, co2, v4, v1, v3, &cur_d, 0)){
+ if(isect_line_tri_v3(co1, co2, v4, v1, v3, &cur_d, 0)){
if(cur_dfoffset=cur_d*50.0f; /* to the middle of volume */
@@ -776,18 +776,18 @@ static void psys_thread_distribute_particle(ParticleThread *thread, ParticleData
// int min_seam=0, near_vert=0;
// /* find closest seam */
// for(i=0; itotseam; i++, seam++){
- // VecSubf(temp,co1,seam->v0);
- // inp=Inpf(temp,seam->dir)/seam->length2;
+ // sub_v3_v3v3(temp,co1,seam->v0);
+ // inp=dot_v3v3(temp,seam->dir)/seam->length2;
// if(inp<0.0f){
- // cur_len=VecLenf(co1,seam->v0);
+ // cur_len=len_v3v3(co1,seam->v0);
// }
// else if(inp>1.0f){
- // cur_len=VecLenf(co1,seam->v1);
+ // cur_len=len_v3v3(co1,seam->v1);
// }
// else{
- // VecCopyf(temp2,seam->dir);
- // VecMulf(temp2,inp);
- // cur_len=VecLenf(temp,temp2);
+ // copy_v3_v3(temp2,seam->dir);
+ // mul_v3_fl(temp2,inp);
+ // cur_len=len_v3v3(temp,temp2);
// }
// if(cur_lenseams+min_seam;
//
- // VecCopyf(temp,seam->v0);
+ // copy_v3_v3(temp,seam->v0);
//
// if(near_vert){
// if(near_vert==-1)
- // VecSubf(tan,co1,seam->v0);
+ // sub_v3_v3v3(tan,co1,seam->v0);
// else{
- // VecSubf(tan,co1,seam->v1);
- // VecCopyf(temp,seam->v1);
+ // sub_v3_v3v3(tan,co1,seam->v1);
+ // copy_v3_v3(temp,seam->v1);
// }
- // Normalize(tan);
+ // normalize_v3(tan);
// }
// else{
- // VecCopyf(tan,seam->tan);
- // VecSubf(temp2,co1,temp);
- // if(Inpf(tan,temp2)<0.0f)
- // VecNegf(tan);
+ // copy_v3_v3(tan,seam->tan);
+ // sub_v3_v3v3(temp2,co1,temp);
+ // if(dot_v3v3(tan,temp2)<0.0f)
+ // negate_v3(tan);
// }
// for(w=0; wflag&ME_SEAM){
- // VecCopyf(cur_seam->v0,(mvert+ed->v1)->co);
- // VecCopyf(cur_seam->v1,(mvert+ed->v2)->co);
+ // copy_v3_v3(cur_seam->v0,(mvert+ed->v1)->co);
+ // copy_v3_v3(cur_seam->v1,(mvert+ed->v2)->co);
- // VecSubf(cur_seam->dir,cur_seam->v1,cur_seam->v0);
+ // sub_v3_v3v3(cur_seam->dir,cur_seam->v1,cur_seam->v0);
- // cur_seam->length2=VecLength(cur_seam->dir);
+ // cur_seam->length2=len_v3(cur_seam->dir);
// cur_seam->length2*=cur_seam->length2;
// temp[0]=(float)((mvert+ed->v1)->no[0]);
@@ -1004,12 +1004,12 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
// temp2[1]=(float)((mvert+ed->v2)->no[1]);
// temp2[2]=(float)((mvert+ed->v2)->no[2]);
- // VecAddf(cur_seam->nor,temp,temp2);
- // Normalize(cur_seam->nor);
+ // add_v3_v3v3(cur_seam->nor,temp,temp2);
+ // normalize_v3(cur_seam->nor);
- // Crossf(cur_seam->tan,cur_seam->dir,cur_seam->nor);
+ // cross_v3_v3v3(cur_seam->tan,cur_seam->dir,cur_seam->nor);
- // Normalize(cur_seam->tan);
+ // normalize_v3(cur_seam->tan);
// cur_seam++;
// }
@@ -1035,7 +1035,7 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
cpa->fuv[0]=2.0f*BLI_frand()-1.0f;
cpa->fuv[1]=2.0f*BLI_frand()-1.0f;
cpa->fuv[2]=2.0f*BLI_frand()-1.0f;
- length=VecLength(cpa->fuv);
+ length=len_v3(cpa->fuv);
}
cpa->num=-1;
@@ -1176,10 +1176,10 @@ static int psys_threads_init_distribution(ParticleThread *threads, Scene *scene,
v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
VECCOPY(co4, v4->co);
}
- cur= AreaQ3Dfl(co1, co2, co3, co4);
+ cur= area_quad_v3(co1, co2, co3, co4);
}
else
- cur= AreaT3Dfl(co1, co2, co3);
+ cur= area_tri_v3(co1, co2, co3);
if(cur>maxweight)
maxweight=cur;
@@ -1682,7 +1682,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
r_rot[1] = 2.0f * (PSYS_FRAND(p + 17) - 0.5f);
r_rot[2] = 2.0f * (PSYS_FRAND(p + 18) - 0.5f);
r_rot[3] = 2.0f * (PSYS_FRAND(p + 19) - 0.5f);
- NormalQuat(r_rot);
+ normalize_qt(r_rot);
r_phase = PSYS_FRAND(p + 20);
@@ -1699,15 +1699,15 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
psys_get_particle_state(&tsim, pa->num, &state, 1);
psys_get_from_key(&state, loc, nor, rot, 0);
- QuatMulVecf(rot, vtan);
- QuatMulVecf(rot, utan);
+ mul_qt_v3(rot, vtan);
+ mul_qt_v3(rot, utan);
VECCOPY(p_vel, state.vel);
- speed=Normalize(p_vel);
- VecMulf(p_vel, Inpf(r_vel, p_vel));
+ speed=normalize_v3(p_vel);
+ mul_v3_fl(p_vel, dot_v3v3(r_vel, p_vel));
VECSUB(p_vel, r_vel, p_vel);
- Normalize(p_vel);
- VecMulf(p_vel, speed);
+ normalize_v3(p_vel);
+ mul_v3_fl(p_vel, speed);
VECCOPY(pa->fuv, loc); /* abusing pa->fuv (not used for "from particle") for storing emit location */
}
@@ -1731,46 +1731,46 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* particles live in global space so */
/* let's convert: */
/* -location */
- Mat4MulVecfl(ob->obmat,loc);
+ mul_m4_v3(ob->obmat,loc);
/* -normal */
- Mat4Mul3Vecfl(ob->obmat,nor);
- Normalize(nor);
+ mul_mat3_m4_v3(ob->obmat,nor);
+ normalize_v3(nor);
/* -tangent */
if(part->tanfac!=0.0){
//float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f;
float phase=0.0f;
- VecMulf(vtan,-(float)cos(M_PI*(part->tanphase+phase)));
+ mul_v3_fl(vtan,-(float)cos(M_PI*(part->tanphase+phase)));
fac=-(float)sin(M_PI*(part->tanphase+phase));
VECADDFAC(vtan,vtan,utan,fac);
- Mat4Mul3Vecfl(ob->obmat,vtan);
+ mul_mat3_m4_v3(ob->obmat,vtan);
VECCOPY(utan,nor);
- VecMulf(utan,Inpf(vtan,nor));
+ mul_v3_fl(utan,dot_v3v3(vtan,nor));
VECSUB(vtan,vtan,utan);
- Normalize(vtan);
+ normalize_v3(vtan);
}
/* -velocity */
if(part->randfac!=0.0){
- Mat4Mul3Vecfl(ob->obmat,r_vel);
- Normalize(r_vel);
+ mul_mat3_m4_v3(ob->obmat,r_vel);
+ normalize_v3(r_vel);
}
/* -angular velocity */
if(part->avemode==PART_AVE_RAND){
- Mat4Mul3Vecfl(ob->obmat,r_ave);
- Normalize(r_ave);
+ mul_mat3_m4_v3(ob->obmat,r_ave);
+ normalize_v3(r_ave);
}
/* -rotation */
if(part->randrotfac != 0.0f){
- Mat4ToQuat(ob->obmat,rot);
- QuatMul(r_rot,r_rot,rot);
+ mat4_to_quat(rot,ob->obmat);
+ mul_qt_qtqt(r_rot,r_rot,rot);
}
}
@@ -1785,8 +1785,8 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* boids store direction in ave */
if(fabs(nor[2])==1.0f) {
- VecSubf(pa->state.ave, loc, ob->obmat[3]);
- Normalize(pa->state.ave);
+ sub_v3_v3v3(pa->state.ave, loc, ob->obmat[3]);
+ normalize_v3(pa->state.ave);
}
else {
VECCOPY(pa->state.ave, nor);
@@ -1799,17 +1799,17 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
/* calculate rotation matrix */
- Projf(dvec, r_vel, pa->state.ave);
- VecSubf(mat[0], pa->state.ave, dvec);
- Normalize(mat[0]);
+ project_v3_v3v3(dvec, r_vel, pa->state.ave);
+ sub_v3_v3v3(mat[0], pa->state.ave, dvec);
+ normalize_v3(mat[0]);
VECCOPY(mat[2], r_vel);
- VecMulf(mat[2], -1.0f);
- Normalize(mat[2]);
- Crossf(mat[1], mat[2], mat[0]);
+ mul_v3_fl(mat[2], -1.0f);
+ normalize_v3(mat[2]);
+ cross_v3_v3v3(mat[1], mat[2], mat[0]);
/* apply rotation */
- Mat3ToQuat_is_ok(mat, q);
- QuatCopy(pa->state.rot, q);
+ mat3_to_quat_is_ok( q,mat);
+ copy_qt_qt(pa->state.rot, q);
bpa->data.health = part->boids->health;
bpa->data.mode = eBoidMode_InAir;
@@ -1828,7 +1828,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* *emitter velocity */
if(dtime!=0.0 && part->obfac!=0.0){
VECSUB(vel,loc,pa->state.co);
- VecMulf(vel,part->obfac/dtime);
+ mul_v3_fl(vel,part->obfac/dtime);
}
/* *emitter normal */
@@ -1843,17 +1843,17 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* *emitter object orientation */
if(part->ob_vel[0]!=0.0) {
VECCOPY(vec, ob->obmat[0]);
- Normalize(vec);
+ normalize_v3(vec);
VECADDFAC(vel, vel, vec, part->ob_vel[0]);
}
if(part->ob_vel[1]!=0.0) {
VECCOPY(vec, ob->obmat[1]);
- Normalize(vec);
+ normalize_v3(vec);
VECADDFAC(vel, vel, vec, part->ob_vel[1]);
}
if(part->ob_vel[2]!=0.0) {
VECCOPY(vec, ob->obmat[2]);
- Normalize(vec);
+ normalize_v3(vec);
VECADDFAC(vel, vel, vec, part->ob_vel[2]);
}
@@ -1874,7 +1874,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
// ptex.ivel*=icu->curval;
//}
- VecMulf(vel,ptex.ivel);
+ mul_v3_fl(vel,ptex.ivel);
VECCOPY(pa->state.vel,vel);
@@ -1889,10 +1889,10 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
/* create vector into which rotation is aligned */
switch(part->rotmode){
case PART_ROT_NOR:
- VecCopyf(rot_vec, nor);
+ copy_v3_v3(rot_vec, nor);
break;
case PART_ROT_VEL:
- VecCopyf(rot_vec, vel);
+ copy_v3_v3(rot_vec, vel);
break;
case PART_ROT_GLOB_X:
case PART_ROT_GLOB_Y:
@@ -1902,28 +1902,28 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
case PART_ROT_OB_X:
case PART_ROT_OB_Y:
case PART_ROT_OB_Z:
- VecCopyf(rot_vec, ob->obmat[part->rotmode - PART_ROT_OB_X]);
+ copy_v3_v3(rot_vec, ob->obmat[part->rotmode - PART_ROT_OB_X]);
break;
}
/* create rotation quat */
- VecNegf(rot_vec);
- vectoquat(rot_vec, OB_POSX, OB_POSZ, q2);
+ negate_v3(rot_vec);
+ vec_to_quat( q2,rot_vec, OB_POSX, OB_POSZ);
/* randomize rotation quat */
if(part->randrotfac!=0.0f)
- QuatInterpol(rot, q2, r_rot, part->randrotfac);
+ interp_qt_qtqt(rot, q2, r_rot, part->randrotfac);
else
- QuatCopy(rot,q2);
+ copy_qt_qt(rot,q2);
/* rotation phase */
phasefac = part->phasefac;
if(part->randphasefac != 0.0f)
phasefac += part->randphasefac * r_phase;
- VecRotToQuat(x_vec, phasefac*(float)M_PI, q_phase);
+ axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
/* combine base rotation & phase */
- QuatMul(pa->state.rot, rot, q_phase);
+ mul_qt_qtqt(pa->state.rot, rot, q_phase);
}
/* -angular velocity */
@@ -1939,13 +1939,13 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
VECCOPY(pa->state.ave,r_ave);
break;
}
- Normalize(pa->state.ave);
- VecMulf(pa->state.ave,part->avefac);
+ normalize_v3(pa->state.ave);
+ mul_v3_fl(pa->state.ave,part->avefac);
//icu=find_ipocurve(psys->part->ipo,PART_EMIT_AVE);
//if(icu){
// calc_icu(icu,100*((pa->time-part->sta)/(part->end-part->sta)));
- // VecMulf(pa->state.ave,icu->curval);
+ // mul_v3_fl(pa->state.ave,icu->curval);
//}
}
}
@@ -2157,7 +2157,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
// }
// }
// else{
-// dist=VecLenf(pa->state.co, re->state.co);
+// dist=len_v3v3(pa->state.co, re->state.co);
// if(dist <= re->size){
// if(pa->alive==PARS_UNBORN){
// pa->time=re->time;
@@ -2168,12 +2168,12 @@ static void set_keyed_keys(ParticleSimulationData *sim)
// float vec[3];
// VECSUB(vec,pa->state.co, re->state.co);
// if(birth==0)
-// VecMulf(vec,(float)pow(1.0f-dist/re->size,part->reactshape));
+// mul_v3_fl(vec,(float)pow(1.0f-dist/re->size,part->reactshape));
// VECADDFAC(pa->state.vel,pa->state.vel,vec,part->reactfac);
// VECADDFAC(pa->state.vel,pa->state.vel,re->state.vel,part->partfac);
// }
// if(birth)
-// VecMulf(pa->state.vel,(float)pow(1.0f-dist/re->size,part->reactshape));
+// mul_v3_fl(pa->state.vel,(float)pow(1.0f-dist/re->size,part->reactshape));
// }
// }
// }
@@ -2287,6 +2287,9 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
case PART_INT_RK4:
steps=4;
break;
+ case PART_INT_VERLET:
+ steps=1;
+ break;
}
copy_particle_key(states,&pa->state,1);
@@ -2301,7 +2304,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
/* calculate air-particle interaction */
if(part->dragfac!=0.0f){
- fac=-part->dragfac*pa->size*pa->size*VecLength(states[i].vel);
+ fac=-part->dragfac*pa->size*pa->size*len_v3(states[i].vel);
VECADDFAC(force,force,states[i].vel,fac);
}
@@ -2313,7 +2316,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
}
/* force to acceleration*/
- VecMulf(force,1.0f/pa_mass);
+ mul_v3_fl(force,1.0f/pa_mass);
/* add global acceleration (gravitation) */
if(sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY
@@ -2321,7 +2324,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
&& (part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)) {
float gravity[3];
VECCOPY(gravity, sim->scene->physics_settings.gravity);
- VecMulf(gravity, part->effector_weights->global_gravity);
+ mul_v3_fl(gravity, part->effector_weights->global_gravity);
VECADD(force,force,gravity);
}
@@ -2348,9 +2351,9 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
switch(i){
case 0:
VECCOPY(dx[0],states->vel);
- VecMulf(dx[0],dtime);
+ mul_v3_fl(dx[0],dtime);
VECCOPY(dv[0],force);
- VecMulf(dv[0],dtime);
+ mul_v3_fl(dv[0],dtime);
VECADDFAC(states[1].co,states->co,dx[0],0.5f);
VECADDFAC(states[1].vel,states->vel,dv[0],0.5f);
@@ -2358,18 +2361,18 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
break;
case 1:
VECADDFAC(dx[1],states->vel,dv[0],0.5f);
- VecMulf(dx[1],dtime);
+ mul_v3_fl(dx[1],dtime);
VECCOPY(dv[1],force);
- VecMulf(dv[1],dtime);
+ mul_v3_fl(dv[1],dtime);
VECADDFAC(states[2].co,states->co,dx[1],0.5f);
VECADDFAC(states[2].vel,states->vel,dv[1],0.5f);
break;
case 2:
VECADDFAC(dx[2],states->vel,dv[1],0.5f);
- VecMulf(dx[2],dtime);
+ mul_v3_fl(dx[2],dtime);
VECCOPY(dv[2],force);
- VecMulf(dv[2],dtime);
+ mul_v3_fl(dv[2],dtime);
VECADD(states[3].co,states->co,dx[2]);
VECADD(states[3].vel,states->vel,dv[2]);
@@ -2377,9 +2380,9 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
break;
case 3:
VECADD(dx[3],states->vel,dv[2]);
- VecMulf(dx[3],dtime);
+ mul_v3_fl(dx[3],dtime);
VECCOPY(dv[3],force);
- VecMulf(dv[3],dtime);
+ mul_v3_fl(dv[3],dtime);
VECADDFAC(pa->state.co,states->co,dx[0],1.0f/6.0f);
VECADDFAC(pa->state.co,pa->state.co,dx[1],1.0f/3.0f);
@@ -2392,12 +2395,19 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
VECADDFAC(pa->state.vel,pa->state.vel,dv[3],1.0f/6.0f);
}
break;
+ case PART_INT_VERLET: /* Verlet integration */
+ VECADDFAC(pa->state.vel,pa->state.vel,force,dtime);
+ VECADDFAC(pa->state.co,pa->state.co,pa->state.vel,dtime);
+
+ VECSUB(pa->state.vel,pa->state.co,pa->prev_state.co);
+ mul_v3_fl(pa->state.vel,1.0f/dtime);
+ break;
}
}
/* damp affects final velocity */
if(part->dampfac!=0.0)
- VecMulf(pa->state.vel,1.0f-part->dampfac);
+ mul_v3_fl(pa->state.vel,1.0f-part->dampfac);
VECCOPY(pa->state.ave, states->ave);
@@ -2414,7 +2424,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra
VECCOPY(pa->state.co,tkey.co);
/* guides don't produce valid velocity */
VECSUB(pa->state.vel,tkey.co,pa->prev_state.co);
- VecMulf(pa->state.vel,1.0f/dtime);
+ mul_v3_fl(pa->state.vel,1.0f/dtime);
pa->state.time=tkey.time;
}
}
@@ -2426,35 +2436,35 @@ static void rotate_particle(ParticleSettings *part, ParticleData *pa, float dfra
if((part->flag & PART_ROT_DYN)==0){
if(part->avemode==PART_AVE_SPIN){
float angle;
- float len1 = VecLength(pa->prev_state.vel);
- float len2 = VecLength(pa->state.vel);
+ float len1 = len_v3(pa->prev_state.vel);
+ float len2 = len_v3(pa->state.vel);
if(len1==0.0f || len2==0.0f)
pa->state.ave[0]=pa->state.ave[1]=pa->state.ave[2]=0.0f;
else{
- Crossf(pa->state.ave,pa->prev_state.vel,pa->state.vel);
- Normalize(pa->state.ave);
- angle=Inpf(pa->prev_state.vel,pa->state.vel)/(len1*len2);
- VecMulf(pa->state.ave,saacos(angle)/dtime);
+ cross_v3_v3v3(pa->state.ave,pa->prev_state.vel,pa->state.vel);
+ normalize_v3(pa->state.ave);
+ angle=dot_v3v3(pa->prev_state.vel,pa->state.vel)/(len1*len2);
+ mul_v3_fl(pa->state.ave,saacos(angle)/dtime);
}
- VecRotToQuat(pa->state.vel,dtime*part->avefac,rot2);
+ axis_angle_to_quat(rot2,pa->state.vel,dtime*part->avefac);
}
}
- rotfac=VecLength(pa->state.ave);
- if(rotfac==0.0){ /* QuatOne (in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
+ rotfac=len_v3(pa->state.ave);
+ if(rotfac==0.0){ /* unit_qt(in VecRotToQuat) doesn't give unit quat [1,0,0,0]?? */
rot1[0]=1.0;
rot1[1]=rot1[2]=rot1[3]=0;
}
else{
- VecRotToQuat(pa->state.ave,rotfac*dtime,rot1);
+ axis_angle_to_quat(rot1,pa->state.ave,rotfac*dtime);
}
- QuatMul(pa->state.rot,rot1,pa->prev_state.rot);
- QuatMul(pa->state.rot,rot2,pa->state.rot);
+ mul_qt_qtqt(pa->state.rot,rot1,pa->prev_state.rot);
+ mul_qt_qtqt(pa->state.rot,rot2,pa->state.rot);
/* keep rotation quat in good health */
- NormalQuat(pa->state.rot);
+ normalize_qt(pa->state.rot);
}
/* convert from triangle barycentric weights to quad mean value weights */
@@ -2471,7 +2481,7 @@ static void intersect_dm_quad_weights(float *v1, float *v2, float *v3, float *v4
co[1]= v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
co[2]= v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
- MeanValueWeights(vert, 4, co, w);
+ interp_weights_poly_v3( w,vert, 4, co);
}
/* check intersection with a derivedmesh */
@@ -2537,18 +2547,18 @@ int psys_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, float *vert_cos
DO_MINMAX(v3,min,max);
if(mface->v4)
DO_MINMAX(v4,min,max)
- if(AabbIntersectAabb(min,max,p_min,p_max)==0)
+ if(isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
continue;
}
else{
VECCOPY(min, face_minmax+6*i);
VECCOPY(max, face_minmax+6*i+3);
- if(AabbIntersectAabb(min,max,p_min,p_max)==0)
+ if(isect_aabb_aabb_v3(min,max,p_min,p_max)==0)
continue;
}
if(radius>0.0f){
- if(SweepingSphereIntersectsTriangleUV(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)){
+ if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)){
if(cur_d<*min_d){
*min_d=cur_d;
VECCOPY(ipoint,cur_ipoint);
@@ -2557,7 +2567,7 @@ int psys_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, float *vert_cos
}
}
if(mface->v4){
- if(SweepingSphereIntersectsTriangleUV(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)){
+ if(isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)){
if(cur_d<*min_d){
*min_d=cur_d;
VECCOPY(ipoint,cur_ipoint);
@@ -2568,7 +2578,7 @@ int psys_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, float *vert_cos
}
}
else{
- if(LineIntersectsTriangle(co1, co2, v1, v2, v3, &cur_d, cur_uv)){
+ if(isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)){
if(cur_d<*min_d){
*min_d=cur_d;
min_w[0]= 1.0 - cur_uv[0] - cur_uv[1];
@@ -2582,7 +2592,7 @@ int psys_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, float *vert_cos
}
}
if(mface->v4){
- if(LineIntersectsTriangle(co1, co2, v1, v3, v4, &cur_d, cur_uv)){
+ if(isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)){
if(cur_d<*min_d){
*min_d=cur_d;
min_w[0]= 1.0 - cur_uv[0] - cur_uv[1];
@@ -2618,7 +2628,7 @@ void particle_intersect_face(void *userdata, int index, const BVHTreeRay *ray, B
VECCOPY(vel, v[ face->v1 ].co);
VECADD(vel, vel, v[ face->v2 ].co);
VECADD(vel, vel, v[ face->v3 ].co);
- VecMulf(vel, 0.33334f);
+ mul_v3_fl(vel, 0.33334f);
/* substract face velocity, in other words convert to
a coordinate system where only the particle moves */
@@ -2628,16 +2638,16 @@ void particle_intersect_face(void *userdata, int index, const BVHTreeRay *ray, B
do
{
if(ray->radius == 0.0f) {
- if(LineIntersectsTriangle(co1, co2, t0, t1, t2, &t, uv)) {
+ if(isect_line_tri_v3(co1, co2, t0, t1, t2, &t, uv)) {
if(t >= 0.0f && t < hit->dist/col->ray_len) {
hit->dist = col->ray_len * t;
hit->index = index;
/* calculate normal that's facing the particle */
- CalcNormFloat(t0, t1, t2, col->nor);
+ normal_tri_v3( col->nor,t0, t1, t2);
VECSUB(temp, co2, co1);
- if(Inpf(col->nor, temp) > 0.0f)
- VecNegf(col->nor);
+ if(dot_v3v3(col->nor, temp) > 0.0f)
+ negate_v3(col->nor);
VECCOPY(col->vel,vel);
@@ -2647,15 +2657,15 @@ void particle_intersect_face(void *userdata, int index, const BVHTreeRay *ray, B
}
}
else {
- if(SweepingSphereIntersectsTriangleUV(co1, co2, ray->radius, t0, t1, t2, &t, ipoint)) {
+ if(isect_sweeping_sphere_tri_v3(co1, co2, ray->radius, t0, t1, t2, &t, ipoint)) {
if(t >=0.0f && t < hit->dist/col->ray_len) {
hit->dist = col->ray_len * t;
hit->index = index;
- VecLerpf(temp, co1, co2, t);
+ interp_v3_v3v3(temp, co1, co2, t);
VECSUB(col->nor, temp, ipoint);
- Normalize(col->nor);
+ normalize_v3(col->nor);
VECCOPY(col->vel,vel);
@@ -2706,7 +2716,7 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
VECSUB(ray_dir, col.co2, col.co1);
hit.index = -1;
- hit.dist = col.ray_len = VecLength(ray_dir);
+ hit.dist = col.ray_len = len_v3(ray_dir);
/* even if particle is stationary we want to check for moving colliders */
/* if hit.dist is zero the bvhtree_ray_cast will just ignore everything */
@@ -2738,10 +2748,10 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
float t = hit.dist/col.ray_len; /* time of collision between this iteration */
float dt = col.t + t * (1.0f - col.t); /* time of collision between frame change*/
- VecLerpf(co, col.co1, col.co2, t);
+ interp_v3_v3v3(co, col.co1, col.co2, t);
VECSUB(vec, col.co2, col.co1);
- VecMulf(col.vel, 1.0f-col.t);
+ mul_v3_fl(col.vel, 1.0f-col.t);
/* particle dies in collision */
if(through == 0 && (part->flag & PART_DIE_ON_COL || pd->flag & PDEFLE_KILL_PART)) {
@@ -2752,9 +2762,9 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
VECADDFAC(co, co, col.nor, (through ? -0.0001f : 0.0001f));
VECCOPY(pa->state.co, co);
- VecLerpf(pa->state.vel, pa->prev_state.vel, pa->state.vel, dt);
- QuatInterpol(pa->state.rot, pa->prev_state.rot, pa->state.rot, dt);
- VecLerpf(pa->state.ave, pa->prev_state.ave, pa->state.ave, dt);
+ interp_v3_v3v3(pa->state.vel, pa->prev_state.vel, pa->state.vel, dt);
+ interp_qt_qtqt(pa->state.rot, pa->prev_state.rot, pa->state.rot, dt);
+ interp_v3_v3v3(pa->state.ave, pa->prev_state.ave, pa->state.ave, dt);
/* particle is dead so we don't need to calculate further */
deflections=max_deflections;
@@ -2772,13 +2782,13 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
CLAMP(frict,0.0,1.0);
/* treat normal & tangent components separately */
- inp = Inpf(col.nor, vec);
- inp_v = Inpf(col.nor, col.vel);
+ inp = dot_v3v3(col.nor, vec);
+ inp_v = dot_v3v3(col.nor, col.vel);
VECADDFAC(tan_vec, vec, col.nor, -inp);
VECADDFAC(tan_vel, col.vel, col.nor, -inp_v);
if((part->flag & PART_ROT_DYN)==0)
- VecLerpf(tan_vec, tan_vec, tan_vel, frict);
+ interp_v3_v3v3(tan_vec, tan_vec, tan_vel, frict);
VECCOPY(nor_vec, col.nor);
inp *= 1.0f - damp;
@@ -2788,9 +2798,9 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
/* special case for object hitting the particle from behind */
if(through==0 && ((inp_v>0 && inp>0 && inp_v>inp) || (inp_v<0 && inp<0 && inp_v linear velocity - slightly more physical and looks even nicer than before */
if(part->flag & PART_ROT_DYN) {
@@ -2800,37 +2810,37 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
VECSUB(surface_vel, tan_vec, tan_vel);
/* direction of rolling friction */
- Crossf(rot_vel, pa->state.ave, col.nor);
+ cross_v3_v3v3(rot_vel, pa->state.ave, col.nor);
/* convert to current dt */
- VecMulf(rot_vel, (timestep*dfra) * (1.0f - col.t));
- VecMulf(rot_vel, pa->size);
+ mul_v3_fl(rot_vel, (timestep*dfra) * (1.0f - col.t));
+ mul_v3_fl(rot_vel, pa->size);
/* apply sliding friction */
VECSUB(surface_vel, surface_vel, rot_vel);
VECCOPY(friction, surface_vel);
- VecMulf(surface_vel, 1.0 - frict);
- VecMulf(friction, frict);
+ mul_v3_fl(surface_vel, 1.0 - frict);
+ mul_v3_fl(friction, frict);
/* sliding changes angular velocity */
- Crossf(dave, col.nor, friction);
- VecMulf(dave, 1.0f/MAX2(pa->size, 0.001));
+ cross_v3_v3v3(dave, col.nor, friction);
+ mul_v3_fl(dave, 1.0f/MAX2(pa->size, 0.001));
/* we assume rolling friction is around 0.01 of sliding friction */
- VecMulf(rot_vel, 1.0 - frict*0.01);
+ mul_v3_fl(rot_vel, 1.0 - frict*0.01);
/* change in angular velocity has to be added to the linear velocity too */
- Crossf(dvel, dave, col.nor);
- VecMulf(dvel, pa->size);
+ cross_v3_v3v3(dvel, dave, col.nor);
+ mul_v3_fl(dvel, pa->size);
VECADD(rot_vel, rot_vel, dvel);
VECADD(surface_vel, surface_vel, rot_vel);
VECADD(tan_vec, surface_vel, tan_vel);
/* convert back to normal time */
- VecMulf(dave, 1.0f/MAX2((timestep*dfra) * (1.0f - col.t), 0.00001));
+ mul_v3_fl(dave, 1.0f/MAX2((timestep*dfra) * (1.0f - col.t), 0.00001));
- VecMulf(pa->state.ave, 1.0 - frict*0.01);
+ mul_v3_fl(pa->state.ave, 1.0 - frict*0.01);
VECADD(pa->state.ave, pa->state.ave, dave);
}
@@ -2839,7 +2849,7 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
/* calculate velocity from collision vector */
VECCOPY(vel, vec);
- VecMulf(vel, 1.0f/MAX2((timestep*dfra) * (1.0f - col.t), 0.00001));
+ mul_v3_fl(vel, 1.0f/MAX2((timestep*dfra) * (1.0f - col.t), 0.00001));
/* make sure we don't hit the current face again */
VECADDFAC(co, co, col.nor, (through ? -0.0001f : 0.0001f));
@@ -2854,15 +2864,15 @@ static void deflect_particle(ParticleSimulationData *sim, int p, float dfra, flo
/* store state for reactors */
//VECCOPY(reaction_state.co, co);
- //VecLerpf(reaction_state.vel, pa->prev_state.vel, pa->state.vel, dt);
- //QuatInterpol(reaction_state.rot, pa->prev_state.rot, pa->state.rot, dt);
+ //interp_v3_v3v3(reaction_state.vel, pa->prev_state.vel, pa->state.vel, dt);
+ //interp_qt_qtqt(reaction_state.rot, pa->prev_state.rot, pa->state.rot, dt);
/* set coordinates for next iteration */
VECCOPY(col.co1, co);
VECADDFAC(col.co2, co, vec, 1.0f - t);
col.t = dt;
- if(VecLength(vec) < 0.001 && VecLength(pa->state.vel) < 0.001) {
+ if(len_v3(vec) < 0.001 && len_v3(pa->state.vel) < 0.001) {
/* kill speed to stop slipping */
VECCOPY(pa->state.vel,zerovec);
VECCOPY(pa->state.co, co);
@@ -3011,7 +3021,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
VECSUB(temp, key->co, (key+1)->co);
VECCOPY(mvert->co, key->co);
VECADD(mvert->co, mvert->co, temp);
- Mat4MulVecfl(hairmat, mvert->co);
+ mul_m4_v3(hairmat, mvert->co);
mvert++;
medge->v1 = pa->hair_index - 1;
@@ -3030,7 +3040,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
}
VECCOPY(mvert->co, key->co);
- Mat4MulVecfl(hairmat, mvert->co);
+ mul_m4_v3(hairmat, mvert->co);
mvert++;
if(k) {
@@ -3105,7 +3115,7 @@ static void save_hair(ParticleSimulationData *sim, float cfra){
PARTICLE_P;
int totpart;
- Mat4Invert(ob->imat, ob->obmat);
+ invert_m4_m4(ob->imat, ob->obmat);
psys->lattice= psys_get_lattice(sim);
@@ -3125,8 +3135,8 @@ static void save_hair(ParticleSimulationData *sim, float cfra){
key += pa->totkey;
/* convert from global to geometry space */
- VecCopyf(key->co, pa->state.co);
- Mat4MulVecfl(ob->imat, key->co);
+ copy_v3_v3(key->co, pa->state.co);
+ mul_m4_v3(ob->imat, key->co);
if(pa->totkey) {
VECSUB(key->co, key->co, root->co);
@@ -3941,6 +3951,6 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
system_step(&sim, cfra);
/* save matrix for duplicators */
- Mat4Invert(psys->imat, ob->obmat);
+ invert_m4_m4(psys->imat, ob->obmat);
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 68f0e33a98f..c2798b4a746 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -170,12 +170,12 @@ static void ptcache_interpolate_softbody(int index, void *soft_v, void **data, f
dfra = cfra2 - cfra1;
- VecMulf(keys[1].vel, dfra);
- VecMulf(keys[2].vel, dfra);
+ mul_v3_fl(keys[1].vel, dfra);
+ mul_v3_fl(keys[2].vel, dfra);
psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
- VecMulf(keys->vel, 1.0f / dfra);
+ mul_v3_fl(keys->vel, 1.0f / dfra);
VECCOPY(bp->pos, keys->co);
VECCOPY(bp->vec, keys->vel);
@@ -255,18 +255,18 @@ static void ptcache_read_particle(int index, void *psys_v, void **data, float fr
/* determine velocity from previous location */
if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
if(cfra > pa->prev_state.time) {
- VecSubf(pa->state.vel, pa->state.co, pa->prev_state.co);
- VecMulf(pa->state.vel, (cfra - pa->prev_state.time) / frs_sec);
+ sub_v3_v3v3(pa->state.vel, pa->state.co, pa->prev_state.co);
+ mul_v3_fl(pa->state.vel, (cfra - pa->prev_state.time) / frs_sec);
}
else {
- VecSubf(pa->state.vel, pa->prev_state.co, pa->state.co);
- VecMulf(pa->state.vel, (pa->prev_state.time - cfra) / frs_sec);
+ sub_v3_v3v3(pa->state.vel, pa->prev_state.co, pa->state.co);
+ mul_v3_fl(pa->state.vel, (pa->prev_state.time - cfra) / frs_sec);
}
}
/* determine rotation from velocity */
if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
- vectoquat(pa->state.vel, OB_NEGX, OB_POSZ, pa->state.rot);
+ vec_to_quat( pa->state.rot,pa->state.vel, OB_NEGX, OB_POSZ);
}
}
static void ptcache_interpolate_particle(int index, void *psys_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data)
@@ -292,18 +292,18 @@ static void ptcache_interpolate_particle(int index, void *psys_v, void **data, f
/* determine velocity from previous location */
if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
if(keys[1].time > keys[2].time) {
- VecSubf(keys[2].vel, keys[1].co, keys[2].co);
- VecMulf(keys[2].vel, (keys[1].time - keys[2].time) / frs_sec);
+ sub_v3_v3v3(keys[2].vel, keys[1].co, keys[2].co);
+ mul_v3_fl(keys[2].vel, (keys[1].time - keys[2].time) / frs_sec);
}
else {
- VecSubf(keys[2].vel, keys[2].co, keys[1].co);
- VecMulf(keys[2].vel, (keys[2].time - keys[1].time) / frs_sec);
+ sub_v3_v3v3(keys[2].vel, keys[2].co, keys[1].co);
+ mul_v3_fl(keys[2].vel, (keys[2].time - keys[1].time) / frs_sec);
}
}
/* determine rotation from velocity */
if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
- vectoquat(keys[2].vel, OB_NEGX, OB_POSZ, keys[2].rot);
+ vec_to_quat( keys[2].rot,keys[2].vel, OB_NEGX, OB_POSZ);
}
if(cfra > pa->time)
@@ -311,13 +311,13 @@ static void ptcache_interpolate_particle(int index, void *psys_v, void **data, f
dfra = cfra2 - cfra1;
- VecMulf(keys[1].vel, dfra / frs_sec);
- VecMulf(keys[2].vel, dfra / frs_sec);
+ mul_v3_fl(keys[1].vel, dfra / frs_sec);
+ mul_v3_fl(keys[2].vel, dfra / frs_sec);
psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1);
- QuatInterpol(pa->state.rot, keys[1].rot, keys[2].rot, (cfra - cfra1) / dfra);
+ interp_qt_qtqt(pa->state.rot, keys[1].rot, keys[2].rot, (cfra - cfra1) / dfra);
- VecMulf(pa->state.vel, frs_sec / dfra);
+ mul_v3_fl(pa->state.vel, frs_sec / dfra);
pa->state.time = cfra;
}
@@ -425,18 +425,18 @@ static int ptcache_totwrite_particle(void *psys_v)
// /* determine velocity from previous location */
// if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) {
// if(cfra > pa->prev_state.time) {
-// VecSubf(pa->state.vel, pa->state.co, pa->prev_state.co);
-// VecMulf(pa->state.vel, (cfra - pa->prev_state.time) / frs_sec);
+// sub_v3_v3v3(pa->state.vel, pa->state.co, pa->prev_state.co);
+// mul_v3_fl(pa->state.vel, (cfra - pa->prev_state.time) / frs_sec);
// }
// else {
-// VecSubf(pa->state.vel, pa->prev_state.co, pa->state.co);
-// VecMulf(pa->state.vel, (pa->prev_state.time - cfra) / frs_sec);
+// sub_v3_v3v3(pa->state.vel, pa->prev_state.co, pa->state.co);
+// mul_v3_fl(pa->state.vel, (pa->prev_state.time - cfra) / frs_sec);
// }
// }
//
// /* determine rotation from velocity */
// if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_ROTATION]) {
-// vectoquat(pa->state.vel, OB_POSX, OB_POSZ, pa->state.rot);
+// vec_to_quat( pa->state.rot,pa->state.vel, OB_POSX, OB_POSZ);
// }
//}
//static void ptcache_interpolate_particle_stream(int index, void *psys_v, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data)
@@ -461,13 +461,13 @@ static int ptcache_totwrite_particle(void *psys_v)
//
// dfra = cfra2 - cfra1;
//
-// VecMulf(keys[1].vel, dfra / frs_sec);
-// VecMulf(keys[2].vel, dfra / frs_sec);
+// mul_v3_fl(keys[1].vel, dfra / frs_sec);
+// mul_v3_fl(keys[2].vel, dfra / frs_sec);
//
// psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1);
-// QuatInterpol(pa->state.rot, keys[1].rot,keys[2].rot, (cfra - cfra1) / dfra);
+// interp_qt_qtqt(pa->state.rot, keys[1].rot,keys[2].rot, (cfra - cfra1) / dfra);
//
-// VecMulf(pa->state.vel, frs_sec / dfra);
+// mul_v3_fl(pa->state.vel, frs_sec / dfra);
//
// pa->state.time = cfra;
//}
@@ -525,12 +525,12 @@ static void ptcache_interpolate_cloth(int index, void *cloth_v, void **data, flo
dfra = cfra2 - cfra1;
- VecMulf(keys[1].vel, dfra);
- VecMulf(keys[2].vel, dfra);
+ mul_v3_fl(keys[1].vel, dfra);
+ mul_v3_fl(keys[2].vel, dfra);
psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1);
- VecMulf(keys->vel, 1.0f / dfra);
+ mul_v3_fl(keys->vel, 1.0f / dfra);
VECCOPY(vert->x, keys->co);
VECCOPY(vert->v, keys->vel);
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 99dbd9b6140..53841426728 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -89,7 +89,7 @@
#include "BPY_extern.h"
#endif
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "FRS_freestyle_config.h"
@@ -423,6 +423,7 @@ Scene *add_scene(char *name)
pset->brushtype= PE_BRUSH_NONE;
pset->draw_step= 2;
pset->fade_frames= 2;
+ pset->selectmode= SCE_SELECT_PATH;
for(a=0; abrush[a].strength= 50;
pset->brush[a].size= 50;
@@ -661,7 +662,7 @@ int next_object(Scene *scene, int val, Base **base, Object **ob)
/* handle dupli's */
if(dupob) {
- Mat4CpyMat4(dupob->ob->obmat, dupob->mat);
+ copy_m4_m4(dupob->ob->obmat, dupob->mat);
(*base)->flag |= OB_FROMDUPLI;
*ob= dupob->ob;
@@ -674,7 +675,7 @@ int next_object(Scene *scene, int val, Base **base, Object **ob)
(*base)->flag &= ~OB_FROMDUPLI;
for(dupob= duplilist->first; dupob; dupob= dupob->next) {
- Mat4CpyMat4(dupob->ob->obmat, dupob->omat);
+ copy_m4_m4(dupob->ob->obmat, dupob->omat);
}
free_object_duplilist(duplilist);
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 078258092f7..a1f81bf6166 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -36,11 +36,13 @@
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_anim_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_global.h"
+#include "BKE_fcurve.h"
#include "BKE_plugin_types.h"
#include "BKE_sequence.h"
#include "BKE_texture.h"
@@ -49,6 +51,8 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
+#include "RNA_access.h"
+
/* **** XXX **** */
static void error() {}
@@ -242,7 +246,6 @@ static void do_plugin_effect(Sequence * seq,int cfra,
if(seq->plugin->cfra)
*(seq->plugin->cfra)= cfra;
-// XXX *(seq->plugin->cfra)= frame_to_float(scene, cfra);
cp = PIL_dynlib_find_symbol(
seq->plugin->handle, "seqname");
@@ -2777,14 +2780,13 @@ static void store_icu_yrange_speed(struct Sequence * seq,
}
}
}
-
-void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
+void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
{
- float facf0 = seq->facf0;
- //float ctime, div;
+ float ctime, div;
int cfra;
float fallback_fac;
SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
+ FCurve *fcu= NULL;
/* if not already done, load / initialize data */
get_sequence_effect(seq);
@@ -2797,6 +2799,11 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
return;
}
+ /* XXX - new in 2.5x. should we use the animation system this way?
+ * The fcurve is needed because many frames need evaluating at once - campbell */
+ fcu= id_data_find_fcurve(&scene->id, seq, &RNA_Sequence, "speed_fader", 0);
+
+
if (!v->frameMap || v->length != seq->len) {
if (v->frameMap) MEM_freeN(v->frameMap);
@@ -2811,8 +2818,7 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
/* if there is no IPO, try to make retiming easy by stretching the
strip */
// XXX old animation system - seq
- if (/*!seq->ipo &&*/ seq->seq1->enddisp != seq->seq1->start
- && seq->seq1->len != 0) {
+ if (!fcu && seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) {
fallback_fac = (float) seq->seq1->len /
(float) (seq->seq1->enddisp - seq->seq1->start);
/* FIXME: this strip stretching gets screwed by stripdata
@@ -2829,32 +2835,29 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
float cursor = 0;
+ float facf;
v->frameMap[0] = 0;
v->lastValidFrame = 0;
for (cfra = 1; cfra < v->length; cfra++) {
-#if 0 // XXX old animation system
- if(seq->ipo) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = frame_to_float(scene, seq->startdisp + cfra);
- div = 1.0;
- } else {
- ctime= frame_to_float(scene, cfra);
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
-
- calc_ipo(seq->ipo, ctime/div);
- execute_ipo((ID *)seq, seq->ipo);
- } else
-#endif // XXX old animation system
- {
- seq->facf0 = fallback_fac;
+ if(fcu) {
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
+
+ facf = evaluate_fcurve(fcu, ctime/div);
+ } else {
+ facf = fallback_fac;
}
- seq->facf0 *= v->globalSpeed;
+ facf *= v->globalSpeed;
- cursor += seq->facf0;
+ cursor += facf;
if (cursor >= v->length) {
v->frameMap[cfra] = v->length - 1;
@@ -2864,40 +2867,39 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force)
}
}
} else {
+ float facf;
+
v->lastValidFrame = 0;
for (cfra = 0; cfra < v->length; cfra++) {
-#if 0 // XXX old animation system
- if(seq->ipo) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = frame_to_float(scene, seq->startdisp + cfra);
- div = 1.0;
- } else {
- ctime= frame_to_float(scene, cfra);
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
+
+ if(fcu) {
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
- calc_ipo(seq->ipo, ctime/div);
- execute_ipo((ID *)seq, seq->ipo);
+ facf = evaluate_fcurve(fcu, ctime / div);
+ if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
+ facf *= v->length;
+ }
}
-#endif // XXX old animation system
- if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
- seq->facf0 *= v->length;
+ if (!fcu) {
+ facf = (float) cfra * fallback_fac;
}
- if (/*!seq->ipo*/ 1) { // XXX old animation system - seq
- seq->facf0 = (float) cfra * fallback_fac;
- }
- seq->facf0 *= v->globalSpeed;
- if (seq->facf0 >= v->length) {
- seq->facf0 = v->length - 1;
+ facf *= v->globalSpeed;
+ if (facf >= v->length) {
+ facf = v->length - 1;
} else {
v->lastValidFrame = cfra;
}
- v->frameMap[cfra] = seq->facf0;
+ v->frameMap[cfra] = facf;
}
}
- seq->facf0 = facf0;
}
/*
diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c
index 1ab085f5fa8..39b911d1c37 100644
--- a/source/blender/blenkernel/intern/sequence.c
+++ b/source/blender/blenkernel/intern/sequence.c
@@ -27,6 +27,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include
#include
#include
#include
@@ -37,14 +38,19 @@
#include "DNA_listBase.h"
#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
+#include "DNA_anim_types.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_sequence.h"
+#include "BKE_fcurve.h"
#include "BKE_utildefines.h"
+#include "RNA_access.h"
+#include "RE_pipeline.h"
#include "BLI_blenlib.h"
+#include "BLI_util.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -63,8 +69,8 @@
/* **** XXX ******** */
static int seqrectx= 0; /* bad bad global! */
static int seqrecty= 0;
-static void waitcursor(int val) {}
-static int blender_test_break() {return 0;}
+//static void waitcursor(int val) {}
+//static int blender_test_break() {return 0;}
/* **** XXX ******** */
@@ -602,9 +608,9 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq)
sce = seq->scene;
}
- strncpy(seq->name + 2, sce->id.name + 2,
- sizeof(seq->name) - 2);
-
+ BLI_strncpy(seq->name+2, sce->id.name + 2, SEQ_NAME_MAXSTR-2);
+ seqUniqueName(scene->ed->seqbasep, seq);
+
seq->len= seq->scene->r.efra - seq->scene->r.sfra + 1;
seq->len -= seq->anim_startofs;
seq->len -= seq->anim_endofs;
@@ -807,25 +813,29 @@ static void do_effect(Scene *scene, int cfra, Sequence *seq, TStripElem * se)
int x, y;
int early_out;
struct SeqEffectHandle sh = get_sequence_effect(seq);
+ FCurve *fcu= NULL;
if (!sh.execute) { /* effect not supported in this version... */
make_black_ibuf(se->ibuf);
return;
}
-#if 0 // XXX old animation system
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(scene, seq, cfra);
- fac= seq->facf0;
- facf= seq->facf1;
- } else
-#endif // XXX old animation system
- {
+ if ((seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) != 0) {
sh.get_default_fac(seq, cfra, &fac, &facf);
+ if( scene->r.mode & R_FIELDS ); else facf= fac;
+ } else {
+ fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
+ "effect_fader", 0);
+ if (fcu) {
+ fac = facf = evaluate_fcurve(fcu, cfra);
+ if( scene->r.mode & R_FIELDS ) {
+ facf = evaluate_fcurve(fcu, cfra + 0.5);
+ }
+ } else {
+ fac = facf = seq->effect_fader;
+ }
}
- if( !(scene->r.mode & R_FIELDS) ) facf = fac;
-
early_out = sh.early_out(seq, fac, facf);
if (early_out == -1) { /* no input needed */
@@ -1230,6 +1240,7 @@ static struct ImBuf * seq_proxy_fetch(Scene *scene, Sequence * seq, int cfra, in
}
}
+#if 0
static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int cfra,
int build_proxy_run, int render_size);
@@ -1360,6 +1371,7 @@ static void seq_proxy_rebuild(Scene *scene, Sequence * seq)
}
waitcursor(0);
}
+#endif
/* **********************************************************************
@@ -1561,12 +1573,6 @@ static int input_have_to_preprocess(Scene *scene, Sequence * seq, TStripElem* se
if(seq->blend_mode == SEQ_BLEND_REPLACE &&
!(seq->type & SEQ_EFFECT)) {
-#if 0 // XXX old animation system
- if (seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(scene, seq, cfra);
- mul *= seq->facf0;
- }
-#endif // XXX old animation system
mul *= seq->blend_opacity / 100.0;
}
@@ -1651,12 +1657,6 @@ static void input_preprocess(Scene *scene, Sequence *seq, TStripElem *se, int cf
mul = seq->mul;
if(seq->blend_mode == SEQ_BLEND_REPLACE) {
-#if 0 // XXX old animation system
- if (seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(scene, seq, cfra);
- mul *= seq->facf0;
- }
-#endif // XXX old animation system
mul *= seq->blend_opacity / 100.0;
}
@@ -2010,14 +2010,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
}
}
} else if(seq->type == SEQ_SCENE) { // scene can be NULL after deletions
-#if 0
- /* XXX move entirely to render? */
- int oldcfra = CFRA;
- Sequence * oldseq = get_last_seq();
- Scene *sce= seq->scene, *oldsce= scene;
+ Scene *sce= seq->scene;// *oldsce= scene;
Render *re;
RenderResult rres;
- int doseq, rendering= G.rendering;
char scenename[64];
int have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first;
int sce_valid =sce && (sce->camera || have_seq);
@@ -2039,18 +2034,24 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
if (!sce_valid) {
se->ok = STRIPELEM_FAILED;
} else if (se->ibuf==NULL && sce_valid) {
- /* no need to display a waitcursor on sequencer
- scene strips */
- if (!have_seq)
- waitcursor(1);
-
+ int oldcfra;
/* Hack! This function can be called from do_render_seq(), in that case
the seq->scene can already have a Render initialized with same name,
so we have to use a default name. (compositor uses scene name to
find render).
However, when called from within the UI (image preview in sequencer)
we do want to use scene Render, that way the render result is defined
- for display in render/imagewindow */
+ for display in render/imagewindow
+
+ Hmm, don't see, why we can't do that all the time,
+ and since G.rendering is uhm, gone... (Peter)
+ */
+
+ int rendering = 1;
+ int doseq;
+
+ oldcfra = seq->scene->r.cfra;
+
if(rendering) {
BLI_strncpy(scenename, sce->id.name+2, 64);
strcpy(sce->id.name+2, " do_build_seq_ibuf");
@@ -2061,16 +2062,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
doseq= scene->r.scemode & R_DOSEQ;
scene->r.scemode &= ~R_DOSEQ;
- BIF_init_render_callbacks(re, 0); /* 0= no display callbacks */
-
- /* XXX hrms, set_scene still needed? work on that... */
- if(sce!=oldsce) set_scene_bg(sce);
RE_BlenderFrame(re, sce,
seq->sfra+se->nr+seq->anim_startofs);
- if(sce!=oldsce) set_scene_bg(oldsce);
- /* UGLY WARNING, it is set to zero in RE_BlenderFrame */
- G.rendering= rendering;
if(rendering)
BLI_strncpy(sce->id.name+2, scenename, 64);
@@ -2090,20 +2084,12 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
RE_ReleaseResultImage(re);
- BIF_end_render_callbacks();
+ // BIF_end_render_callbacks();
/* restore */
scene->r.scemode |= doseq;
-
- // XXX
-#if 0
- if((G.f & G_PLAYANIM)==0 /* bad, is set on do_render_seq */
- && !have_seq
- && !build_proxy_run)
-#endif
-
- CFRA = oldcfra;
- set_last_seq(oldseq);
+
+ seq->scene->r.cfra = oldcfra;
copy_to_ibuf_still(seq, se);
@@ -2116,7 +2102,6 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
}
}
-#endif
}
if (!build_proxy_run) {
if (se->ibuf && use_limiter) {
@@ -2134,24 +2119,28 @@ static void do_effect_seq_recursively(Scene *scene, Sequence *seq, TStripElem *s
float fac, facf;
struct SeqEffectHandle sh = get_sequence_effect(seq);
int early_out;
+ FCurve *fcu= NULL;
se->se1 = 0;
se->se2 = 0;
se->se3 = 0;
-#if 0 // XXX old animation system
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(scene, seq, cfra);
- fac= seq->facf0;
- facf= seq->facf1;
- } else
-#endif // XXX old animation system
- {
+ if ((seq->flag & SEQ_USE_EFFECT_DEFAULT_FADE) != 0) {
sh.get_default_fac(seq, cfra, &fac, &facf);
- }
+ if( scene->r.mode & R_FIELDS ); else facf= fac;
+ } else {
+ fcu = id_data_find_fcurve(&scene->id, seq, &RNA_Sequence,
+ "effect_fader", 0);
+ if (fcu) {
+ fac = facf = evaluate_fcurve(fcu, cfra);
+ if( scene->r.mode & R_FIELDS ) {
+ facf = evaluate_fcurve(fcu, cfra + 0.5);
+ }
+ } else {
+ fac = facf = seq->effect_fader;
+ }
+ }
- if( scene->r.mode & R_FIELDS ); else facf= fac;
-
early_out = sh.early_out(seq, fac, facf);
switch (early_out) {
case -1:
@@ -2224,7 +2213,7 @@ static TStripElem* do_handle_speed_effect(Scene *scene, Sequence * seq, int cfra
TStripElem * se1 = 0;
TStripElem * se2 = 0;
- sequence_effect_speed_rebuild_map(seq, 0);
+ sequence_effect_speed_rebuild_map(scene, seq, 0);
f_cfra = seq->start + s->frameMap[nr];
@@ -2385,6 +2374,7 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
int early_out;
Sequence * seq = seq_arr[i];
struct SeqEffectHandle sh;
+ float facf;
se = give_tstripelem(seq, cfra);
@@ -2411,20 +2401,9 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
sh = get_sequence_blend(seq);
- seq->facf0 = seq->facf1 = 1.0;
+ facf = seq->blend_opacity / 100.0;
-#if 0 // XXX old animation system
- if(seq->ipo && seq->ipo->curve.first) {
- do_seq_ipo(scene, seq, cfra);
- }
-#endif
-
- if( scene->r.mode & R_FIELDS ); else seq->facf0 = seq->facf1;
-
- seq->facf0 *= seq->blend_opacity / 100.0;
- seq->facf1 *= seq->blend_opacity / 100.0;
-
- early_out = sh.early_out(seq, seq->facf0, seq->facf1);
+ early_out = sh.early_out(seq, facf, facf);
switch (early_out) {
case -1:
@@ -2481,8 +2460,10 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
struct SeqEffectHandle sh = get_sequence_blend(seq);
TStripElem* se1 = give_tstripelem(seq_arr[i-1], cfra);
TStripElem* se2 = give_tstripelem(seq_arr[i], cfra);
+
+ float facf = seq->blend_opacity / 100.0;
- int early_out = sh.early_out(seq, seq->facf0, seq->facf1);
+ int early_out = sh.early_out(seq, facf, facf);
switch (early_out) {
case 0: {
int x= se2->ibuf->x;
@@ -2530,12 +2511,12 @@ static TStripElem* do_build_seq_array_recursively(Scene *scene,
if (swap_input) {
sh.execute(seq, cfra,
- seq->facf0, seq->facf1, x, y,
+ facf, facf, x, y,
se2->ibuf, se1->ibuf_comp, 0,
se2->ibuf_comp);
} else {
sh.execute(seq, cfra,
- seq->facf0, seq->facf1, x, y,
+ facf, facf, x, y,
se1->ibuf_comp, se2->ibuf, 0,
se2->ibuf_comp);
}
@@ -2631,6 +2612,7 @@ ImBuf *give_ibuf_seq(Scene *scene, int rectx, int recty, int cfra, int chanshown
return i;
}
+#if 0
/* check used when we need to change seq->blend_mode but not to effect or audio strips */
static int seq_can_blend(Sequence *seq)
{
@@ -2640,6 +2622,7 @@ static int seq_can_blend(Sequence *seq)
return 0;
}
}
+#endif
/* *********************** threading api ******************* */
@@ -2651,8 +2634,8 @@ static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER;
+//static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER;
+//static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER;
@@ -2685,6 +2668,7 @@ typedef struct PrefetchQueueElem {
struct ImBuf * ibuf;
} PrefetchQueueElem;
+#if 0
static void *seq_prefetch_thread(void * This_)
{
PrefetchThread * This = This_;
@@ -2833,6 +2817,7 @@ static void seq_stop_threads()
/* deinit malloc mutex */
BLI_end_threads(0);
}
+#endif
void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown,
int render_size)
@@ -2859,6 +2844,7 @@ void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown,
pthread_mutex_unlock(&wakeup_lock);
}
+#if 0
static void seq_wait_for_prefetch_ready()
{
PrefetchThread *tslot;
@@ -2887,6 +2873,7 @@ static void seq_wait_for_prefetch_ready()
fprintf(stderr, "SEQ-THREAD: prefetch done\n");
}
+#endif
ImBuf *give_ibuf_seq_threaded(Scene *scene, int rectx, int recty, int cfra, int chanshown, int render_size)
{
@@ -2993,6 +2980,7 @@ static void free_anim_seq(Sequence *seq)
}
}
+#if 0
static void free_imbuf_seq_except(Scene *scene, int cfra)
{
Editing *ed= seq_give_editing(scene, FALSE);
@@ -3042,8 +3030,9 @@ static void free_imbuf_seq_except(Scene *scene, int cfra)
}
SEQ_END
}
+#endif
-void free_imbuf_seq(ListBase * seqbase, int check_mem_usage)
+void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage)
{
Sequence *seq;
TStripElem *se;
@@ -3101,11 +3090,11 @@ void free_imbuf_seq(ListBase * seqbase, int check_mem_usage)
if(seq->type==SEQ_MOVIE)
free_anim_seq(seq);
if(seq->type==SEQ_SPEED) {
- sequence_effect_speed_rebuild_map(seq, 1);
+ sequence_effect_speed_rebuild_map(scene, seq, 1);
}
}
if(seq->type==SEQ_META) {
- free_imbuf_seq(&seq->seqbase, FALSE);
+ free_imbuf_seq(scene, &seq->seqbase, FALSE);
}
if(seq->type==SEQ_SCENE) {
/* FIXME: recurs downwards,
@@ -3154,7 +3143,7 @@ static int update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *chan
if(seq->type == SEQ_MOVIE)
free_anim_seq(seq);
if(seq->type == SEQ_SPEED) {
- sequence_effect_speed_rebuild_map(seq, 1);
+ sequence_effect_speed_rebuild_map(scene, seq, 1);
}
}
@@ -3187,6 +3176,7 @@ void free_imbuf_seq()
}
#endif
+#if 0 // XXX old animation system
static void free_imbuf_seq_with_ipo(Scene *scene, struct Ipo *ipo)
{
/* force update of all sequences with this ipo, on ipo changes */
@@ -3206,6 +3196,7 @@ static void free_imbuf_seq_with_ipo(Scene *scene, struct Ipo *ipo)
}
SEQ_END
}
+#endif
/* seq funcs's for transforming internally
notice the difference between start/end and left/right.
@@ -3498,3 +3489,205 @@ void seq_update_sound(struct Sequence *seq)
seq->sound_handle->changed = -1;
}
}
+
+Sequence *active_seq_get(Scene *scene)
+{
+ Editing *ed= seq_give_editing(scene, FALSE);
+ if(ed==NULL) return NULL;
+ return ed->act_seq;
+}
+
+void active_seq_set(Scene *scene, Sequence *seq)
+{
+ Editing *ed= seq_give_editing(scene, FALSE);
+ if(ed==NULL) return;
+
+ ed->act_seq= seq;
+}
+
+/* api like funcs for adding */
+
+void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
+{
+ if(seq) {
+ strcpy(seq->name, seq_load->name);
+ seqUniqueName(scene->ed->seqbasep, seq);
+
+ if(seq_load->flag & SEQ_LOAD_FRAME_ADVANCE) {
+ seq_load->start_frame += (seq->enddisp - seq->startdisp);
+ }
+
+ if(seq_load->flag & SEQ_LOAD_REPLACE_SEL) {
+ seq_load->flag |= 1; /* SELECT */
+ active_seq_set(scene, seq);
+ }
+
+ if(seq_load->flag & SEQ_LOAD_SOUND_CACHE) {
+ if(seq->sound)
+ sound_cache(seq->sound, 0);
+ }
+
+ seq_load->tot_success++;
+ }
+ else {
+ seq_load->tot_error++;
+ }
+}
+
+Sequence *alloc_sequence(ListBase *lb, int cfra, int machine)
+{
+ Sequence *seq;
+
+ seq= MEM_callocN( sizeof(Sequence), "addseq");
+ BLI_addtail(lb, seq);
+
+ *( (short *)seq->name )= ID_SEQ;
+ seq->name[2]= 0;
+
+ seq->flag= 1; /* SELECT */
+ seq->start= cfra;
+ seq->machine= machine;
+ seq->mul= 1.0;
+ seq->blend_opacity = 100.0;
+
+ return seq;
+}
+
+void seqUniqueName(ListBase *seqbasep, Sequence *seq)
+{
+ BLI_uniquename(seqbasep, seq, "Sequence", '.', offsetof(Sequence, name), SEQ_NAME_MAXSTR);
+}
+
+/* NOTE: this function doesn't fill in iamge names */
+Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
+{
+ Scene *scene= CTX_data_scene(C); /* only for active seq */
+ Sequence *seq;
+ Strip *strip;
+ StripElem *se;
+
+ seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
+ seq->type= SEQ_IMAGE;
+ BLI_strncpy(seq->name+2, "Image", SEQ_NAME_MAXSTR-2);
+ seqUniqueName(seqbasep, seq);
+
+ /* basic defaults */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+
+ strip->len = seq->len = seq_load->len ? seq_load->len : 1;
+ strip->us= 1;
+ strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+ BLI_split_dirfile_basic(seq_load->path, strip->dir, se->name);
+
+ seq_load_apply(scene, seq, seq_load);
+
+ return seq;
+}
+
+Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
+{
+ Scene *scene= CTX_data_scene(C); /* only for sound */
+ Editing *ed= seq_give_editing(scene, TRUE);
+ bSound *sound;
+
+ Sequence *seq; /* generic strip vars */
+ Strip *strip;
+ StripElem *se;
+
+ AUD_SoundInfo info;
+
+ sound = sound_new_file(CTX_data_main(C), seq_load->path);
+
+ if (sound==NULL || sound->handle == NULL) {
+ //if(op)
+ // BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return NULL;
+ }
+
+ info = AUD_getInfo(sound->handle);
+
+ if (info.specs.format == AUD_FORMAT_INVALID) {
+ sound_delete(C, sound);
+ //if(op)
+ // BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
+ return NULL;
+ }
+
+ seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
+
+ seq->type= SEQ_SOUND;
+ seq->sound= sound;
+ BLI_strncpy(seq->name+2, "Sound", SEQ_NAME_MAXSTR-2);
+ seqUniqueName(seqbasep, seq);
+
+ /* basic defaults */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ strip->len = seq->len = (int) (info.length * FPS);
+ strip->us= 1;
+
+ strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+
+ BLI_split_dirfile_basic(seq_load->path, strip->dir, se->name);
+
+ seq->sound_handle = sound_new_handle(scene, sound, seq_load->start_frame, seq_load->start_frame + strip->len, 0);
+
+ calc_sequence_disp(seq);
+
+ /* last active name */
+ strncpy(ed->act_sounddir, strip->dir, FILE_MAXDIR-1);
+
+ seq_load_apply(scene, seq, seq_load);
+
+ return seq;
+}
+
+Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
+{
+ Scene *scene= CTX_data_scene(C); /* only for sound */
+
+ Sequence *seq, *soundseq; /* generic strip vars */
+ Strip *strip;
+ StripElem *se;
+
+ struct anim *an;
+
+ an = openanim(seq_load->path, IB_rect);
+
+ if(an==NULL)
+ return NULL;
+
+ seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
+
+ seq->type= SEQ_MOVIE;
+ seq->anim= an;
+ seq->anim_preseek = IMB_anim_get_preseek(an);
+ BLI_strncpy(seq->name+2, "Movie", SEQ_NAME_MAXSTR-2);
+ seqUniqueName(seqbasep, seq);
+
+ /* basic defaults */
+ seq->strip= strip= MEM_callocN(sizeof(Strip), "strip");
+ strip->len = seq->len = IMB_anim_get_duration( an );
+ strip->us= 1;
+
+ strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
+
+ BLI_split_dirfile_basic(seq_load->path, strip->dir, se->name);
+
+ calc_sequence_disp(seq);
+
+
+ if(seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
+ int start_frame_back= seq_load->start_frame;
+ seq_load->channel++;
+
+ soundseq = sequencer_add_sound_strip(C, seqbasep, seq_load);
+
+ seq_load->start_frame= start_frame_back;
+ seq_load->channel--;
+ }
+
+ /* can be NULL */
+ seq_load_apply(scene, seq, seq_load);
+
+ return seq;
+}
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index efb7db04029..c9bf29ed29c 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -51,7 +51,7 @@
#include "BKE_mesh.h"
#include "BKE_subsurf.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_kdtree.h"
#include "BLI_kdopbvh.h"
#include "BLI_editVert.h"
@@ -116,31 +116,31 @@ DerivedMesh *object_get_derived_final(struct Scene *scene, Object *ob, CustomDat
void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float target[4][4])
{
float itarget[4][4];
- Mat4Invert(itarget, target);
- Mat4MulSerie(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0);
- Mat4Invert(data->target2local, data->local2target);
+ invert_m4_m4(itarget, target);
+ mul_serie_m4(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0);
+ invert_m4_m4(data->target2local, data->local2target);
}
void space_transform_apply(const SpaceTransform *data, float *co)
{
- VecMat4MulVecfl(co, ((SpaceTransform*)data)->local2target, co);
+ mul_v3_m4v3(co, ((SpaceTransform*)data)->local2target, co);
}
void space_transform_invert(const SpaceTransform *data, float *co)
{
- VecMat4MulVecfl(co, ((SpaceTransform*)data)->target2local, co);
+ mul_v3_m4v3(co, ((SpaceTransform*)data)->target2local, co);
}
static void space_transform_apply_normal(const SpaceTransform *data, float *no)
{
- Mat4Mul3Vecfl( ((SpaceTransform*)data)->local2target, no);
- Normalize(no); // TODO: could we just determine de scale value from the matrix?
+ mul_mat3_m4_v3( ((SpaceTransform*)data)->local2target, no);
+ normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
}
static void space_transform_invert_normal(const SpaceTransform *data, float *no)
{
- Mat4Mul3Vecfl(((SpaceTransform*)data)->target2local, no);
- Normalize(no); // TODO: could we just determine de scale value from the matrix?
+ mul_mat3_m4_v3(((SpaceTransform*)data)->target2local, no);
+ normalize_v3(no); // TODO: could we just determine de scale value from the matrix?
}
/*
@@ -223,7 +223,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
VECCOPY(tmp_co, nearest.co);
space_transform_invert(&calc->local2target, tmp_co);
- VecLerpf(co, co, tmp_co, weight); //linear interpolation
+ interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation
}
}
@@ -258,7 +258,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
space_transform_apply_normal( transf, tmp_no );
no = tmp_no;
- hit_tmp.dist *= Mat4ToScalef( ((SpaceTransform*)transf)->local2target );
+ hit_tmp.dist *= mat4_to_scale( ((SpaceTransform*)transf)->local2target );
}
else
{
@@ -285,7 +285,7 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
space_transform_invert( transf, hit_tmp.co );
space_transform_invert_normal( transf, hit_tmp.no );
- hit_tmp.dist = VecLenf( (float*)vert, hit_tmp.co );
+ hit_tmp.dist = len_v3v3( (float*)vert, hit_tmp.co );
}
memcpy(hit, &hit_tmp, sizeof(hit_tmp) );
@@ -331,7 +331,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, struct S
if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) proj_axis[1] = 1.0f;
if(calc->smd->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) proj_axis[2] = 1.0f;
- Normalize(proj_axis);
+ normalize_v3(proj_axis);
//Invalid projection direction
if(INPR(proj_axis, proj_axis) < FLT_EPSILON)
@@ -364,7 +364,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, struct S
{
VECCOPY(tmp_co, calc->vert[i].co);
if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
- NormalShortToFloat(tmp_no, calc->vert[i].no);
+ normal_short_to_float_v3(tmp_no, calc->vert[i].no);
else
VECCOPY(tmp_no, proj_axis);
}
@@ -403,7 +403,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, struct S
if(hit.index != -1)
{
- VecLerpf(co, co, hit.co, weight);
+ interp_v3_v3v3(co, co, hit.co, weight);
}
}
}
@@ -486,14 +486,14 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
//Adjusting the vertex weight, so that after interpolating it keeps a certain distance from the nearest position
float dist = sasqrt( nearest.dist );
if(dist > FLT_EPSILON)
- VecLerpf(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
+ interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
else
VECCOPY( tmp_co, nearest.co );
}
//Convert the coordinates back to mesh coordinates
space_transform_invert(&calc->local2target, tmp_co);
- VecLerpf(co, co, tmp_co, weight); //linear interpolation
+ interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation
}
}
diff --git a/source/blender/blenkernel/intern/simple_deform.c b/source/blender/blenkernel/intern/simple_deform.c
index 2978a6f7f01..b2920615f5a 100644
--- a/source/blender/blenkernel/intern/simple_deform.c
+++ b/source/blender/blenkernel/intern/simple_deform.c
@@ -35,7 +35,7 @@
#include "BKE_lattice.h"
#include "BKE_deform.h"
#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_shrinkwrap.h"
#include
@@ -171,8 +171,8 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s
}
else
{
- Mat4CpyMat4(transf->local2target, smd->origin->obmat);
- Mat4Invert(transf->target2local, transf->local2target);
+ copy_m4_m4(transf->local2target, smd->origin->obmat);
+ invert_m4_m4(transf->target2local, transf->local2target);
}
}
@@ -246,7 +246,7 @@ void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object *ob, s
axis_limit(limit_axis, smd_limit, co, dcut);
simpleDeform_callback(smd_factor, dcut, co); //Apply deform
- VecLerpf(vertexCos[i], vertexCos[i], co, weight); //Use vertex weight has coef of linear interpolation
+ interp_v3_v3v3(vertexCos[i], vertexCos[i], co, weight); //Use vertex weight has coef of linear interpolation
if(transf) space_transform_invert(transf, vertexCos[i]);
}
diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c
index 8deae7e8e10..a41c7747b1a 100644
--- a/source/blender/blenkernel/intern/sketch.c
+++ b/source/blender/blenkernel/intern/sketch.c
@@ -30,7 +30,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_sketch.h"
#include "BKE_utildefines.h"
@@ -73,7 +73,7 @@ void sk_initPoint(SK_Point *pt, SK_DrawData *dd, float *no)
if (no)
{
VECCOPY(pt->no, no);
- Normalize(pt->no);
+ normalize_v3(pt->no);
}
else
{
@@ -235,7 +235,7 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f
total = end - start;
- VecSubf(delta_p, p_end, p_start);
+ sub_v3_v3v3(delta_p, p_end, p_start);
prev = stk->points + start;
next = stk->points + end;
@@ -259,8 +259,8 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f
float *p = stk->points[start + 1 + i].p;
VECCOPY(p, delta_p);
- VecMulf(p, delta);
- VecAddf(p, p, p_start);
+ mul_v3_fl(p, delta);
+ add_v3_v3v3(p, p, p_start);
}
}
@@ -320,9 +320,9 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end)
VECCOPY(normal, stk->points[start].no);
- VecSubf(distance, stk->points[end].p, stk->points[start].p);
- Projf(normal, distance, normal);
- limit = Normalize(normal);
+ sub_v3_v3v3(distance, stk->points[end].p, stk->points[start].p);
+ project_v3_v3v3(normal, distance, normal);
+ limit = normalize_v3(normal);
for (i = 1; i < total - 1; i++)
{
@@ -330,14 +330,14 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end)
float offset[3];
float *p = stk->points[start + i].p;
- VecSubf(distance, p, stk->points[start].p);
- Projf(distance, distance, normal);
+ sub_v3_v3v3(distance, p, stk->points[start].p);
+ project_v3_v3v3(distance, distance, normal);
VECCOPY(offset, normal);
- VecMulf(offset, d);
+ mul_v3_fl(offset, d);
- VecSubf(p, p, distance);
- VecAddf(p, p, offset);
+ sub_v3_v3v3(p, p, distance);
+ add_v3_v3v3(p, p, offset);
}
}
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index b7fe0bdfc98..0a106b1920d 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -44,7 +44,7 @@
#include "BLI_rand.h"
#include "BLI_jitter.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_kdtree.h"
#include "BLI_kdopbvh.h"
@@ -150,7 +150,7 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
float tmp[3];
VECCOPY(tmp, verts[i].co);
- Mat4MulVecfl(ob->obmat, tmp);
+ mul_m4_v3(ob->obmat, tmp);
// min BB
min[0] = MIN2(min[0], tmp[0]);
@@ -262,8 +262,8 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
// bvhtree_from_mesh_faces(smd->flow->bvh, dm, 0.0, 2, 6);
// copy obmat
- // Mat4CpyMat4(smd->flow->mat, ob->obmat);
- // Mat4CpyMat4(smd->flow->mat_old, ob->obmat);
+ // copy_m4_m4(smd->flow->mat, ob->obmat);
+ // copy_m4_m4(smd->flow->mat_old, ob->obmat);
}
*/
@@ -283,8 +283,8 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
SmokeCollSettings *scs = smd->coll;
// copy obmat
- Mat4CpyMat4(scs->mat, ob->obmat);
- Mat4CpyMat4(scs->mat_old, ob->obmat);
+ copy_m4_m4(scs->mat, ob->obmat);
+ copy_m4_m4(scs->mat_old, ob->obmat);
fill_scs_points(ob, dm, scs);
}
@@ -332,7 +332,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
{
float tmpvec[3];
VECCOPY(tmpvec, mvert[i].co);
- Mat4MulVecfl (ob->obmat, tmpvec);
+ mul_m4_v3(ob->obmat, tmpvec);
VECCOPY(&scs->points[i * 3], tmpvec);
}
@@ -358,10 +358,10 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
VECSUB(side2, mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
}
- Crossf(trinormorg, side1, side2);
- Normalize(trinormorg);
+ cross_v3_v3v3(trinormorg, side1, side2);
+ normalize_v3(trinormorg);
VECCOPY(trinorm, trinormorg);
- VecMulf(trinorm, 0.25 * cell_len);
+ mul_v3_fl(trinorm, 0.25 * cell_len);
for(j = 0; j <= divs1; j++)
{
@@ -390,9 +390,9 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
VECCOPY(p3, mvert[ mface[i].v3 ].co);
}
- VecMulf(p1, (1.0-uf-vf));
- VecMulf(p2, uf);
- VecMulf(p3, vf);
+ mul_v3_fl(p1, (1.0-uf-vf));
+ mul_v3_fl(p2, uf);
+ mul_v3_fl(p3, vf);
VECADD(p, p1, p2);
VECADD(p, p, p3);
@@ -403,7 +403,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
// mMovPoints.push_back(p + trinorm);
VECCOPY(tmpvec, p);
VECADD(tmpvec, tmpvec, trinorm);
- Mat4MulVecfl (ob->obmat, tmpvec);
+ mul_m4_v3(ob->obmat, tmpvec);
VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
newdivs++;
@@ -413,7 +413,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
// mMovPoints.push_back(p - trinorm);
VECCOPY(tmpvec, p);
VECSUB(tmpvec, tmpvec, trinorm);
- Mat4MulVecfl (ob->obmat, tmpvec);
+ mul_m4_v3(ob->obmat, tmpvec);
VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
newdivs++;
}
@@ -466,11 +466,11 @@ void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int
int divs1=0, divs2=0, divs3=0;
VECCOPY(p0, verts[faces[i].v1].co);
- Mat4MulVecfl (ob->obmat, p0);
+ mul_m4_v3(ob->obmat, p0);
VECCOPY(p1, verts[faces[i].v2].co);
- Mat4MulVecfl (ob->obmat, p1);
+ mul_m4_v3(ob->obmat, p1);
VECCOPY(p2, verts[faces[i].v3].co);
- Mat4MulVecfl (ob->obmat, p2);
+ mul_m4_v3(ob->obmat, p2);
VECSUB(side1, p1, p0);
VECSUB(side2, p2, p0);
@@ -478,12 +478,12 @@ void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int
if(INPR(side1, side1) > fsTri*fsTri)
{
- float tmp = Normalize(side1);
+ float tmp = normalize_v3(side1);
divs1 = (int)ceil(tmp/fsTri);
}
if(INPR(side2, side2) > fsTri*fsTri)
{
- float tmp = Normalize(side2);
+ float tmp = normalize_v3(side2);
divs2 = (int)ceil(tmp/fsTri);
/*
@@ -505,11 +505,11 @@ void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int
facecounter++;
VECCOPY(p0, verts[faces[i].v3].co);
- Mat4MulVecfl (ob->obmat, p0);
+ mul_m4_v3(ob->obmat, p0);
VECCOPY(p1, verts[faces[i].v4].co);
- Mat4MulVecfl (ob->obmat, p1);
+ mul_m4_v3(ob->obmat, p1);
VECCOPY(p2, verts[faces[i].v1].co);
- Mat4MulVecfl (ob->obmat, p2);
+ mul_m4_v3(ob->obmat, p2);
VECSUB(side1, p1, p0);
VECSUB(side2, p2, p0);
@@ -517,12 +517,12 @@ void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *faces, int
if(INPR(side1, side1) > fsTri*fsTri)
{
- float tmp = Normalize(side1);
+ float tmp = normalize_v3(side1);
divs1 = (int)ceil(tmp/fsTri);
}
if(INPR(side2, side2) > fsTri*fsTri)
{
- float tmp = Normalize(side2);
+ float tmp = normalize_v3(side2);
divs2 = (int)ceil(tmp/fsTri);
}
@@ -849,7 +849,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue;
else if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP)) continue;
// VECCOPY(pos, pa->state.co);
- // Mat4MulVecfl (ob->imat, pos);
+ // mul_m4_v3(ob->imat, pos);
// 1. get corresponding cell
get_cell(smd->domain->p0, smd->domain->res, smd->domain->dx, pa->state.co, cell, 0);
// check if cell is valid (in the domain boundary)
@@ -1105,8 +1105,8 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
// rigid movement support
/*
- Mat4CpyMat4(smd->flow->mat_old, smd->flow->mat);
- Mat4CpyMat4(smd->flow->mat, ob->obmat);
+ copy_m4_m4(smd->flow->mat_old, smd->flow->mat);
+ copy_m4_m4(smd->flow->mat, ob->obmat);
*/
}
else if(scene->r.cfra < smd->time)
@@ -1131,8 +1131,8 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
smd->coll->dm = CDDM_copy(dm);
// rigid movement support
- Mat4CpyMat4(smd->coll->mat_old, smd->coll->mat);
- Mat4CpyMat4(smd->coll->mat, ob->obmat);
+ copy_m4_m4(smd->coll->mat_old, smd->coll->mat);
+ copy_m4_m4(smd->coll->mat, ob->obmat);
}
else if(scene->r.cfra < smd->time)
{
@@ -1378,7 +1378,7 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int
float tmp[3];
VECSUB(tmp, pos, p0);
- VecMulf(tmp, 1.0 / dx);
+ mul_v3_fl(tmp, 1.0 / dx);
if(correct)
{
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 6e986325f55..f53700976fd 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -66,7 +66,7 @@ variables on the UI for now
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_ghash.h"
#include "BLI_threads.h"
@@ -108,6 +108,16 @@ typedef struct BodyFace {
short flag;
} BodyFace;
+typedef struct ReferenceVert {
+ float pos[3]; /* position relative to com */
+ float mass; /* node mass */
+} ReferenceVert;
+
+typedef struct ReferenceState {
+ float com[3]; /* center of mass*/
+ ReferenceVert *ivert; /* list of intial values */
+}ReferenceState ;
+
/*private scratch pad for caching and other data only needed when alive*/
typedef struct SBScratch {
@@ -117,6 +127,7 @@ typedef struct SBScratch {
BodyFace *bodyface;
int totface;
float aabbmin[3],aabbmax[3];
+ ReferenceState Ref;
}SBScratch;
typedef struct SB_thread_context {
@@ -265,7 +276,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
/* ah yeah, put the verices to global coords once */
/* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
- Mat4MulVecfl(ob->obmat, pccd_M->mvert[i].co);
+ mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
/* evaluate limits */
VECCOPY(v,pccd_M->mvert[i].co);
@@ -362,7 +373,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
/* ah yeah, put the verices to global coords once */
/* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
- Mat4MulVecfl(ob->obmat, pccd_M->mvert[i].co);
+ mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
/* evaluate limits */
VECCOPY(v,pccd_M->mvert[i].co);
@@ -593,7 +604,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
if (ob->soft){
int nofquads;
- float s_shear = ob->soft->shearstiff*ob->soft->shearstiff;
+ //float s_shear = ob->soft->shearstiff*ob->soft->shearstiff;
nofquads = count_mesh_quads(me);
if (nofquads) {
@@ -882,6 +893,9 @@ static void free_scratch(SoftBody *sb)
if (sb->scratch->bodyface){
MEM_freeN(sb->scratch->bodyface);
}
+ if (sb->scratch->Ref.ivert){
+ MEM_freeN(sb->scratch->Ref.ivert);
+ }
MEM_freeN(sb->scratch);
sb->scratch = NULL;
}
@@ -1059,8 +1073,8 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
/* calculate face normal once again SIGH */
VECSUB(edge1, face_v1, face_v2);
VECSUB(edge2, face_v3, face_v2);
- Crossf(d_nvect, edge2, edge1);
- Normalize(d_nvect);
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ normalize_v3(d_nvect);
hash = vertexowner->soft->scratch->colliderhash;
@@ -1103,14 +1117,14 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
while(a){
VECCOPY(nv1,mvert[a-1].co);
if(mprevvert){
- VecMulf(nv1,time);
+ mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co);
}
/* origin to face_v2*/
VECSUB(nv1, nv1, face_v2);
- facedist = Inpf(nv1,d_nvect);
+ facedist = dot_v3v3(nv1,d_nvect);
if (ABS(facedist) 0){
df = (outerfacethickness-facedist)/outerfacethickness;
@@ -1218,17 +1232,17 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
VECCOPY(nv4,mvert[mface->v4].co);
}
if (mprevvert){
- VecMulf(nv1,time);
+ mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
- VecMulf(nv2,time);
+ mul_v3_fl(nv2,time);
Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
- VecMulf(nv3,time);
+ mul_v3_fl(nv3,time);
Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
if (mface->v4){
- VecMulf(nv4,time);
+ mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
}
@@ -1237,12 +1251,12 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
/* switch origin to be nv2*/
VECSUB(edge1, nv1, nv2);
VECSUB(edge2, nv3, nv2);
- Crossf(d_nvect, edge2, edge1);
- Normalize(d_nvect);
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ normalize_v3(d_nvect);
if (
- LineIntersectsTriangle(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) ||
- LineIntersectsTriangle(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
- LineIntersectsTriangle(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ){
+ isect_line_tri_v3(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) ||
+ isect_line_tri_v3(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
+ isect_line_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ){
Vec3PlusStVec(force,-0.5f,d_nvect);
*damp=tune*ob->pd->pdef_sbdamp;
deflected = 2;
@@ -1251,13 +1265,13 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
/* switch origin to be nv4 */
VECSUB(edge1, nv3, nv4);
VECSUB(edge2, nv1, nv4);
- Crossf(d_nvect, edge2, edge1);
- Normalize(d_nvect);
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ normalize_v3(d_nvect);
if (
- /* LineIntersectsTriangle(nv1, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
+ /* isect_line_tri_v3(nv1, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
we did that edge allready */
- LineIntersectsTriangle(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) ||
- LineIntersectsTriangle(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ){
+ isect_line_tri_v3(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) ||
+ isect_line_tri_v3(nv4, nv1, face_v1, face_v2, face_v3, &t, NULL) ){
Vec3PlusStVec(force,-0.5f,d_nvect);
*damp=tune*ob->pd->pdef_sbdamp;
deflected = 2;
@@ -1380,7 +1394,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
aabbmax[1] = MAX2(edge_v1[1],edge_v2[1]);
aabbmax[2] = MAX2(edge_v1[2],edge_v2[2]);
- el = VecLenf(edge_v1,edge_v2);
+ el = len_v3v3(edge_v1,edge_v2);
hash = vertexowner->soft->scratch->colliderhash;
ihash = BLI_ghashIterator_new(hash);
@@ -1446,17 +1460,17 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
VECCOPY(nv4,mvert[mface->v4].co);
}
if (mprevvert){
- VecMulf(nv1,time);
+ mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
- VecMulf(nv2,time);
+ mul_v3_fl(nv2,time);
Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
- VecMulf(nv3,time);
+ mul_v3_fl(nv3,time);
Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
if (mface->v4){
- VecMulf(nv4,time);
+ mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
}
@@ -1466,15 +1480,15 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
VECSUB(edge1, nv1, nv2);
VECSUB(edge2, nv3, nv2);
- Crossf(d_nvect, edge2, edge1);
- Normalize(d_nvect);
- if ( LineIntersectsTriangle(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ normalize_v3(d_nvect);
+ if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
VECSUB(v1, edge_v1, nv2);
VECSUB(v2, edge_v2, nv2);
- i1 = Inpf(v1,d_nvect);
- i2 = Inpf(v2,d_nvect);
+ i1 = dot_v3v3(v1,d_nvect);
+ i2 = dot_v3v3(v2,d_nvect);
intrusiondepth = -MIN2(i1,i2)/el;
Vec3PlusStVec(force,intrusiondepth,d_nvect);
*damp=ob->pd->pdef_sbdamp;
@@ -1485,15 +1499,15 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
VECSUB(edge1, nv3, nv4);
VECSUB(edge2, nv1, nv4);
- Crossf(d_nvect, edge2, edge1);
- Normalize(d_nvect);
- if (LineIntersectsTriangle( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ normalize_v3(d_nvect);
+ if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
VECSUB(v1, edge_v1, nv4);
VECSUB(v2, edge_v2, nv4);
- i1 = Inpf(v1,d_nvect);
- i2 = Inpf(v2,d_nvect);
+ i1 = dot_v3v3(v1,d_nvect);
+ i2 = dot_v3v3(v2,d_nvect);
intrusiondepth = -MIN2(i1,i2)/el;
@@ -1531,7 +1545,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
if (ob->softflag & OB_SB_EDGECOLL){
if ( sb_detect_edge_collisionCached (sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos,
&damp,feedback,ob->lay,ob,timenow)){
- VecAddf(bs->ext_force,bs->ext_force,feedback);
+ add_v3_v3v3(bs->ext_force,bs->ext_force,feedback);
bs->flag |= BSF_INTERSECT;
//bs->cf=damp;
bs->cf=sb->choke*0.01f;
@@ -1550,30 +1564,30 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
EffectedPoint epoint;
float speed[3]={0.0f,0.0f,0.0f};
float pos[3];
- VecMidf(pos, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
- VecMidf(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
+ mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
+ mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
pd_point_from_soft(scene, pos, vel, -1, &epoint);
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
- VecMulf(speed,windfactor);
- VecAddf(vel,vel,speed);
+ mul_v3_fl(speed,windfactor);
+ add_v3_v3v3(vel,vel,speed);
}
/* media in rest */
else{
VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
}
- f = Normalize(vel);
+ f = normalize_v3(vel);
f = -0.0001f*f*f*sb->aeroedge;
/* (todo) add a nice angle dependant function done for now BUT */
/* still there could be some nice drag/lift function, but who needs it */
VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
- Projf(pr,vel,sp);
+ project_v3_v3v3(pr,vel,sp);
VECSUB(vel,vel,pr);
- Normalize(vel);
+ normalize_v3(vel);
if (ob->softflag & OB_SB_AERO_ANGLE){
- Normalize(sp);
- Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(Inpf(vel,sp))),vel);
+ normalize_v3(sp);
+ Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(dot_v3v3(vel,sp))),vel);
}
else{
Vec3PlusStVec(bs->ext_force,f,vel); // to keep compatible with 2.45 release files
@@ -1671,15 +1685,15 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
{
float mindist,cp;
int winner =1;
- mindist = ABS(Inpf(pos,a));
+ mindist = ABS(dot_v3v3(pos,a));
- cp = ABS(Inpf(pos,b));
+ cp = ABS(dot_v3v3(pos,b));
if ( mindist < cp ){
mindist = cp;
winner =2;
}
- cp = ABS(Inpf(pos,c));
+ cp = ABS(dot_v3v3(pos,c));
if (mindist < cp ){
mindist = cp;
winner =3;
@@ -1805,17 +1819,17 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECSUB(vv4,nv4,mprevvert[mface->v4].co);
}
- VecMulf(nv1,time);
+ mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
- VecMulf(nv2,time);
+ mul_v3_fl(nv2,time);
Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
- VecMulf(nv3,time);
+ mul_v3_fl(nv3,time);
Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
if (mface->v4){
- VecMulf(nv4,time);
+ mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
}
@@ -1826,14 +1840,14 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECSUB(edge2, nv3, nv2);
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
- Crossf(d_nvect, edge2, edge1);
- n_mag = Normalize(d_nvect);
- facedist = Inpf(dv1,d_nvect);
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ n_mag = normalize_v3(d_nvect);
+ facedist = dot_v3v3(dv1,d_nvect);
// so rules are
//
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
- if (point_in_tri_prism(opco, nv1, nv2, nv3) ){
+ if (isect_point_tri_prism_v3(opco, nv1, nv2, nv3) ){
force_mag_norm =(float)exp(-ee*facedist);
if (facedist > outerfacethickness*ff)
force_mag_norm =(float)force_mag_norm*fa*(facedist - outerfacethickness)*(facedist - outerfacethickness);
@@ -1863,12 +1877,12 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECSUB(edge2, nv1, nv4);
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
- Crossf(d_nvect, edge2, edge1);
- n_mag = Normalize(d_nvect);
- facedist = Inpf(dv1,d_nvect);
+ cross_v3_v3v3(d_nvect, edge2, edge1);
+ n_mag = normalize_v3(d_nvect);
+ facedist = dot_v3v3(dv1,d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
- if (point_in_tri_prism(opco, nv1, nv3, nv4) ){
+ if (isect_point_tri_prism_v3(opco, nv1, nv3, nv4) ){
force_mag_norm =(float)exp(-ee*facedist);
if (facedist > outerfacethickness*ff)
force_mag_norm =(float)force_mag_norm*fa*(facedist - outerfacethickness)*(facedist - outerfacethickness);
@@ -1898,45 +1912,45 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
{ // see if 'outer' hits an edge
float dist;
- PclosestVL3Dfl(ve, opco, nv1, nv2);
+ closest_to_line_segment_v3(ve, opco, nv1, nv2);
VECSUB(ve,opco,ve);
- dist = Normalize(ve);
+ dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
deflected=1;
}
- PclosestVL3Dfl(ve, opco, nv2, nv3);
+ closest_to_line_segment_v3(ve, opco, nv2, nv3);
VECSUB(ve,opco,ve);
- dist = Normalize(ve);
+ dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
deflected=1;
}
- PclosestVL3Dfl(ve, opco, nv3, nv1);
+ closest_to_line_segment_v3(ve, opco, nv3, nv1);
VECSUB(ve,opco,ve);
- dist = Normalize(ve);
+ dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
deflected=1;
}
if (mface->v4){ /* quad */
- PclosestVL3Dfl(ve, opco, nv3, nv4);
+ closest_to_line_segment_v3(ve, opco, nv3, nv4);
VECSUB(ve,opco,ve);
- dist = Normalize(ve);
+ dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
deflected=1;
}
- PclosestVL3Dfl(ve, opco, nv1, nv4);
+ closest_to_line_segment_v3(ve, opco, nv1, nv4);
VECSUB(ve,opco,ve);
- dist = Normalize(ve);
+ dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
@@ -1974,12 +1988,12 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
BLI_ghashIterator_free(ihash);
- if (cavel) VecMulf(avel,1.0f/(float)cavel);
+ if (cavel) mul_v3_fl(avel,1.0f/(float)cavel);
VECCOPY(vel,avel);
if (ci) *intrusion /= ci;
if (deflected){
VECCOPY(facenormal,force);
- Normalize(facenormal);
+ normalize_v3(facenormal);
}
return deflected;
}
@@ -2060,8 +2074,8 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
}
/* do bp1 <--> bp2 elastic */
- VecSubf(dir,bp1->pos,bp2->pos);
- distance = Normalize(dir);
+ sub_v3_v3v3(dir,bp1->pos,bp2->pos);
+ distance = normalize_v3(dir);
if (bs->len < distance)
iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
else
@@ -2092,10 +2106,10 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
Vec3PlusStVec(bp1->force,(bs->len - distance)*forcefactor,dir);
/* do bp1 <--> bp2 viscous */
- VecSubf(dvel,bp1->vec,bp2->vec);
+ sub_v3_v3v3(dvel,bp1->vec,bp2->vec);
kd = sb->infrict * sb_fric_force_scale(ob);
- absvel = Normalize(dvel);
- projvel = Inpf(dir,dvel);
+ absvel = normalize_v3(dvel);
+ projvel = dot_v3v3(dir,dvel);
kd *= absvel * projvel;
Vec3PlusStVec(bp1->force,-kd,dir);
@@ -2169,11 +2183,11 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
compare = (obp->colball + bp->colball);
- VecSubf(def, bp->pos, obp->pos);
+ sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
- distance = Normalize(def);
+ distance = normalize_v3(def);
if (distance < compare ){
/* exclude body points attached with a spring */
attached = 0;
@@ -2186,16 +2200,16 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if (!attached){
float f = bstune/(distance) + bstune/(compare*compare)*distance - 2.0f*bstune/compare ;
- VecMidf(velcenter, bp->vec, obp->vec);
- VecSubf(dvel,velcenter,bp->vec);
- VecMulf(dvel,bp->mass);
+ mid_v3_v3v3(velcenter, bp->vec, obp->vec);
+ sub_v3_v3v3(dvel,velcenter,bp->vec);
+ mul_v3_fl(dvel,bp->mass);
Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
Vec3PlusStVec(bp->force,sb->balldamp,dvel);
/* exploit force(a,b) == -force(b,a) part2/2 */
- VecSubf(dvel,velcenter,obp->vec);
- VecMulf(dvel,bp->mass);
+ sub_v3_v3v3(dvel,velcenter,obp->vec);
+ mul_v3_fl(dvel,bp->mass);
Vec3PlusStVec(obp->force,sb->balldamp,dvel);
Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
@@ -2213,16 +2227,16 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if(ob->softflag & OB_SB_GOAL) {
/* true elastic goal */
float ks,kd;
- VecSubf(auxvect,bp->pos,bp->origT);
+ sub_v3_v3v3(auxvect,bp->pos,bp->origT);
ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ;
bp->force[0]+= -ks*(auxvect[0]);
bp->force[1]+= -ks*(auxvect[1]);
bp->force[2]+= -ks*(auxvect[2]);
/* calulate damping forces generated by goals*/
- VecSubf(velgoal,bp->origS, bp->origE);
+ sub_v3_v3v3(velgoal,bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob) ;
- VecAddf(auxvect,velgoal,bp->vec);
+ add_v3_v3v3(auxvect,velgoal,bp->vec);
if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */
bp->force[0]-= kd * (auxvect[0]);
@@ -2241,8 +2255,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
float gravity[3];
VECCOPY(gravity, scene->physics_settings.gravity);
- VecMulf(gravity, sb_grav_force_scale(ob)*bp->mass*sb->effector_weights->global_gravity); /* individual mass of node here */
- VecAddf(bp->force, bp->force, gravity);
+ mul_v3_fl(gravity, sb_grav_force_scale(ob)*bp->mass*sb->effector_weights->global_gravity); /* individual mass of node here */
+ add_v3_v3v3(bp->force, bp->force, gravity);
}
/* particle field & vortex */
@@ -2256,7 +2270,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
/* apply forcefield*/
- VecMulf(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
VECADD(bp->force, bp->force, force);
/* BP friction in moving media */
@@ -2309,7 +2323,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
for(b=bp->nofsprings;b>0;b--){
bs = sb->bspring + bp->springs[b-1];
if (do_springcollision || do_aero){
- VecAddf(bp->force,bp->force,bs->ext_force);
+ add_v3_v3v3(bp->force,bp->force,bs->ext_force);
if (bs->flag & BSF_INTERSECT)
bp->choke = bs->cf;
@@ -2478,7 +2492,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
VECCOPY(gravity, scene->physics_settings.gravity);
- VecMulf(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity);
+ mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity);
}
/* check conditions for various options */
@@ -2538,13 +2552,13 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//if ((bp->octantflag & obp->octantflag) == 0) continue;
compare = (obp->colball + bp->colball);
- VecSubf(def, bp->pos, obp->pos);
+ sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
- distance = Normalize(def);
+ distance = normalize_v3(def);
if (distance < compare ){
/* exclude body points attached with a spring */
attached = 0;
@@ -2557,9 +2571,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (!attached){
float f = tune/(distance) + tune/(compare*compare)*distance - 2.0f*tune/compare ;
- VecMidf(velcenter, bp->vec, obp->vec);
- VecSubf(dvel,velcenter,bp->vec);
- VecMulf(dvel,bp->mass);
+ mid_v3_v3v3(velcenter, bp->vec, obp->vec);
+ sub_v3_v3v3(dvel,velcenter,bp->vec);
+ mul_v3_fl(dvel,bp->mass);
Vec3PlusStVec(bp->force,f*(1.0f-sb->balldamp),def);
Vec3PlusStVec(bp->force,sb->balldamp,dvel);
@@ -2589,8 +2603,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
}
/* exploit force(a,b) == -force(b,a) part2/2 */
- VecSubf(dvel,velcenter,obp->vec);
- VecMulf(dvel,(bp->mass+obp->mass)/2.0f);
+ sub_v3_v3v3(dvel,velcenter,obp->vec);
+ mul_v3_fl(dvel,(bp->mass+obp->mass)/2.0f);
Vec3PlusStVec(obp->force,sb->balldamp,dvel);
Vec3PlusStVec(obp->force,-f*(1.0f-sb->balldamp),def);
@@ -2609,7 +2623,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* do goal stuff */
if(ob->softflag & OB_SB_GOAL) {
/* true elastic goal */
- VecSubf(auxvect,bp->pos,bp->origT);
+ sub_v3_v3v3(auxvect,bp->pos,bp->origT);
ks = 1.0f/(1.0f- bp->goal*sb->goalspring)-1.0f ;
bp->force[0]+= -ks*(auxvect[0]);
bp->force[1]+= -ks*(auxvect[1]);
@@ -2624,9 +2638,9 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* calulate damping forces generated by goals*/
- VecSubf(velgoal,bp->origS, bp->origE);
+ sub_v3_v3v3(velgoal,bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob) ;
- VecAddf(auxvect,velgoal,bp->vec);
+ add_v3_v3v3(auxvect,velgoal,bp->vec);
if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */
bp->force[0]-= kd * (auxvect[0]);
@@ -2634,7 +2648,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->force[2]-= kd * (auxvect[2]);
if(nl_flags & NLF_BUILD){
//int ia =3*(sb->totpoint-a);
- Normalize(auxvect);
+ normalize_v3(auxvect);
/* depending on my vel */
//dfdv_goal(ia,ia,kd*forcetime);
}
@@ -2663,7 +2677,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
/* apply forcefield*/
- VecMulf(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
VECADD(bp->force, bp->force, force);
/* BP friction in moving media */
@@ -2750,7 +2764,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
for(b=bp->nofsprings;b>0;b--){
bs = sb->bspring + bp->springs[b-1];
if (do_springcollision || do_aero){
- VecAddf(bp->force,bp->force,bs->ext_force);
+ add_v3_v3v3(bp->force,bp->force,bs->ext_force);
if (bs->flag & BSF_INTERSECT)
bp->choke = bs->cf;
@@ -2882,7 +2896,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* the ( ... )' operator denotes derivate respective time */
/* the euler step for velocity then becomes */
/* v(t + dt) = v(t) + a(t) * dt */
- VecMulf(bp->force,timeovermass);/* individual mass of node here */
+ mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */
/* some nasty if's to have heun in here too */
VECCOPY(dv,bp->force);
@@ -2909,17 +2923,17 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* so here is (x)'= v(elocity) */
/* the euler step for location then becomes */
/* x(t + dt) = x(t) + v(t~) * dt */
- VecMulf(dx,forcetime);
+ mul_v3_fl(dx,forcetime);
/* the freezer coming sooner or later */
/*
- if ((Inpf(dx,dx)force,bp->force)force,bp->force)frozen /=2;
}
else{
bp->frozen =MIN2(bp->frozen*1.05f,1.0f);
}
- VecMulf(dx,bp->frozen);
+ mul_v3_fl(dx,bp->frozen);
*/
/* again some nasty if's to have heun in here too */
if (mode ==1){
@@ -2940,10 +2954,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
we don't want to end up in deep space so we add some
to balance that out */
if (bp->choke2 > 0.0f){
- VecMulf(bp->vec,(1.0f - bp->choke2));
+ mul_v3_fl(bp->vec,(1.0f - bp->choke2));
}
if (bp->choke > 0.0f){
- VecMulf(bp->vec,(1.0f - bp->choke));
+ mul_v3_fl(bp->vec,(1.0f - bp->choke));
}
}
@@ -2959,7 +2973,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if (bp->flag & SBF_DOFUZZY) fuzzy =1;
} /*for*/
- if (sb->totpoint) VecMulf(cm,1.0f/sb->totpoint);
+ if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint);
if (sb->scratch){
VECCOPY(sb->scratch->aabbmin,aabbmin);
VECCOPY(sb->scratch->aabbmax,aabbmax);
@@ -3100,7 +3114,7 @@ static void apply_spring_memory(Object *ob)
bs = &sb->bspring[a];
bp1 =&sb->bpoint[bs->v1];
bp2 =&sb->bpoint[bs->v2];
- l = VecLenf(bp1->pos,bp2->pos);
+ l = len_v3v3(bp1->pos,bp2->pos);
r = bs->len/l;
if (( r > 1.05f) || (r < 0.95)){
bs->len = ((100.0f - b) * bs->len + b*l)/100.0f;
@@ -3192,7 +3206,7 @@ static void springs_from_mesh(Object *ob)
bp= ob->soft->bpoint;
for(a=0; atotvert; a++, bp++) {
VECCOPY(bp->origS, me->mvert[a].co);
- Mat4MulVecfl(ob->obmat, bp->origS);
+ mul_m4_v3(ob->obmat, bp->origS);
}
}
@@ -3203,7 +3217,7 @@ static void springs_from_mesh(Object *ob)
}
for(a=0; atotspring; a++) {
BodySpring *bs = &sb->bspring[a];
- bs->len= scale*VecLenf(sb->bpoint[bs->v1].origS, sb->bpoint[bs->v2].origS);
+ bs->len= scale*len_v3v3(sb->bpoint[bs->v1].origS, sb->bpoint[bs->v2].origS);
}
}
}
@@ -3332,6 +3346,27 @@ static void mesh_faces_to_scratch(Object *ob)
}
sb->scratch->totface = me->totface;
}
+static void reference_to_scratch(Object *ob)
+{
+ SoftBody *sb= ob->soft;
+ ReferenceVert *rp;
+ BodyPoint *bp;
+ float accu_pos[3] ={0.f,0.f,0.f};
+ float accu_mass = 0.f;
+ int a;
+
+ sb->scratch->Ref.ivert = MEM_mallocN(sizeof(ReferenceVert)*sb->totpoint,"SB_Reference");
+ bp= ob->soft->bpoint;
+ rp= sb->scratch->Ref.ivert;
+ for(a=0; atotpoint; a++, rp++, bp++) {
+ VECCOPY(rp->pos,bp->pos);
+ VECADD(accu_pos,accu_pos,bp->pos);
+ accu_mass += bp-> mass;
+ }
+ mul_v3_fl(accu_pos,1.0f/accu_mass);
+ VECCOPY(sb->scratch->Ref.com,accu_pos);
+ /* printf("reference_to_scratch \n"); */
+}
/*
helper function to get proper spring length
@@ -3341,10 +3376,10 @@ static float globallen(float *v1,float *v2,Object *ob)
{
float p1[3],p2[3];
VECCOPY(p1,v1);
- Mat4MulVecfl(ob->obmat, p1);
+ mul_m4_v3(ob->obmat, p1);
VECCOPY(p2,v2);
- Mat4MulVecfl(ob->obmat, p2);
- return VecLenf(p1,p2);
+ mul_m4_v3(ob->obmat, p2);
+ return len_v3v3(p1,p2);
}
static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *ob)
@@ -3569,16 +3604,19 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
/* copies softbody result back in object */
static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts, int local)
{
- BodyPoint *bp= ob->soft->bpoint;
- int a;
+ SoftBody *sb= ob->soft;
+ if(sb){
+ BodyPoint *bp= sb->bpoint;
+ int a;
+ if(sb->solverflags & SBSO_MONITOR ||sb->solverflags & SBSO_ESTIMATEIPO){SB_estimate_transform(ob,sb->lcom,sb->lrot,sb->lscale);}
+ /* inverse matrix is not uptodate... */
+ invert_m4_m4(ob->imat, ob->obmat);
- /* inverse matrix is not uptodate... */
- Mat4Invert(ob->imat, ob->obmat);
-
- for(a=0; apos);
- if(local==0)
- Mat4MulVecfl(ob->imat, vertexCos[a]); /* softbody is in global coords, baked optionally not */
+ for(a=0; apos);
+ if(local==0)
+ mul_m4_v3(ob->imat, vertexCos[a]); /* softbody is in global coords, baked optionally not */
+ }
}
}
@@ -3592,6 +3630,7 @@ static void sb_new_scratch(SoftBody *sb)
sb->scratch->totface = 0;
sb->scratch->aabbmax[0]=sb->scratch->aabbmax[1]=sb->scratch->aabbmax[2] = 1.0e30f;
sb->scratch->aabbmin[0]=sb->scratch->aabbmin[1]=sb->scratch->aabbmin[2] = -1.0e30f;
+ sb->scratch->Ref.ivert = NULL;
}
/* --- ************ maintaining scratch *************** */
@@ -3706,13 +3745,62 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
/* copy the position of the goals at desired end time */
VECCOPY(bp->origE, vertexCos[a]);
/* vertexCos came from local world, go global */
- Mat4MulVecfl(ob->obmat, bp->origE);
+ mul_m4_v3(ob->obmat, bp->origE);
/* just to be save give bp->origT a defined value
will be calulated in interpolate_exciter()*/
VECCOPY(bp->origT, bp->origE);
}
}
+
+/* void SB_estimate_transform */
+/* input Object *ob out (says any object that can do SB like mesh,lattice,curve )
+ output float lloc[3],float lrot[3][3],float lscale[3][3]
+ that is:
+ a precise position vector denoting the motion of the center of mass
+ give a rotation/scale matrix using averaging method, that's why estimate and not calculate
+ see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
+ our advantage here we know the identity of the vertex
+ there are others methods giving other results.
+ lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
+ should be pretty useful for pythoneers :)
+ not! velocity .. 2nd order stuff
+ vcloud_estimate_transform see
+ */
+
+void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3])
+{
+ BodyPoint *bp;
+ ReferenceVert *rp;
+ SoftBody *sb = 0;
+ float (*opos)[3];
+ float (*rpos)[3];
+ float com[3],rcom[3];
+ int a;
+
+ if(!ob ||!ob->soft) return; /* why did we get here ? */
+ sb= ob->soft;
+ if(!sb || !sb->bpoint) return;
+ opos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_OPOS");
+ rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS");
+ /* might filter vertex selection with a vertex group */
+ for(a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; atotpoint; a++, bp++, rp++) {
+ VECCOPY(rpos[a],rp->pos);
+ VECCOPY(opos[a],bp->pos);
+ }
+
+ vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale);
+ //VECSUB(com,com,rcom);
+ if (lloc) VECCOPY(lloc,com);
+ VECCOPY(sb->lcom,com);
+ if (lscale) copy_m3_m3(sb->lscale,lscale);
+ if (lrot) copy_m3_m3(sb->lrot,lrot);
+
+
+ MEM_freeN(opos);
+ MEM_freeN(rpos);
+}
+
static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int numVerts)
{
BodyPoint *bp;
@@ -3720,7 +3808,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
for(a=0,bp=sb->bpoint; apos, vertexCos[a]);
- Mat4MulVecfl(ob->obmat, bp->pos); /* yep, sofbody is global coords*/
+ mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/
VECCOPY(bp->origS, bp->pos);
VECCOPY(bp->origE, bp->pos);
VECCOPY(bp->origT, bp->pos);
@@ -3750,6 +3838,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
sb->scratch->needstobuildcollider=1;
/* copy some info to scratch */
+ if (1) reference_to_scratch(ob); /* wa only need that if we want to reconstruct IPO */
switch(ob->type) {
case OB_MESH:
if (ob->softflag & OB_SB_FACECOLL) mesh_faces_to_scratch(ob);
@@ -3932,7 +4021,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
//cache->last_exact= 0;
-
return;
}
else if(framenr > endframe) {
@@ -3967,22 +4055,19 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
if(BKE_ptcache_get_continue_physics()) {
cache->flag &= ~PTCACHE_SIMULATION_VALID;
cache->simframe= 0;
-
/* do simulation */
dtime = timescale;
-
softbody_update_positions(ob, sb, vertexCos, numVerts);
softbody_step(scene, ob, sb, dtime);
-
softbody_to_object(ob, vertexCos, numVerts, 0);
-
return;
}
/* still no points? go away */
- if(sb->totpoint==0) return;
-
- if(framenr == startframe) {
+ if(sb->totpoint==0) {
+ return;
+ }
+ if(framenr == startframe) {
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
/* first frame, no simulation to do, just set the positions */
@@ -4035,7 +4120,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i
cache->simframe= framenr;
cache->flag |= PTCACHE_SIMULATION_VALID;
-
BKE_ptcache_write_cache(&pid, framenr);
}
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 6ac9b020f21..d8950c7dace 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -384,6 +384,8 @@ void sound_update_playing(struct bContext *C)
}
}
+ AUD_setSoundVolume(handle->handle, handle->volume);
+
if(action & 1)
{
if(handle->state == AUD_STATUS_INVALID)
@@ -468,7 +470,9 @@ AUD_Device* sound_mixdown(struct Scene *scene, AUD_Specs specs, int start, int e
frameskip -= s;
s = 0;
}
-
+
+ AUD_setSoundVolume(handle->handle, handle->volume);
+
limiter = AUD_limitSound(handle->source->handle, frameskip / fps, e / fps);
delayer = AUD_delaySound(limiter, s / fps);
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 6e95fe7ebc7..cb2e2c437bf 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -54,7 +54,7 @@
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_linklist.h"
#include "BLI_memarena.h"
#include "BLI_edgehash.h"
@@ -561,7 +561,7 @@ static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
}
DM_interp_vert_data(dm, result, vertIdx, weight[0][0], numVerts, i);
- VecCopyf(mvert->co, ccgSubSurf_getFaceCenterData(f));
+ copy_v3_v3(mvert->co, ccgSubSurf_getFaceCenterData(f));
*origIndex = ORIGINDEX_NONE;
++mvert;
++origIndex;
@@ -579,7 +579,7 @@ static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
w[nextS] = weight[x][0][2];
w[otherS] = weight[x][0][3];
DM_interp_vert_data(dm, result, vertIdx, w, numVerts, i);
- VecCopyf(mvert->co,
+ copy_v3_v3(mvert->co,
ccgSubSurf_getFaceGridEdgeData(ss, f, S, x));
*origIndex = ORIGINDEX_NONE;
@@ -602,7 +602,7 @@ static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
w[nextS] = weight[y * gridFaces + x][0][2];
w[otherS] = weight[y * gridFaces + x][0][3];
DM_interp_vert_data(dm, result, vertIdx, w, numVerts, i);
- VecCopyf(mvert->co,
+ copy_v3_v3(mvert->co,
ccgSubSurf_getFaceGridData(ss, f, S, x, y));
*origIndex = ORIGINDEX_NONE;
++mvert;
@@ -633,7 +633,7 @@ static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
w[1] = (float) x / (edgeSize - 1);
w[0] = 1 - w[1];
DM_interp_vert_data(dm, result, vertIdx, w, 2, i);
- VecCopyf(mvert->co, ccgSubSurf_getEdgeData(ss, e, x));
+ copy_v3_v3(mvert->co, ccgSubSurf_getEdgeData(ss, e, x));
*origIndex = ORIGINDEX_NONE;
++mvert;
++origIndex;
@@ -651,7 +651,7 @@ static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
DM_copy_vert_data(dm, result, vertIdx, i, 1);
- VecCopyf(mvert->co, ccgSubSurf_getVertData(ss, v));
+ copy_v3_v3(mvert->co, ccgSubSurf_getVertData(ss, v));
*((int*)ccgSubSurf_getVertUserData(ss, v)) = i;
*origIndex = ccgDM_getVertMapIndex(ss, v);
@@ -1016,19 +1016,19 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
offset = vertNum - ccgdm->faceMap[i].startVert;
if(offset < 1) {
- VecCopyf(mv->co, ccgSubSurf_getFaceCenterData(f));
+ copy_v3_v3(mv->co, ccgSubSurf_getFaceCenterData(f));
} else if(offset < gridSideEnd) {
offset -= 1;
grid = offset / gridSideVerts;
x = offset % gridSideVerts + 1;
- VecCopyf(mv->co, ccgSubSurf_getFaceGridEdgeData(ss, f, grid, x));
+ copy_v3_v3(mv->co, ccgSubSurf_getFaceGridEdgeData(ss, f, grid, x));
} else if(offset < gridInternalEnd) {
offset -= gridSideEnd;
grid = offset / gridInternalVerts;
offset %= gridInternalVerts;
y = offset / gridSideVerts + 1;
x = offset % gridSideVerts + 1;
- VecCopyf(mv->co, ccgSubSurf_getFaceGridData(ss, f, grid, x, y));
+ copy_v3_v3(mv->co, ccgSubSurf_getFaceGridData(ss, f, grid, x, y));
}
} else if((vertNum < ccgdm->vertMap[0].startVert) && (ccgSubSurf_getNumEdges(ss) > 0)) {
/* this vert comes from edge data */
@@ -1043,14 +1043,14 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv)
e = ccgdm->edgeMap[i].edge;
x = vertNum - ccgdm->edgeMap[i].startVert + 1;
- VecCopyf(mv->co, ccgSubSurf_getEdgeData(ss, e, x));
+ copy_v3_v3(mv->co, ccgSubSurf_getEdgeData(ss, e, x));
} else {
/* this vert comes from vert data */
CCGVert *v;
i = vertNum - ccgdm->vertMap[0].startVert;
v = ccgdm->vertMap[i].vert;
- VecCopyf(mv->co, ccgSubSurf_getVertData(ss, v));
+ copy_v3_v3(mv->co, ccgSubSurf_getVertData(ss, v));
}
}
@@ -1188,11 +1188,11 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
- VecCopyf(mvert[i++].co, ccgSubSurf_getFaceCenterData(f));
+ copy_v3_v3(mvert[i++].co, ccgSubSurf_getFaceCenterData(f));
for(S = 0; S < numVerts; S++) {
for(x = 1; x < gridSize - 1; x++) {
- VecCopyf(mvert[i++].co,
+ copy_v3_v3(mvert[i++].co,
ccgSubSurf_getFaceGridEdgeData(ss, f, S, x));
}
}
@@ -1200,7 +1200,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
for(S = 0; S < numVerts; S++) {
for(y = 1; y < gridSize - 1; y++) {
for(x = 1; x < gridSize - 1; x++) {
- VecCopyf(mvert[i++].co,
+ copy_v3_v3(mvert[i++].co,
ccgSubSurf_getFaceGridData(ss, f, S, x, y));
}
}
@@ -1213,7 +1213,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
int x;
for(x = 1; x < edgeSize - 1; x++) {
- VecCopyf(mvert[i++].co, ccgSubSurf_getEdgeData(ss, e, x));
+ copy_v3_v3(mvert[i++].co, ccgSubSurf_getEdgeData(ss, e, x));
}
}
@@ -1221,7 +1221,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
for(index = 0; index < totvert; index++) {
CCGVert *v = ccgdm->vertMap[index].vert;
- VecCopyf(mvert[i].co, ccgSubSurf_getVertData(ss, v));
+ copy_v3_v3(mvert[i].co, ccgSubSurf_getVertData(ss, v));
i++;
}
@@ -1397,18 +1397,18 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3]) {
CCGFace *f = faceMap2[index];
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
- VecCopyf(cos[i++], ccgSubSurf_getFaceCenterData(f));
+ copy_v3_v3(cos[i++], ccgSubSurf_getFaceCenterData(f));
for (S=0; Scurl->len % TXT_TABSIZE];
+ txt_insert_buf(text, sb);
+}
+
int txt_add_char (Text *text, char add)
{
int len, lineno;
@@ -2368,6 +2379,12 @@ int txt_add_char (Text *text, char add)
return 1;
}
+ /* insert spaces rather then tabs */
+ if (add == '\t') {
+ txt_convert_tab_to_spaces(text);
+ return 1;
+ }
+
txt_delete_sel(text);
mrk= txt_find_marker_region(text, text->curl, text->curc-1, text->curl->len, 0, 0);
@@ -2443,7 +2460,13 @@ void indent(Text *text)
{
int len, num;
char *tmp;
- char add = '\t';
+ /* char *addtab = "\t";
+ int tablen = 1; */
+ /* hardcoded: TXT_TABSIZE = 4 spaces: */
+ int spaceslen = TXT_TABSIZE;
+ /* hardcoded: use spaces: */
+ char *add = tab_to_spaces;
+ int indentlen = spaceslen;
if (!text) return;
if (!text->curl) return;
@@ -2452,19 +2475,19 @@ void indent(Text *text)
num = 0;
while (TRUE)
{
- tmp= MEM_mallocN(text->curl->len+2, "textline_string");
+ tmp= MEM_mallocN(text->curl->len+indentlen+1, "textline_string");
text->curc = 0;
- if(text->curc) memcpy(tmp, text->curl->line, text->curc);
- tmp[text->curc]= add;
+ if(text->curc) memcpy(tmp, text->curl->line, text->curc); /* XXX never true, check prev line */
+ memcpy(tmp+text->curc, add, indentlen);
len= text->curl->len - text->curc;
- if(len>0) memcpy(tmp+text->curc+1, text->curl->line+text->curc, len);
- tmp[text->curl->len+1]=0;
+ if(len>0) memcpy(tmp+text->curc+indentlen, text->curl->line+text->curc, len);
+ tmp[text->curl->len+indentlen]= 0;
make_new_line(text->curl, tmp);
- text->curc++;
+ text->curc+= indentlen;
txt_make_dirty(text);
txt_clean_text(text);
@@ -2494,8 +2517,12 @@ void indent(Text *text)
void unindent(Text *text)
{
int num = 0;
- char remove = '\t';
-
+ /* char *rmtab = "\t"; */
+ char *remove = tab_to_spaces;
+ /* int indenttab = 1; */
+ int indentspaces = TXT_TABSIZE;
+ int indent = indentspaces;
+
if (!text) return;
if (!text->curl) return;
if (!text->sell) return;
@@ -2504,15 +2531,14 @@ void unindent(Text *text)
{
int i = 0;
- if (text->curl->line[i] == remove)
+ if (BLI_strncasecmp(text->curl->line, remove, indent) == 0)
{
while(i< text->curl->len) {
- text->curl->line[i]= text->curl->line[i+1];
+ text->curl->line[i]= text->curl->line[i+indent];
i++;
}
- text->curl->len--;
+ text->curl->len-= indent;
}
-
txt_make_dirty(text);
txt_clean_text(text);
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 14460423999..818e6195049 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -41,7 +41,7 @@
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_kdopbvh.h"
@@ -215,7 +215,7 @@ TexMapping *add_mapping(void)
texmap->size[0]= texmap->size[1]= texmap->size[2]= 1.0f;
texmap->max[0]= texmap->max[1]= texmap->max[2]= 1.0f;
- Mat4One(texmap->mat);
+ unit_m4(texmap->mat);
return texmap;
}
@@ -224,16 +224,16 @@ void init_mapping(TexMapping *texmap)
{
float eul[3], smat[3][3], rmat[3][3], mat[3][3];
- SizeToMat3(texmap->size, smat);
+ size_to_mat3( smat,texmap->size);
eul[0]= (M_PI/180.0f)*texmap->rot[0];
eul[1]= (M_PI/180.0f)*texmap->rot[1];
eul[2]= (M_PI/180.0f)*texmap->rot[2];
- EulToMat3(eul, rmat);
+ eul_to_mat3( rmat,eul);
- Mat3MulMat3(mat, rmat, smat);
+ mul_m3_m3m3(mat, rmat, smat);
- Mat4CpyMat3(texmap->mat, mat);
+ copy_m4_m3(texmap->mat, mat);
VECCOPY(texmap->mat[3], texmap->loc);
}
@@ -518,7 +518,7 @@ void default_tex(Tex *tex)
/* ------------------------------------------------------------------------- */
-Tex *add_texture(char *name)
+Tex *add_texture(const char *name)
{
Tex *tex;
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index c75c9272e5c..b5f8bc81b81 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -42,7 +42,7 @@
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_utildefines.h"
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
deleted file mode 100644
index 16da7d25721..00000000000
--- a/source/blender/blenlib/BLI_arithb.h
+++ /dev/null
@@ -1,571 +0,0 @@
-#undef TEST_ACTIVE
-//#define ACTIVE 1
-/**
- * blenlib/BLI_arithb.h mar 2001 Nzc
- *
- * $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_ARITHB_H
-#define BLI_ARITHB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef WIN32
-#define _USE_MATH_DEFINES
-#endif
-
-#include
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-#ifndef M_SQRT1_2
-#define M_SQRT1_2 0.70710678118654752440
-#endif
-#ifndef M_1_PI
-#define M_1_PI 0.318309886183790671538
-#endif
-
-#ifndef M_E
-#define M_E 2.7182818284590452354
-#endif
-#ifndef M_LOG2E
-#define M_LOG2E 1.4426950408889634074
-#endif
-#ifndef M_LOG10E
-#define M_LOG10E 0.43429448190325182765
-#endif
-#ifndef M_LN2
-#define M_LN2 0.69314718055994530942
-#endif
-#ifndef M_LN10
-#define M_LN10 2.30258509299404568402
-#endif
-
-#ifndef sqrtf
-#define sqrtf(a) ((float)sqrt(a))
-#endif
-#ifndef powf
-#define powf(a, b) ((float)pow(a, b))
-#endif
-#ifndef cosf
-#define cosf(a) ((float)cos(a))
-#endif
-#ifndef sinf
-#define sinf(a) ((float)sin(a))
-#endif
-#ifndef acosf
-#define acosf(a) ((float)acos(a))
-#endif
-#ifndef asinf
-#define asinf(a) ((float)asin(a))
-#endif
-#ifndef atan2f
-#define atan2f(a, b) ((float)atan2(a, b))
-#endif
-#ifndef tanf
-#define tanf(a) ((float)tan(a))
-#endif
-#ifndef atanf
-#define atanf(a) ((float)atan(a))
-#endif
-#ifndef floorf
-#define floorf(a) ((float)floor(a))
-#endif
-#ifndef ceilf
-#define ceilf(a) ((float)ceil(a))
-#endif
-#ifndef fabsf
-#define fabsf(a) ((float)fabs(a))
-#endif
-#ifndef logf
-#define logf(a) ((float)log(a))
-#endif
-#ifndef expf
-#define expf(a) ((float)exp(a))
-#endif
-#ifndef fmodf
-#define fmodf(a, b) ((float)fmod(a, b))
-#endif
-
-#ifdef WIN32
- #ifndef FREE_WINDOWS
- #define isnan(n) _isnan(n)
- #define finite _finite
- #endif
-#endif
-
-#define MAT4_UNITY {{ 1.0, 0.0, 0.0, 0.0},\
- { 0.0, 1.0, 0.0, 0.0},\
- { 0.0, 0.0, 1.0, 0.0},\
- { 0.0, 0.0, 0.0, 1.0}}
-
-#define MAT3_UNITY {{ 1.0, 0.0, 0.0},\
- { 0.0, 1.0, 0.0},\
- { 0.0, 0.0, 1.0}}
-
-
-void CalcCent3f(float *cent, float *v1, float *v2, float *v3);
-void CalcCent4f(float *cent, float *v1, float *v2, float *v3, float *v4);
-
-void Crossf(float *c, float *a, float *b);
-void Projf(float *c, float *v1, float *v2);
-
-float Inpf(float *v1, float *v2);
-float Inp2f(float *v1, float *v2);
-
-float Normalize(float *n);
-float Normalize2(float *n);
-
-float Sqrt3f(float f);
-double Sqrt3d(double d);
-
-float saacos(float fac);
-float saasin(float fac);
-float sasqrt(float fac);
-float saacosf(float fac);
-float saasinf(float fac);
-float sasqrtf(float fac);
-
-int FloatCompare(float *v1, float *v2, float limit);
-int FloatCompare4(float *v1, float *v2, float limit);
-float FloatLerpf(float target, float origin, float fac);
-
-float CalcNormFloat(float *v1, float *v2, float *v3, float *n);
-float CalcNormFloat4(float *v1, float *v2, float *v3, float *v4, float *n);
-
-void CalcNormLong(int *v1, int *v2, int *v3, float *n);
-/* CalcNormShort: is ook uitprodukt - (translates as 'is also out/cross product') */
-void CalcNormShort(short *v1, short *v2, short *v3, float *n);
-float power_of_2(float val);
-
-/**
- * @section Euler conversion routines (With Custom Order)
- */
-
-/* Defines for rotation orders
- * WARNING: must match the eRotationModes in DNA_action_types.h
- * order matters - types are saved to file!
- */
-typedef enum eEulerRotationOrders {
- EULER_ORDER_DEFAULT = 1, /* Blender 'default' (classic) is basically XYZ */
- EULER_ORDER_XYZ = 1, /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */
- EULER_ORDER_XZY,
- EULER_ORDER_YXZ,
- EULER_ORDER_YZX,
- EULER_ORDER_ZXY,
- EULER_ORDER_ZYX,
- /* NOTE: there are about 6 more entries when including duplicated entries too */
-} eEulerRotationOrders;
-
-void EulOToQuat(float eul[3], short order, float quat[4]);
-void QuatToEulO(float quat[4], float eul[3], short order);
-
-void EulOToMat3(float eul[3], short order, float Mat[3][3]);
-void EulOToMat4(float eul[3], short order, float Mat[4][4]);
-
-void Mat3ToEulO(float Mat[3][3], float eul[3], short order);
-void Mat4ToEulO(float Mat[4][4], float eul[3], short order);
-
-void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order);
-
-void eulerO_rot(float beul[3], float ang, char axis, short order);
-
-/**
- * @section Euler conversion routines (Blender XYZ)
- */
-
-void EulToMat3(float *eul, float mat[][3]);
-void EulToMat4(float *eul, float mat[][4]);
-
-void Mat3ToEul(float tmat[][3], float *eul);
-void Mat4ToEul(float tmat[][4],float *eul);
-
-void EulToQuat(float *eul, float *quat);
-
-void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot);
-void EulToGimbalAxis(float gmat[][3], float *eul, short order);
-
-
-void compatible_eul(float *eul, float *oldrot);
-void euler_rot(float *beul, float ang, char axis);
-
-
-/**
- * @section Quaternion arithmetic routines
- */
-
-int QuatIsNul(float *q);
-void QuatToEul(float *quat, float *eul);
-void QuatOne(float *);
-void QuatMul(float *, float *, float *);
-void QuatMulVecf(float *q, float *v);
-void QuatMulf(float *q, float f);
-void QuatMulFac(float *q, float fac);
-
-void NormalQuat(float *);
-void VecRotToQuat(float *vec, float phi, float *quat);
-
-void QuatSub(float *q, float *q1, float *q2);
-void QuatConj(float *q);
-void QuatInv(float *q);
-float QuatDot(float *q1, float *q2);
-void QuatCopy(float *q1, float *q2);
-
-void printquat(char *str, float q[4]);
-
-void QuatInterpol(float *result, float *quat1, float *quat2, float t);
-void QuatAdd(float *result, float *quat1, float *quat2, float t);
-
-void QuatToMat3(float *q, float m[][3]);
-void QuatToMat4(float *q, float m[][4]);
-
-/**
- * @section matrix multiplication and copying routines
- */
-
-void Mat3MulFloat(float *m, float f);
-void Mat4MulFloat(float *m, float f);
-void Mat4MulFloat3(float *m, float f);
-
-void Mat3Transp(float mat[][3]);
-void Mat4Transp(float mat[][4]);
-
-int Mat4Invert(float inverse[][4], float mat[][4]);
-void Mat4InvertSimp(float inverse[][4], float mat[][4]);
-void Mat4Inv(float *m1, float *m2);
-void Mat4InvGG(float out[][4], float in[][4]);
-void Mat3Inv(float m1[][3], float m2[][3]);
-
-void Mat3CpyMat4(float m1[][3],float m2[][4]);
-void Mat4CpyMat3(float m1[][4], float m2[][3]);
-
-void Mat3BlendMat3(float out[][3], float dst[][3], float src[][3], float srcweight);
-void Mat4BlendMat4(float out[][4], float dst[][4], float src[][4], float srcweight);
-
-float Det2x2(float a,float b,float c, float d);
-
-float Det3x3(
- float a1, float a2, float a3,
- float b1, float b2, float b3,
- float c1, float c2, float c3
-);
-
-float Det4x4(float m[][4]);
-
-void Mat3Adj(float m1[][3], float m[][3]);
-void Mat4Adj(float out[][4], float in[][4]);
-
-void Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]);
-void subMat4MulMat4(float *m1, float *m2, float *m3);
-#ifndef TEST_ACTIVE
-void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]);
-#else
-void Mat3MulMat3(float *m1, float *m3, float *m2);
-#endif
-void Mat4MulMat34(float (*m1)[4], float (*m3)[3], float (*m2)[4]);
-void Mat4CpyMat4(float m1[][4], float m2[][4]);
-void Mat4SwapMat4(float m1[][4], float m2[][4]);
-void Mat3CpyMat3(float m1[][3], float m2[][3]);
-
-void Mat3MulSerie(float answ[][3],
- float m1[][3], float m2[][3], float m3[][3],
- float m4[][3], float m5[][3], float m6[][3],
- float m7[][3], float m8[][3]
-);
-
-void Mat4MulSerie(float answ[][4], float m1[][4],
- float m2[][4], float m3[][4], float m4[][4],
- float m5[][4], float m6[][4], float m7[][4],
- float m8[][4]
-);
-
-void Mat4Clr(float *m);
-void Mat3Clr(float *m);
-
-void Mat3One(float m[][3]);
-void Mat4One(float m[][4]);
-
-void Mat3Scale(float m[][3], float scale);
-void Mat4Scale(float m[][4], float scale);
-
-/* NOTE: These only normalise the matrix, they don't make it orthogonal */
-void Mat3Ortho(float mat[][3]);
-void Mat4Ortho(float mat[][4]);
-
-int IsMat3Orthogonal(float mat[][3]);
-void Mat3Orthogonal(float mat[][3], int axis); /* axis is the one to keep in place (assumes it is non-null) */
-int IsMat4Orthogonal(float mat[][4]);
-void Mat4Orthogonal(float mat[][4], int axis); /* axis is the one to keep in place (assumes it is non-null) */
-
-void VecMat4MulVecfl(float *in, float mat[][4], float *vec);
-void Mat4MulMat43(float (*m1)[4], float (*m3)[4], float (*m2)[3]);
-void Mat3IsMat3MulMat4(float m1[][3], float m2[][3], float m3[][4]);
-
-void Mat4MulVec(float mat[][4],int *vec);
-void Mat4MulVecfl(float mat[][4], float *vec);
-void Mat4Mul3Vecfl(float mat[][4], float *vec);
-void Mat4MulVec3Project(float mat[][4],float *vec);
-void Mat4MulVec4fl(float mat[][4], float *vec);
-void Mat3MulVec(float mat[][3],int *vec);
-void Mat3MulVecfl(float mat[][3], float *vec);
-void Mat3MulVecd(float mat[][3], double *vec);
-void Mat3TransMulVecfl(float mat[][3], float *vec);
-
-void Mat3AddMat3(float m1[][3], float m2[][3], float m3[][3]);
-void Mat4AddMat4(float m1[][4], float m2[][4], float m3[][4]);
-
-void VecUpMat3old(float *vec, float mat[][3], short axis);
-void VecUpMat3(float *vec, float mat[][3], short axis);
-
-void VecCopyf(float *v1, float *v2);
-int VecLen(int *v1, int *v2);
-float VecLenf(float v1[3], float v2[3]);
-float VecLength(float *v);
-void VecMulf(float *v1, float f);
-void VecNegf(float *v1);
-
-int VecLenCompare(float *v1, float *v2, float limit);
-int VecCompare(float *v1, float *v2, float limit);
-int VecEqual(float *v1, float *v2);
-int VecIsNull(float *v);
-
-void printvecf(char *str,float v[3]);
-void printvec4f(char *str, float v[4]);
-
-void VecAddf(float *v, float *v1, float *v2);
-void VecSubf(float *v, float *v1, float *v2);
-void VecMulVecf(float *v, float *v1, float *v2);
-void VecLerpf(float *target, const float *a, const float *b, const float t);
-void VecLerp3f(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]);
-void VecMidf(float *v, float *v1, float *v2);
-
-void VecOrthoBasisf(float *v, float *v1, float *v2);
-
-float Vec2Lenf(float *v1, float *v2);
-float Vec2Length(float *v);
-void Vec2Mulf(float *v1, float f);
-void Vec2Addf(float *v, float *v1, float *v2);
-void Vec2Subf(float *v, float *v1, float *v2);
-void Vec2Copyf(float *v1, float *v2);
-void Vec2Lerpf(float *target, const float *a, const float *b, const float t);
-void Vec2Lerp3f(float p[2], const float v1[2], const float v2[2], const float v3[2], const float w[3]);
-
-void AxisAngleToQuat(float q[4], float axis[3], float angle);
-void QuatToAxisAngle(float q[4], float axis[3], float *angle);
-void AxisAngleToEulO(float axis[3], float angle, float eul[3], short order);
-void EulOToAxisAngle(float eul[3], short order, float axis[3], float *angle);
-void AxisAngleToMat3(float axis[3], float angle, float mat[3][3]);
-void AxisAngleToMat4(float axis[3], float angle, float mat[4][4]);
-void Mat3ToAxisAngle(float mat[3][3], float axis[3], float *angle);
-void Mat4ToAxisAngle(float mat[4][4], float axis[3], float *angle);
-
-void Mat3ToVecRot(float mat[3][3], float axis[3], float *angle);
-void Mat4ToVecRot(float mat[4][4], float axis[3], float *angle);
-void VecRotToMat3(float *vec, float phi, float mat[][3]);
-void VecRotToMat4(float *vec, float phi, float mat[][4]);
-
-void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]);
-void vectoquat(float *vec, short axis, short upflag, float *q);
-void Mat3ToQuat_is_ok(float wmat[][3], float *q);
-
-void VecReflect(float *out, float *v1, float *v2);
-void VecBisect3(float *v, float *v1, float *v2, float *v3);
-float VecAngle2(float *v1, float *v2);
-float VecAngle3(float *v1, float *v2, float *v3);
-float NormalizedVecAngle2(float *v1, float *v2);
-
-float Vec2Angle3(float *v1, float *v2, float *v3);
-float NormalizedVecAngle2_2D(float *v1, float *v2);
-
-void NormalShortToFloat(float *out, short *in);
-void NormalFloatToShort(short *out, float *in);
-
-float DistVL2Dfl(float *v1, float *v2, float *v3);
-float PdistVL2Dfl(float *v1, float *v2, float *v3);
-float PdistVL3Dfl(float *v1, float *v2, float *v3);
-void PclosestVL3Dfl(float *closest, float v1[3], float v2[3], float v3[3]);
-float AreaF2Dfl(float *v1, float *v2, float *v3);
-float AreaQ3Dfl(float *v1, float *v2, float *v3, float *v4);
-float AreaT3Dfl(float *v1, float *v2, float *v3);
-float AreaPoly3Dfl(int nr, float *verts, float *normal);
-
-/* intersect Line-Line
- return:
- -1: colliniar
- 0: no intersection of segments
- 1: exact intersection of segments
- 2: cross-intersection of segments
-*/
-extern short IsectLL2Df(float *v1, float *v2, float *v3, float *v4);
-extern short IsectLL2Ds(short *v1, short *v2, short *v3, short *v4);
-
-/*point in tri, 0 no intersection, 1 intersect */
-int IsectPT2Df(float pt[2], float v1[2], float v2[2], float v3[2]);
-/* point in quad, 0 no intersection, 1 intersect */
-int IsectPQ2Df(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2]);
-
-/* interpolation weights of point in a triangle or quad, v4 may be NULL */
-void InterpWeightsQ3Dfl(float *v1, float *v2, float *v3, float *v4, float *co, float *w);
-/* interpolation weights of point in a polygon with >= 3 vertices */
-void MeanValueWeights(float v[][3], int n, float *co, float *w);
-
-void i_lookat(
- float vx, float vy,
- float vz, float px,
- float py, float pz,
- float twist, float mat[][4]
-);
-
-void i_window(
- float left, float right,
- float bottom, float top,
- float nearClip, float farClip,
- float mat[][4]
-);
-
-#define BLI_CS_SMPTE 0
-#define BLI_CS_REC709 1
-#define BLI_CS_CIE 2
-
-#define RAD2DEG(_rad) ((_rad)*(180.0/M_PI))
-#define DEG2RAD(_deg) ((_deg)*(M_PI/180.0))
-
-void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b);
-void hex_to_rgb(char *hexcol, float *r, float *g, float *b);
-void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv);
-void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb);
-void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb);
-void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr);
-void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv);
-void xyz_to_rgb(float x, float y, float z, float *r, float *g, float *b, int colorspace);
-int constrain_rgb(float *r, float *g, float *b);
-unsigned int hsv_to_cpack(float h, float s, float v);
-unsigned int rgb_to_cpack(float r, float g, float b);
-void cpack_to_rgb(unsigned int col, float *r, float *g, float *b);
-void MinMaxRGB(short c[]);
-
-
-
-void VecStar(float mat[][3],float *vec);
-
-short EenheidsMat(float mat[][3]);
-
-void i_ortho(float left, float right, float bottom, float top, float nearClip, float farClip, float matrix[][4]);
-void i_polarview(float dist, float azimuth, float incidence, float twist, float Vm[][4]);
-void i_translate(float Tx, float Ty, float Tz, float mat[][4]);
-void i_multmatrix(float icand[][4], float Vm[][4]);
-void i_rotate(float angle, char axis, float mat[][4]);
-
-
-
-void MinMax3(float *min, float *max, float *vec);
-void SizeToMat3(float *size, float mat[][3]);
-void SizeToMat4(float *size, float mat[][4]);
-
-float Mat3ToScalef(float mat[][3]);
-float Mat4ToScalef(float mat[][4]);
-
-void printmatrix3(char *str, float m[][3]);
-void printmatrix4(char *str, float m[][4]);
-
-/* uit Sig.Proc.85 pag 253 */
-void Mat3ToQuat(float wmat[][3], float *q);
-void Mat4ToQuat(float m[][4], float *q);
-
-void Mat3ToSize(float mat[][3], float *size);
-void Mat4ToSize(float mat[][4], float *size);
-
-void triatoquat(float *v1, float *v2, float *v3, float *quat);
-
-void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3]);
-void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder);
-void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3]);
-
-void tubemap(float x, float y, float z, float *u, float *v);
-void spheremap(float x, float y, float z, float *u, float *v);
-
-int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3]);
-int LineIntersectLineStrict(float v1[3], float v2[3], float v3[3], float v4[3], float vi[3], float *lambda);
-int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
-int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv);
-int RayIntersectsTriangleThreshold(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float threshold);
-int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint);
-int AxialLineIntersectsTriangle(int axis, float co1[3], float co2[3], float v0[3], float v1[3], float v2[3], float *lambda);
-int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3]);
-void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, float *x, float *v);
-void PointInQuad2DUV(float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
-void PointInFace2DUV(int isquad, float v0[2], float v1[2], float v2[2], float v3[2], float pt[2], float *uv);
-int IsPointInTri2D(float v1[2], float v2[2], float v3[2], float pt[2]);
-int IsPointInTri2DInts(int x1, int y1, int x2, int y2, int a, int b);
-int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3]);
-
-float lambda_cp_line_ex(float p[3], float l1[3], float l2[3], float cp[3]);
-
-float AngleToLength(const float angle);
-
-typedef struct DualQuat {
- float quat[4];
- float trans[4];
-
- float scale[4][4];
- float scale_weight;
-} DualQuat;
-
-void Mat4ToDQuat(float basemat[][4], float mat[][4], DualQuat *dq);
-void DQuatToMat4(DualQuat *dq, float mat[][4]);
-void DQuatAddWeighted(DualQuat *dqsum, DualQuat *dq, float weight);
-void DQuatNormalize(DualQuat *dq, float totweight);
-void DQuatMulVecfl(DualQuat *dq, float *co, float mat[][3]);
-void DQuatCpyDQuat(DualQuat *dq1, DualQuat *dq2);
-
-/* Tangent stuff */
-typedef struct VertexTangent {
- float tang[3], uv[2];
- struct VertexTangent *next;
-} VertexTangent;
-
-void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, float *tang, float *uv);
-float *find_vertex_tangent(VertexTangent *vtang, float *uv);
-void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, float *co3, float *n, float *tang);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index a17cbbd1993..bced738b4e7 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -54,10 +54,10 @@ typedef struct DLRBT_Node {
} DLRBT_Node;
/* Red/Black defines for tree_col */
-enum eDLRBT_Colors {
+typedef enum eDLRBT_Colors {
DLRBT_BLACK= 0,
DLRBT_RED,
-};
+} eDLRBT_Colors;
/* -------- */
@@ -70,9 +70,30 @@ typedef struct DLRBT_Tree {
void *root; /* this should be based on DLRBT_Node-s */
} DLRBT_Tree;
+/* Callback Types --------------------------------- */
+
+/* return -1, 0, 1 for whether the given data is less than, equal to, or greater than the given node
+ * - node: the node to compare to
+ * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function
+ */
+typedef short (*DLRBT_Comparator_FP)(void *node, void *data);
+
+/* return a new node instance wrapping the given data
+ * - data: pointer to the relevant data to create a subclass of node from
+ */
+typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data);
+
+/* update an existing node instance accordingly to be in sync with the given data *
+ * - node: the node to update
+ * - data: pointer to the relevant data or values stored in the bitpattern dependant on the function
+ */
+typedef void (*DLRBT_NUpdate_FP)(void *node, void *data);
+
/* ********************************************** */
/* Public API */
+/* ADT Management ------------------------------- */
+
/* Create a new tree, and initialise as necessary */
DLRBT_Tree *BLI_dlrbTree_new(void);
@@ -86,16 +107,52 @@ void BLI_dlrbTree_free(DLRBT_Tree *tree);
void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree);
+/* Searching ------------------------------------ */
-/* Balance the tree after the given element has been added to it
- * (using custom code, in the Binary Tree way).
+/* Find the node which matches or is the closest to the requested node */
+DLRBT_Node *BLI_dlrbTree_search(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data);
+
+/* Find the node which exactly matches the required data */
+DLRBT_Node *BLI_dlrbTree_search_exact(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data);
+
+/* Find the node which occurs immediately before the best matching node */
+DLRBT_Node *BLI_dlrbTree_search_prev(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data);
+
+/* Find the node which occurs immediately after the best matching node */
+DLRBT_Node *BLI_dlrbTree_search_next(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data);
+
+
+/* Check whether there is a node matching the requested node */
+short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data);
+
+
+/* Node Operations (Managed) --------------------- */
+/* These methods automate the process of adding/removing nodes from the BST,
+ * using the supplied data and callbacks
*/
-void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node);
+
+/* Add the given data to the tree, and return the node added */
+// NOTE: for duplicates, the update_cb is called (if available), and the existing node is returned
+DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
+ DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data);
+
/* Remove the given element from the tree and balance again */
// FIXME: this is not implemented yet...
void BLI_dlrbTree_remove(DLRBT_Tree *tree, DLRBT_Node *node);
+/* Node Operations (Manual) --------------------- */
+/* These methods require custom code for creating BST nodes and adding them to the
+ * tree in special ways, such that the node can then be balanced.
+ *
+ * It is recommended that these methods are only used where the other method is too cumbersome...
+ */
+
+/* Balance the tree after the given node has been added to it
+ * (using custom code, in the Binary Tree way).
+ */
+void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node);
+
/* ********************************************** */
#endif // BLI_DLRB_TREE_H
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 21b4c83bd88..bd735888f95 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -55,7 +55,7 @@ void BLI_sortlist(struct ListBase *listbase, int (*cmp)(void *, void *));
void BLI_freelist(struct ListBase *listbase);
int BLI_countlist(struct ListBase *listbase);
void BLI_freelinkN(struct ListBase *listbase, void *vlink);
-void BLI_duplicatelist(struct ListBase *list1, struct ListBase *list2); /* copy from 2 to 1 */
+void BLI_duplicatelist(struct ListBase *list1, const struct ListBase *list2);
/* create a generic list node containing link to provided data */
struct LinkData *BLI_genericNodeN(void *data);
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 05530bce0e5..c50d9caade0 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -43,7 +43,7 @@ float normal_quad_v3(float r[3], float a[3], float b[3], float c[3], float d[3])
float area_tri_v2(float a[2], float b[2], float c[2]);
float area_tri_v3(float a[3], float b[3], float c[3]);
float area_quad_v3(float a[3], float b[3], float c[3], float d[3]);
-float area_poly_v3(int nr, float *verts, float normal[3]); // TODO float verts[][3]
+float area_poly_v3(int nr, float verts[][3], float normal[3]);
/********************************* Distance **********************************/
@@ -56,7 +56,6 @@ void closest_to_line_segment_v3(float r[3], float p[3], float l1[3], float l2[3]
/******************************* Intersection ********************************/
-/* TODO return values are not always first yet */
/* TODO int return value consistency */
/* line-line */
@@ -65,8 +64,8 @@ void closest_to_line_segment_v3(float r[3], float p[3], float l1[3], float l2[3]
#define ISECT_LINE_LINE_EXACT 1
#define ISECT_LINE_LINE_CROSS 2
-short isect_line_line_v2(float a1[2], float a2[2], float b1[2], float b2[2]); // TODO return int
-short isect_line_line_v2_short(short a1[2], short a2[2], short b1[2], short b2[2]); // TODO return int
+int isect_line_line_v2(float a1[2], float a2[2], float b1[2], float b2[2]);
+int isect_line_line_v2_short(short a1[2], short a2[2], short b1[2], short b2[2]);
/* Returns the number of point of interests
* 0 - lines are colinear
@@ -149,6 +148,12 @@ void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang,
void tangent_from_uv(float *uv1, float *uv2, float *uv3,
float *co1, float *co2, float *co3, float *n, float *tang);
+/********************************* vector clouds******************************/
+
+
+void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,float (*rpos)[3], float *rweight,
+ float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3]);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 9a9c1be6258..5667fb79332 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -43,8 +43,8 @@ extern "C" {
{ 0.0, 1.0, 0.0},\
{ 0.0, 0.0, 1.0}}
-void zero_m3(float *R); // TODO R[3][3]);
-void zero_m4(float *R); // TODO R[4][4]);
+void zero_m3(float R[3][3]);
+void zero_m4(float R[4][4]);
void unit_m3(float R[3][3]);
void unit_m4(float R[4][4]);
@@ -62,8 +62,6 @@ void swap_m4m4(float A[4][4], float B[4][4]);
void add_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]);
void add_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]);
-// TODO review mul order
-
void mul_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]);
void mul_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]);
void mul_m4_m3m4(float R[4][4], float A[3][3], float B[4][4]);
@@ -77,24 +75,25 @@ void mul_serie_m4(float R[4][4],
float M1[4][4], float M2[4][4], float M3[4][4], float M4[4][4],
float M5[4][4], float M6[4][4], float M7[4][4], float M8[4][4]);
-void mul_m4_v3(float M[4][4], float r[3]); // TODO order
+void mul_m4_v3(float M[4][4], float r[3]);
void mul_v3_m4v3(float r[3], float M[4][4], float v[3]);
-void mul_no_transl_m4v3(float M[4][4], float r[3]);
-void mul_m4_v4(float M[4][4], float r[3]); // TODO order
-void mul_project_m4_v4(float M[4][4], float r[3]); // TODO order
+void mul_mat3_m4_v3(float M[4][4], float r[3]);
+void mul_m4_v4(float M[4][4], float r[3]);
+void mul_project_m4_v4(float M[4][4], float r[3]);
-void mul_m3_v3(float M[3][3], float r[3]); // TODO order
-void mul_transposed_m3_v3(float M[3][3], float r[3]); // TODO order
+void mul_m3_v3(float M[3][3], float r[3]);
+void mul_v3_m3v3(float r[3], float M[3][3], float a[3]);
+void mul_transposed_m3_v3(float M[3][3], float r[3]);
void mul_m3_v3_double(float M[3][3], double r[3]);
-void mul_m3_fl(float *R, float f); // TODO R[3][3], float f);
-void mul_m4_fl(float *R, float f); // TODO R[4][4], float f);
-void mul_no_transl_m4_fl(float *R, float f); // TODO R[4][4], float f);
+void mul_m3_fl(float R[3][3], float f);
+void mul_m4_fl(float R[4][4], float f);
+void mul_mat3_m4_fl(float R[4][4], float f);
-void invert_m3(float R[3][3]);
-void invert_m3_m3(float R[3][3], float A[3][3]);
-void invert_m4(float R[4][4]); // TODO does not exist
-int invert_m4_m4(float R[4][4], float A[4][4]); // TODO return int
+int invert_m3(float R[3][3]);
+int invert_m3_m3(float R[3][3], float A[3][3]);
+int invert_m4(float R[4][4]);
+int invert_m4_m4(float R[4][4], float A[4][4]);
/****************************** Linear Algebra *******************************/
@@ -113,9 +112,6 @@ int is_orthogonal_m4(float mat[4][4]);
void adjoint_m3_m3(float R[3][3], float A[3][3]);
void adjoint_m4_m4(float R[4][4], float A[4][4]);
-//float determinant_m2(float A[2][2]); // TODO params
-//float determinant_m3(float A[3][3]); // TODO params
-
float determinant_m2(
float a, float b,
float c, float d);
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index b1546e3db6c..b221d89487f 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -44,7 +44,7 @@ void copy_qt_qt(float q[4], float a[4]);
/* arithmetic */
void mul_qt_qtqt(float q[4], float a[4], float b[4]);
-void mul_qt_v3(float q[4], float r[3]); // TODO order
+void mul_qt_v3(float q[4], float r[3]);
void mul_qt_fl(float q[4], float f);
void mul_fac_qt_fl(float q[4], float f);
@@ -60,7 +60,7 @@ int is_zero_qt(float q[4]);
/* interpolation */
void interp_qt_qtqt(float q[4], float a[4], float b[4], float t);
-void add_qt_qtqt(float q[4], float a[4], float b[4], float t); // TODO name
+void add_qt_qtqt(float q[4], float a[4], float b[4], float t);
/* conversion */
void quat_to_mat3(float mat[3][3], float q[4]);
@@ -72,7 +72,8 @@ void tri_to_quat(float q[4], float a[3], float b[3], float c[3]);
void vec_to_quat(float q[4], float vec[3], short axis, short upflag);
void rotation_between_vecs_to_quat(float q[4], float v1[3], float v2[3]);
-void Mat3ToQuat_is_ok(float wmat[][3], float *q); // TODO what is this?
+/* TODO: don't what this is, but it's not the same as mat3_to_quat */
+void mat3_to_quat_is_ok(float q[4], float mat[3][3]);
/* other */
void print_qt(char *str, float q[4]);
@@ -96,7 +97,7 @@ void mat4_to_axis_angle(float axis[3], float *angle, float M[4][4]);
void mat3_to_vec_rot(float vec[3], float *phi, float mat[3][3]);
void mat4_to_vec_rot(float vec[3], float *phi, float mat[4][4]);
-void vec_rot_to_quat(float quat[4], float vec[3], float phi); // TODO
+void vec_rot_to_quat(float quat[4], float vec[3], float phi);
void vec_rot_to_mat3(float mat[3][3], float vec[3], float phi);
void vec_rot_to_mat4(float mat[4][4], float vec[3], float phi);
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 1cb1912208e..399c234a108 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -32,64 +32,82 @@
extern "C" {
#endif
-#define MINLINE
+/* add platform/compiler checks here if it is not supported */
+#define BLI_MATH_INLINE
-//#define static inline
-//#include "intern/math_vector_inline.h"
+#ifdef BLI_MATH_INLINE
+#ifdef _MSC_VER
+#define MINLINE static __inline
+#else
+#define MINLINE static inline
+#endif
+#include "intern/math_vector_inline.c"
+#else
+#define MINLINE
+#endif
/************************************* Init ***********************************/
-void zero_v2(float r[2]);
-void zero_v3(float r[3]);
+MINLINE void zero_v2(float r[2]);
+MINLINE void zero_v3(float r[3]);
-void copy_v2_v2(float r[2], float a[2]);
-void copy_v3_v3(float r[3], float a[3]);
+MINLINE void copy_v2_v2(float r[2], float a[2]);
+MINLINE void copy_v3_v3(float r[3], float a[3]);
+
+MINLINE void swap_v2_v2(float a[2], float b[2]);
+MINLINE void swap_v3_v3(float a[3], float b[3]);
/********************************* Arithmetic ********************************/
-void add_v2_v2(float r[2], float a[2]);
-void add_v2_v2v2(float r[2], float a[2], float b[2]);
-void add_v3_v3(float r[3], float a[3]);
-void add_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void add_v2_v2(float r[2], float a[2]);
+MINLINE void add_v2_v2v2(float r[2], float a[2], float b[2]);
+MINLINE void add_v3_v3(float r[3], float a[3]);
+MINLINE void add_v3_v3v3(float r[3], float a[3], float b[3]);
-void sub_v2_v2(float r[2], float a[2]);
-void sub_v2_v2v2(float r[2], float a[2], float b[2]);
-void sub_v3_v3(float r[3], float a[3]);
-void sub_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void sub_v2_v2(float r[2], float a[2]);
+MINLINE void sub_v2_v2v2(float r[2], float a[2], float b[2]);
+MINLINE void sub_v3_v3(float r[3], float a[3]);
+MINLINE void sub_v3_v3v3(float r[3], float a[3], float b[3]);
-void mul_v2_fl(float r[2], float f);
-void mul_v3_fl(float r[3], float f);
-void mul_v3_v3fl(float r[3], float a[3], float f);
-void mul_v3_v3(float r[3], float a[3]);
-void mul_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void mul_v2_fl(float r[2], float f);
+MINLINE void mul_v3_fl(float r[3], float f);
+MINLINE void mul_v3_v3fl(float r[3], float a[3], float f);
+MINLINE void mul_v3_v3(float r[3], float a[3]);
+MINLINE void mul_v3_v3v3(float r[3], float a[3], float b[3]);
-void negate_v3(float r[3]);
-void negate_v3_v3(float r[3], float a[3]);
+MINLINE void madd_v3_v3fl(float r[3], float a[3], float f);
+MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f);
+MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3]);
-float dot_v2v2(float a[2], float b[2]);
-float dot_v3v3(float a[3], float b[3]);
+MINLINE void negate_v3(float r[3]);
+MINLINE void negate_v3_v3(float r[3], float a[3]);
-float cross_v2v2(float a[2], float b[2]);
-void cross_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE float dot_v2v2(float a[2], float b[2]);
+MINLINE float dot_v3v3(float a[3], float b[3]);
-void star_m3_v3(float R[3][3],float a[3]);
+MINLINE float cross_v2v2(float a[2], float b[2]);
+MINLINE void cross_v3_v3v3(float r[3], float a[3], float b[3]);
+
+MINLINE void star_m3_v3(float R[3][3],float a[3]);
/*********************************** Length **********************************/
-float len_v2(float a[2]);
-float len_v2v2(float a[2], float b[2]);
-float len_v3(float a[3]);
-float len_v3v3(float a[3], float b[3]);
+MINLINE float len_v2(float a[2]);
+MINLINE float len_v2v2(float a[2], float b[2]);
+MINLINE float len_v3(float a[3]);
+MINLINE float len_v3v3(float a[3], float b[3]);
-float normalize_v2(float r[2]);
-float normalize_v3(float r[3]);
+MINLINE float normalize_v2(float r[2]);
+MINLINE float normalize_v3(float r[3]);
/******************************* Interpolation *******************************/
-void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t); // TODO const
-void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[3], const float t[3]); // TODO const
-void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t); // TODO const
-void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]); // TODO const
+void interp_v2_v2v2(float r[2], float a[2], float b[2], float t);
+void interp_v2_v2v2v2(float r[2], float a[2], float b[2], float c[3], float t[3]);
+void interp_v3_v3v3(float r[3], float a[3], float b[3], float t);
+void interp_v3_v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float w[3]);
+void interp_v3_v3v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float v4[3], float w[4]);
void mid_v3_v3v3(float r[3], float a[3], float b[3]);
@@ -127,8 +145,8 @@ void print_v2(char *str, float a[2]);
void print_v3(char *str, float a[3]);
void print_v4(char *str, float a[4]);
-void normal_short_to_float_v3(float r[3], short n[3]);
-void normal_float_to_short_v3(short r[3], float n[3]);
+MINLINE void normal_short_to_float_v3(float r[3], short n[3]);
+MINLINE void normal_float_to_short_v3(short r[3], float n[3]);
void minmax_v3_v3v3(float r[3], float min[3], float max[3]);
diff --git a/source/blender/blenlib/BLI_util.h b/source/blender/blenlib/BLI_util.h
index 7642b71eea0..ca483903d46 100644
--- a/source/blender/blenlib/BLI_util.h
+++ b/source/blender/blenlib/BLI_util.h
@@ -61,7 +61,7 @@ void BLI_split_dirfile_basic(const char *string, char *dir, char *file);
void BLI_join_dirfile(char *string, const char *dir, const char *file);
void BLI_getlastdir(const char* dir, char *last, int maxlen);
int BLI_testextensie(const char *str, const char *ext);
-void BLI_uniquename(struct ListBase *list, void *vlink, char defname[], char delim, short name_offs, short len);
+void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len);
void BLI_newname(char * name, int add);
int BLI_stringdec(char *string, char *kop, char *start, unsigned short *numlen);
void BLI_stringenc(char *string, char *kop, char *start, unsigned short numlen, int pic);
diff --git a/source/blender/blenlib/intern/BLI_bfile.c b/source/blender/blenlib/intern/BLI_bfile.c
index 042cf4beffc..d9f6c8ad96f 100644
--- a/source/blender/blenlib/intern/BLI_bfile.c
+++ b/source/blender/blenlib/intern/BLI_bfile.c
@@ -27,9 +27,9 @@
#include
#include
#ifndef WIN32
+ #include
#include
#include
-// #include
#else
#include
#include "BLI_winstuff.h"
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index eea49254a0e..3f4b9fbae25 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -37,7 +37,7 @@
#include "BKE_utildefines.h"
#include "BLI_kdopbvh.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#ifdef _OPENMP
#include
@@ -332,10 +332,12 @@ static void sort(BVHNode **a0, int begin, int end, int axis)
bvh_insertionsort(a, begin, end, axis);
}
}
+#if 0
static void sort_along_axis(BVHTree *tree, int start, int end, int axis)
{
sort(tree->nodes, start, end, axis);
}
+#endif
//after a call to this function you can expect one of:
// every node to left of a[n] are smaller or equal to it
@@ -1532,6 +1534,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
}
}
+#if 0
static void iterative_raycast(BVHRayCastData *data, BVHNode *node)
{
while(node)
@@ -1562,6 +1565,7 @@ static void iterative_raycast(BVHRayCastData *data, BVHNode *node)
}
}
}
+#endif
int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
{
@@ -1578,7 +1582,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
VECCOPY(data.ray.direction, dir);
data.ray.radius = radius;
- Normalize(data.ray.direction);
+ normalize_v3(data.ray.direction);
for(i=0; i<3; i++)
{
@@ -1635,7 +1639,7 @@ float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, fl
data.ray.origin[1] = light_start[1];
data.ray.origin[2] = light_start[2];
- Normalize(data.ray.direction);
+ normalize_v3(data.ray.direction);
VECCOPY(data.ray_dot_axis, data.ray.direction);
dist = ray_nearest_hit(&data, bv);
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index ccf79ed42dc..abf61bfb734 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -34,7 +34,7 @@
#include "MEM_guardedalloc.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_kdtree.h"
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
@@ -76,8 +76,8 @@ void BLI_kdtree_insert(KDTree *tree, int index, float *co, float *nor)
KDTreeNode *node= &tree->nodes[tree->totnode++];
node->index= index;
- VecCopyf(node->co, co);
- if(nor) VecCopyf(node->nor, nor);
+ copy_v3_v3(node->co, co);
+ if(nor) copy_v3_v3(node->nor, nor);
}
static KDTreeNode *kdtree_balance(KDTreeNode *nodes, int totnode, int axis)
@@ -225,7 +225,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
if(nearest) {
nearest->index= min_node->index;
nearest->dist= sqrt(min_dist);
- VecCopyf(nearest->co, min_node->co);
+ copy_v3_v3(nearest->co, min_node->co);
}
if(stack != defaultstack)
@@ -249,7 +249,7 @@ static void add_nearest(KDTreeNearest *ptn, int *found, int n, int index, float
ptn[i].index= index;
ptn[i].dist= dist;
- VecCopyf(ptn[i].co, co);
+ copy_v3_v3(ptn[i].co, co);
}
/* finds the nearest n entries in tree to specified coordinates */
@@ -366,7 +366,7 @@ static void add_in_range(KDTreeNearest **ptn, int found, int *totfoundstack, int
to->index = index;
to->dist = sqrt(dist);
- VecCopyf(to->co, co);
+ copy_v3_v3(to->co, co);
}
int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest)
{
diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c
index af9774c6afd..8eb743e282c 100644
--- a/source/blender/blenlib/intern/DLRB_tree.c
+++ b/source/blender/blenlib/intern/DLRB_tree.c
@@ -129,6 +129,155 @@ void BLI_dlrbTree_linkedlist_sync (DLRBT_Tree *tree)
linkedlist_sync_add_node(tree, tree->root);
}
+/* *********************************************** */
+/* Tree Search Utilities */
+
+/* Find the node which matches or is the closest to the requested node */
+DLRBT_Node *BLI_dlrbTree_search (DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
+{
+ DLRBT_Node *node = (tree) ? tree->root : NULL;
+ short found= 0;
+
+ /* check that there is a comparator to use */
+ // TODO: if no comparator is supplied, try using the one supplied with the tree...
+ if (cmp_cb == NULL)
+ return NULL;
+
+ /* iteratively perform this search */
+ while (node && found==0)
+ {
+ /* check if traverse further or not
+ * NOTE: it is assumed that the values will be unit values only
+ */
+ switch (cmp_cb(node, search_data)) {
+ case -1: /* data less than node */
+ if (node->left)
+ node= node->left;
+ else
+ found= 1;
+ break;
+
+ case 1: /* data greater than node */
+ if (node->right)
+ node= node->right;
+ else
+ found= 1;
+ break;
+
+ default: /* data equals node */
+ found= 1;
+ break;
+ }
+ }
+
+ /* return the nearest matching node */
+ return node;
+}
+
+/* Find the node which exactly matches the required data */
+DLRBT_Node *BLI_dlrbTree_search_exact (DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
+{
+ DLRBT_Node *node = (tree) ? tree->root : NULL;
+ short found= 0;
+
+ /* check that there is a comparator to use */
+ // TODO: if no comparator is supplied, try using the one supplied with the tree...
+ if (cmp_cb == NULL)
+ return NULL;
+
+ /* iteratively perform this search */
+ while (node && found==0)
+ {
+ /* check if traverse further or not
+ * NOTE: it is assumed that the values will be unit values only
+ */
+ switch (cmp_cb(node, search_data)) {
+ case -1: /* data less than node */
+ if (node->left)
+ node= node->left;
+ else
+ found= -1;
+ break;
+
+ case 1: /* data greater than node */
+ if (node->right)
+ node= node->right;
+ else
+ found= -1;
+ break;
+
+ default: /* data equals node */
+ found= 1;
+ break;
+ }
+ }
+
+ /* return the nearest matching node */
+ return (found == 1) ? (node) : (NULL);
+}
+
+/* Find the node which occurs immediately before the best matching node */
+DLRBT_Node *BLI_dlrbTree_search_prev (DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
+{
+ DLRBT_Node *node;
+
+ /* check that there is a comparator to use */
+ // TODO: if no comparator is supplied, try using the one supplied with the tree...
+ if (cmp_cb == NULL)
+ return NULL;
+
+ /* get the node which best matches this description */
+ node= BLI_dlrbTree_search(tree, cmp_cb, search_data);
+
+ if (node) {
+ /* if the item we're searching for is greater than the node found, we've found the match */
+ if (cmp_cb(node, search_data) > 0)
+ return node;
+
+ /* return the previous node otherwise */
+ // NOTE: what happens if there is no previous node?
+ return node->prev;
+ }
+
+ /* nothing matching was found */
+ return NULL;
+}
+
+/* Find the node which occurs immediately after the best matching node */
+DLRBT_Node *BLI_dlrbTree_search_next (DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
+{
+ DLRBT_Node *node;
+
+ /* check that there is a comparator to use */
+ // TODO: if no comparator is supplied, try using the one supplied with the tree...
+ if (cmp_cb == NULL)
+ return NULL;
+
+ /* get the node which best matches this description */
+ node= BLI_dlrbTree_search(tree, cmp_cb, search_data);
+
+ if (node) {
+ /* if the item we're searching for is less than the node found, we've found the match */
+ if (cmp_cb(node, search_data) < 0)
+ return node;
+
+ /* return the previous node otherwise */
+ // NOTE: what happens if there is no previous node?
+ return node->next;
+ }
+
+ /* nothing matching was found */
+ return NULL;
+}
+
+
+/* Check whether there is a node matching the requested node */
+short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
+{
+ /* check if an exact search throws up anything... */
+ return (BLI_dlrbTree_search_exact(tree, cmp_cb, search_data) != NULL);
+}
+
/* *********************************************** */
/* Tree Relationships Utilities */
@@ -161,6 +310,7 @@ static DLRBT_Node *get_uncle (DLRBT_Node *node)
/* *********************************************** */
/* Tree Rotation Utilities */
+/* make right child of 'root' the new root */
static void rotate_left (DLRBT_Tree *tree, DLRBT_Node *root)
{
DLRBT_Node **root_slot, *pivot;
@@ -194,6 +344,7 @@ static void rotate_left (DLRBT_Tree *tree, DLRBT_Node *root)
*root_slot= pivot;
}
+/* make the left child of the 'root' the new root */
static void rotate_right (DLRBT_Tree *tree, DLRBT_Node *root)
{
DLRBT_Node **root_slot, *pivot;
@@ -332,7 +483,7 @@ static void insert_check_3 (DLRBT_Tree *tree, DLRBT_Node *node)
/* Balance the tree after the given element has been added to it
* (using custom code, in the Binary Tree way).
*/
-void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node)
+void BLI_dlrbTree_insert (DLRBT_Tree *tree, DLRBT_Node *node)
{
/* sanity checks */
if ((tree == NULL) || (node == NULL))
@@ -345,6 +496,90 @@ void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node)
insert_check_1(tree, node);
}
+/* ----- */
+
+/* Add the given data to the tree, and return the node added */
+// NOTE: for duplicates, the update_cb is called (if available), and the existing node is returned
+DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
+ DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data)
+{
+ DLRBT_Node *parNode, *node=NULL;
+ short new_node = 0;
+
+ /* sanity checks */
+ if (tree == NULL)
+ return NULL;
+
+ // TODO: if no comparator is supplied, try using the one supplied with the tree...
+ if (cmp_cb == NULL)
+ return NULL;
+ // TODO: if no allocator is supplied, try using the one supplied with the tree...
+ if (new_cb == NULL)
+ return NULL;
+ // TODO: if no updater is supplied, try using the one supplied with the tree...
+
+ /* try to find the nearest node to this one */
+ parNode= BLI_dlrbTree_search(tree, cmp_cb, data);
+
+ /* add new node to the BST in the 'standard way' as appropriate
+ * NOTE: we do not support duplicates in our tree...
+ */
+ if (parNode) {
+ /* check how this new node compares with the existing ones
+ * NOTE: it is assumed that the values will be unit values only
+ */
+ switch (cmp_cb(parNode, data)) {
+ case -1: /* add new node as left child */
+ {
+ node= new_cb(data);
+ new_node= 1;
+
+ parNode->left= node;
+ node->parent= parNode;
+ }
+ break;
+
+ case 1: /* add new node as right child */
+ {
+ node= new_cb(data);
+ new_node= 1;
+
+ parNode->right= node;
+ node->parent= parNode;
+ }
+ break;
+
+ default: /* update the duplicate node as appropriate */
+ {
+ if (update_cb)
+ update_cb(parNode, data);
+ }
+ break;
+ }
+ }
+ else {
+ /* no nodes in the tree yet... add a new node as the root */
+ node= new_cb(data);
+ new_node= 1;
+
+ tree->root= node;
+ }
+
+ /* if a new node was added, it should be tagged as red, and then balanced as appropriate */
+ if (new_node) {
+ /* tag this new node as being 'red' */
+ node->tree_col= DLRBT_RED;
+
+ /* perform BST balancing steps:
+ * start from case 1, an trek through the tail-recursive insertion checks
+ */
+ insert_check_1(tree, node);
+ }
+
+ /* return the node added */
+ return node;
+}
+
/* *********************************************** */
/* Remove */
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
deleted file mode 100644
index 874756135e5..00000000000
--- a/source/blender/blenlib/intern/arithb.c
+++ /dev/null
@@ -1,5488 +0,0 @@
-/* arithb.c
- *
- * simple math for blender code
- *
- * sort of cleaned up mar-01 nzc
- *
- * $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 *****
- */
-
-/* ************************ FUNKTIES **************************** */
-
-#include
-#include
-#include
-#include
-#include
-
-#ifdef HAVE_CONFIG_H
-#include
-#endif
-
-#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__)
-#include
-#endif
-
-#if !defined(__sgi) && !defined(WIN32)
-#include
-#include
-#endif
-
-#include
-#include "BLI_arithb.h"
-#include "BLI_memarena.h"
-
-/* A few small defines. Keep'em local! */
-#define SMALL_NUMBER 1.e-8
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
-#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
-
-float saacos(float fac)
-{
- if(fac<= -1.0f) return (float)M_PI;
- else if(fac>=1.0f) return 0.0;
- else return (float)acos(fac);
-}
-
-float saasin(float fac)
-{
- if(fac<= -1.0f) return (float)-M_PI/2.0f;
- else if(fac>=1.0f) return (float)M_PI/2.0f;
- else return (float)asin(fac);
-}
-
-float sasqrt(float fac)
-{
- if(fac<=0.0) return 0.0;
- return (float)sqrt(fac);
-}
-
-float saacosf(float fac)
-{
- if(fac<= -1.0f) return (float)M_PI;
- else if(fac>=1.0f) return 0.0f;
- else return (float)acosf(fac);
-}
-
-float saasinf(float fac)
-{
- if(fac<= -1.0f) return (float)-M_PI/2.0f;
- else if(fac>=1.0f) return (float)M_PI/2.0f;
- else return (float)asinf(fac);
-}
-
-float sasqrtf(float fac)
-{
- if(fac<=0.0) return 0.0;
- return (float)sqrtf(fac);
-}
-
-float Normalize(float *n)
-{
- float d;
-
- d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
- /* A larger value causes normalize errors in a scaled down models with camera xtreme close */
- if(d>1.0e-35f) {
- d= (float)sqrt(d);
-
- n[0]/=d;
- n[1]/=d;
- n[2]/=d;
- } else {
- n[0]=n[1]=n[2]= 0.0f;
- d= 0.0f;
- }
- return d;
-}
-
-/* Crossf stores the cross product c = a x b */
-void Crossf(float *c, float *a, float *b)
-{
- c[0] = a[1] * b[2] - a[2] * b[1];
- c[1] = a[2] * b[0] - a[0] * b[2];
- c[2] = a[0] * b[1] - a[1] * b[0];
-}
-
-/* Inpf returns the dot product, also called the scalar product and inner product */
-float Inpf( float *v1, float *v2)
-{
- return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2];
-}
-
-/* Project v1 on v2 */
-void Projf(float *c, float *v1, float *v2)
-{
- float mul;
- mul = Inpf(v1, v2) / Inpf(v2, v2);
-
- c[0] = mul * v2[0];
- c[1] = mul * v2[1];
- c[2] = mul * v2[2];
-}
-
-void Mat3Transp(float mat[][3])
-{
- float t;
-
- t = mat[0][1] ;
- mat[0][1] = mat[1][0] ;
- mat[1][0] = t;
- t = mat[0][2] ;
- mat[0][2] = mat[2][0] ;
- mat[2][0] = t;
- t = mat[1][2] ;
- mat[1][2] = mat[2][1] ;
- mat[2][1] = t;
-}
-
-void Mat4Transp(float mat[][4])
-{
- float t;
-
- t = mat[0][1] ;
- mat[0][1] = mat[1][0] ;
- mat[1][0] = t;
- t = mat[0][2] ;
- mat[0][2] = mat[2][0] ;
- mat[2][0] = t;
- t = mat[0][3] ;
- mat[0][3] = mat[3][0] ;
- mat[3][0] = t;
-
- t = mat[1][2] ;
- mat[1][2] = mat[2][1] ;
- mat[2][1] = t;
- t = mat[1][3] ;
- mat[1][3] = mat[3][1] ;
- mat[3][1] = t;
-
- t = mat[2][3] ;
- mat[2][3] = mat[3][2] ;
- mat[3][2] = t;
-}
-
-
-/*
- * invertmat -
- * computes the inverse of mat and puts it in inverse. Returns
- * TRUE on success (i.e. can always find a pivot) and FALSE on failure.
- * Uses Gaussian Elimination with partial (maximal column) pivoting.
- *
- * Mark Segal - 1992
- */
-
-int Mat4Invert(float inverse[][4], float mat[][4])
-{
- int i, j, k;
- double temp;
- float tempmat[4][4];
- float max;
- int maxj;
-
- /* Set inverse to identity */
- for (i=0; i<4; i++)
- for (j=0; j<4; j++)
- inverse[i][j] = 0;
- for (i=0; i<4; i++)
- inverse[i][i] = 1;
-
- /* Copy original matrix so we don't mess it up */
- for(i = 0; i < 4; i++)
- for(j = 0; j <4; j++)
- tempmat[i][j] = mat[i][j];
-
- for(i = 0; i < 4; i++) {
- /* Look for row with max pivot */
- max = ABS(tempmat[i][i]);
- maxj = i;
- for(j = i + 1; j < 4; j++) {
- if(ABS(tempmat[j][i]) > max) {
- max = ABS(tempmat[j][i]);
- maxj = j;
- }
- }
- /* Swap rows if necessary */
- if (maxj != i) {
- for( k = 0; k < 4; k++) {
- SWAP(float, tempmat[i][k], tempmat[maxj][k]);
- SWAP(float, inverse[i][k], inverse[maxj][k]);
- }
- }
-
- temp = tempmat[i][i];
- if (temp == 0)
- return 0; /* No non-zero pivot */
- for(k = 0; k < 4; k++) {
- tempmat[i][k] = (float)(tempmat[i][k]/temp);
- inverse[i][k] = (float)(inverse[i][k]/temp);
- }
- for(j = 0; j < 4; j++) {
- if(j != i) {
- temp = tempmat[j][i];
- for(k = 0; k < 4; k++) {
- tempmat[j][k] -= (float)(tempmat[i][k]*temp);
- inverse[j][k] -= (float)(inverse[i][k]*temp);
- }
- }
- }
- }
- return 1;
-}
-#ifdef TEST_ACTIVE
-void Mat4InvertSimp(float inverse[][4], float mat[][4])
-{
- /* only for Matrices that have a rotation */
- /* based at GG IV pag 205 */
- float scale;
-
- scale= mat[0][0]*mat[0][0] + mat[1][0]*mat[1][0] + mat[2][0]*mat[2][0];
- if(scale==0.0) return;
-
- scale= 1.0/scale;
-
- /* transpose and scale */
- inverse[0][0]= scale*mat[0][0];
- inverse[1][0]= scale*mat[0][1];
- inverse[2][0]= scale*mat[0][2];
- inverse[0][1]= scale*mat[1][0];
- inverse[1][1]= scale*mat[1][1];
- inverse[2][1]= scale*mat[1][2];
- inverse[0][2]= scale*mat[2][0];
- inverse[1][2]= scale*mat[2][1];
- inverse[2][2]= scale*mat[2][2];
-
- inverse[3][0]= -(inverse[0][0]*mat[3][0] + inverse[1][0]*mat[3][1] + inverse[2][0]*mat[3][2]);
- inverse[3][1]= -(inverse[0][1]*mat[3][0] + inverse[1][1]*mat[3][1] + inverse[2][1]*mat[3][2]);
- inverse[3][2]= -(inverse[0][2]*mat[3][0] + inverse[1][2]*mat[3][1] + inverse[2][2]*mat[3][2]);
-
- inverse[0][3]= inverse[1][3]= inverse[2][3]= 0.0;
- inverse[3][3]= 1.0;
-}
-#endif
-/* struct Matrix4; */
-
-#ifdef TEST_ACTIVE
-/* this seems to be unused.. */
-
-void Mat4Inv(float *m1, float *m2)
-{
-
-/* This gets me into trouble: */
- float mat1[3][3], mat2[3][3];
-
-/* void Mat3Inv(); */
-/* void Mat3CpyMat4(); */
-/* void Mat4CpyMat3(); */
-
- Mat3CpyMat4((float*)mat2,m2);
- Mat3Inv((float*)mat1, (float*) mat2);
- Mat4CpyMat3(m1, mat1);
-
-}
-#endif
-
-
-float Det2x2(float a,float b,float c,float d)
-{
-
- return a*d - b*c;
-}
-
-
-
-float Det3x3(float a1, float a2, float a3,
- float b1, float b2, float b3,
- float c1, float c2, float c3 )
-{
- float ans;
-
- ans = a1 * Det2x2( b2, b3, c2, c3 )
- - b1 * Det2x2( a2, a3, c2, c3 )
- + c1 * Det2x2( a2, a3, b2, b3 );
-
- return ans;
-}
-
-float Det4x4(float m[][4])
-{
- float ans;
- float a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4;
-
- a1= m[0][0];
- b1= m[0][1];
- c1= m[0][2];
- d1= m[0][3];
-
- a2= m[1][0];
- b2= m[1][1];
- c2= m[1][2];
- d2= m[1][3];
-
- a3= m[2][0];
- b3= m[2][1];
- c3= m[2][2];
- d3= m[2][3];
-
- a4= m[3][0];
- b4= m[3][1];
- c4= m[3][2];
- d4= m[3][3];
-
- ans = a1 * Det3x3( b2, b3, b4, c2, c3, c4, d2, d3, d4)
- - b1 * Det3x3( a2, a3, a4, c2, c3, c4, d2, d3, d4)
- + c1 * Det3x3( a2, a3, a4, b2, b3, b4, d2, d3, d4)
- - d1 * Det3x3( a2, a3, a4, b2, b3, b4, c2, c3, c4);
-
- return ans;
-}
-
-
-void Mat4Adj(float out[][4], float in[][4]) /* out = ADJ(in) */
-{
- float a1, a2, a3, a4, b1, b2, b3, b4;
- float c1, c2, c3, c4, d1, d2, d3, d4;
-
- a1= in[0][0];
- b1= in[0][1];
- c1= in[0][2];
- d1= in[0][3];
-
- a2= in[1][0];
- b2= in[1][1];
- c2= in[1][2];
- d2= in[1][3];
-
- a3= in[2][0];
- b3= in[2][1];
- c3= in[2][2];
- d3= in[2][3];
-
- a4= in[3][0];
- b4= in[3][1];
- c4= in[3][2];
- d4= in[3][3];
-
-
- out[0][0] = Det3x3( b2, b3, b4, c2, c3, c4, d2, d3, d4);
- out[1][0] = - Det3x3( a2, a3, a4, c2, c3, c4, d2, d3, d4);
- out[2][0] = Det3x3( a2, a3, a4, b2, b3, b4, d2, d3, d4);
- out[3][0] = - Det3x3( a2, a3, a4, b2, b3, b4, c2, c3, c4);
-
- out[0][1] = - Det3x3( b1, b3, b4, c1, c3, c4, d1, d3, d4);
- out[1][1] = Det3x3( a1, a3, a4, c1, c3, c4, d1, d3, d4);
- out[2][1] = - Det3x3( a1, a3, a4, b1, b3, b4, d1, d3, d4);
- out[3][1] = Det3x3( a1, a3, a4, b1, b3, b4, c1, c3, c4);
-
- out[0][2] = Det3x3( b1, b2, b4, c1, c2, c4, d1, d2, d4);
- out[1][2] = - Det3x3( a1, a2, a4, c1, c2, c4, d1, d2, d4);
- out[2][2] = Det3x3( a1, a2, a4, b1, b2, b4, d1, d2, d4);
- out[3][2] = - Det3x3( a1, a2, a4, b1, b2, b4, c1, c2, c4);
-
- out[0][3] = - Det3x3( b1, b2, b3, c1, c2, c3, d1, d2, d3);
- out[1][3] = Det3x3( a1, a2, a3, c1, c2, c3, d1, d2, d3);
- out[2][3] = - Det3x3( a1, a2, a3, b1, b2, b3, d1, d2, d3);
- out[3][3] = Det3x3( a1, a2, a3, b1, b2, b3, c1, c2, c3);
-}
-
-void Mat4InvGG(float out[][4], float in[][4]) /* from Graphic Gems I, out= INV(in) */
-{
- int i, j;
- float det;
-
- /* calculate the adjoint matrix */
-
- Mat4Adj(out,in);
-
- det = Det4x4(out);
-
- if ( fabs( det ) < SMALL_NUMBER) {
- return;
- }
-
- /* scale the adjoint matrix to get the inverse */
-
- for (i=0; i<4; i++)
- for(j=0; j<4; j++)
- out[i][j] = out[i][j] / det;
-
- /* the last factor is not always 1. For that reason an extra division should be implemented? */
-}
-
-
-void Mat3Inv(float m1[][3], float m2[][3])
-{
- short a,b;
- float det;
-
- /* calc adjoint */
- Mat3Adj(m1,m2);
-
- /* then determinant old matrix! */
- det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
-
- if(det==0) det=1;
- det= 1/det;
- for(a=0;a<3;a++) {
- for(b=0;b<3;b++) {
- m1[a][b]*=det;
- }
- }
-}
-
-void Mat3Adj(float m1[][3], float m[][3])
-{
- m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1];
- m1[0][1]= -m[0][1]*m[2][2]+m[0][2]*m[2][1];
- m1[0][2]=m[0][1]*m[1][2]-m[0][2]*m[1][1];
-
- m1[1][0]= -m[1][0]*m[2][2]+m[1][2]*m[2][0];
- m1[1][1]=m[0][0]*m[2][2]-m[0][2]*m[2][0];
- m1[1][2]= -m[0][0]*m[1][2]+m[0][2]*m[1][0];
-
- m1[2][0]=m[1][0]*m[2][1]-m[1][1]*m[2][0];
- m1[2][1]= -m[0][0]*m[2][1]+m[0][1]*m[2][0];
- m1[2][2]=m[0][0]*m[1][1]-m[0][1]*m[1][0];
-}
-
-void Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4])
-{
- /* matrix product: m1[j][k] = m2[j][i].m3[i][k] */
-
- m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0] + m2[0][3]*m3[3][0];
- m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1] + m2[0][3]*m3[3][1];
- m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2] + m2[0][3]*m3[3][2];
- m1[0][3] = m2[0][0]*m3[0][3] + m2[0][1]*m3[1][3] + m2[0][2]*m3[2][3] + m2[0][3]*m3[3][3];
-
- m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0] + m2[1][3]*m3[3][0];
- m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1] + m2[1][3]*m3[3][1];
- m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2] + m2[1][3]*m3[3][2];
- m1[1][3] = m2[1][0]*m3[0][3] + m2[1][1]*m3[1][3] + m2[1][2]*m3[2][3] + m2[1][3]*m3[3][3];
-
- m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0] + m2[2][3]*m3[3][0];
- m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1] + m2[2][3]*m3[3][1];
- m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2] + m2[2][3]*m3[3][2];
- m1[2][3] = m2[2][0]*m3[0][3] + m2[2][1]*m3[1][3] + m2[2][2]*m3[2][3] + m2[2][3]*m3[3][3];
-
- m1[3][0] = m2[3][0]*m3[0][0] + m2[3][1]*m3[1][0] + m2[3][2]*m3[2][0] + m2[3][3]*m3[3][0];
- m1[3][1] = m2[3][0]*m3[0][1] + m2[3][1]*m3[1][1] + m2[3][2]*m3[2][1] + m2[3][3]*m3[3][1];
- m1[3][2] = m2[3][0]*m3[0][2] + m2[3][1]*m3[1][2] + m2[3][2]*m3[2][2] + m2[3][3]*m3[3][2];
- m1[3][3] = m2[3][0]*m3[0][3] + m2[3][1]*m3[1][3] + m2[3][2]*m3[2][3] + m2[3][3]*m3[3][3];
-
-}
-#ifdef TEST_ACTIVE
-void subMat4MulMat4(float *m1, float *m2, float *m3)
-{
-
- m1[0]= m2[0]*m3[0] + m2[1]*m3[4] + m2[2]*m3[8];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[5] + m2[2]*m3[9];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[6] + m2[2]*m3[10];
- m1[3]= m2[0]*m3[3] + m2[1]*m3[7] + m2[2]*m3[11] + m2[3];
- m1+=4;
- m2+=4;
- m1[0]= m2[0]*m3[0] + m2[1]*m3[4] + m2[2]*m3[8];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[5] + m2[2]*m3[9];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[6] + m2[2]*m3[10];
- m1[3]= m2[0]*m3[3] + m2[1]*m3[7] + m2[2]*m3[11] + m2[3];
- m1+=4;
- m2+=4;
- m1[0]= m2[0]*m3[0] + m2[1]*m3[4] + m2[2]*m3[8];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[5] + m2[2]*m3[9];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[6] + m2[2]*m3[10];
- m1[3]= m2[0]*m3[3] + m2[1]*m3[7] + m2[2]*m3[11] + m2[3];
-}
-#endif
-
-#ifndef TEST_ACTIVE
-void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3])
-#else
-void Mat3MulMat3(float *m1, float *m3, float *m2)
-#endif
-{
- /* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */
-#ifndef TEST_ACTIVE
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
-
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
-
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
-#else
- m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8];
- m1+=3;
- m2+=3;
- m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8];
- m1+=3;
- m2+=3;
- m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6];
- m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7];
- m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8];
-#endif
-} /* end of void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */
-
-void Mat4MulMat43(float (*m1)[4], float (*m3)[4], float (*m2)[3])
-{
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
-}
-/* m1 = m2 * m3, ignore the elements on the 4th row/column of m3*/
-void Mat3IsMat3MulMat4(float m1[][3], float m2[][3], float m3[][4])
-{
- /* m1[i][j] = m2[i][k] * m3[k][j] */
- m1[0][0] = m2[0][0] * m3[0][0] + m2[0][1] * m3[1][0] +m2[0][2] * m3[2][0];
- m1[0][1] = m2[0][0] * m3[0][1] + m2[0][1] * m3[1][1] +m2[0][2] * m3[2][1];
- m1[0][2] = m2[0][0] * m3[0][2] + m2[0][1] * m3[1][2] +m2[0][2] * m3[2][2];
-
- m1[1][0] = m2[1][0] * m3[0][0] + m2[1][1] * m3[1][0] +m2[1][2] * m3[2][0];
- m1[1][1] = m2[1][0] * m3[0][1] + m2[1][1] * m3[1][1] +m2[1][2] * m3[2][1];
- m1[1][2] = m2[1][0] * m3[0][2] + m2[1][1] * m3[1][2] +m2[1][2] * m3[2][2];
-
- m1[2][0] = m2[2][0] * m3[0][0] + m2[2][1] * m3[1][0] +m2[2][2] * m3[2][0];
- m1[2][1] = m2[2][0] * m3[0][1] + m2[2][1] * m3[1][1] +m2[2][2] * m3[2][1];
- m1[2][2] = m2[2][0] * m3[0][2] + m2[2][1] * m3[1][2] +m2[2][2] * m3[2][2];
-}
-
-
-
-void Mat4MulMat34(float (*m1)[4], float (*m3)[3], float (*m2)[4])
-{
- m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0];
- m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1];
- m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2];
- m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0];
- m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1];
- m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2];
- m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0];
- m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1];
- m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2];
-}
-
-void Mat4CpyMat4(float m1[][4], float m2[][4])
-{
- memcpy(m1, m2, 4*4*sizeof(float));
-}
-
-void Mat4SwapMat4(float m1[][4], float m2[][4])
-{
- float t;
- int i, j;
-
- for(i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- t = m1[i][j];
- m1[i][j] = m2[i][j];
- m2[i][j] = t;
- }
- }
-}
-
-typedef float Mat3Row[3];
-typedef float Mat4Row[4];
-
-#ifdef TEST_ACTIVE
-void Mat3CpyMat4(float *m1p, float *m2p)
-#else
-void Mat3CpyMat4(float m1[][3], float m2[][4])
-#endif
-{
-#ifdef TEST_ACTIVE
- int i, j;
- Mat3Row *m1= (Mat3Row *)m1p;
- Mat4Row *m2= (Mat4Row *)m2p;
- for ( i = 0; i++; i < 3) {
- for (j = 0; j++; j < 3) {
- m1p[3*i + j] = m2p[4*i + j];
- }
- }
-#endif
- m1[0][0]= m2[0][0];
- m1[0][1]= m2[0][1];
- m1[0][2]= m2[0][2];
-
- m1[1][0]= m2[1][0];
- m1[1][1]= m2[1][1];
- m1[1][2]= m2[1][2];
-
- m1[2][0]= m2[2][0];
- m1[2][1]= m2[2][1];
- m1[2][2]= m2[2][2];
-}
-
-/* Butched. See .h for comment */
-/* void Mat4CpyMat3(float m1[][4], float m2[][3]) */
-#ifdef TEST_ACTIVE
-void Mat4CpyMat3(float* m1, float *m2)
-{
- int i;
- for (i = 0; i < 3; i++) {
- m1[(4*i)] = m2[(3*i)];
- m1[(4*i) + 1]= m2[(3*i) + 1];
- m1[(4*i) + 2]= m2[(3*i) + 2];
- m1[(4*i) + 3]= 0.0;
- i++;
- }
-
- m1[12]=m1[13]= m1[14]= 0.0;
- m1[15]= 1.0;
-}
-#else
-
-void Mat4CpyMat3(float m1[][4], float m2[][3]) /* no clear */
-{
- m1[0][0]= m2[0][0];
- m1[0][1]= m2[0][1];
- m1[0][2]= m2[0][2];
-
- m1[1][0]= m2[1][0];
- m1[1][1]= m2[1][1];
- m1[1][2]= m2[1][2];
-
- m1[2][0]= m2[2][0];
- m1[2][1]= m2[2][1];
- m1[2][2]= m2[2][2];
-
- /* Reevan's Bugfix */
- m1[0][3]=0.0F;
- m1[1][3]=0.0F;
- m1[2][3]=0.0F;
-
- m1[3][0]=0.0F;
- m1[3][1]=0.0F;
- m1[3][2]=0.0F;
- m1[3][3]=1.0F;
-
-
-}
-#endif
-
-void Mat3CpyMat3(float m1[][3], float m2[][3])
-{
- /* destination comes first: */
- memcpy(&m1[0], &m2[0], 9*sizeof(float));
-}
-
-void Mat3MulSerie(float answ[][3],
- float m1[][3], float m2[][3], float m3[][3],
- float m4[][3], float m5[][3], float m6[][3],
- float m7[][3], float m8[][3])
-{
- float temp[3][3];
-
- if(m1==0 || m2==0) return;
-
-
- Mat3MulMat3(answ, m2, m1);
- if(m3) {
- Mat3MulMat3(temp, m3, answ);
- if(m4) {
- Mat3MulMat3(answ, m4, temp);
- if(m5) {
- Mat3MulMat3(temp, m5, answ);
- if(m6) {
- Mat3MulMat3(answ, m6, temp);
- if(m7) {
- Mat3MulMat3(temp, m7, answ);
- if(m8) {
- Mat3MulMat3(answ, m8, temp);
- }
- else Mat3CpyMat3(answ, temp);
- }
- }
- else Mat3CpyMat3(answ, temp);
- }
- }
- else Mat3CpyMat3(answ, temp);
- }
-}
-
-void Mat4MulSerie(float answ[][4], float m1[][4],
- float m2[][4], float m3[][4], float m4[][4],
- float m5[][4], float m6[][4], float m7[][4],
- float m8[][4])
-{
- float temp[4][4];
-
- if(m1==0 || m2==0) return;
-
- Mat4MulMat4(answ, m2, m1);
- if(m3) {
- Mat4MulMat4(temp, m3, answ);
- if(m4) {
- Mat4MulMat4(answ, m4, temp);
- if(m5) {
- Mat4MulMat4(temp, m5, answ);
- if(m6) {
- Mat4MulMat4(answ, m6, temp);
- if(m7) {
- Mat4MulMat4(temp, m7, answ);
- if(m8) {
- Mat4MulMat4(answ, m8, temp);
- }
- else Mat4CpyMat4(answ, temp);
- }
- }
- else Mat4CpyMat4(answ, temp);
- }
- }
- else Mat4CpyMat4(answ, temp);
- }
-}
-
-void Mat3BlendMat3(float out[][3], float dst[][3], float src[][3], float srcweight)
-{
- float squat[4], dquat[4], fquat[4];
- float ssize[3], dsize[3], fsize[4];
- float rmat[3][3], smat[3][3];
-
- Mat3ToQuat(dst, dquat);
- Mat3ToSize(dst, dsize);
-
- Mat3ToQuat(src, squat);
- Mat3ToSize(src, ssize);
-
- /* do blending */
- QuatInterpol(fquat, dquat, squat, srcweight);
- VecLerpf(fsize, dsize, ssize, srcweight);
-
- /* compose new matrix */
- QuatToMat3(fquat, rmat);
- SizeToMat3(fsize, smat);
- Mat3MulMat3(out, rmat, smat);
-}
-
-void Mat4BlendMat4(float out[][4], float dst[][4], float src[][4], float srcweight)
-{
- float squat[4], dquat[4], fquat[4];
- float ssize[3], dsize[3], fsize[4];
- float sloc[3], dloc[3], floc[3];
-
- Mat4ToQuat(dst, dquat);
- Mat4ToSize(dst, dsize);
- VecCopyf(dloc, dst[3]);
-
- Mat4ToQuat(src, squat);
- Mat4ToSize(src, ssize);
- VecCopyf(sloc, src[3]);
-
- /* do blending */
- VecLerpf(floc, dloc, sloc, srcweight);
- QuatInterpol(fquat, dquat, squat, srcweight);
- VecLerpf(fsize, dsize, ssize, srcweight);
-
- /* compose new matrix */
- LocQuatSizeToMat4(out, floc, fquat, fsize);
-}
-
-void Mat4Clr(float *m)
-{
- memset(m, 0, 4*4*sizeof(float));
-}
-
-void Mat3Clr(float *m)
-{
- memset(m, 0, 3*3*sizeof(float));
-}
-
-void Mat4One(float m[][4])
-{
-
- m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0;
- m[0][1]= m[0][2]= m[0][3]= 0.0;
- m[1][0]= m[1][2]= m[1][3]= 0.0;
- m[2][0]= m[2][1]= m[2][3]= 0.0;
- m[3][0]= m[3][1]= m[3][2]= 0.0;
-}
-
-void Mat3One(float m[][3])
-{
-
- m[0][0]= m[1][1]= m[2][2]= 1.0;
- m[0][1]= m[0][2]= 0.0;
- m[1][0]= m[1][2]= 0.0;
- m[2][0]= m[2][1]= 0.0;
-}
-
-void Mat4Scale(float m[][4], float scale)
-{
-
- m[0][0]= m[1][1]= m[2][2]= scale;
- m[3][3]= 1.0;
- m[0][1]= m[0][2]= m[0][3]= 0.0;
- m[1][0]= m[1][2]= m[1][3]= 0.0;
- m[2][0]= m[2][1]= m[2][3]= 0.0;
- m[3][0]= m[3][1]= m[3][2]= 0.0;
-}
-
-void Mat3Scale(float m[][3], float scale)
-{
-
- m[0][0]= m[1][1]= m[2][2]= scale;
- m[0][1]= m[0][2]= 0.0;
- m[1][0]= m[1][2]= 0.0;
- m[2][0]= m[2][1]= 0.0;
-}
-
-void Mat4MulVec( float mat[][4], int *vec)
-{
- int x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]=(int)(x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0]);
- vec[1]=(int)(x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1]);
- vec[2]=(int)(x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2]);
-}
-
-void Mat4MulVecfl( float mat[][4], float *vec)
-{
- float x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]=x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0];
- vec[1]=x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1];
- vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2];
-}
-
-void VecMat4MulVecfl(float *in, float mat[][4], float *vec)
-{
- float x,y;
-
- x=vec[0];
- y=vec[1];
- in[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0];
- in[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1];
- in[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2];
-}
-
-void Mat4Mul3Vecfl( float mat[][4], float *vec)
-{
- float x,y;
-
- x= vec[0];
- y= vec[1];
- vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2];
- vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2];
- vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
-}
-
-void Mat4MulVec3Project(float mat[][4], float *vec)
-{
- float w;
-
- w = vec[0]*mat[0][3] + vec[1]*mat[1][3] + vec[2]*mat[2][3] + mat[3][3];
- Mat4MulVecfl(mat, vec);
-
- vec[0] /= w;
- vec[1] /= w;
- vec[2] /= w;
-}
-
-void Mat4MulVec4fl( float mat[][4], float *vec)
-{
- float x,y,z;
-
- x=vec[0];
- y=vec[1];
- z= vec[2];
- vec[0]=x*mat[0][0] + y*mat[1][0] + z*mat[2][0] + mat[3][0]*vec[3];
- vec[1]=x*mat[0][1] + y*mat[1][1] + z*mat[2][1] + mat[3][1]*vec[3];
- vec[2]=x*mat[0][2] + y*mat[1][2] + z*mat[2][2] + mat[3][2]*vec[3];
- vec[3]=x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*vec[3];
-}
-
-void Mat3MulVec( float mat[][3], int *vec)
-{
- int x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]= (int)(x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]);
- vec[1]= (int)(x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]);
- vec[2]= (int)(x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]);
-}
-
-void Mat3MulVecfl( float mat[][3], float *vec)
-{
- float x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2];
- vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2];
- vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
-}
-
-void Mat3MulVecd( float mat[][3], double *vec)
-{
- double x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2];
- vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2];
- vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2];
-}
-
-void Mat3TransMulVecfl( float mat[][3], float *vec)
-{
- float x,y;
-
- x=vec[0];
- y=vec[1];
- vec[0]= x*mat[0][0] + y*mat[0][1] + mat[0][2]*vec[2];
- vec[1]= x*mat[1][0] + y*mat[1][1] + mat[1][2]*vec[2];
- vec[2]= x*mat[2][0] + y*mat[2][1] + mat[2][2]*vec[2];
-}
-
-void Mat3MulFloat(float *m, float f)
-{
- int i;
-
- for(i=0;i<9;i++) m[i]*=f;
-}
-
-void Mat4MulFloat(float *m, float f)
-{
- int i;
-
- for(i=0;i<16;i++) m[i]*=f; /* count to 12: without vector component */
-}
-
-
-void Mat4MulFloat3(float *m, float f) /* only scale component */
-{
- int i,j;
-
- for(i=0; i<3; i++) {
- for(j=0; j<3; j++) {
-
- m[4*i+j] *= f;
- }
- }
-}
-
-void Mat3AddMat3(float m1[][3], float m2[][3], float m3[][3])
-{
- int i, j;
-
- for(i=0;i<3;i++)
- for(j=0;j<3;j++)
- m1[i][j]= m2[i][j] + m3[i][j];
-}
-
-void Mat4AddMat4(float m1[][4], float m2[][4], float m3[][4])
-{
- int i, j;
-
- for(i=0;i<4;i++)
- for(j=0;j<4;j++)
- m1[i][j]= m2[i][j] + m3[i][j];
-}
-
-void VecStar(float mat[][3], float *vec)
-{
-
- mat[0][0]= mat[1][1]= mat[2][2]= 0.0;
- mat[0][1]= -vec[2];
- mat[0][2]= vec[1];
- mat[1][0]= vec[2];
- mat[1][2]= -vec[0];
- mat[2][0]= -vec[1];
- mat[2][1]= vec[0];
-
-}
-#ifdef TEST_ACTIVE
-short EenheidsMat(float mat[][3])
-{
-
- if(mat[0][0]==1.0 && mat[0][1]==0.0 && mat[0][2]==0.0)
- if(mat[1][0]==0.0 && mat[1][1]==1.0 && mat[1][2]==0.0)
- if(mat[2][0]==0.0 && mat[2][1]==0.0 && mat[2][2]==1.0)
- return 1;
- return 0;
-}
-#endif
-
-int FloatCompare( float *v1, float *v2, float limit)
-{
-
- if( fabs(v1[0]-v2[0])FLT_EPSILON) {
- s= sqrt( tr);
- q[0]= (float)s;
- s= 1.0/(4.0*s);
- q[1]= (float)((mat[1][2]-mat[2][1])*s);
- q[2]= (float)((mat[2][0]-mat[0][2])*s);
- q[3]= (float)((mat[0][1]-mat[1][0])*s);
- }
- else {
- if(mat[0][0] > mat[1][1] && mat[0][0] > mat[2][2]) {
- s= 2.0*sqrtf(1.0 + mat[0][0] - mat[1][1] - mat[2][2]);
- q[1]= (float)(0.25*s);
-
- s= 1.0/s;
- q[0]= (float)((mat[2][1] - mat[1][2])*s);
- q[2]= (float)((mat[1][0] + mat[0][1])*s);
- q[3]= (float)((mat[2][0] + mat[0][2])*s);
- }
- else if(mat[1][1] > mat[2][2]) {
- s= 2.0*sqrtf(1.0 + mat[1][1] - mat[0][0] - mat[2][2]);
- q[2]= (float)(0.25*s);
-
- s= 1.0/s;
- q[0]= (float)((mat[2][0] - mat[0][2])*s);
- q[1]= (float)((mat[1][0] + mat[0][1])*s);
- q[3]= (float)((mat[2][1] + mat[1][2])*s);
- }
- else {
- s= 2.0*sqrtf(1.0 + mat[2][2] - mat[0][0] - mat[1][1]);
- q[3]= (float)(0.25*s);
-
- s= 1.0/s;
- q[0]= (float)((mat[1][0] - mat[0][1])*s);
- q[1]= (float)((mat[2][0] + mat[0][2])*s);
- q[2]= (float)((mat[2][1] + mat[1][2])*s);
- }
- }
- NormalQuat(q);
-}
-
-void Mat3ToQuat_is_ok( float wmat[][3], float *q)
-{
- float mat[3][3], matr[3][3], matn[3][3], q1[4], q2[4], angle, si, co, nor[3];
-
- /* work on a copy */
- Mat3CpyMat3(mat, wmat);
- Mat3Ortho(mat);
-
- /* rotate z-axis of matrix to z-axis */
-
- nor[0] = mat[2][1]; /* cross product with (0,0,1) */
- nor[1] = -mat[2][0];
- nor[2] = 0.0;
- Normalize(nor);
-
- co= mat[2][2];
- angle= 0.5f*saacos(co);
-
- co= (float)cos(angle);
- si= (float)sin(angle);
- q1[0]= co;
- q1[1]= -nor[0]*si; /* negative here, but why? */
- q1[2]= -nor[1]*si;
- q1[3]= -nor[2]*si;
-
- /* rotate back x-axis from mat, using inverse q1 */
- QuatToMat3(q1, matr);
- Mat3Inv(matn, matr);
- Mat3MulVecfl(matn, mat[0]);
-
- /* and align x-axes */
- angle= (float)(0.5*atan2(mat[0][1], mat[0][0]));
-
- co= (float)cos(angle);
- si= (float)sin(angle);
- q2[0]= co;
- q2[1]= 0.0f;
- q2[2]= 0.0f;
- q2[3]= si;
-
- QuatMul(q, q1, q2);
-}
-
-
-void Mat4ToQuat( float m[][4], float *q)
-{
- float mat[3][3];
-
- Mat3CpyMat4(mat, m);
- Mat3ToQuat(mat, q);
-
-}
-
-void QuatOne(float *q)
-{
- q[0]= 1.0;
- q[1]= q[2]= q[3]= 0.0;
-}
-
-void NormalQuat(float *q)
-{
- float len;
-
- len= (float)sqrt(q[0]*q[0]+q[1]*q[1]+q[2]*q[2]+q[3]*q[3]);
- if(len!=0.0) {
- q[0]/= len;
- q[1]/= len;
- q[2]/= len;
- q[3]/= len;
- } else {
- q[1]= 1.0f;
- q[0]= q[2]= q[3]= 0.0f;
- }
-}
-
-void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3])
-{
- float axis[3];
- float angle;
-
- Crossf(axis, v1, v2);
-
- angle = NormalizedVecAngle2(v1, v2);
-
- AxisAngleToQuat(q, axis, angle);
-}
-
-void vectoquat(float *vec, short axis, short upflag, float *q)
-{
- float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1;
-
- /* first rotate to axis */
- if(axis>2) {
- x2= vec[0] ; y2= vec[1] ; z2= vec[2];
- axis-= 3;
- }
- else {
- x2= -vec[0] ; y2= -vec[1] ; z2= -vec[2];
- }
-
- q[0]=1.0;
- q[1]=q[2]=q[3]= 0.0;
-
- len1= (float)sqrt(x2*x2+y2*y2+z2*z2);
- if(len1 == 0.0) return;
-
- /* nasty! I need a good routine for this...
- * problem is a rotation of an Y axis to the negative Y-axis for example.
- */
-
- if(axis==0) { /* x-axis */
- nor[0]= 0.0;
- nor[1]= -z2;
- nor[2]= y2;
-
- if(fabs(y2)+fabs(z2)<0.0001)
- nor[1]= 1.0;
-
- co= x2;
- }
- else if(axis==1) { /* y-axis */
- nor[0]= z2;
- nor[1]= 0.0;
- nor[2]= -x2;
-
- if(fabs(x2)+fabs(z2)<0.0001)
- nor[2]= 1.0;
-
- co= y2;
- }
- else { /* z-axis */
- nor[0]= -y2;
- nor[1]= x2;
- nor[2]= 0.0;
-
- if(fabs(x2)+fabs(y2)<0.0001)
- nor[0]= 1.0;
-
- co= z2;
- }
- co/= len1;
-
- Normalize(nor);
-
- angle= 0.5f*saacos(co);
- si= (float)sin(angle);
- q[0]= (float)cos(angle);
- q[1]= nor[0]*si;
- q[2]= nor[1]*si;
- q[3]= nor[2]*si;
-
- if(axis!=upflag) {
- QuatToMat3(q, mat);
-
- fp= mat[2];
- if(axis==0) {
- if(upflag==1) angle= (float)(0.5*atan2(fp[2], fp[1]));
- else angle= (float)(-0.5*atan2(fp[1], fp[2]));
- }
- else if(axis==1) {
- if(upflag==0) angle= (float)(-0.5*atan2(fp[2], fp[0]));
- else angle= (float)(0.5*atan2(fp[0], fp[2]));
- }
- else {
- if(upflag==0) angle= (float)(0.5*atan2(-fp[1], -fp[0]));
- else angle= (float)(-0.5*atan2(-fp[0], -fp[1]));
- }
-
- co= (float)cos(angle);
- si= (float)(sin(angle)/len1);
- q2[0]= co;
- q2[1]= x2*si;
- q2[2]= y2*si;
- q2[3]= z2*si;
-
- QuatMul(q,q2,q);
- }
-}
-
-void VecUpMat3old( float *vec, float mat[][3], short axis)
-{
- float inp, up[3];
- short cox = 0, coy = 0, coz = 0;
-
- /* using different up's is not useful, infact there is no real 'up'!
- */
-
- up[0]= 0.0;
- up[1]= 0.0;
- up[2]= 1.0;
-
- if(axis==0) {
- cox= 0; coy= 1; coz= 2; /* Y up Z tr */
- }
- if(axis==1) {
- cox= 1; coy= 2; coz= 0; /* Z up X tr */
- }
- if(axis==2) {
- cox= 2; coy= 0; coz= 1; /* X up Y tr */
- }
- if(axis==3) {
- cox= 0; coy= 2; coz= 1; /* */
- }
- if(axis==4) {
- cox= 1; coy= 0; coz= 2; /* */
- }
- if(axis==5) {
- cox= 2; coy= 1; coz= 0; /* Y up X tr */
- }
-
- mat[coz][0]= vec[0];
- mat[coz][1]= vec[1];
- mat[coz][2]= vec[2];
- Normalize((float *)mat[coz]);
-
- inp= mat[coz][0]*up[0] + mat[coz][1]*up[1] + mat[coz][2]*up[2];
- mat[coy][0]= up[0] - inp*mat[coz][0];
- mat[coy][1]= up[1] - inp*mat[coz][1];
- mat[coy][2]= up[2] - inp*mat[coz][2];
-
- Normalize((float *)mat[coy]);
-
- Crossf(mat[cox], mat[coy], mat[coz]);
-
-}
-
-void VecUpMat3(float *vec, float mat[][3], short axis)
-{
- float inp;
- short cox = 0, coy = 0, coz = 0;
-
- /* using different up's is not useful, infact there is no real 'up'!
- */
-
- if(axis==0) {
- cox= 0; coy= 1; coz= 2; /* Y up Z tr */
- }
- if(axis==1) {
- cox= 1; coy= 2; coz= 0; /* Z up X tr */
- }
- if(axis==2) {
- cox= 2; coy= 0; coz= 1; /* X up Y tr */
- }
- if(axis==3) {
- cox= 0; coy= 1; coz= 2; /* Y op -Z tr */
- vec[0]= -vec[0];
- vec[1]= -vec[1];
- vec[2]= -vec[2];
- }
- if(axis==4) {
- cox= 1; coy= 0; coz= 2; /* */
- }
- if(axis==5) {
- cox= 2; coy= 1; coz= 0; /* Y up X tr */
- }
-
- mat[coz][0]= vec[0];
- mat[coz][1]= vec[1];
- mat[coz][2]= vec[2];
- Normalize((float *)mat[coz]);
-
- inp= mat[coz][2];
- mat[coy][0]= - inp*mat[coz][0];
- mat[coy][1]= - inp*mat[coz][1];
- mat[coy][2]= 1.0f - inp*mat[coz][2];
-
- Normalize((float *)mat[coy]);
-
- Crossf(mat[cox], mat[coy], mat[coz]);
-
-}
-
-/* A & M Watt, Advanced animation and rendering techniques, 1992 ACM press */
-void QuatInterpolW(float *, float *, float *, float ); // XXX why this?
-
-void QuatInterpolW(float *result, float *quat1, float *quat2, float t)
-{
- float omega, cosom, sinom, sc1, sc2;
-
- cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ;
-
- /* rotate around shortest angle */
- if ((1.0f + cosom) > 0.0001f) {
-
- if ((1.0f - cosom) > 0.0001f) {
- omega = (float)acos(cosom);
- sinom = (float)sin(omega);
- sc1 = (float)sin((1.0 - t) * omega) / sinom;
- sc2 = (float)sin(t * omega) / sinom;
- }
- else {
- sc1 = 1.0f - t;
- sc2 = t;
- }
- result[0] = sc1*quat1[0] + sc2*quat2[0];
- result[1] = sc1*quat1[1] + sc2*quat2[1];
- result[2] = sc1*quat1[2] + sc2*quat2[2];
- result[3] = sc1*quat1[3] + sc2*quat2[3];
- }
- else {
- result[0] = quat2[3];
- result[1] = -quat2[2];
- result[2] = quat2[1];
- result[3] = -quat2[0];
-
- sc1 = (float)sin((1.0 - t)*M_PI_2);
- sc2 = (float)sin(t*M_PI_2);
-
- result[0] = sc1*quat1[0] + sc2*result[0];
- result[1] = sc1*quat1[1] + sc2*result[1];
- result[2] = sc1*quat1[2] + sc2*result[2];
- result[3] = sc1*quat1[3] + sc2*result[3];
- }
-}
-
-void QuatInterpol(float *result, float *quat1, float *quat2, float t)
-{
- float quat[4], omega, cosom, sinom, sc1, sc2;
-
- cosom = quat1[0]*quat2[0] + quat1[1]*quat2[1] + quat1[2]*quat2[2] + quat1[3]*quat2[3] ;
-
- /* rotate around shortest angle */
- if (cosom < 0.0f) {
- cosom = -cosom;
- quat[0]= -quat1[0];
- quat[1]= -quat1[1];
- quat[2]= -quat1[2];
- quat[3]= -quat1[3];
- }
- else {
- quat[0]= quat1[0];
- quat[1]= quat1[1];
- quat[2]= quat1[2];
- quat[3]= quat1[3];
- }
-
- if ((1.0f - cosom) > 0.0001f) {
- omega = (float)acos(cosom);
- sinom = (float)sin(omega);
- sc1 = (float)sin((1 - t) * omega) / sinom;
- sc2 = (float)sin(t * omega) / sinom;
- } else {
- sc1= 1.0f - t;
- sc2= t;
- }
-
- result[0] = sc1 * quat[0] + sc2 * quat2[0];
- result[1] = sc1 * quat[1] + sc2 * quat2[1];
- result[2] = sc1 * quat[2] + sc2 * quat2[2];
- result[3] = sc1 * quat[3] + sc2 * quat2[3];
-}
-
-void QuatAdd(float *result, float *quat1, float *quat2, float t)
-{
- result[0]= quat1[0] + t*quat2[0];
- result[1]= quat1[1] + t*quat2[1];
- result[2]= quat1[2] + t*quat2[2];
- result[3]= quat1[3] + t*quat2[3];
-}
-
-void QuatCopy(float *q1, float *q2)
-{
- q1[0]= q2[0];
- q1[1]= q2[1];
- q1[2]= q2[2];
- q1[3]= q2[3];
-}
-
-/* **************** DUAL QUATERNIONS ************** */
-
-/*
- Conversion routines between (regular quaternion, translation) and
- dual quaternion.
-
- Version 1.0.0, February 7th, 2007
-
- Copyright (C) 2006-2007 University of Dublin, Trinity College, All Rights
- Reserved
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the author(s) be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Author: Ladislav Kavan, kavanl@cs.tcd.ie
-
- Changes for Blender:
- - renaming, style changes and optimizations
- - added support for scaling
-*/
-
-void Mat4ToDQuat(float basemat[][4], float mat[][4], DualQuat *dq)
-{
- float *t, *q, dscale[3], scale[3], basequat[4];
- float baseRS[4][4], baseinv[4][4], baseR[4][4], baseRinv[4][4];
- float R[4][4], S[4][4];
-
- /* split scaling and rotation, there is probably a faster way to do
- this, it's done like this now to correctly get negative scaling */
- Mat4MulMat4(baseRS, basemat, mat);
- Mat4ToSize(baseRS, scale);
-
- VecCopyf(dscale, scale);
- dscale[0] -= 1.0f; dscale[1] -= 1.0f; dscale[2] -= 1.0f;
-
- if((Det4x4(mat) < 0.0f) || VecLength(dscale) > 1e-4) {
- /* extract R and S */
- Mat4ToQuat(baseRS, basequat);
- QuatToMat4(basequat, baseR);
- VecCopyf(baseR[3], baseRS[3]);
-
- Mat4Invert(baseinv, basemat);
- Mat4MulMat4(R, baseinv, baseR);
-
- Mat4Invert(baseRinv, baseR);
- Mat4MulMat4(S, baseRS, baseRinv);
-
- /* set scaling part */
- Mat4MulSerie(dq->scale, basemat, S, baseinv, 0, 0, 0, 0, 0);
- dq->scale_weight= 1.0f;
- }
- else {
- /* matrix does not contain scaling */
- Mat4CpyMat4(R, mat);
- dq->scale_weight= 0.0f;
- }
-
- /* non-dual part */
- Mat4ToQuat(R, dq->quat);
-
- /* dual part */
- t= R[3];
- q= dq->quat;
- dq->trans[0]= -0.5f*( t[0]*q[1] + t[1]*q[2] + t[2]*q[3]);
- dq->trans[1]= 0.5f*( t[0]*q[0] + t[1]*q[3] - t[2]*q[2]);
- dq->trans[2]= 0.5f*(-t[0]*q[3] + t[1]*q[0] + t[2]*q[1]);
- dq->trans[3]= 0.5f*( t[0]*q[2] - t[1]*q[1] + t[2]*q[0]);
-}
-
-void DQuatToMat4(DualQuat *dq, float mat[][4])
-{
- float len, *t, q0[4];
-
- /* regular quaternion */
- QuatCopy(q0, dq->quat);
-
- /* normalize */
- len= (float)sqrt(QuatDot(q0, q0));
- if(len != 0.0f)
- QuatMulf(q0, 1.0f/len);
-
- /* rotation */
- QuatToMat4(q0, mat);
-
- /* translation */
- t= dq->trans;
- mat[3][0]= 2.0f*(-t[0]*q0[1] + t[1]*q0[0] - t[2]*q0[3] + t[3]*q0[2]);
- mat[3][1]= 2.0f*(-t[0]*q0[2] + t[1]*q0[3] + t[2]*q0[0] - t[3]*q0[1]);
- mat[3][2]= 2.0f*(-t[0]*q0[3] - t[1]*q0[2] + t[2]*q0[1] + t[3]*q0[0]);
-
- /* note: this does not handle scaling */
-}
-
-void DQuatAddWeighted(DualQuat *dqsum, DualQuat *dq, float weight)
-{
- int flipped= 0;
-
- /* make sure we interpolate quats in the right direction */
- if (QuatDot(dq->quat, dqsum->quat) < 0) {
- flipped= 1;
- weight= -weight;
- }
-
- /* interpolate rotation and translation */
- dqsum->quat[0] += weight*dq->quat[0];
- dqsum->quat[1] += weight*dq->quat[1];
- dqsum->quat[2] += weight*dq->quat[2];
- dqsum->quat[3] += weight*dq->quat[3];
-
- dqsum->trans[0] += weight*dq->trans[0];
- dqsum->trans[1] += weight*dq->trans[1];
- dqsum->trans[2] += weight*dq->trans[2];
- dqsum->trans[3] += weight*dq->trans[3];
-
- /* interpolate scale - but only if needed */
- if (dq->scale_weight) {
- float wmat[4][4];
-
- if(flipped) /* we don't want negative weights for scaling */
- weight= -weight;
-
- Mat4CpyMat4(wmat, dq->scale);
- Mat4MulFloat((float*)wmat, weight);
- Mat4AddMat4(dqsum->scale, dqsum->scale, wmat);
- dqsum->scale_weight += weight;
- }
-}
-
-void DQuatNormalize(DualQuat *dq, float totweight)
-{
- float scale= 1.0f/totweight;
-
- QuatMulf(dq->quat, scale);
- QuatMulf(dq->trans, scale);
-
- if(dq->scale_weight) {
- float addweight= totweight - dq->scale_weight;
-
- if(addweight) {
- dq->scale[0][0] += addweight;
- dq->scale[1][1] += addweight;
- dq->scale[2][2] += addweight;
- dq->scale[3][3] += addweight;
- }
-
- Mat4MulFloat((float*)dq->scale, scale);
- dq->scale_weight= 1.0f;
- }
-}
-
-void DQuatMulVecfl(DualQuat *dq, float *co, float mat[][3])
-{
- float M[3][3], t[3], scalemat[3][3], len2;
- float w= dq->quat[0], x= dq->quat[1], y= dq->quat[2], z= dq->quat[3];
- float t0= dq->trans[0], t1= dq->trans[1], t2= dq->trans[2], t3= dq->trans[3];
-
- /* rotation matrix */
- M[0][0]= w*w + x*x - y*y - z*z;
- M[1][0]= 2*(x*y - w*z);
- M[2][0]= 2*(x*z + w*y);
-
- M[0][1]= 2*(x*y + w*z);
- M[1][1]= w*w + y*y - x*x - z*z;
- M[2][1]= 2*(y*z - w*x);
-
- M[0][2]= 2*(x*z - w*y);
- M[1][2]= 2*(y*z + w*x);
- M[2][2]= w*w + z*z - x*x - y*y;
-
- len2= QuatDot(dq->quat, dq->quat);
- if(len2 > 0.0f)
- len2= 1.0f/len2;
-
- /* translation */
- t[0]= 2*(-t0*x + w*t1 - t2*z + y*t3);
- t[1]= 2*(-t0*y + t1*z - x*t3 + w*t2);
- t[2]= 2*(-t0*z + x*t2 + w*t3 - t1*y);
-
- /* apply scaling */
- if(dq->scale_weight)
- Mat4MulVecfl(dq->scale, co);
-
- /* apply rotation and translation */
- Mat3MulVecfl(M, co);
- co[0]= (co[0] + t[0])*len2;
- co[1]= (co[1] + t[1])*len2;
- co[2]= (co[2] + t[2])*len2;
-
- /* compute crazyspace correction mat */
- if(mat) {
- if(dq->scale_weight) {
- Mat3CpyMat4(scalemat, dq->scale);
- Mat3MulMat3(mat, M, scalemat);
- }
- else
- Mat3CpyMat3(mat, M);
- Mat3MulFloat((float*)mat, len2);
- }
-}
-
-void DQuatCpyDQuat(DualQuat *dq1, DualQuat *dq2)
-{
- memcpy(dq1, dq2, sizeof(DualQuat));
-}
-
-/* **************** VIEW / PROJECTION ******************************** */
-
-
-void i_ortho(
- float left, float right,
- float bottom, float top,
- float nearClip, float farClip,
- float matrix[][4]
-){
- float Xdelta, Ydelta, Zdelta;
-
- Xdelta = right - left;
- Ydelta = top - bottom;
- Zdelta = farClip - nearClip;
- if (Xdelta == 0.0 || Ydelta == 0.0 || Zdelta == 0.0) {
- return;
- }
- Mat4One(matrix);
- matrix[0][0] = 2.0f/Xdelta;
- matrix[3][0] = -(right + left)/Xdelta;
- matrix[1][1] = 2.0f/Ydelta;
- matrix[3][1] = -(top + bottom)/Ydelta;
- matrix[2][2] = -2.0f/Zdelta; /* note: negate Z */
- matrix[3][2] = -(farClip + nearClip)/Zdelta;
-}
-
-void i_window(
- float left, float right,
- float bottom, float top,
- float nearClip, float farClip,
- float mat[][4]
-){
- float Xdelta, Ydelta, Zdelta;
-
- Xdelta = right - left;
- Ydelta = top - bottom;
- Zdelta = farClip - nearClip;
-
- if (Xdelta == 0.0 || Ydelta == 0.0 || Zdelta == 0.0) {
- return;
- }
- mat[0][0] = nearClip * 2.0f/Xdelta;
- mat[1][1] = nearClip * 2.0f/Ydelta;
- mat[2][0] = (right + left)/Xdelta; /* note: negate Z */
- mat[2][1] = (top + bottom)/Ydelta;
- mat[2][2] = -(farClip + nearClip)/Zdelta;
- mat[2][3] = -1.0f;
- mat[3][2] = (-2.0f * nearClip * farClip)/Zdelta;
- mat[0][1] = mat[0][2] = mat[0][3] =
- mat[1][0] = mat[1][2] = mat[1][3] =
- mat[3][0] = mat[3][1] = mat[3][3] = 0.0;
-
-}
-
-void i_translate(float Tx, float Ty, float Tz, float mat[][4])
-{
- mat[3][0] += (Tx*mat[0][0] + Ty*mat[1][0] + Tz*mat[2][0]);
- mat[3][1] += (Tx*mat[0][1] + Ty*mat[1][1] + Tz*mat[2][1]);
- mat[3][2] += (Tx*mat[0][2] + Ty*mat[1][2] + Tz*mat[2][2]);
-}
-
-void i_multmatrix( float icand[][4], float Vm[][4])
-{
- int row, col;
- float temp[4][4];
-
- for(row=0 ; row<4 ; row++)
- for(col=0 ; col<4 ; col++)
- temp[row][col] = icand[row][0] * Vm[0][col]
- + icand[row][1] * Vm[1][col]
- + icand[row][2] * Vm[2][col]
- + icand[row][3] * Vm[3][col];
- Mat4CpyMat4(Vm, temp);
-}
-
-void i_rotate(float angle, char axis, float mat[][4])
-{
- int col;
- float temp[4];
- float cosine, sine;
-
- for(col=0; col<4 ; col++) /* init temp to zero matrix */
- temp[col] = 0;
-
- angle = (float)(angle*(3.1415926535/180.0));
- cosine = (float)cos(angle);
- sine = (float)sin(angle);
- switch(axis){
- case 'x':
- case 'X':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[1][col] + sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = - sine*mat[1][col] + cosine*mat[2][col];
- mat[1][col] = temp[col];
- }
- break;
-
- case 'y':
- case 'Y':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] - sine*mat[2][col];
- for(col=0 ; col<4 ; col++) {
- mat[2][col] = sine*mat[0][col] + cosine*mat[2][col];
- mat[0][col] = temp[col];
- }
- break;
-
- case 'z':
- case 'Z':
- for(col=0 ; col<4 ; col++)
- temp[col] = cosine*mat[0][col] + sine*mat[1][col];
- for(col=0 ; col<4 ; col++) {
- mat[1][col] = - sine*mat[0][col] + cosine*mat[1][col];
- mat[0][col] = temp[col];
- }
- break;
- }
-}
-
-void i_polarview(float dist, float azimuth, float incidence, float twist, float Vm[][4])
-{
-
- Mat4One(Vm);
-
- i_translate(0.0, 0.0, -dist, Vm);
- i_rotate(-twist,'z', Vm);
- i_rotate(-incidence,'x', Vm);
- i_rotate(-azimuth,'z', Vm);
-}
-
-void i_lookat(float vx, float vy, float vz, float px, float py, float pz, float twist, float mat[][4])
-{
- float sine, cosine, hyp, hyp1, dx, dy, dz;
- float mat1[4][4];
-
- Mat4One(mat);
- Mat4One(mat1);
-
- i_rotate(-twist,'z', mat);
-
- dx = px - vx;
- dy = py - vy;
- dz = pz - vz;
- hyp = dx * dx + dz * dz; /* hyp squared */
- hyp1 = (float)sqrt(dy*dy + hyp);
- hyp = (float)sqrt(hyp); /* the real hyp */
-
- if (hyp1 != 0.0) { /* rotate X */
- sine = -dy / hyp1;
- cosine = hyp /hyp1;
- } else {
- sine = 0;
- cosine = 1.0f;
- }
- mat1[1][1] = cosine;
- mat1[1][2] = sine;
- mat1[2][1] = -sine;
- mat1[2][2] = cosine;
-
- i_multmatrix(mat1, mat);
-
- mat1[1][1] = mat1[2][2] = 1.0f; /* be careful here to reinit */
- mat1[1][2] = mat1[2][1] = 0.0; /* those modified by the last */
-
- /* paragraph */
- if (hyp != 0.0f) { /* rotate Y */
- sine = dx / hyp;
- cosine = -dz / hyp;
- } else {
- sine = 0;
- cosine = 1.0f;
- }
- mat1[0][0] = cosine;
- mat1[0][2] = -sine;
- mat1[2][0] = sine;
- mat1[2][2] = cosine;
-
- i_multmatrix(mat1, mat);
- i_translate(-vx,-vy,-vz, mat); /* translate viewpoint to origin */
-}
-
-
-
-
-
-/* ************************************************ */
-
-void Mat3Orthogonal(float mat[][3], int axis)
-{
- float size[3];
- size[0] = VecLength(mat[0]);
- size[1] = VecLength(mat[1]);
- size[2] = VecLength(mat[2]);
- Normalize(mat[axis]);
- switch(axis)
- {
- case 0:
- if (Inpf(mat[0], mat[1]) < 1) {
- Crossf(mat[2], mat[0], mat[1]);
- Normalize(mat[2]);
- Crossf(mat[1], mat[2], mat[0]);
- } else if (Inpf(mat[0], mat[2]) < 1) {
- Crossf(mat[1], mat[2], mat[0]);
- Normalize(mat[1]);
- Crossf(mat[2], mat[0], mat[1]);
- } else {
- float vec[3] = {mat[0][1], mat[0][2], mat[0][0]};
-
- Crossf(mat[2], mat[0], vec);
- Normalize(mat[2]);
- Crossf(mat[1], mat[2], mat[0]);
- }
- case 1:
- if (Inpf(mat[1], mat[0]) < 1) {
- Crossf(mat[2], mat[0], mat[1]);
- Normalize(mat[2]);
- Crossf(mat[0], mat[1], mat[2]);
- } else if (Inpf(mat[0], mat[2]) < 1) {
- Crossf(mat[0], mat[1], mat[2]);
- Normalize(mat[0]);
- Crossf(mat[2], mat[0], mat[1]);
- } else {
- float vec[3] = {mat[1][1], mat[1][2], mat[1][0]};
-
- Crossf(mat[0], mat[1], vec);
- Normalize(mat[0]);
- Crossf(mat[2], mat[0], mat[1]);
- }
- case 2:
- if (Inpf(mat[2], mat[0]) < 1) {
- Crossf(mat[1], mat[2], mat[0]);
- Normalize(mat[1]);
- Crossf(mat[0], mat[1], mat[2]);
- } else if (Inpf(mat[2], mat[1]) < 1) {
- Crossf(mat[0], mat[1], mat[2]);
- Normalize(mat[0]);
- Crossf(mat[1], mat[2], mat[0]);
- } else {
- float vec[3] = {mat[2][1], mat[2][2], mat[2][0]};
-
- Crossf(mat[0], vec, mat[2]);
- Normalize(mat[0]);
- Crossf(mat[1], mat[2], mat[0]);
- }
- }
- VecMulf(mat[0], size[0]);
- VecMulf(mat[1], size[1]);
- VecMulf(mat[2], size[2]);
-}
-
-void Mat4Orthogonal(float mat[][4], int axis)
-{
- float size[3];
- size[0] = VecLength(mat[0]);
- size[1] = VecLength(mat[1]);
- size[2] = VecLength(mat[2]);
- Normalize(mat[axis]);
- switch(axis)
- {
- case 0:
- if (Inpf(mat[0], mat[1]) < 1) {
- Crossf(mat[2], mat[0], mat[1]);
- Normalize(mat[2]);
- Crossf(mat[1], mat[2], mat[0]);
- } else if (Inpf(mat[0], mat[2]) < 1) {
- Crossf(mat[1], mat[2], mat[0]);
- Normalize(mat[1]);
- Crossf(mat[2], mat[0], mat[1]);
- } else {
- float vec[3] = {mat[0][1], mat[0][2], mat[0][0]};
-
- Crossf(mat[2], mat[0], vec);
- Normalize(mat[2]);
- Crossf(mat[1], mat[2], mat[0]);
- }
- case 1:
- Normalize(mat[0]);
- if (Inpf(mat[1], mat[0]) < 1) {
- Crossf(mat[2], mat[0], mat[1]);
- Normalize(mat[2]);
- Crossf(mat[0], mat[1], mat[2]);
- } else if (Inpf(mat[0], mat[2]) < 1) {
- Crossf(mat[0], mat[1], mat[2]);
- Normalize(mat[0]);
- Crossf(mat[2], mat[0], mat[1]);
- } else {
- float vec[3] = {mat[1][1], mat[1][2], mat[1][0]};
-
- Crossf(mat[0], mat[1], vec);
- Normalize(mat[0]);
- Crossf(mat[2], mat[0], mat[1]);
- }
- case 2:
- if (Inpf(mat[2], mat[0]) < 1) {
- Crossf(mat[1], mat[2], mat[0]);
- Normalize(mat[1]);
- Crossf(mat[0], mat[1], mat[2]);
- } else if (Inpf(mat[2], mat[1]) < 1) {
- Crossf(mat[0], mat[1], mat[2]);
- Normalize(mat[0]);
- Crossf(mat[1], mat[2], mat[0]);
- } else {
- float vec[3] = {mat[2][1], mat[2][2], mat[2][0]};
-
- Crossf(mat[0], vec, mat[2]);
- Normalize(mat[0]);
- Crossf(mat[1], mat[2], mat[0]);
- }
- }
- VecMulf(mat[0], size[0]);
- VecMulf(mat[1], size[1]);
- VecMulf(mat[2], size[2]);
-}
-
-int IsMat3Orthogonal(float mat[][3])
-{
- if (fabs(Inpf(mat[0], mat[1])) > 1.5 * FLT_EPSILON)
- return 0;
-
- if (fabs(Inpf(mat[1], mat[2])) > 1.5 * FLT_EPSILON)
- return 0;
-
- if (fabs(Inpf(mat[0], mat[2])) > 1.5 * FLT_EPSILON)
- return 0;
-
- return 1;
-}
-
-int IsMat4Orthogonal(float mat[][4])
-{
- if (fabs(Inpf(mat[0], mat[1])) > 1.5 * FLT_EPSILON)
- return 0;
-
- if (fabs(Inpf(mat[1], mat[2])) > 1.5 * FLT_EPSILON)
- return 0;
-
- if (fabs(Inpf(mat[0], mat[2])) > 1.5 * FLT_EPSILON)
- return 0;
-
- return 1;
-}
-
-void Mat3Ortho(float mat[][3])
-{
- Normalize(mat[0]);
- Normalize(mat[1]);
- Normalize(mat[2]);
-}
-
-void Mat4Ortho(float mat[][4])
-{
- float len;
-
- len= Normalize(mat[0]);
- if(len!=0.0) mat[0][3]/= len;
- len= Normalize(mat[1]);
- if(len!=0.0) mat[1][3]/= len;
- len= Normalize(mat[2]);
- if(len!=0.0) mat[2][3]/= len;
-}
-
-void VecCopyf(float *v1, float *v2)
-{
- v1[0]= v2[0];
- v1[1]= v2[1];
- v1[2]= v2[2];
-}
-
-int VecLen( int *v1, int *v2)
-{
- float x,y,z;
-
- x=(float)(v1[0]-v2[0]);
- y=(float)(v1[1]-v2[1]);
- z=(float)(v1[2]-v2[2]);
- return (int)floor(sqrt(x*x+y*y+z*z));
-}
-
-float VecLenf(float v1[3], float v2[3])
-{
- float x,y,z;
-
- x=v1[0]-v2[0];
- y=v1[1]-v2[1];
- z=v1[2]-v2[2];
- return (float)sqrt(x*x+y*y+z*z);
-}
-
-float VecLength(float *v)
-{
- return (float) sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
-}
-
-void VecAddf(float *v, float *v1, float *v2)
-{
- v[0]= v1[0]+ v2[0];
- v[1]= v1[1]+ v2[1];
- v[2]= v1[2]+ v2[2];
-}
-
-void VecSubf(float *v, float *v1, float *v2)
-{
- v[0]= v1[0]- v2[0];
- v[1]= v1[1]- v2[1];
- v[2]= v1[2]- v2[2];
-}
-
-void VecMulVecf(float *v, float *v1, float *v2)
-{
- v[0] = v1[0] * v2[0];
- v[1] = v1[1] * v2[1];
- v[2] = v1[2] * v2[2];
-}
-
-void VecLerpf(float *target, const float *a, const float *b, const float t)
-{
- const float s = 1.0f-t;
-
- target[0]= s*a[0] + t*b[0];
- target[1]= s*a[1] + t*b[1];
- target[2]= s*a[2] + t*b[2];
-}
-
-void Vec2Lerpf(float *target, const float *a, const float *b, const float t)
-{
- const float s = 1.0f-t;
-
- target[0]= s*a[0] + t*b[0];
- target[1]= s*a[1] + t*b[1];
-}
-
-/* weight 3 vectors, (VecWeightf in 2.4x)
- * 'w' must be unit length but is not a vector, just 3 weights */
-void VecLerp3f(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
-{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
- p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2];
-}
-
-/* weight 3 2D vectors, (Vec2Weightf in 2.4x)
- * 'w' must be unit length but is not a vector, just 3 weights */
-void Vec2Lerp3f(float p[2], const float v1[2], const float v2[2], const float v3[2], const float w[3])
-{
- p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
- p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
-}
-
-void VecMidf(float *v, float *v1, float *v2)
-{
- v[0]= 0.5f*(v1[0]+ v2[0]);
- v[1]= 0.5f*(v1[1]+ v2[1]);
- v[2]= 0.5f*(v1[2]+ v2[2]);
-}
-
-void VecMulf(float *v1, float f)
-{
-
- v1[0]*= f;
- v1[1]*= f;
- v1[2]*= f;
-}
-
-void VecNegf(float *v1)
-{
- v1[0] = -v1[0];
- v1[1] = -v1[1];
- v1[2] = -v1[2];
-}
-
-void VecOrthoBasisf(float *v, float *v1, float *v2)
-{
- const float f = (float)sqrt(v[0]*v[0] + v[1]*v[1]);
-
- if (f < 1e-35f) {
- // degenerate case
- v1[0] = (v[2] < 0.0f) ? -1.0f : 1.0f;
- v1[1] = v1[2] = v2[0] = v2[2] = 0.0f;
- v2[1] = 1.0f;
- }
- else {
- const float d= 1.0f/f;
-
- v1[0] = v[1]*d;
- v1[1] = -v[0]*d;
- v1[2] = 0.0f;
- v2[0] = -v[2]*v1[1];
- v2[1] = v[2]*v1[0];
- v2[2] = v[0]*v1[1] - v[1]*v1[0];
- }
-}
-
-int VecLenCompare(float *v1, float *v2, float limit)
-{
- float x,y,z;
-
- x=v1[0]-v2[0];
- y=v1[1]-v2[1];
- z=v1[2]-v2[2];
-
- return ((x*x + y*y + z*z) < (limit*limit));
-}
-
-int VecCompare( float *v1, float *v2, float limit)
-{
- if( fabs(v1[0]-v2[0])=1.0) {
- pt[0]= v3[0];
- pt[1]= v3[1];
- }
- else {
- pt[0]= labda*rc[0]+v2[0];
- pt[1]= labda*rc[1]+v2[1];
- }
-
- rc[0]= pt[0]-v1[0];
- rc[1]= pt[1]-v1[1];
- return (float)sqrt(rc[0]*rc[0]+ rc[1]*rc[1]);
-}
-
-float AreaF2Dfl( float *v1, float *v2, float *v3)
-{
- return (float)(0.5*fabs( (v1[0]-v2[0])*(v2[1]-v3[1]) + (v1[1]-v2[1])*(v3[0]-v2[0]) ));
-}
-
-
-float AreaQ3Dfl( float *v1, float *v2, float *v3, float *v4) /* only convex Quadrilaterals */
-{
- float len, vec1[3], vec2[3], n[3];
-
- VecSubf(vec1, v2, v1);
- VecSubf(vec2, v4, v1);
- Crossf(n, vec1, vec2);
- len= Normalize(n);
-
- VecSubf(vec1, v4, v3);
- VecSubf(vec2, v2, v3);
- Crossf(n, vec1, vec2);
- len+= Normalize(n);
-
- return (len/2.0f);
-}
-
-float AreaT3Dfl( float *v1, float *v2, float *v3) /* Triangles */
-{
- float len, vec1[3], vec2[3], n[3];
-
- VecSubf(vec1, v3, v2);
- VecSubf(vec2, v1, v2);
- Crossf(n, vec1, vec2);
- len= Normalize(n);
-
- return (len/2.0f);
-}
-
-#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
-#define MAX3(x,y,z) MAX2( MAX2((x),(y)) , (z) )
-
-
-float AreaPoly3Dfl(int nr, float *verts, float *normal)
-{
- float x, y, z, area, max;
- float *cur, *prev;
- int a, px=0, py=1;
-
- /* first: find dominant axis: 0==X, 1==Y, 2==Z */
- x= (float)fabs(normal[0]);
- y= (float)fabs(normal[1]);
- z= (float)fabs(normal[2]);
- max = MAX3(x, y, z);
- if(max==y) py=2;
- else if(max==x) {
- px=1;
- py= 2;
- }
-
- /* The Trapezium Area Rule */
- prev= verts+3*(nr-1);
- cur= verts;
- area= 0;
- for(a=0; a=0.0f && labda<=1.0f && mu>=0.0f && mu<=1.0f) {
- if(labda==0.0f || labda==1.0f || mu==0.0f || mu==1.0f) return 1;
- return 2;
- }
- return 0;
-}
-
-/* intersect Line-Line, floats */
-short IsectLL2Df(float *v1, float *v2, float *v3, float *v4)
-{
- /* return:
- -1: colliniar
-0: no intersection of segments
-1: exact intersection of segments
-2: cross-intersection of segments
- */
- float div, labda, mu;
-
- div= (v2[0]-v1[0])*(v4[1]-v3[1])-(v2[1]-v1[1])*(v4[0]-v3[0]);
- if(div==0.0) return -1;
-
- labda= ((float)(v1[1]-v3[1])*(v4[0]-v3[0])-(v1[0]-v3[0])*(v4[1]-v3[1]))/div;
-
- mu= ((float)(v1[1]-v3[1])*(v2[0]-v1[0])-(v1[0]-v3[0])*(v2[1]-v1[1]))/div;
-
- if(labda>=0.0 && labda<=1.0 && mu>=0.0 && mu<=1.0) {
- if(labda==0.0 || labda==1.0 || mu==0.0 || mu==1.0) return 1;
- return 2;
- }
- return 0;
-}
-
-/*
--1: colliniar
- 1: intersection
-
-*/
-static short IsectLLPt2Df(float x0,float y0,float x1,float y1,
- float x2,float y2,float x3,float y3, float *xi,float *yi)
-
-{
- /*
- this function computes the intersection of the sent lines
- and returns the intersection point, note that the function assumes
- the lines intersect. the function can handle vertical as well
- as horizontal lines. note the function isn't very clever, it simply
- applies the math, but we don't need speed since this is a
- pre-processing step
- */
- float c1,c2, // constants of linear equations
- det_inv, // the inverse of the determinant of the coefficient
- m1,m2; // the slopes of each line
- /*
- compute slopes, note the cludge for infinity, however, this will
- be close enough
- */
- if ( fabs( x1-x0 ) > 0.000001 )
- m1 = ( y1-y0 ) / ( x1-x0 );
- else
- return -1; /*m1 = ( float ) 1e+10;*/ // close enough to infinity
-
- if ( fabs( x3-x2 ) > 0.000001 )
- m2 = ( y3-y2 ) / ( x3-x2 );
- else
- return -1; /*m2 = ( float ) 1e+10;*/ // close enough to infinity
-
- if (fabs(m1-m2) < 0.000001)
- return -1; /* paralelle lines */
-
-// compute constants
-
- c1 = ( y0-m1*x0 );
- c2 = ( y2-m2*x2 );
-
-// compute the inverse of the determinate
-
- det_inv = 1.0f / ( -m1 + m2 );
-
-// use Kramers rule to compute xi and yi
-
- *xi= ( ( -c2 + c1 ) *det_inv );
- *yi= ( ( m2*c1 - m1*c2 ) *det_inv );
-
- return 1;
-} // end Intersect_Lines
-
-#define SIDE_OF_LINE(pa,pb,pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
-/* point in tri */
-int IsectPT2Df(float pt[2], float v1[2], float v2[2], float v3[2])
-{
- if (SIDE_OF_LINE(v1,v2,pt)>=0.0) {
- if (SIDE_OF_LINE(v2,v3,pt)>=0.0) {
- if (SIDE_OF_LINE(v3,v1,pt)>=0.0) {
- return 1;
- }
- }
- } else {
- if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0) ) {
- if (! (SIDE_OF_LINE(v3,v1,pt)>=0.0)) {
- return -1;
- }
- }
- }
-
- return 0;
-}
-/* point in quad - only convex quads */
-int IsectPQ2Df(float pt[2], float v1[2], float v2[2], float v3[2], float v4[2])
-{
- if (SIDE_OF_LINE(v1,v2,pt)>=0.0) {
- if (SIDE_OF_LINE(v2,v3,pt)>=0.0) {
- if (SIDE_OF_LINE(v3,v4,pt)>=0.0) {
- if (SIDE_OF_LINE(v4,v1,pt)>=0.0) {
- return 1;
- }
- }
- }
- } else {
- if (! (SIDE_OF_LINE(v2,v3,pt)>=0.0) ) {
- if (! (SIDE_OF_LINE(v3,v4,pt)>=0.0)) {
- if (! (SIDE_OF_LINE(v4,v1,pt)>=0.0)) {
- return -1;
- }
- }
- }
- }
-
- return 0;
-}
-
-
-/**
- *
- * @param min
- * @param max
- * @param vec
- */
-void MinMax3(float *min, float *max, float *vec)
-{
- if(min[0]>vec[0]) min[0]= vec[0];
- if(min[1]>vec[1]) min[1]= vec[1];
- if(min[2]>vec[2]) min[2]= vec[2];
-
- if(max[0]=xn && zn>=yn) {i= 0; j= 1;}
- else if(yn>=xn && yn>=zn) {i= 0; j= 2;}
- else {i= 1; j= 2;}
-
- a1= TriSignedArea(v2, v3, co, i, j);
- a2= TriSignedArea(v3, v1, co, i, j);
- a3= TriSignedArea(v1, v2, co, i, j);
-
- asum= a1 + a2 + a3;
-
- if (fabs(asum) < FLT_EPSILON) {
- /* zero area triangle */
- w[0]= w[1]= w[2]= 1.0f/3.0f;
- return 1;
- }
-
- asum= 1.0f/asum;
- w[0]= a1*asum;
- w[1]= a2*asum;
- w[2]= a3*asum;
-
- return 0;
-}
-
-void InterpWeightsQ3Dfl(float *v1, float *v2, float *v3, float *v4, float *co, float *w)
-{
- float w2[3];
-
- w[0]= w[1]= w[2]= w[3]= 0.0f;
-
- /* first check for exact match */
- if(VecEqual(co, v1))
- w[0]= 1.0f;
- else if(VecEqual(co, v2))
- w[1]= 1.0f;
- else if(VecEqual(co, v3))
- w[2]= 1.0f;
- else if(v4 && VecEqual(co, v4))
- w[3]= 1.0f;
- else {
- /* otherwise compute barycentric interpolation weights */
- float n1[3], n2[3], n[3];
- int degenerate;
-
- VecSubf(n1, v1, v3);
- if (v4) {
- VecSubf(n2, v2, v4);
- }
- else {
- VecSubf(n2, v2, v3);
- }
- Crossf(n, n1, n2);
-
- /* OpenGL seems to split this way, so we do too */
- if (v4) {
- degenerate= BarycentricWeights(v1, v2, v4, co, n, w);
- SWAP(float, w[2], w[3]);
-
- if(degenerate || (w[0] < 0.0f)) {
- /* if w[1] is negative, co is on the other side of the v1-v3 edge,
- so we interpolate using the other triangle */
- degenerate= BarycentricWeights(v2, v3, v4, co, n, w2);
-
- if(!degenerate) {
- w[0]= 0.0f;
- w[1]= w2[0];
- w[2]= w2[1];
- w[3]= w2[2];
- }
- }
- }
- else
- BarycentricWeights(v1, v2, v3, co, n, w);
- }
-}
-
-/* Mean value weights - smooth interpolation weights for polygons with
- * more than 3 vertices */
-static float MeanValueHalfTan(float *v1, float *v2, float *v3)
-{
- float d2[3], d3[3], cross[3], area, dot, len;
-
- VecSubf(d2, v2, v1);
- VecSubf(d3, v3, v1);
- Crossf(cross, d2, d3);
-
- area= VecLength(cross);
- dot= Inpf(d2, d3);
- len= VecLength(d2)*VecLength(d3);
-
- if(area == 0.0f)
- return 0.0f;
- else
- return (len - dot)/area;
-}
-
-void MeanValueWeights(float v[][3], int n, float *co, float *w)
-{
- float totweight, t1, t2, len, *vmid, *vprev, *vnext;
- int i;
-
- totweight= 0.0f;
-
- for(i=0; i=1) ? &rotOrders[(order)-1] : &rotOrders[0])
-
-/* Construct quaternion from Euler angles (in radians). */
-void EulOToQuat(float e[3], short order, float q[4])
-{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
- double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- double a[3];
-
- ti = e[i]/2; tj = e[j]/2; th = e[k]/2;
-
- if (R->parity) e[j] = -e[j];
-
- ci = cos(ti); cj = cos(tj); ch = cos(th);
- si = sin(ti); sj = sin(tj); sh = sin(th);
-
- cc = ci*ch; cs = ci*sh;
- sc = si*ch; ss = si*sh;
-
- a[i] = cj*sc - sj*cs;
- a[j] = cj*ss + sj*cc;
- a[k] = cj*cs - sj*sc;
-
- q[0] = cj*cc + sj*ss;
- q[1] = a[0];
- q[2] = a[1];
- q[3] = a[2];
-
- if (R->parity) q[j] = -q[j];
-}
-
-/* Convert quaternion to Euler angles (in radians). */
-void QuatToEulO(float q[4], float e[3], short order)
-{
- float M[3][3];
-
- QuatToMat3(q, M);
- Mat3ToEulO(M, e, order);
-}
-
-/* Construct 3x3 matrix from Euler angles (in radians). */
-void EulOToMat3(float e[3], short order, float M[3][3])
-{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
- double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- if (R->parity) {
- ti = -e[i]; tj = -e[j]; th = -e[k];
- }
- else {
- ti = e[i]; tj = e[j]; th = e[k];
- }
-
- ci = cos(ti); cj = cos(tj); ch = cos(th);
- si = sin(ti); sj = sin(tj); sh = sin(th);
-
- cc = ci*ch; cs = ci*sh;
- sc = si*ch; ss = si*sh;
-
- M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss;
- M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc;
- M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci;
-}
-
-/* Construct 4x4 matrix from Euler angles (in radians). */
-void EulOToMat4(float e[3], short order, float M[4][4])
-{
- float m[3][3];
-
- /* for now, we'll just do this the slow way (i.e. copying matrices) */
- Mat3Ortho(m);
- EulOToMat3(e, order, m);
- Mat4CpyMat3(M, m);
-}
-
-/* Convert 3x3 matrix to Euler angles (in radians). */
-void Mat3ToEulO(float M[3][3], float e[3], short order)
-{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
- double cy = sqrt(M[i][i]*M[i][i] + M[i][j]*M[i][j]);
-
- if (cy > 16*FLT_EPSILON) {
- e[i] = atan2(M[j][k], M[k][k]);
- e[j] = atan2(-M[i][k], cy);
- e[k] = atan2(M[i][j], M[i][i]);
- }
- else {
- e[i] = atan2(-M[k][j], M[j][j]);
- e[j] = atan2(-M[i][k], cy);
- e[k] = 0;
- }
-
- if (R->parity) {
- e[0] = -e[0];
- e[1] = -e[1];
- e[2] = -e[2];
- }
-}
-
-/* Convert 4x4 matrix to Euler angles (in radians). */
-void Mat4ToEulO(float M[4][4], float e[3], short order)
-{
- float m[3][3];
-
- /* for now, we'll just do this the slow way (i.e. copying matrices) */
- Mat3CpyMat4(m, M);
- Mat3Ortho(m);
- Mat3ToEulO(m, e, order);
-}
-
-/* returns two euler calculation methods, so we can pick the best */
-static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order)
-{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
- short i=R->axis[0], j=R->axis[1], k=R->axis[2];
- float m[3][3];
- double cy;
-
- /* process the matrix first */
- Mat3CpyMat3(m, M);
- Mat3Ortho(m);
-
- cy= sqrt(m[i][i]*m[i][i] + m[i][j]*m[i][j]);
-
- if (cy > 16*FLT_EPSILON) {
- e1[i] = atan2(m[j][k], m[k][k]);
- e1[j] = atan2(-m[i][k], cy);
- e1[k] = atan2(m[i][j], m[i][i]);
-
- e2[i] = atan2(-m[j][k], -m[k][k]);
- e2[j] = atan2(-m[i][k], -cy);
- e2[k] = atan2(-m[i][j], -m[i][i]);
- }
- else {
- e1[i] = atan2(-m[k][j], m[j][j]);
- e1[j] = atan2(-m[i][k], cy);
- e1[k] = 0;
-
- VecCopyf(e2, e1);
- }
-
- if (R->parity) {
- e1[0] = -e1[0];
- e1[1] = -e1[1];
- e1[2] = -e1[2];
-
- e2[0] = -e2[0];
- e2[1] = -e2[1];
- e2[2] = -e2[2];
- }
-}
-
-/* uses 2 methods to retrieve eulers, and picks the closest */
-void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order)
-{
- float eul1[3], eul2[3];
- float d1, d2;
-
- mat3_to_eulo2(mat, eul1, eul2, order);
-
- compatible_eul(eul1, oldrot);
- compatible_eul(eul2, oldrot);
-
- d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
- d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
-
- /* return best, which is just the one with lowest difference */
- if (d1 > d2)
- VecCopyf(eul, eul2);
- else
- VecCopyf(eul, eul1);
-}
-
-/* rotate the given euler by the given angle on the specified axis */
-// NOTE: is this safe to do with different axis orders?
-void eulerO_rot(float beul[3], float ang, char axis, short order)
-{
- float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
-
- eul[0]= eul[1]= eul[2]= 0.0f;
- if (axis=='x')
- eul[0]= ang;
- else if (axis=='y')
- eul[1]= ang;
- else
- eul[2]= ang;
-
- EulOToMat3(eul, order, mat1);
- EulOToMat3(beul, order, mat2);
-
- Mat3MulMat3(totmat, mat2, mat1);
-
- Mat3ToEulO(totmat, beul, order);
-}
-
-/* ************ EULER (old XYZ) *************** */
-
-/* XYZ order */
-void EulToMat3( float *eul, float mat[][3])
-{
- double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ci = cos(eul[0]);
- cj = cos(eul[1]);
- ch = cos(eul[2]);
- si = sin(eul[0]);
- sj = sin(eul[1]);
- sh = sin(eul[2]);
- cc = ci*ch;
- cs = ci*sh;
- sc = si*ch;
- ss = si*sh;
-
- mat[0][0] = (float)(cj*ch);
- mat[1][0] = (float)(sj*sc-cs);
- mat[2][0] = (float)(sj*cc+ss);
- mat[0][1] = (float)(cj*sh);
- mat[1][1] = (float)(sj*ss+cc);
- mat[2][1] = (float)(sj*cs-sc);
- mat[0][2] = (float)-sj;
- mat[1][2] = (float)(cj*si);
- mat[2][2] = (float)(cj*ci);
-
-}
-
-/* XYZ order */
-void EulToMat4( float *eul,float mat[][4])
-{
- double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ci = cos(eul[0]);
- cj = cos(eul[1]);
- ch = cos(eul[2]);
- si = sin(eul[0]);
- sj = sin(eul[1]);
- sh = sin(eul[2]);
- cc = ci*ch;
- cs = ci*sh;
- sc = si*ch;
- ss = si*sh;
-
- mat[0][0] = (float)(cj*ch);
- mat[1][0] = (float)(sj*sc-cs);
- mat[2][0] = (float)(sj*cc+ss);
- mat[0][1] = (float)(cj*sh);
- mat[1][1] = (float)(sj*ss+cc);
- mat[2][1] = (float)(sj*cs-sc);
- mat[0][2] = (float)-sj;
- mat[1][2] = (float)(cj*si);
- mat[2][2] = (float)(cj*ci);
-
-
- mat[3][0]= mat[3][1]= mat[3][2]= mat[0][3]= mat[1][3]= mat[2][3]= 0.0f;
- mat[3][3]= 1.0f;
-}
-
-/* returns two euler calculation methods, so we can pick the best */
-/* XYZ order */
-static void mat3_to_eul2(float tmat[][3], float *eul1, float *eul2)
-{
- float cy, quat[4], mat[3][3];
-
- Mat3ToQuat(tmat, quat);
- QuatToMat3(quat, mat);
- Mat3CpyMat3(mat, tmat);
- Mat3Ortho(mat);
-
- cy = (float)sqrt(mat[0][0]*mat[0][0] + mat[0][1]*mat[0][1]);
-
- if (cy > 16.0*FLT_EPSILON) {
-
- eul1[0] = (float)atan2(mat[1][2], mat[2][2]);
- eul1[1] = (float)atan2(-mat[0][2], cy);
- eul1[2] = (float)atan2(mat[0][1], mat[0][0]);
-
- eul2[0] = (float)atan2(-mat[1][2], -mat[2][2]);
- eul2[1] = (float)atan2(-mat[0][2], -cy);
- eul2[2] = (float)atan2(-mat[0][1], -mat[0][0]);
-
- } else {
- eul1[0] = (float)atan2(-mat[2][1], mat[1][1]);
- eul1[1] = (float)atan2(-mat[0][2], cy);
- eul1[2] = 0.0f;
-
- VecCopyf(eul2, eul1);
- }
-}
-
-/* XYZ order */
-void Mat3ToEul(float tmat[][3], float *eul)
-{
- float eul1[3], eul2[3];
-
- mat3_to_eul2(tmat, eul1, eul2);
-
- /* return best, which is just the one with lowest values it in */
- if( fabs(eul1[0])+fabs(eul1[1])+fabs(eul1[2]) > fabs(eul2[0])+fabs(eul2[1])+fabs(eul2[2])) {
- VecCopyf(eul, eul2);
- }
- else {
- VecCopyf(eul, eul1);
- }
-}
-
-/* XYZ order */
-void Mat4ToEul(float tmat[][4], float *eul)
-{
- float tempMat[3][3];
-
- Mat3CpyMat4(tempMat, tmat);
- Mat3Ortho(tempMat);
- Mat3ToEul(tempMat, eul);
-}
-
-/* XYZ order */
-void QuatToEul(float *quat, float *eul)
-{
- float mat[3][3];
-
- QuatToMat3(quat, mat);
- Mat3ToEul(mat, eul);
-}
-
-/* XYZ order */
-void EulToQuat(float *eul, float *quat)
-{
- float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
-
- ti = eul[0]*0.5f; tj = eul[1]*0.5f; th = eul[2]*0.5f;
- ci = (float)cos(ti); cj = (float)cos(tj); ch = (float)cos(th);
- si = (float)sin(ti); sj = (float)sin(tj); sh = (float)sin(th);
- cc = ci*ch; cs = ci*sh; sc = si*ch; ss = si*sh;
-
- quat[0] = cj*cc + sj*ss;
- quat[1] = cj*sc - sj*cs;
- quat[2] = cj*ss + sj*cc;
- quat[3] = cj*cs - sj*sc;
-}
-
-/* XYZ order */
-void euler_rot(float *beul, float ang, char axis)
-{
- float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
-
- eul[0]= eul[1]= eul[2]= 0.0f;
- if(axis=='x') eul[0]= ang;
- else if(axis=='y') eul[1]= ang;
- else eul[2]= ang;
-
- EulToMat3(eul, mat1);
- EulToMat3(beul, mat2);
-
- Mat3MulMat3(totmat, mat2, mat1);
-
- Mat3ToEul(totmat, beul);
-
-}
-
-/* exported to transform.c */
-/* order independent! */
-void compatible_eul(float *eul, float *oldrot)
-{
- float dx, dy, dz;
-
- /* correct differences of about 360 degrees first */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
- while(fabs(dx) > 5.1) {
- if(dx > 0.0f) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
- dx= eul[0] - oldrot[0];
- }
- while(fabs(dy) > 5.1) {
- if(dy > 0.0f) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
- dy= eul[1] - oldrot[1];
- }
- while(fabs(dz) > 5.1) {
- if(dz > 0.0f) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
- dz= eul[2] - oldrot[2];
- }
-
- /* is 1 of the axis rotations larger than 180 degrees and the other small? NO ELSE IF!! */
- if( fabs(dx) > 3.2 && fabs(dy)<1.6 && fabs(dz)<1.6 ) {
- if(dx > 0.0) eul[0] -= 2.0f*(float)M_PI; else eul[0]+= 2.0f*(float)M_PI;
- }
- if( fabs(dy) > 3.2 && fabs(dz)<1.6 && fabs(dx)<1.6 ) {
- if(dy > 0.0) eul[1] -= 2.0f*(float)M_PI; else eul[1]+= 2.0f*(float)M_PI;
- }
- if( fabs(dz) > 3.2 && fabs(dx)<1.6 && fabs(dy)<1.6 ) {
- if(dz > 0.0) eul[2] -= 2.0f*(float)M_PI; else eul[2]+= 2.0f*(float)M_PI;
- }
-
- /* the method below was there from ancient days... but why! probably because the code sucks :)
- */
-#if 0
- /* calc again */
- dx= eul[0] - oldrot[0];
- dy= eul[1] - oldrot[1];
- dz= eul[2] - oldrot[2];
-
- /* special case, tested for x-z */
-
- if( (fabs(dx) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dz) > 3.1 ) ) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(eul[1] > 0.0) eul[1]= M_PI - eul[1]; else eul[1]= -M_PI - eul[1];
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
-
- }
- else if( (fabs(dx) > 3.1 && fabs(dy) > 1.5 ) || ( fabs(dx) > 1.5 && fabs(dy) > 3.1 ) ) {
- if(dx > 0.0) eul[0] -= M_PI; else eul[0]+= M_PI;
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(eul[2] > 0.0) eul[2]= M_PI - eul[2]; else eul[2]= -M_PI - eul[2];
- }
- else if( (fabs(dy) > 3.1 && fabs(dz) > 1.5 ) || ( fabs(dy) > 1.5 && fabs(dz) > 3.1 ) ) {
- if(eul[0] > 0.0) eul[0]= M_PI - eul[0]; else eul[0]= -M_PI - eul[0];
- if(dy > 0.0) eul[1] -= M_PI; else eul[1]+= M_PI;
- if(dz > 0.0) eul[2] -= M_PI; else eul[2]+= M_PI;
- }
-#endif
-}
-
-/* uses 2 methods to retrieve eulers, and picks the closest */
-/* XYZ order */
-void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot)
-{
- float eul1[3], eul2[3];
- float d1, d2;
-
- mat3_to_eul2(mat, eul1, eul2);
-
- compatible_eul(eul1, oldrot);
- compatible_eul(eul2, oldrot);
-
- d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]);
- d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]);
-
- /* return best, which is just the one with lowest difference */
- if( d1 > d2) {
- VecCopyf(eul, eul2);
- }
- else {
- VecCopyf(eul, eul1);
- }
-
-}
-
-/* the matrix is written to as 3 axis vectors */
-void EulToGimbalAxis(float gmat[][3], float *eul, short order)
-{
- RotOrderInfo *R= GET_ROTATIONORDER_INFO(order);
-
- float mat[3][3];
- float teul[3];
-
- /* first axis is local */
- EulOToMat3(eul, order, mat);
- VecCopyf(gmat[R->axis[0]], mat[R->axis[0]]);
-
- /* second axis is local minus first rotation */
- VecCopyf(teul, eul);
- teul[R->axis[0]] = 0;
- EulOToMat3(teul, order, mat);
- VecCopyf(gmat[R->axis[1]], mat[R->axis[1]]);
-
-
- /* Last axis is global */
- gmat[R->axis[2]][0] = 0;
- gmat[R->axis[2]][1] = 0;
- gmat[R->axis[2]][2] = 0;
- gmat[R->axis[2]][R->axis[2]] = 1;
-}
-
-/* ************ AXIS ANGLE *************** */
-
-/* Axis angle to Quaternions */
-void AxisAngleToQuat(float q[4], float axis[3], float angle)
-{
- float nor[3];
- float si;
-
- VecCopyf(nor, axis);
- Normalize(nor);
-
- angle /= 2;
- si = (float)sin(angle);
- q[0] = (float)cos(angle);
- q[1] = nor[0] * si;
- q[2] = nor[1] * si;
- q[3] = nor[2] * si;
-}
-
-/* Quaternions to Axis Angle */
-void QuatToAxisAngle(float q[4], float axis[3], float *angle)
-{
- float ha, si;
-
- /* calculate angle/2, and sin(angle/2) */
- ha= (float)acos(q[0]);
- si= (float)sin(ha);
-
- /* from half-angle to angle */
- *angle= ha * 2;
-
- /* prevent division by zero for axis conversion */
- if (fabs(si) < 0.0005)
- si= 1.0f;
-
- axis[0]= q[1] / si;
- axis[1]= q[2] / si;
- axis[2]= q[3] / si;
-}
-
-/* Axis Angle to Euler Rotation */
-void AxisAngleToEulO(float axis[3], float angle, float eul[3], short order)
-{
- float q[4];
-
- /* use quaternions as intermediate representation for now... */
- AxisAngleToQuat(q, axis, angle);
- QuatToEulO(q, eul, order);
-}
-
-/* Euler Rotation to Axis Angle */
-void EulOToAxisAngle(float eul[3], short order, float axis[3], float *angle)
-{
- float q[4];
-
- /* use quaternions as intermediate representation for now... */
- EulOToQuat(eul, order, q);
- QuatToAxisAngle(q, axis, angle);
-}
-
-/* axis angle to 3x3 matrix - safer version (normalisation of axis performed) */
-void AxisAngleToMat3(float axis[3], float angle, float mat[3][3])
-{
- float nor[3], nsi[3], co, si, ico;
-
- /* normalise the axis first (to remove unwanted scaling) */
- VecCopyf(nor, axis);
- Normalize(nor);
-
- /* now convert this to a 3x3 matrix */
- co= (float)cos(angle);
- si= (float)sin(angle);
-
- ico= (1.0f - co);
- nsi[0]= nor[0]*si;
- nsi[1]= nor[1]*si;
- nsi[2]= nor[2]*si;
-
- mat[0][0] = ((nor[0] * nor[0]) * ico) + co;
- mat[0][1] = ((nor[0] * nor[1]) * ico) + nsi[2];
- mat[0][2] = ((nor[0] * nor[2]) * ico) - nsi[1];
- mat[1][0] = ((nor[0] * nor[1]) * ico) - nsi[2];
- mat[1][1] = ((nor[1] * nor[1]) * ico) + co;
- mat[1][2] = ((nor[1] * nor[2]) * ico) + nsi[0];
- mat[2][0] = ((nor[0] * nor[2]) * ico) + nsi[1];
- mat[2][1] = ((nor[1] * nor[2]) * ico) - nsi[0];
- mat[2][2] = ((nor[2] * nor[2]) * ico) + co;
-}
-
-/* axis angle to 4x4 matrix - safer version (normalisation of axis performed) */
-void AxisAngleToMat4(float axis[3], float angle, float mat[4][4])
-{
- float tmat[3][3];
-
- AxisAngleToMat3(axis, angle, tmat);
- Mat4One(mat);
- Mat4CpyMat3(mat, tmat);
-}
-
-/* 3x3 matrix to axis angle (see Mat4ToVecRot too) */
-void Mat3ToAxisAngle(float mat[3][3], float axis[3], float *angle)
-{
- float q[4];
-
- /* use quaternions as intermediate representation */
- // TODO: it would be nicer to go straight there...
- Mat3ToQuat(mat, q);
- QuatToAxisAngle(q, axis, angle);
-}
-
-/* 4x4 matrix to axis angle (see Mat4ToVecRot too) */
-void Mat4ToAxisAngle(float mat[4][4], float axis[3], float *angle)
-{
- float q[4];
-
- /* use quaternions as intermediate representation */
- // TODO: it would be nicer to go straight there...
- Mat4ToQuat(mat, q);
- QuatToAxisAngle(q, axis, angle);
-}
-
-/* ************ AXIS ANGLE (unchecked) *************** */
-// TODO: the following calls should probably be depreceated sometime
-
-/* 3x3 matrix to axis angle */
-void Mat3ToVecRot(float mat[3][3], float axis[3], float *angle)
-{
- float q[4];
-
- /* use quaternions as intermediate representation */
- // TODO: it would be nicer to go straight there...
- Mat3ToQuat(mat, q);
- QuatToAxisAngle(q, axis, angle);
-}
-
-/* 4x4 matrix to axis angle */
-void Mat4ToVecRot(float mat[4][4], float axis[3], float *angle)
-{
- float q[4];
-
- /* use quaternions as intermediate representation */
- // TODO: it would be nicer to go straight there...
- Mat4ToQuat(mat, q);
- QuatToAxisAngle(q, axis, angle);
-}
-
-/* axis angle to 3x3 matrix */
-void VecRotToMat3(float *vec, float phi, float mat[][3])
-{
- /* rotation of phi radials around vec */
- float vx, vx2, vy, vy2, vz, vz2, co, si;
-
- vx= vec[0];
- vy= vec[1];
- vz= vec[2];
- vx2= vx*vx;
- vy2= vy*vy;
- vz2= vz*vz;
- co= (float)cos(phi);
- si= (float)sin(phi);
-
- mat[0][0]= vx2+co*(1.0f-vx2);
- mat[0][1]= vx*vy*(1.0f-co)+vz*si;
- mat[0][2]= vz*vx*(1.0f-co)-vy*si;
- mat[1][0]= vx*vy*(1.0f-co)-vz*si;
- mat[1][1]= vy2+co*(1.0f-vy2);
- mat[1][2]= vy*vz*(1.0f-co)+vx*si;
- mat[2][0]= vz*vx*(1.0f-co)+vy*si;
- mat[2][1]= vy*vz*(1.0f-co)-vx*si;
- mat[2][2]= vz2+co*(1.0f-vz2);
-}
-
-/* axis angle to 4x4 matrix */
-void VecRotToMat4(float *vec, float phi, float mat[][4])
-{
- float tmat[3][3];
-
- VecRotToMat3(vec, phi, tmat);
- Mat4One(mat);
- Mat4CpyMat3(mat, tmat);
-}
-
-/* axis angle to quaternion */
-void VecRotToQuat(float *vec, float phi, float *quat)
-{
- /* rotation of phi radials around vec */
- float si;
-
- quat[1]= vec[0];
- quat[2]= vec[1];
- quat[3]= vec[2];
-
- if( Normalize(quat+1) == 0.0f) {
- QuatOne(quat);
- }
- else {
- quat[0]= (float)cos( phi/2.0 );
- si= (float)sin( phi/2.0 );
- quat[1] *= si;
- quat[2] *= si;
- quat[3] *= si;
- }
-}
-
-/* ************ VECTORS *************** */
-
-/* Returns a vector bisecting the angle at v2 formed by v1, v2 and v3 */
-void VecBisect3(float *out, float *v1, float *v2, float *v3)
-{
- float d_12[3], d_23[3];
- VecSubf(d_12, v2, v1);
- VecSubf(d_23, v3, v2);
- Normalize(d_12);
- Normalize(d_23);
- VecAddf(out, d_12, d_23);
- Normalize(out);
-}
-
-/* Returns a reflection vector from a vector and a normal vector
-reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror)
-*/
-void VecReflect(float *out, float *v1, float *v2)
-{
- float vec[3], normal[3];
- float reflect[3] = {0.0f, 0.0f, 0.0f};
- float dot2;
-
- VecCopyf(vec, v1);
- VecCopyf(normal, v2);
-
- Normalize(normal);
-
- dot2 = 2 * Inpf(vec, normal);
-
- reflect[0] = vec[0] - (dot2 * normal[0]);
- reflect[1] = vec[1] - (dot2 * normal[1]);
- reflect[2] = vec[2] - (dot2 * normal[2]);
-
- VecCopyf(out, reflect);
-}
-
-/* Return the angle in degrees between vecs 1-2 and 2-3 in degrees
- If v1 is a shoulder, v2 is the elbow and v3 is the hand,
- this would return the angle at the elbow */
-float VecAngle3(float *v1, float *v2, float *v3)
-{
- float vec1[3], vec2[3];
-
- VecSubf(vec1, v2, v1);
- VecSubf(vec2, v2, v3);
- Normalize(vec1);
- Normalize(vec2);
-
- return NormalizedVecAngle2(vec1, vec2);
-}
-
-float Vec2Angle3(float *v1, float *v2, float *v3)
-{
- float vec1[2], vec2[2];
-
- vec1[0] = v2[0]-v1[0];
- vec1[1] = v2[1]-v1[1];
-
- vec2[0] = v2[0]-v3[0];
- vec2[1] = v2[1]-v3[1];
-
- Normalize2(vec1);
- Normalize2(vec2);
-
- return NormalizedVecAngle2_2D(vec1, vec2);
-}
-
-/* Return the shortest angle in degrees between the 2 vectors */
-float VecAngle2(float *v1, float *v2)
-{
- float vec1[3], vec2[3];
-
- VecCopyf(vec1, v1);
- VecCopyf(vec2, v2);
- Normalize(vec1);
- Normalize(vec2);
-
- return NormalizedVecAngle2(vec1, vec2);
-}
-
-float NormalizedVecAngle2(float *v1, float *v2)
-{
- /* this is the same as acos(Inpf(v1, v2)), but more accurate */
- if (Inpf(v1, v2) < 0.0f) {
- float vec[3];
-
- vec[0]= -v2[0];
- vec[1]= -v2[1];
- vec[2]= -v2[2];
-
- return (float)M_PI - 2.0f*(float)saasin(VecLenf(vec, v1)/2.0f);
- }
- else
- return 2.0f*(float)saasin(VecLenf(v2, v1)/2.0f);
-}
-
-float NormalizedVecAngle2_2D(float *v1, float *v2)
-{
- /* this is the same as acos(Inpf(v1, v2)), but more accurate */
- if (Inp2f(v1, v2) < 0.0f) {
- float vec[2];
-
- vec[0]= -v2[0];
- vec[1]= -v2[1];
-
- return (float)M_PI - 2.0f*saasin(Vec2Lenf(vec, v1)/2.0f);
- }
- else
- return 2.0f*(float)saasin(Vec2Lenf(v2, v1)/2.0f);
-}
-
-/* ******************************************** */
-
-void SizeToMat3( float *size, float mat[][3])
-{
- mat[0][0]= size[0];
- mat[0][1]= 0.0f;
- mat[0][2]= 0.0f;
- mat[1][1]= size[1];
- mat[1][0]= 0.0f;
- mat[1][2]= 0.0f;
- mat[2][2]= size[2];
- mat[2][1]= 0.0f;
- mat[2][0]= 0.0f;
-}
-
-void SizeToMat4( float *size, float mat[][4])
-{
- float tmat[3][3];
-
- SizeToMat3(size, tmat);
- Mat4One(mat);
- Mat4CpyMat3(mat, tmat);
-}
-
-void Mat3ToSize( float mat[][3], float *size)
-{
- size[0]= VecLength(mat[0]);
- size[1]= VecLength(mat[1]);
- size[2]= VecLength(mat[2]);
-}
-
-void Mat4ToSize( float mat[][4], float *size)
-{
- size[0]= VecLength(mat[0]);
- size[1]= VecLength(mat[1]);
- size[2]= VecLength(mat[2]);
-}
-
-/* this gets the average scale of a matrix, only use when your scaling
- * data that has no idea of scale axis, examples are bone-envelope-radius
- * and curve radius */
-float Mat3ToScalef(float mat[][3])
-{
- /* unit length vector */
- float unit_vec[3] = {0.577350269189626f, 0.577350269189626f, 0.577350269189626f};
- Mat3MulVecfl(mat, unit_vec);
- return VecLength(unit_vec);
-}
-
-float Mat4ToScalef(float mat[][4])
-{
- float tmat[3][3];
- Mat3CpyMat4(tmat, mat);
- return Mat3ToScalef(tmat);
-}
-
-
-/* ************* SPECIALS ******************* */
-
-void triatoquat( float *v1, float *v2, float *v3, float *quat)
-{
- /* imaginary x-axis, y-axis triangle is being rotated */
- float vec[3], q1[4], q2[4], n[3], si, co, angle, mat[3][3], imat[3][3];
-
- /* move z-axis to face-normal */
- CalcNormFloat(v1, v2, v3, vec);
-
- n[0]= vec[1];
- n[1]= -vec[0];
- n[2]= 0.0f;
- Normalize(n);
-
- if(n[0]==0.0f && n[1]==0.0f) n[0]= 1.0f;
-
- angle= -0.5f*(float)saacos(vec[2]);
- co= (float)cos(angle);
- si= (float)sin(angle);
- q1[0]= co;
- q1[1]= n[0]*si;
- q1[2]= n[1]*si;
- q1[3]= 0.0f;
-
- /* rotate back line v1-v2 */
- QuatToMat3(q1, mat);
- Mat3Inv(imat, mat);
- VecSubf(vec, v2, v1);
- Mat3MulVecfl(imat, vec);
-
- /* what angle has this line with x-axis? */
- vec[2]= 0.0f;
- Normalize(vec);
-
- angle= (float)(0.5*atan2(vec[1], vec[0]));
- co= (float)cos(angle);
- si= (float)sin(angle);
- q2[0]= co;
- q2[1]= 0.0f;
- q2[2]= 0.0f;
- q2[3]= si;
-
- QuatMul(quat, q1, q2);
-}
-
-void MinMaxRGB(short c[])
-{
- if(c[0]>255) c[0]=255;
- else if(c[0]<0) c[0]=0;
- if(c[1]>255) c[1]=255;
- else if(c[1]<0) c[1]=0;
- if(c[2]>255) c[2]=255;
- else if(c[2]<0) c[2]=0;
-}
-
-float Vec2Lenf(float *v1, float *v2)
-{
- float x, y;
-
- x = v1[0]-v2[0];
- y = v1[1]-v2[1];
- return (float)sqrt(x*x+y*y);
-}
-
-float Vec2Length(float *v)
-{
- return (float)sqrt(v[0]*v[0] + v[1]*v[1]);
-}
-
-void Vec2Mulf(float *v1, float f)
-{
- v1[0]*= f;
- v1[1]*= f;
-}
-
-void Vec2Addf(float *v, float *v1, float *v2)
-{
- v[0]= v1[0]+ v2[0];
- v[1]= v1[1]+ v2[1];
-}
-
-void Vec2Subf(float *v, float *v1, float *v2)
-{
- v[0]= v1[0]- v2[0];
- v[1]= v1[1]- v2[1];
-}
-
-void Vec2Copyf(float *v1, float *v2)
-{
- v1[0]= v2[0];
- v1[1]= v2[1];
-}
-
-float Inp2f(float *v1, float *v2)
-{
- return v1[0]*v2[0]+v1[1]*v2[1];
-}
-
-float Normalize2(float *n)
-{
- float d;
-
- d= n[0]*n[0]+n[1]*n[1];
-
- if(d>1.0e-35f) {
- d= (float)sqrt(d);
- n[0]/=d;
- n[1]/=d;
- } else {
- n[0]=n[1]= 0.0f;
- d= 0.0f;
- }
- return d;
-}
-
-void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
-{
- int i;
- float f, p, q, t;
-
- h *= 360.0f;
-
- if(s==0.0f) {
- *r = v;
- *g = v;
- *b = v;
- }
- else {
- if(h== 360.0f) h = 0.0f;
-
- h /= 60.0f;
- i = (int)floor(h);
- f = h - i;
- p = v*(1.0f-s);
- q = v*(1.0f-(s*f));
- t = v*(1.0f-(s*(1.0f-f)));
-
- switch (i) {
- case 0 :
- *r = v;
- *g = t;
- *b = p;
- break;
- case 1 :
- *r = q;
- *g = v;
- *b = p;
- break;
- case 2 :
- *r = p;
- *g = v;
- *b = t;
- break;
- case 3 :
- *r = p;
- *g = q;
- *b = v;
- break;
- case 4 :
- *r = t;
- *g = p;
- *b = v;
- break;
- case 5 :
- *r = v;
- *g = p;
- *b = q;
- break;
- }
- }
-}
-
-void rgb_to_yuv(float r, float g, float b, float *ly, float *lu, float *lv)
-{
- float y, u, v;
- y= 0.299f*r + 0.587f*g + 0.114f*b;
- u=-0.147f*r - 0.289f*g + 0.436f*b;
- v= 0.615f*r - 0.515f*g - 0.100f*b;
-
- *ly=y;
- *lu=u;
- *lv=v;
-}
-
-void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb)
-{
- float r, g, b;
- r=y+1.140f*v;
- g=y-0.394f*u - 0.581f*v;
- b=y+2.032f*u;
-
- *lr=r;
- *lg=g;
- *lb=b;
-}
-
-void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr)
-{
- float sr,sg, sb;
- float y, cr, cb;
-
- sr=255.0f*r;
- sg=255.0f*g;
- sb=255.0f*b;
-
-
- y=(0.257f*sr)+(0.504f*sg)+(0.098f*sb)+16.0f;
- cb=(-0.148f*sr)-(0.291f*sg)+(0.439f*sb)+128.0f;
- cr=(0.439f*sr)-(0.368f*sg)-(0.071f*sb)+128.0f;
-
- *ly=y;
- *lcb=cb;
- *lcr=cr;
-}
-
-void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb)
-{
- float r,g,b;
-
- r=1.164f*(y-16.0f)+1.596f*(cr-128.0f);
- g=1.164f*(y-16.0f)-0.813f*(cr-128.0f)-0.392f*(cb-128.0f);
- b=1.164f*(y-16.0f)+2.017f*(cb-128.0f);
-
- *lr=r/255.0f;
- *lg=g/255.0f;
- *lb=b/255.0f;
-}
-
-void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
-{
- unsigned int ri, gi, bi;
-
- if (hexcol[0] == '#') hexcol++;
-
- if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi)) {
- *r = ri / 255.0f;
- *g = gi / 255.0f;
- *b = bi / 255.0f;
- }
-}
-
-void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
-{
- float h, s, v;
- float cmax, cmin, cdelta;
- float rc, gc, bc;
-
- cmax = r;
- cmin = r;
- cmax = (g>cmax ? g:cmax);
- cmin = (gcmax ? b:cmax);
- cmin = (b 0) {
- *r += w; *g += w; *b += w;
- return 1; /* Color modified to fit RGB gamut */
- }
-
- return 0; /* Color within RGB gamut */
-}
-
-
-/* we define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so.
- for that reason it is sensitive for endianness... with this function it works correctly
-*/
-
-unsigned int hsv_to_cpack(float h, float s, float v)
-{
- short r, g, b;
- float rf, gf, bf;
- unsigned int col;
-
- hsv_to_rgb(h, s, v, &rf, &gf, &bf);
-
- r= (short)(rf*255.0f);
- g= (short)(gf*255.0f);
- b= (short)(bf*255.0f);
-
- col= ( r + (g*256) + (b*256*256) );
- return col;
-}
-
-
-unsigned int rgb_to_cpack(float r, float g, float b)
-{
- int ir, ig, ib;
-
- ir= (int)floor(255.0*r);
- if(ir<0) ir= 0; else if(ir>255) ir= 255;
- ig= (int)floor(255.0*g);
- if(ig<0) ig= 0; else if(ig>255) ig= 255;
- ib= (int)floor(255.0*b);
- if(ib<0) ib= 0; else if(ib>255) ib= 255;
-
- return (ir+ (ig*256) + (ib*256*256));
-}
-
-void cpack_to_rgb(unsigned int col, float *r, float *g, float *b)
-{
-
- *r= (float)((col)&0xFF);
- *r /= 255.0f;
-
- *g= (float)(((col)>>8)&0xFF);
- *g /= 255.0f;
-
- *b= (float)(((col)>>16)&0xFF);
- *b /= 255.0f;
-}
-
-
-/* *************** PROJECTIONS ******************* */
-
-void tubemap(float x, float y, float z, float *u, float *v)
-{
- float len;
-
- *v = (z + 1.0f) / 2.0f;
-
- len= (float)sqrt(x*x+y*y);
- if(len > 0.0f)
- *u = (float)((1.0 - (atan2(x/len,y/len) / M_PI)) / 2.0);
- else
- *v = *u = 0.0f; /* to avoid un-initialized variables */
-}
-
-/* ------------------------------------------------------------------------- */
-
-void spheremap(float x, float y, float z, float *u, float *v)
-{
- float len;
-
- len= (float)sqrt(x*x+y*y+z*z);
- if(len > 0.0f) {
- if(x==0.0f && y==0.0f) *u= 0.0f; /* othwise domain error */
- else *u = (float)((1.0 - (float)atan2(x,y) / M_PI) / 2.0);
-
- z/=len;
- *v = 1.0f - (float)saacos(z)/(float)M_PI;
- } else {
- *v = *u = 0.0f; /* to avoid un-initialized variables */
- }
-}
-
-/* ------------------------------------------------------------------------- */
-
-/* proposed api by ton and zr, not used yet */
-#if 0
-/* ***************** m1 = m2 ***************** */
-static void cpy_m3_m3(float m1[][3], float m2[][3])
-{
- memcpy(m1[0], m2[0], 9*sizeof(float));
-}
-
-/* ***************** m1 = m2 ***************** */
-static void cpy_m4_m4(float m1[][4], float m2[][4])
-{
- memcpy(m1[0], m2[0], 16*sizeof(float));
-}
-
-/* ***************** identity matrix ***************** */
-static void ident_m4(float m[][4])
-{
-
- m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0;
- m[0][1]= m[0][2]= m[0][3]= 0.0;
- m[1][0]= m[1][2]= m[1][3]= 0.0;
- m[2][0]= m[2][1]= m[2][3]= 0.0;
- m[3][0]= m[3][1]= m[3][2]= 0.0;
-}
-
-/* ***************** m1 = m2 (pre) * m3 (post) ***************** */
-static void mul_m3_m3m3(float m1[][3], float m2[][3], float m3[][3])
-{
- float m[3][3];
-
- m[0][0]= m2[0][0]*m3[0][0] + m2[1][0]*m3[0][1] + m2[2][0]*m3[0][2];
- m[0][1]= m2[0][1]*m3[0][0] + m2[1][1]*m3[0][1] + m2[2][1]*m3[0][2];
- m[0][2]= m2[0][2]*m3[0][0] + m2[1][2]*m3[0][1] + m2[2][2]*m3[0][2];
-
- m[1][0]= m2[0][0]*m3[1][0] + m2[1][0]*m3[1][1] + m2[2][0]*m3[1][2];
- m[1][1]= m2[0][1]*m3[1][0] + m2[1][1]*m3[1][1] + m2[2][1]*m3[1][2];
- m[1][2]= m2[0][2]*m3[1][0] + m2[1][2]*m3[1][1] + m2[2][2]*m3[1][2];
-
- m[2][0]= m2[0][0]*m3[2][0] + m2[1][0]*m3[2][1] + m2[2][0]*m3[2][2];
- m[2][1]= m2[0][1]*m3[2][0] + m2[1][1]*m3[2][1] + m2[2][1]*m3[2][2];
- m[2][2]= m2[0][2]*m3[2][0] + m2[1][2]*m3[2][1] + m2[2][2]*m3[2][2];
-
- cpy_m3_m3(m1, m2);
-}
-
-/* ***************** m1 = m2 (pre) * m3 (post) ***************** */
-static void mul_m4_m4m4(float m1[][4], float m2[][4], float m3[][4])
-{
- float m[4][4];
-
- m[0][0]= m2[0][0]*m3[0][0] + m2[1][0]*m3[0][1] + m2[2][0]*m3[0][2] + m2[3][0]*m3[0][3];
- m[0][1]= m2[0][1]*m3[0][0] + m2[1][1]*m3[0][1] + m2[2][1]*m3[0][2] + m2[3][1]*m3[0][3];
- m[0][2]= m2[0][2]*m3[0][0] + m2[1][2]*m3[0][1] + m2[2][2]*m3[0][2] + m2[3][2]*m3[0][3];
- m[0][3]= m2[0][3]*m3[0][0] + m2[1][3]*m3[0][1] + m2[2][3]*m3[0][2] + m2[3][3]*m3[0][3];
-
- m[1][0]= m2[0][0]*m3[1][0] + m2[1][0]*m3[1][1] + m2[2][0]*m3[1][2] + m2[3][0]*m3[1][3];
- m[1][1]= m2[0][1]*m3[1][0] + m2[1][1]*m3[1][1] + m2[2][1]*m3[1][2] + m2[3][1]*m3[1][3];
- m[1][2]= m2[0][2]*m3[1][0] + m2[1][2]*m3[1][1] + m2[2][2]*m3[1][2] + m2[3][2]*m3[1][3];
- m[1][3]= m2[0][3]*m3[1][0] + m2[1][3]*m3[1][1] + m2[2][3]*m3[1][2] + m2[3][3]*m3[1][3];
-
- m[2][0]= m2[0][0]*m3[2][0] + m2[1][0]*m3[2][1] + m2[2][0]*m3[2][2] + m2[3][0]*m3[2][3];
- m[2][1]= m2[0][1]*m3[2][0] + m2[1][1]*m3[2][1] + m2[2][1]*m3[2][2] + m2[3][1]*m3[2][3];
- m[2][2]= m2[0][2]*m3[2][0] + m2[1][2]*m3[2][1] + m2[2][2]*m3[2][2] + m2[3][2]*m3[2][3];
- m[2][3]= m2[0][3]*m3[2][0] + m2[1][3]*m3[2][1] + m2[2][3]*m3[2][2] + m2[3][3]*m3[2][3];
-
- m[3][0]= m2[0][0]*m3[3][0] + m2[1][0]*m3[3][1] + m2[2][0]*m3[3][2] + m2[3][0]*m3[3][3];
- m[3][1]= m2[0][1]*m3[3][0] + m2[1][1]*m3[3][1] + m2[2][1]*m3[3][2] + m2[3][1]*m3[3][3];
- m[3][2]= m2[0][2]*m3[3][0] + m2[1][2]*m3[3][1] + m2[2][2]*m3[3][2] + m2[3][2]*m3[3][3];
- m[3][3]= m2[0][3]*m3[3][0] + m2[1][3]*m3[3][1] + m2[2][3]*m3[3][2] + m2[3][3]*m3[3][3];
-
- cpy_m4_m4(m1, m2);
-}
-
-/* ***************** m1 = inverse(m2) ***************** */
-static void inv_m3_m3(float m1[][3], float m2[][3])
-{
- short a,b;
- float det;
-
- /* calc adjoint */
- Mat3Adj(m1, m2);
-
- /* then determinant old matrix! */
- det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
- -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
- +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
-
- if(det==0.0f) det=1.0f;
- det= 1.0f/det;
- for(a=0;a<3;a++) {
- for(b=0;b<3;b++) {
- m1[a][b]*=det;
- }
- }
-}
-
-/* ***************** m1 = inverse(m2) ***************** */
-static int inv_m4_m4(float inverse[][4], float mat[][4])
-{
- int i, j, k;
- double temp;
- float tempmat[4][4];
- float max;
- int maxj;
-
- /* Set inverse to identity */
- ident_m4(inverse);
-
- /* Copy original matrix so we don't mess it up */
- cpy_m4_m4(tempmat, mat);
-
- for(i = 0; i < 4; i++) {
- /* Look for row with max pivot */
- max = ABS(tempmat[i][i]);
- maxj = i;
- for(j = i + 1; j < 4; j++) {
- if(ABS(tempmat[j][i]) > max) {
- max = ABS(tempmat[j][i]);
- maxj = j;
- }
- }
- /* Swap rows if necessary */
- if (maxj != i) {
- for( k = 0; k < 4; k++) {
- SWAP(float, tempmat[i][k], tempmat[maxj][k]);
- SWAP(float, inverse[i][k], inverse[maxj][k]);
- }
- }
-
- temp = tempmat[i][i];
- if (temp == 0)
- return 0; /* No non-zero pivot */
- for(k = 0; k < 4; k++) {
- tempmat[i][k] = (float)(tempmat[i][k]/temp);
- inverse[i][k] = (float)(inverse[i][k]/temp);
- }
- for(j = 0; j < 4; j++) {
- if(j != i) {
- temp = tempmat[j][i];
- for(k = 0; k < 4; k++) {
- tempmat[j][k] -= (float)(tempmat[i][k]*temp);
- inverse[j][k] -= (float)(inverse[i][k]*temp);
- }
- }
- }
- }
- return 1;
-}
-
-/* ***************** v1 = v2 * mat ***************** */
-static void mul_v3_v3m4(float *v1, float *v2, float mat[][4])
-{
- float x, y;
-
- x= v2[0]; /* work with a copy, v1 can be same as v2 */
- y= v2[1];
- v1[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*v2[2] + mat[3][0];
- v1[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*v2[2] + mat[3][1];
- v1[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*v2[2] + mat[3][2];
-
-}
-
-#endif
-
-/* moved from effect.c
- test if the line starting at p1 ending at p2 intersects the triangle v0..v2
- return non zero if it does
-*/
-int LineIntersectsTriangle(float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv)
-{
-
- float p[3], s[3], d[3], e1[3], e2[3], q[3];
- float a, f, u, v;
-
- VecSubf(e1, v1, v0);
- VecSubf(e2, v2, v0);
- VecSubf(d, p2, p1);
-
- Crossf(p, d, e2);
- a = Inpf(e1, p);
- if ((a > -0.000001) && (a < 0.000001)) return 0;
- f = 1.0f/a;
-
- VecSubf(s, p1, v0);
-
- Crossf(q, s, e1);
- *lambda = f * Inpf(e2, q);
- if ((*lambda < 0.0)||(*lambda > 1.0)) return 0;
-
- u = f * Inpf(s, p);
- if ((u < 0.0)||(u > 1.0)) return 0;
-
- v = f * Inpf(d, q);
- if ((v < 0.0)||((u + v) > 1.0)) return 0;
-
- if(uv) {
- uv[0]= u;
- uv[1]= v;
- }
-
- return 1;
-}
-
-/* moved from effect.c
- test if the ray starting at p1 going in d direction intersects the triangle v0..v2
- return non zero if it does
-*/
-int RayIntersectsTriangle(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv)
-{
- float p[3], s[3], e1[3], e2[3], q[3];
- float a, f, u, v;
-
- VecSubf(e1, v1, v0);
- VecSubf(e2, v2, v0);
-
- Crossf(p, d, e2);
- a = Inpf(e1, p);
- if ((a > -0.000001) && (a < 0.000001)) return 0;
- f = 1.0f/a;
-
- VecSubf(s, p1, v0);
-
- Crossf(q, s, e1);
- *lambda = f * Inpf(e2, q);
- if ((*lambda < 0.0)) return 0;
-
- u = f * Inpf(s, p);
- if ((u < 0.0)||(u > 1.0)) return 0;
-
- v = f * Inpf(d, q);
- if ((v < 0.0)||((u + v) > 1.0)) return 0;
-
- if(uv) {
- uv[0]= u;
- uv[1]= v;
- }
-
- return 1;
-}
-
-int RayIntersectsTriangleThreshold(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, float *uv, float threshold)
-{
- float p[3], s[3], e1[3], e2[3], q[3];
- float a, f, u, v;
- float du = 0, dv = 0;
-
- VecSubf(e1, v1, v0);
- VecSubf(e2, v2, v0);
-
- Crossf(p, d, e2);
- a = Inpf(e1, p);
- if ((a > -0.000001) && (a < 0.000001)) return 0;
- f = 1.0f/a;
-
- VecSubf(s, p1, v0);
-
- Crossf(q, s, e1);
- *lambda = f * Inpf(e2, q);
- if ((*lambda < 0.0)) return 0;
-
- u = f * Inpf(s, p);
- v = f * Inpf(d, q);
-
- if (u < 0) du = u;
- if (u > 1) du = u - 1;
- if (v < 0) dv = v;
- if (v > 1) dv = v - 1;
- if (u > 0 && v > 0 && u + v > 1)
- {
- float t = u + v - 1;
- du = u - t/2;
- dv = v - t/2;
- }
-
- VecMulf(e1, du);
- VecMulf(e2, dv);
-
- if (Inpf(e1, e1) + Inpf(e2, e2) > threshold * threshold)
- {
- return 0;
- }
-
- if(uv) {
- uv[0]= u;
- uv[1]= v;
- }
-
- return 1;
-}
-
-
-/* Adapted from the paper by Kasper Fauerby */
-/* "Improved Collision detection and Response" */
-static int getLowestRoot(float a, float b, float c, float maxR, float* root)
-{
- // Check if a solution exists
- float determinant = b*b - 4.0f*a*c;
-
- // If determinant is negative it means no solutions.
- if (determinant >= 0.0f)
- {
- // calculate the two roots: (if determinant == 0 then
- // x1==x2 but let’s disregard that slight optimization)
- float sqrtD = (float)sqrt(determinant);
- float r1 = (-b - sqrtD) / (2.0f*a);
- float r2 = (-b + sqrtD) / (2.0f*a);
-
- // Sort so x1 <= x2
- if (r1 > r2)
- SWAP( float, r1, r2);
-
- // Get lowest root:
- if (r1 > 0.0f && r1 < maxR)
- {
- *root = r1;
- return 1;
- }
-
- // It is possible that we want x2 - this can happen
- // if x1 < 0
- if (r2 > 0.0f && r2 < maxR)
- {
- *root = r2;
- return 1;
- }
- }
- // No (valid) solutions
- return 0;
-}
-
-int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint)
-{
- float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], temp[3], bv[3];
- float a, b, c, d, e, x, y, z, radius2=radius*radius;
- float elen2,edotv,edotbv,nordotv,vel2;
- float newLambda;
- int found_by_sweep=0;
-
- VecSubf(e1,v1,v0);
- VecSubf(e2,v2,v0);
- VecSubf(vel,p2,p1);
-
-/*---test plane of tri---*/
- Crossf(nor,e1,e2);
- Normalize(nor);
-
- /* flip normal */
- if(Inpf(nor,vel)>0.0f) VecNegf(nor);
-
- a=Inpf(p1,nor)-Inpf(v0,nor);
- nordotv=Inpf(nor,vel);
-
- if (fabs(nordotv) < 0.000001)
- {
- if(fabs(a)>=radius)
- {
- return 0;
- }
- }
- else
- {
- float t0=(-a+radius)/nordotv;
- float t1=(-a-radius)/nordotv;
-
- if(t0>t1)
- SWAP(float, t0, t1);
-
- if(t0>1.0f || t1<0.0f) return 0;
-
- /* clamp to [0,1] */
- CLAMP(t0, 0.0f, 1.0f);
- CLAMP(t1, 0.0f, 1.0f);
-
- /*---test inside of tri---*/
- /* plane intersection point */
-
- point[0] = p1[0] + vel[0]*t0 - nor[0]*radius;
- point[1] = p1[1] + vel[1]*t0 - nor[1]*radius;
- point[2] = p1[2] + vel[2]*t0 - nor[2]*radius;
-
-
- /* is the point in the tri? */
- a=Inpf(e1,e1);
- b=Inpf(e1,e2);
- c=Inpf(e2,e2);
-
- VecSubf(temp,point,v0);
- d=Inpf(temp,e1);
- e=Inpf(temp,e2);
-
- x=d*c-e*b;
- y=e*a-d*b;
- z=x+y-(a*c-b*b);
-
-
- if( z <= 0.0f && (x >= 0.0f && y >= 0.0f))
- {
- //( ((unsigned int)z)& ~(((unsigned int)x)|((unsigned int)y)) ) & 0x80000000){
- *lambda=t0;
- VecCopyf(ipoint,point);
- return 1;
- }
- }
-
-
- *lambda=1.0f;
-
-/*---test points---*/
- a=vel2=Inpf(vel,vel);
-
- /*v0*/
- VecSubf(temp,p1,v0);
- b=2.0f*Inpf(vel,temp);
- c=Inpf(temp,temp)-radius2;
-
- if(getLowestRoot(a, b, c, *lambda, lambda))
- {
- VecCopyf(ipoint,v0);
- found_by_sweep=1;
- }
-
- /*v1*/
- VecSubf(temp,p1,v1);
- b=2.0f*Inpf(vel,temp);
- c=Inpf(temp,temp)-radius2;
-
- if(getLowestRoot(a, b, c, *lambda, lambda))
- {
- VecCopyf(ipoint,v1);
- found_by_sweep=1;
- }
-
- /*v2*/
- VecSubf(temp,p1,v2);
- b=2.0f*Inpf(vel,temp);
- c=Inpf(temp,temp)-radius2;
-
- if(getLowestRoot(a, b, c, *lambda, lambda))
- {
- VecCopyf(ipoint,v2);
- found_by_sweep=1;
- }
-
-/*---test edges---*/
- VecSubf(e3,v2,v1); //wasnt yet calculated
-
-
- /*e1*/
- VecSubf(bv,v0,p1);
-
- elen2 = Inpf(e1,e1);
- edotv = Inpf(e1,vel);
- edotbv = Inpf(e1,bv);
-
- a=elen2*(-Inpf(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
-
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
- {
- e=(edotv*newLambda-edotbv)/elen2;
-
- if(e >= 0.0f && e <= 1.0f)
- {
- *lambda = newLambda;
- VecCopyf(ipoint,e1);
- VecMulf(ipoint,e);
- VecAddf(ipoint,ipoint,v0);
- found_by_sweep=1;
- }
- }
-
- /*e2*/
- /*bv is same*/
- elen2 = Inpf(e2,e2);
- edotv = Inpf(e2,vel);
- edotbv = Inpf(e2,bv);
-
- a=elen2*(-Inpf(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
-
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
- {
- e=(edotv*newLambda-edotbv)/elen2;
-
- if(e >= 0.0f && e <= 1.0f)
- {
- *lambda = newLambda;
- VecCopyf(ipoint,e2);
- VecMulf(ipoint,e);
- VecAddf(ipoint,ipoint,v0);
- found_by_sweep=1;
- }
- }
-
- /*e3*/
- VecSubf(bv,v0,p1);
- elen2 = Inpf(e1,e1);
- edotv = Inpf(e1,vel);
- edotbv = Inpf(e1,bv);
-
- VecSubf(bv,v1,p1);
- elen2 = Inpf(e3,e3);
- edotv = Inpf(e3,vel);
- edotbv = Inpf(e3,bv);
-
- a=elen2*(-Inpf(vel,vel))+edotv*edotv;
- b=2.0f*(elen2*Inpf(vel,bv)-edotv*edotbv);
- c=elen2*(radius2-Inpf(bv,bv))+edotbv*edotbv;
-
- if(getLowestRoot(a, b, c, *lambda, &newLambda))
- {
- e=(edotv*newLambda-edotbv)/elen2;
-
- if(e >= 0.0f && e <= 1.0f)
- {
- *lambda = newLambda;
- VecCopyf(ipoint,e3);
- VecMulf(ipoint,e);
- VecAddf(ipoint,ipoint,v1);
- found_by_sweep=1;
- }
- }
-
-
- return found_by_sweep;
-}
-int AxialLineIntersectsTriangle(int axis, float p1[3], float p2[3], float v0[3], float v1[3], float v2[3], float *lambda)
-{
- float p[3], e1[3], e2[3];
- float u, v, f;
- int a0=axis, a1=(axis+1)%3, a2=(axis+2)%3;
-
- //return LineIntersectsTriangle(p1,p2,v0,v1,v2,lambda);
-
- ///* first a simple bounding box test */
- //if(MIN3(v0[a1],v1[a1],v2[a1]) > p1[a1]) return 0;
- //if(MIN3(v0[a2],v1[a2],v2[a2]) > p1[a2]) return 0;
- //if(MAX3(v0[a1],v1[a1],v2[a1]) < p1[a1]) return 0;
- //if(MAX3(v0[a2],v1[a2],v2[a2]) < p1[a2]) return 0;
-
- ///* then a full intersection test */
-
- VecSubf(e1,v1,v0);
- VecSubf(e2,v2,v0);
- VecSubf(p,v0,p1);
-
- f= (e2[a1]*e1[a2]-e2[a2]*e1[a1]);
- if ((f > -0.000001) && (f < 0.000001)) return 0;
-
- v= (p[a2]*e1[a1]-p[a1]*e1[a2])/f;
- if ((v < 0.0)||(v > 1.0)) return 0;
-
- f= e1[a1];
- if((f > -0.000001) && (f < 0.000001)){
- f= e1[a2];
- if((f > -0.000001) && (f < 0.000001)) return 0;
- u= (-p[a2]-v*e2[a2])/f;
- }
- else
- u= (-p[a1]-v*e2[a1])/f;
-
- if ((u < 0.0)||((u + v) > 1.0)) return 0;
-
- *lambda = (p[a0]+u*e1[a0]+v*e2[a0])/(p2[a0]-p1[a0]);
-
- if ((*lambda < 0.0)||(*lambda > 1.0)) return 0;
-
- return 1;
-}
-
-/* Returns the number of point of interests
- * 0 - lines are colinear
- * 1 - lines are coplanar, i1 is set to intersection
- * 2 - i1 and i2 are the nearest points on line 1 (v1, v2) and line 2 (v3, v4) respectively
- * */
-int LineIntersectLine(float v1[3], float v2[3], float v3[3], float v4[3], float i1[3], float i2[3])
-{
- float a[3], b[3], c[3], ab[3], cb[3], dir1[3], dir2[3];
- float d;
-
- VecSubf(c, v3, v1);
- VecSubf(a, v2, v1);
- VecSubf(b, v4, v3);
-
- VecCopyf(dir1, a);
- Normalize(dir1);
- VecCopyf(dir2, b);
- Normalize(dir2);
- d = Inpf(dir1, dir2);
- if (d == 1.0f || d == -1.0f) {
- /* colinear */
- return 0;
- }
-
- Crossf(ab, a, b);
- d = Inpf(c, ab);
-
- /* test if the two lines are coplanar */
- if (d > -0.000001f && d < 0.000001f) {
- Crossf(cb, c, b);
-
- VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab));
- VecAddf(i1, v1, a);
- VecCopyf(i2, i1);
-
- return 1; /* one intersection only */
- }
- /* if not */
- else {
- float n[3], t[3];
- float v3t[3], v4t[3];
- VecSubf(t, v1, v3);
-
- /* offset between both plane where the lines lies */
- Crossf(n, a, b);
- Projf(t, t, n);
-
- /* for the first line, offset the second line until it is coplanar */
- VecAddf(v3t, v3, t);
- VecAddf(v4t, v4, t);
-
- VecSubf(c, v3t, v1);
- VecSubf(a, v2, v1);
- VecSubf(b, v4t, v3t);
-
- Crossf(ab, a, b);
- Crossf(cb, c, b);
-
- VecMulf(a, Inpf(cb, ab) / Inpf(ab, ab));
- VecAddf(i1, v1, a);
-
- /* for the second line, just substract the offset from the first intersection point */
- VecSubf(i2, i1, t);
-
- return 2; /* two nearest points */
- }
-}
-
-/* Intersection point strictly between the two lines
- * 0 when no intersection is found
- * */
-int LineIntersectLineStrict(float v1[3], float v2[3], float v3[3], float v4[3], float vi[3], float *lambda)
-{
- float a[3], b[3], c[3], ab[3], cb[3], ca[3], dir1[3], dir2[3];
- float d;
- float d1;
-
- VecSubf(c, v3, v1);
- VecSubf(a, v2, v1);
- VecSubf(b, v4, v3);
-
- VecCopyf(dir1, a);
- Normalize(dir1);
- VecCopyf(dir2, b);
- Normalize(dir2);
- d = Inpf(dir1, dir2);
- if (d == 1.0f || d == -1.0f || d == 0) {
- /* colinear or one vector is zero-length*/
- return 0;
- }
-
- d1 = d;
-
- Crossf(ab, a, b);
- d = Inpf(c, ab);
-
- /* test if the two lines are coplanar */
- if (d > -0.000001f && d < 0.000001f) {
- float f1, f2;
- Crossf(cb, c, b);
- Crossf(ca, c, a);
-
- f1 = Inpf(cb, ab) / Inpf(ab, ab);
- f2 = Inpf(ca, ab) / Inpf(ab, ab);
-
- if (f1 >= 0 && f1 <= 1 &&
- f2 >= 0 && f2 <= 1)
- {
- VecMulf(a, f1);
- VecAddf(vi, v1, a);
-
- if (lambda != NULL)
- {
- *lambda = f1;
- }
-
- return 1; /* intersection found */
- }
- else
- {
- return 0;
- }
- }
- else
- {
- return 0;
- }
-}
-
-int AabbIntersectAabb(float min1[3], float max1[3], float min2[3], float max2[3])
-{
- return (min1[0]=0.0f && inp2>=0.0f && inp3>=0.0f) return 1;
-
- return 0;
-}
-
-#if 0
-int IsPointInTri2D(float v0[2], float v1[2], float v2[2], float pt[2])
-{
- /* not for quads, use for our abuse of LineIntersectsTriangleUV */
- float p1_3d[3], p2_3d[3], v0_3d[3], v1_3d[3], v2_3d[3];
- /* not used */
- float lambda, uv[3];
-
- p1_3d[0] = p2_3d[0] = uv[0]= pt[0];
- p1_3d[1] = p2_3d[1] = uv[1]= uv[2]= pt[1];
- p1_3d[2] = 1.0f;
- p2_3d[2] = -1.0f;
- v0_3d[2] = v1_3d[2] = v2_3d[2] = 0.0;
-
- /* generate a new fuv, (this is possibly a non optimal solution,
- * since we only need 2d calculation but use 3d func's)
- *
- * this method makes an imaginary triangle in 2d space using the UV's from the derived mesh face
- * Then find new uv coords using the fuv and this face with LineIntersectsTriangleUV.
- * This means the new values will be correct in relation to the derived meshes face.
- */
- Vec2Copyf(v0_3d, v0);
- Vec2Copyf(v1_3d, v1);
- Vec2Copyf(v2_3d, v2);
-
- /* Doing this in 3D is not nice */
- return LineIntersectsTriangle(p1_3d, p2_3d, v0_3d, v1_3d, v2_3d, &lambda, uv);
-}
-#endif
-
-/*
-
- x1,y2
- | \
- | \ .(a,b)
- | \
- x1,y1-- x2,y1
-
-*/
-int IsPointInTri2DInts(int x1, int y1, int x2, int y2, int a, int b)
-{
- float v1[2], v2[2], v3[2], p[2];
-
- v1[0]= (float)x1;
- v1[1]= (float)y1;
-
- v2[0]= (float)x1;
- v2[1]= (float)y2;
-
- v3[0]= (float)x2;
- v3[1]= (float)y1;
-
- p[0]= (float)a;
- p[1]= (float)b;
-
- return IsPointInTri2D(v1, v2, v3, p);
-
-}
-
-/* (x1,v1)(t1=0)------(x2,v2)(t2=1), 0 (x,v)(t) */
-void VecfCubicInterpol(float *x1, float *v1, float *x2, float *v2, float t, float *x, float *v)
-{
- float a[3],b[3];
- float t2= t*t;
- float t3= t2*t;
-
- /* cubic interpolation */
- a[0]= v1[0] + v2[0] + 2*(x1[0] - x2[0]);
- a[1]= v1[1] + v2[1] + 2*(x1[1] - x2[1]);
- a[2]= v1[2] + v2[2] + 2*(x1[2] - x2[2]);
-
- b[0]= -2*v1[0] - v2[0] - 3*(x1[0] - x2[0]);
- b[1]= -2*v1[1] - v2[1] - 3*(x1[1] - x2[1]);
- b[2]= -2*v1[2] - v2[2] - 3*(x1[2] - x2[2]);
-
- x[0]= a[0]*t3 + b[0]*t2 + v1[0]*t + x1[0];
- x[1]= a[1]*t3 + b[1]*t2 + v1[1]*t + x1[1];
- x[2]= a[2]*t3 + b[2]*t2 + v1[2]*t + x1[2];
-
- v[0]= 3*a[0]*t2 + 2*b[0]*t + v1[0];
- v[1]= 3*a[1]*t2 + 2*b[1]*t + v1[1];
- v[2]= 3*a[2]*t2 + 2*b[2]*t + v1[2];
-}
-
-static int point_in_slice(float p[3], float v1[3], float l1[3], float l2[3])
-{
-/*
-what is a slice ?
-some maths:
-a line including l1,l2 and a point not on the line
-define a subset of R3 delimeted by planes parallel to the line and orthogonal
-to the (point --> line) distance vector,one plane on the line one on the point,
-the room inside usually is rather small compared to R3 though still infinte
-useful for restricting (speeding up) searches
-e.g. all points of triangular prism are within the intersection of 3 'slices'
-onother trivial case : cube
-but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
-*/
- float h,rp[3],cp[3],q[3];
-
- lambda_cp_line_ex(v1,l1,l2,cp);
- VecSubf(q,cp,v1);
-
- VecSubf(rp,p,v1);
- h=Inpf(q,rp)/Inpf(q,q);
- if (h < 0.0f || h > 1.0f) return 0;
- return 1;
-}
-
-#if 0
-/*adult sister defining the slice planes by the origin and the normal
-NOTE |normal| may not be 1 but defining the thickness of the slice*/
-static int point_in_slice_as(float p[3],float origin[3],float normal[3])
-{
- float h,rp[3];
- VecSubf(rp,p,origin);
- h=Inpf(normal,rp)/Inpf(normal,normal);
- if (h < 0.0f || h > 1.0f) return 0;
- return 1;
-}
-
-/*mama (knowing the squared lenght of the normal)*/
-static int point_in_slice_m(float p[3],float origin[3],float normal[3],float lns)
-{
- float h,rp[3];
- VecSubf(rp,p,origin);
- h=Inpf(normal,rp)/lns;
- if (h < 0.0f || h > 1.0f) return 0;
- return 1;
-}
-#endif
-
-
-int point_in_tri_prism(float p[3], float v1[3], float v2[3], float v3[3])
-{
- if(!point_in_slice(p,v1,v2,v3)) return 0;
- if(!point_in_slice(p,v2,v3,v1)) return 0;
- if(!point_in_slice(p,v3,v1,v2)) return 0;
- return 1;
-}
-
-/* point closest to v1 on line v2-v3 in 3D */
-void PclosestVL3Dfl(float *closest, float v1[3], float v2[3], float v3[3])
-{
- float lambda, cp[3];
-
- lambda= lambda_cp_line_ex(v1, v2, v3, cp);
-
- if(lambda <= 0.0f)
- VecCopyf(closest, v2);
- else if(lambda >= 1.0f)
- VecCopyf(closest, v3);
- else
- VecCopyf(closest, cp);
-}
-
-/* distance v1 to line-piece v2-v3 in 3D */
-float PdistVL3Dfl(float *v1, float *v2, float *v3)
-{
- float closest[3];
-
- PclosestVL3Dfl(closest, v1, v2, v3);
-
- return VecLenf(closest, v1);
-}
-
-/********************************************************/
-
-/* make a 4x4 matrix out of 3 transform components */
-/* matrices are made in the order: scale * rot * loc */
-// TODO: need to have a version that allows for rotation order...
-void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3])
-{
- float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
- Mat4One(mat);
-
- /* make rotation + scaling part */
- EulToMat3(eul, rmat);
- SizeToMat3(size, smat);
- Mat3MulMat3(tmat, rmat, smat);
-
- /* copy rot/scale part to output matrix*/
- Mat4CpyMat3(mat, tmat);
-
- /* copy location to matrix */
- mat[3][0] = loc[0];
- mat[3][1] = loc[1];
- mat[3][2] = loc[2];
-}
-
-/* make a 4x4 matrix out of 3 transform components */
-/* matrices are made in the order: scale * rot * loc */
-void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder)
-{
- float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
- Mat4One(mat);
-
- /* make rotation + scaling part */
- EulOToMat3(eul, rotOrder, rmat);
- SizeToMat3(size, smat);
- Mat3MulMat3(tmat, rmat, smat);
-
- /* copy rot/scale part to output matrix*/
- Mat4CpyMat3(mat, tmat);
-
- /* copy location to matrix */
- mat[3][0] = loc[0];
- mat[3][1] = loc[1];
- mat[3][2] = loc[2];
-}
-
-
-/* make a 4x4 matrix out of 3 transform components */
-/* matrices are made in the order: scale * rot * loc */
-void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3])
-{
- float rmat[3][3], smat[3][3], tmat[3][3];
-
- /* initialise new matrix */
- Mat4One(mat);
-
- /* make rotation + scaling part */
- QuatToMat3(quat, rmat);
- SizeToMat3(size, smat);
- Mat3MulMat3(tmat, rmat, smat);
-
- /* copy rot/scale part to output matrix*/
- Mat4CpyMat3(mat, tmat);
-
- /* copy location to matrix */
- mat[3][0] = loc[0];
- mat[3][1] = loc[1];
- mat[3][2] = loc[2];
-}
-
-/********************************************************/
-
-/* Tangents */
-
-/* For normal map tangents we need to detect uv boundaries, and only average
- * tangents in case the uvs are connected. Alternative would be to store 1
- * tangent per face rather than 4 per face vertex, but that's not compatible
- * with games */
-
-
-/* from BKE_mesh.h */
-#define STD_UV_CONNECT_LIMIT 0.0001f
-
-void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, float *tang, float *uv)
-{
- VertexTangent *vt;
-
- /* find a tangent with connected uvs */
- for(vt= *vtang; vt; vt=vt->next) {
- if(fabs(uv[0]-vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabs(uv[1]-vt->uv[1]) < STD_UV_CONNECT_LIMIT) {
- VecAddf(vt->tang, vt->tang, tang);
- return;
- }
- }
-
- /* if not found, append a new one */
- vt= BLI_memarena_alloc((MemArena *)arena, sizeof(VertexTangent));
- VecCopyf(vt->tang, tang);
- vt->uv[0]= uv[0];
- vt->uv[1]= uv[1];
-
- if(*vtang)
- vt->next= *vtang;
- *vtang= vt;
-}
-
-float *find_vertex_tangent(VertexTangent *vtang, float *uv)
-{
- VertexTangent *vt;
- static float nulltang[3] = {0.0f, 0.0f, 0.0f};
-
- for(vt= vtang; vt; vt=vt->next)
- if(fabs(uv[0]-vt->uv[0]) < STD_UV_CONNECT_LIMIT && fabs(uv[1]-vt->uv[1]) < STD_UV_CONNECT_LIMIT)
- return vt->tang;
-
- return nulltang; /* shouldn't happen, except for nan or so */
-}
-
-void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2, float *co3, float *n, float *tang)
-{
- float tangv[3], ct[3], e1[3], e2[3], s1, t1, s2, t2, det;
-
- s1= uv2[0] - uv1[0];
- s2= uv3[0] - uv1[0];
- t1= uv2[1] - uv1[1];
- t2= uv3[1] - uv1[1];
- det= 1.0f / (s1 * t2 - s2 * t1);
-
- /* normals in render are inversed... */
- VecSubf(e1, co1, co2);
- VecSubf(e2, co1, co3);
- tang[0] = (t2*e1[0] - t1*e2[0])*det;
- tang[1] = (t2*e1[1] - t1*e2[1])*det;
- tang[2] = (t2*e1[2] - t1*e2[2])*det;
- tangv[0] = (s1*e2[0] - s2*e1[0])*det;
- tangv[1] = (s1*e2[1] - s2*e1[1])*det;
- tangv[2] = (s1*e2[2] - s2*e1[2])*det;
- Crossf(ct, tang, tangv);
-
- /* check flip */
- if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f)
- VecNegf(tang);
-}
-
-/* used for zoom values*/
-float power_of_2(float val) {
- return (float)pow(2, ceil(log(val) / log(2)));
-}
diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c
index 7d5e1eec53e..d31bc4e762d 100644
--- a/source/blender/blenlib/intern/boxpack2d.c
+++ b/source/blender/blenlib/intern/boxpack2d.c
@@ -31,7 +31,7 @@
* The defined Below are for internal use only */
/* free vert flags */
-#define eul 0.0000001f
+#define eps 0.0000001f
#define BLF 1
#define TRF 2
#define TLF 4
@@ -68,10 +68,10 @@
b->v[TR]->y = f;\
UPDATE_V34Y(b)
#define BOXINTERSECT(b1, b2)\
- (!( BOXLEFT(b1)+eul>=BOXRIGHT(b2) ||\
- BOXBOTTOM(b1)+eul>=BOXTOP(b2) ||\
- BOXRIGHT(b1)-eul<=BOXLEFT(b2) ||\
- BOXTOP(b1)-eul<=BOXBOTTOM(b2) ))
+ (!( BOXLEFT(b1)+eps>=BOXRIGHT(b2) ||\
+ BOXBOTTOM(b1)+eps>=BOXTOP(b2) ||\
+ BOXRIGHT(b1)-eps<=BOXLEFT(b2) ||\
+ BOXTOP(b1)-eps<=BOXBOTTOM(b2) ))
#define MIN2(x,y) ( (x)<(y) ? (x) : (y) )
#define MAX2(x,y) ( (x)>(y) ? (x) : (y) )
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index cb5632df569..f2727f6f259 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -45,7 +45,7 @@
#include "BLI_vfontdata.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
//XXX #include "BIF_toolbox.h"
@@ -256,11 +256,11 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
// VecLenf, see if there's a distance between the three points
// VecLenf again, to check the angle between the handles
// finally, check if one of them is a vector handle
- if((DistVL2Dfl(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) &&
- (VecLenf(bezt->vec[0], bezt->vec[1]) > 0.0001) &&
- (VecLenf(bezt->vec[1], bezt->vec[2]) > 0.0001) &&
- (VecLenf(bezt->vec[0], bezt->vec[2]) > 0.0002) &&
- (VecLenf(bezt->vec[0], bezt->vec[2]) > MAX2(VecLenf(bezt->vec[0], bezt->vec[1]), VecLenf(bezt->vec[1], bezt->vec[2]))) &&
+ if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) &&
+ (len_v3v3(bezt->vec[0], bezt->vec[1]) > 0.0001) &&
+ (len_v3v3(bezt->vec[1], bezt->vec[2]) > 0.0001) &&
+ (len_v3v3(bezt->vec[0], bezt->vec[2]) > 0.0002) &&
+ (len_v3v3(bezt->vec[0], bezt->vec[2]) > MAX2(len_v3v3(bezt->vec[0], bezt->vec[1]), len_v3v3(bezt->vec[1], bezt->vec[2]))) &&
bezt->h1 != HD_VECT && bezt->h2 != HD_VECT)
{
bezt->h1= bezt->h2= HD_ALIGN;
diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c
index 49a3cad53f1..fd6bb1a2014 100644
--- a/source/blender/blenlib/intern/graph.c
+++ b/source/blender/blenlib/intern/graph.c
@@ -30,7 +30,7 @@
#include "BLI_graph.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BKE_utildefines.h"
@@ -267,7 +267,7 @@ void BLI_removeDoubleNodes(BGraph *graph, float limit)
{
for(node_replaced = graph->nodes.first; node_replaced; node_replaced = node_replaced->next)
{
- if (node_replaced != node_src && VecLenf(node_replaced->p, node_src->p) <= limit)
+ if (node_replaced != node_src && len_v3v3(node_replaced->p, node_src->p) <= limit)
{
BLI_replaceNode(graph, node_src, node_replaced);
}
@@ -283,7 +283,7 @@ BNode * BLI_FindNodeByPosition(BGraph *graph, float *p, float limit)
for(node = graph->nodes.first; node; node = node->next)
{
- float distance = VecLenf(p, node->p);
+ float distance = len_v3v3(p, node->p);
if (distance <= limit && (closest_node == NULL || distance < min_distance))
{
closest_node = node;
@@ -526,10 +526,10 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3])
{
float dv[3], pv[3];
- VecSubf(dv, v, center);
- Projf(pv, dv, axis);
- VecMulf(pv, -2);
- VecAddf(v, v, pv);
+ sub_v3_v3v3(dv, v, center);
+ project_v3_v3v3(pv, dv, axis);
+ mul_v3_fl(pv, -2);
+ add_v3_v3v3(v, v, pv);
}
static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring, int total, float axis[3], float limit, int group)
@@ -546,7 +546,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
for (j = i + 1; j < total; j++)
{
- float angle = Inpf(ring[i].n, ring[j].n);
+ float angle = dot_v3v3(ring[i].n, ring[j].n);
/* map negative values to 1..2 */
if (angle < 0)
@@ -579,8 +579,8 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
float p[3];
int j = (i + 1) % total; /* next arc in the circular list */
- VecAddf(tangent, ring[i].n, ring[j].n);
- Crossf(normal, tangent, axis);
+ add_v3_v3v3(tangent, ring[i].n, ring[j].n);
+ cross_v3_v3v3(normal, tangent, axis);
node1 = BLI_otherNode(ring[i].arc, root_node);
node2 = BLI_otherNode(ring[j].arc, root_node);
@@ -589,7 +589,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
BLI_mirrorAlongAxis(p, root_node->p, normal);
/* check if it's within limit before continuing */
- if (VecLenf(node1->p, p) > limit)
+ if (len_v3v3(node1->p, p) > limit)
{
symmetric = 0;
}
@@ -658,11 +658,11 @@ static void handleRadialSymmetry(BGraph *graph, BNode *root_node, int depth, flo
unit->arc = connectedArc;
/* project the node to node vector on the symmetry plane */
- VecSubf(unit->n, otherNode->p, root_node->p);
- Projf(vec, unit->n, axis);
- VecSubf(unit->n, unit->n, vec);
+ sub_v3_v3v3(unit->n, otherNode->p, root_node->p);
+ project_v3_v3v3(vec, unit->n, axis);
+ sub_v3_v3v3(unit->n, unit->n, vec);
- Normalize(unit->n);
+ normalize_v3(unit->n);
unit++;
}
@@ -780,9 +780,9 @@ static void flagAxialSymmetry(BNode *root_node, BNode *end_node, BArc *arc, int
arc->symmetry_group = group;
- VecSubf(vec, end_node->p, root_node->p);
+ sub_v3_v3v3(vec, end_node->p, root_node->p);
- if (Inpf(vec, root_node->symmetry_axis) < 0)
+ if (dot_v3v3(vec, root_node->symmetry_axis) < 0)
{
arc->symmetry_flag |= SYM_SIDE_NEGATIVE;
}
@@ -796,26 +796,26 @@ static void testAxialSymmetry(BGraph *graph, BNode* root_node, BNode* node1, BNo
{
float nor[3], vec[3], p[3];
- VecSubf(p, node1->p, root_node->p);
- Crossf(nor, p, axis);
+ sub_v3_v3v3(p, node1->p, root_node->p);
+ cross_v3_v3v3(nor, p, axis);
- VecSubf(p, root_node->p, node2->p);
- Crossf(vec, p, axis);
- VecAddf(vec, vec, nor);
+ sub_v3_v3v3(p, root_node->p, node2->p);
+ cross_v3_v3v3(vec, p, axis);
+ add_v3_v3v3(vec, vec, nor);
- Crossf(nor, vec, axis);
+ cross_v3_v3v3(nor, vec, axis);
if (abs(nor[0]) > abs(nor[1]) && abs(nor[0]) > abs(nor[2]) && nor[0] < 0)
{
- VecNegf(nor);
+ negate_v3(nor);
}
else if (abs(nor[1]) > abs(nor[0]) && abs(nor[1]) > abs(nor[2]) && nor[1] < 0)
{
- VecNegf(nor);
+ negate_v3(nor);
}
else if (abs(nor[2]) > abs(nor[1]) && abs(nor[2]) > abs(nor[0]) && nor[2] < 0)
{
- VecNegf(nor);
+ negate_v3(nor);
}
/* mirror node2 along axis */
@@ -823,7 +823,7 @@ static void testAxialSymmetry(BGraph *graph, BNode* root_node, BNode* node1, BNo
BLI_mirrorAlongAxis(p, root_node->p, nor);
/* check if it's within limit before continuing */
- if (VecLenf(node1->p, p) <= limit)
+ if (len_v3v3(node1->p, p) <= limit)
{
/* mark node as symmetric physically */
VECCOPY(root_node->symmetry_axis, nor);
@@ -905,12 +905,12 @@ static void markdownSecondarySymmetry(BGraph *graph, BNode *node, int depth, int
/* If arc is on the axis */
else if (connectedArc->symmetry_level == level)
{
- VecAddf(axis, axis, connectedArc->head->p);
- VecSubf(axis, axis, connectedArc->tail->p);
+ add_v3_v3v3(axis, axis, connectedArc->head->p);
+ sub_v3_v3v3(axis, axis, connectedArc->tail->p);
}
}
- Normalize(axis);
+ normalize_v3(axis);
/* Split between axial and radial symmetry */
if (count == 2)
diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c
index fd658765802..e7933ee98a2 100644
--- a/source/blender/blenlib/intern/jitter.c
+++ b/source/blender/blenlib/intern/jitter.c
@@ -34,7 +34,7 @@
#include
#include "MEM_guardedalloc.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_jitter.h"
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index b3a4722d6d9..166f4ed029e 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -343,7 +343,7 @@ int BLI_findindex(ListBase *listbase, void *vlink)
return -1;
}
-void BLI_duplicatelist(ListBase *list1, ListBase *list2) /* copy from 2 to 1 */
+void BLI_duplicatelist(ListBase *list1, const ListBase *list2)
{
struct Link *link1, *link2;
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index ca7b95cb3f1..f3fe09c088f 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -35,14 +35,12 @@
/* A few small defines. Keep'em local! */
#define SMALL_NUMBER 1.e-8
-#if 0
float sqrt3f(float f)
{
if(f==0.0) return 0;
if(f<0) return (float)(-exp(log(-f)/3));
else return (float)(exp(log(f)/3));
}
-#endif
double sqrt3d(double d)
{
@@ -51,7 +49,6 @@ double sqrt3d(double d)
else return exp(log(d)/3);
}
-#if 0
float saacos(float fac)
{
if(fac<= -1.0f) return (float)M_PI;
@@ -96,7 +93,6 @@ float interpf(float target, float origin, float fac)
{
return (fac*target) + (1.0f-fac)*origin;
}
-#endif
/* useful to calculate an even width shell, by taking the angle between 2 planes.
* The return value is a scale on the offset.
@@ -107,11 +103,9 @@ float shell_angle_to_dist(const float angle)
return (angle < SMALL_NUMBER) ? 1.0f : fabsf(1.0f / cosf(angle * (M_PI/180.0f)));
}
-#if 0
/* used for zoom values*/
float power_of_2(float val)
{
return (float)pow(2, ceil(log(val) / log(2)));
}
-#endif
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 3b3801a197f..7ae380a1dde 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -32,7 +32,6 @@
#include "BLI_math.h"
-#if 0
void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
{
int i;
@@ -311,5 +310,4 @@ int constrain_rgb(float *r, float *g, float *b)
return 0; /* Color within RGB gamut */
}
-#endif
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 5c7890ffee4..efa5876e1b0 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -124,7 +124,7 @@ float area_tri_v3(float *v1, float *v2, float *v3) /* Triangles */
#define MAX3(x,y,z) MAX2(MAX2((x),(y)) , (z))
-float area_poly_v3(int nr, float *verts, float *normal)
+float area_poly_v3(int nr, float verts[][3], float *normal)
{
float x, y, z, area, max;
float *cur, *prev;
@@ -142,13 +142,13 @@ float area_poly_v3(int nr, float *verts, float *normal)
}
/* The Trapezium Area Rule */
- prev= verts+3*(nr-1);
- cur= verts;
+ prev= verts[nr-1];
+ cur= verts[0];
area= 0;
for(a=0; a=0.0) {
@@ -432,7 +433,9 @@ int isect_ray_tri_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
- if ((a > -0.000001) && (a < 0.000001)) return 0;
+ /* note: these values were 0.000001 in 2.4x but for projection snapping on
+ * a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
+ if ((a > -0.00000001) && (a < 0.00000001)) return 0;
f = 1.0f/a;
sub_v3_v3v3(s, p1, v0);
@@ -1074,8 +1077,8 @@ void isect_point_face_uv_v2(int isquad, float v0[2], float v1[2], float v2[2], f
}
}
-#if 0
-int isect_point_tri_v2(float v1[2], float v2[2], float v3[2], float pt[2])
+#if 0 // XXX this version used to be used in isect_point_tri_v2_int() and was called IsPointInTri2D
+int isect_point_tri_v2(float pt[2], float v1[2], float v2[2], float v3[2])
{
float inp1, inp2, inp3;
@@ -1145,7 +1148,7 @@ int isect_point_tri_v2_int(int x1, int y1, int x2, int y2, int a, int b)
p[0]= (float)a;
p[1]= (float)b;
- return isect_point_tri_v2(v1, v2, v3, p);
+ return isect_point_tri_v2(p, v1, v2, v3);
}
static int point_in_slice(float p[3], float v1[3], float l1[3], float l2[3])
@@ -1533,7 +1536,6 @@ void map_to_sphere(float *u, float *v,float x, float y, float z)
/* from BKE_mesh.h */
#define STD_UV_CONNECT_LIMIT 0.0001f
-#if 0
void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, float *tang, float *uv)
{
VertexTangent *vt;
@@ -1594,5 +1596,162 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2,
if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f)
negate_v3(tang);
}
-#endif
+/********************************************************/
+
+/* vector clouds */
+/* void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,float (*rpos)[3], float *rweight,
+ float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
+
+input
+(
+int list_size
+4 lists as pointer to array[list_size]
+1. current pos array of 'new' positions
+2. current weight array of 'new'weights (may be NULL pointer if you have no weights )
+3. reference rpos array of 'old' positions
+4. reference rweight array of 'old'weights (may be NULL pointer if you have no weights )
+)
+output
+(
+float lloc[3] center of mass pos
+float rloc[3] center of mass rpos
+float lrot[3][3] rotation matrix
+float lscale[3][3] scale matrix
+pointers may be NULL if not needed
+)
+
+*/
+/* can't believe there is none in math utils */
+float _det_m3(float m2[3][3])
+{
+ float det = 0.f;
+ if (m2){
+ det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1])
+ -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1])
+ +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]);
+ }
+ return det;
+}
+
+
+void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight,float (*rpos)[3], float *rweight,
+ float lloc[3],float rloc[3],float lrot[3][3],float lscale[3][3])
+{
+ float accu_com[3]= {0.0f,0.0f,0.0f}, accu_rcom[3]= {0.0f,0.0f,0.0f};
+ float accu_weight = 0.0f,accu_rweight = 0.0f,eps = 0.000001f;
+
+ int a;
+ /* first set up a nice default response */
+ if (lloc) zero_v3(lloc);
+ if (rloc) zero_v3(rloc);
+ if (lrot) unit_m3(lrot);
+ if (lscale) unit_m3(lscale);
+ /* do com for both clouds */
+ if (pos && rpos && (list_size > 0)) /* paranoya check */
+ {
+ /* do com for both clouds */
+ for(a=0; aPolardecompose*/
+ /* build 'projection' matrix */
+ float m[3][3],mr[3][3],q[3][3],qi[3][3];
+ float va[3],vb[3],stunt[3];
+ float odet,ndet;
+ int i=0,imax=15;
+ zero_m3(m);
+ zero_m3(mr);
+
+ /* build 'projection' matrix */
+ for(a=0; amass); mass needs renormalzation here ?? */
+ sub_v3_v3v3(vb,pos[a],accu_com);
+ /* mul_v3_fl(va,rp->mass); */
+ m[0][0] += va[0] * vb[0];
+ m[0][1] += va[0] * vb[1];
+ m[0][2] += va[0] * vb[2];
+
+ m[1][0] += va[1] * vb[0];
+ m[1][1] += va[1] * vb[1];
+ m[1][2] += va[1] * vb[2];
+
+ m[2][0] += va[2] * vb[0];
+ m[2][1] += va[2] * vb[1];
+ m[2][2] += va[2] * vb[2];
+
+ /* building the referenc matrix on the fly
+ needed to scale properly later*/
+
+ mr[0][0] += va[0] * va[0];
+ mr[0][1] += va[0] * va[1];
+ mr[0][2] += va[0] * va[2];
+
+ mr[1][0] += va[1] * va[0];
+ mr[1][1] += va[1] * va[1];
+ mr[1][2] += va[1] * va[2];
+
+ mr[2][0] += va[2] * va[0];
+ mr[2][1] += va[2] * va[1];
+ mr[2][2] += va[2] * va[2];
+ }
+ copy_m3_m3(q,m);
+ stunt[0] = q[0][0]; stunt[1] = q[1][1]; stunt[2] = q[2][2];
+ /* renormalizing for numeric stability */
+ mul_m3_fl(q,1.f/len_v3(stunt));
+
+ /* this is pretty much Polardecompose 'inline' the algo based on Higham's thesis */
+ /* without the far case ... but seems to work here pretty neat */
+ odet = 0.f;
+ ndet = _det_m3(q);
+ while((odet-ndet)*(odet-ndet) > eps && iscale);
- mul_m4_fl((float*)wmat, weight);
+ mul_m4_fl(wmat, weight);
add_m4_m4m4(dqsum->scale, dqsum->scale, wmat);
dqsum->scale_weight += weight;
}
@@ -1445,7 +1440,7 @@ void normalize_dq(DualQuat *dq, float totweight)
dq->scale[3][3] += addweight;
}
- mul_m4_fl((float*)dq->scale, scale);
+ mul_m4_fl(dq->scale, scale);
dq->scale_weight= 1.0f;
}
}
@@ -1496,7 +1491,7 @@ void mul_v3m3_dq(float *co, float mat[][3],DualQuat *dq)
}
else
copy_m3_m3(mat, M);
- mul_m3_fl((float*)mat, len2);
+ mul_m3_fl(mat, len2);
}
}
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 8336b529da3..289d8818753 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -32,234 +32,11 @@
#include "BLI_math.h"
-/********************************** Init *************************************/
+//******************************* Interpolation *******************************/
-void zero_v2(float r[2])
+void interp_v2_v2v2(float *target, float *a, float *b, float t)
{
- r[0]= 0.0f;
- r[1]= 0.0f;
-}
-
-void zero_v3(float r[3])
-{
- r[0]= 0.0f;
- r[1]= 0.0f;
- r[2]= 0.0f;
-}
-
-void copy_v2_v2(float r[2], float a[2])
-{
- r[0]= a[0];
- r[1]= a[1];
-}
-
-void copy_v3_v3(float r[3], float a[3])
-{
- r[0]= a[0];
- r[1]= a[1];
- r[2]= a[2];
-}
-
-/********************************* Arithmetic ********************************/
-
-void add_v2_v2(float *r, float *a)
-{
- r[0] += a[0];
- r[1] += a[1];
-}
-
-void add_v2_v2v2(float *r, float *a, float *b)
-{
- r[0]= a[0] + b[0];
- r[1]= a[1] + b[1];
-}
-
-void add_v3_v3(float *r, float *a)
-{
- r[0] += a[0];
- r[1] += a[1];
- r[1] += a[1];
-}
-
-void add_v3_v3v3(float *r, float *a, float *b)
-{
- r[0]= a[0] + b[0];
- r[1]= a[1] + b[1];
- r[2]= a[2] + b[2];
-}
-
-void sub_v2_v2(float *r, float *a)
-{
- r[0] -= a[0];
- r[1] -= a[1];
-}
-
-void sub_v2_v2v2(float *r, float *a, float *b)
-{
- r[0]= a[0] - b[0];
- r[1]= a[1] - b[1];
-}
-
-void sub_v3_v3(float *r, float *a)
-{
- r[0] -= a[0];
- r[1] -= a[1];
- r[1] -= a[1];
-}
-
-void sub_v3_v3v3(float *r, float *a, float *b)
-{
- r[0]= a[0] - b[0];
- r[1]= a[1] - b[1];
- r[2]= a[2] - b[2];
-}
-
-void mul_v2_fl(float *v1, float f)
-{
- v1[0]*= f;
- v1[1]*= f;
-}
-
-void mul_v3_fl(float r[3], float f)
-{
- r[0] *= f;
- r[1] *= f;
- r[2] *= f;
-}
-
-void mul_v3_v3fl(float r[3], float a[3], float f)
-{
- r[0]= a[0]*f;
- r[1]= a[1]*f;
- r[2]= a[2]*f;
-}
-
-void mul_v3_v3(float r[3], float a[3])
-{
- r[0] *= a[0];
- r[1] *= a[1];
- r[2] *= a[2];
-}
-
-void mul_v3_v3v3(float *v, float *v1, float *v2)
-{
- v[0] = v1[0] * v2[0];
- v[1] = v1[1] * v2[1];
- v[2] = v1[2] * v2[2];
-}
-
-void negate_v3(float r[3])
-{
- r[0]= -r[0];
- r[1]= -r[1];
- r[2]= -r[2];
-}
-
-void negate_v3_v3(float r[3], float a[3])
-{
- r[0]= -a[0];
- r[1]= -a[1];
- r[2]= -a[2];
-}
-
-float dot_v2v2(float *a, float *b)
-{
- return a[0]*b[0] + a[1]*b[1];
-}
-
-float dot_v3v3(float a[3], float b[3])
-{
- return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
-}
-
-void cross_v3_v3v3(float r[3], float a[3], float b[3])
-{
- r[0]= a[1]*b[2] - a[2]*b[1];
- r[1]= a[2]*b[0] - a[0]*b[2];
- r[2]= a[0]*b[1] - a[1]*b[0];
-}
-
-void star_m3_v3(float mat[][3], float *vec)
-{
- mat[0][0]= mat[1][1]= mat[2][2]= 0.0;
- mat[0][1]= -vec[2];
- mat[0][2]= vec[1];
- mat[1][0]= vec[2];
- mat[1][2]= -vec[0];
- mat[2][0]= -vec[1];
- mat[2][1]= vec[0];
-
-}
-
-/*********************************** Length **********************************/
-
-float len_v2(float *v)
-{
- return (float)sqrt(v[0]*v[0] + v[1]*v[1]);
-}
-
-float len_v2v2(float *v1, float *v2)
-{
- float x, y;
-
- x = v1[0]-v2[0];
- y = v1[1]-v2[1];
- return (float)sqrt(x*x+y*y);
-}
-
-float len_v3(float a[3])
-{
- return sqrtf(dot_v3v3(a, a));
-}
-
-float len_v3v3(float a[3], float b[3])
-{
- float d[3];
-
- sub_v3_v3v3(d, b, a);
- return len_v3(d);
-}
-
-float normalize_v2(float n[2])
-{
- float d;
-
- d= n[0]*n[0]+n[1]*n[1];
-
- if(d>1.0e-35f) {
- d= (float)sqrt(d);
- n[0]/=d;
- n[1]/=d;
- } else {
- n[0]=n[1]= 0.0f;
- d= 0.0f;
- }
- return d;
-}
-
-float normalize_v3(float n[3])
-{
- float d= dot_v3v3(n, n);
-
- /* a larger value causes normalize errors in a
- scaled down models with camera xtreme close */
- if(d > 1.0e-35f) {
- d= sqrtf(d);
- mul_v3_fl(n, 1.0f/d);
- }
- else {
- zero_v3(n);
- d= 0.0f;
- }
-
- return d;
-}
-
-/******************************* Interpolation *******************************/
-
-void interp_v2_v2v2(float *target, const float *a, const float *b, const float t)
-{
- const float s = 1.0f-t;
+ float s = 1.0f-t;
target[0]= s*a[0] + t*b[0];
target[1]= s*a[1] + t*b[1];
@@ -267,17 +44,15 @@ void interp_v2_v2v2(float *target, const float *a, const float *b, const float t
/* weight 3 2D vectors,
* 'w' must be unit length but is not a vector, just 3 weights */
-void interp_v2_v2v2v2(float p[2], const float v1[2], const float v2[2], const float v3[2], const float w[3])
+void interp_v2_v2v2v2(float p[2], float v1[2], float v2[2], float v3[2], float w[3])
{
p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
}
-
-
-void interp_v3_v3v3(float *target, const float *a, const float *b, const float t)
+void interp_v3_v3v3(float *target, float *a, float *b, float t)
{
- const float s = 1.0f-t;
+ float s = 1.0f-t;
target[0]= s*a[0] + t*b[0];
target[1]= s*a[1] + t*b[1];
@@ -286,18 +61,27 @@ void interp_v3_v3v3(float *target, const float *a, const float *b, const float t
/* weight 3 vectors,
* 'w' must be unit length but is not a vector, just 3 weights */
-void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
+void interp_v3_v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float w[3])
{
p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2];
p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2];
p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2];
}
+/* weight 3 vectors,
+ * 'w' must be unit length but is not a vector, just 3 weights */
+void interp_v3_v3v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float v4[3], float w[4])
+{
+ p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
+ p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
+ p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
+}
+
void mid_v3_v3v3(float *v, float *v1, float *v2)
{
- v[0]= 0.5f*(v1[0]+ v2[0]);
- v[1]= 0.5f*(v1[1]+ v2[1]);
- v[2]= 0.5f*(v1[2]+ v2[2]);
+ v[0]= 0.5f*(v1[0] + v2[0]);
+ v[1]= 0.5f*(v1[1] + v2[1]);
+ v[2]= 0.5f*(v1[2] + v2[2]);
}
/********************************* Comparison ********************************/
@@ -508,20 +292,6 @@ void print_v4(char *str, float v[4])
printf("%s: %.3f %.3f %.3f %.3f\n", str, v[0], v[1], v[2], v[3]);
}
-void normal_short_to_float_v3(float *out, short *in)
-{
- out[0] = in[0]*(1.0f/32767.0f);
- out[1] = in[1]*(1.0f/32767.0f);
- out[2] = in[2]*(1.0f/32767.0f);
-}
-
-void normal_float_to_short_v3(short *out, float *in)
-{
- out[0] = (short)(in[0]*32767.0f);
- out[1] = (short)(in[1]*32767.0f);
- out[2] = (short)(in[2]*32767.0f);
-}
-
void minmax_v3_v3v3(float *min, float *max, float *vec)
{
if(min[0]>vec[0]) min[0]= vec[0];
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
new file mode 100644
index 00000000000..cb629312712
--- /dev/null
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -0,0 +1,313 @@
+/**
+ * $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: some of this file.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ * */
+
+#include "BLI_math.h"
+
+#ifndef BLI_MATH_VECTOR_INLINE
+#define BLI_MATH_VECTOR_INLINE
+
+/********************************** Init *************************************/
+
+MINLINE void zero_v2(float r[2])
+{
+ r[0]= 0.0f;
+ r[1]= 0.0f;
+}
+
+MINLINE void zero_v3(float r[3])
+{
+ r[0]= 0.0f;
+ r[1]= 0.0f;
+ r[2]= 0.0f;
+}
+
+MINLINE void copy_v2_v2(float r[2], float a[2])
+{
+ r[0]= a[0];
+ r[1]= a[1];
+}
+
+MINLINE void copy_v3_v3(float r[3], float a[3])
+{
+ r[0]= a[0];
+ r[1]= a[1];
+ r[2]= a[2];
+}
+
+MINLINE void swap_v2_v2(float a[2], float b[2])
+{
+ SWAP(float, a[0], b[0]);
+ SWAP(float, a[1], b[1]);
+}
+
+MINLINE void swap_v3_v3(float a[3], float b[3])
+{
+ SWAP(float, a[0], b[0]);
+ SWAP(float, a[1], b[1]);
+ SWAP(float, a[2], b[2]);
+}
+
+/********************************* Arithmetic ********************************/
+
+MINLINE void add_v2_v2(float *r, float *a)
+{
+ r[0] += a[0];
+ r[1] += a[1];
+}
+
+MINLINE void add_v2_v2v2(float *r, float *a, float *b)
+{
+ r[0]= a[0] + b[0];
+ r[1]= a[1] + b[1];
+}
+
+MINLINE void add_v3_v3(float *r, float *a)
+{
+ r[0] += a[0];
+ r[1] += a[1];
+ r[2] += a[2];
+}
+
+MINLINE void add_v3_v3v3(float *r, float *a, float *b)
+{
+ r[0]= a[0] + b[0];
+ r[1]= a[1] + b[1];
+ r[2]= a[2] + b[2];
+}
+
+MINLINE void sub_v2_v2(float *r, float *a)
+{
+ r[0] -= a[0];
+ r[1] -= a[1];
+}
+
+MINLINE void sub_v2_v2v2(float *r, float *a, float *b)
+{
+ r[0]= a[0] - b[0];
+ r[1]= a[1] - b[1];
+}
+
+MINLINE void sub_v3_v3(float *r, float *a)
+{
+ r[0] -= a[0];
+ r[1] -= a[1];
+ r[2] -= a[2];
+}
+
+MINLINE void sub_v3_v3v3(float *r, float *a, float *b)
+{
+ r[0]= a[0] - b[0];
+ r[1]= a[1] - b[1];
+ r[2]= a[2] - b[2];
+}
+
+MINLINE void mul_v2_fl(float *v1, float f)
+{
+ v1[0]*= f;
+ v1[1]*= f;
+}
+
+MINLINE void mul_v3_fl(float r[3], float f)
+{
+ r[0] *= f;
+ r[1] *= f;
+ r[2] *= f;
+}
+
+MINLINE void mul_v3_v3fl(float r[3], float a[3], float f)
+{
+ r[0]= a[0]*f;
+ r[1]= a[1]*f;
+ r[2]= a[2]*f;
+}
+
+MINLINE void mul_v3_v3(float r[3], float a[3])
+{
+ r[0] *= a[0];
+ r[1] *= a[1];
+ r[2] *= a[2];
+}
+
+MINLINE void madd_v3_v3fl(float r[3], float a[3], float f)
+{
+ r[0] += a[0]*f;
+ r[1] += a[1]*f;
+ r[2] += a[2]*f;
+}
+
+MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3])
+{
+ r[0] += a[0]*b[0];
+ r[1] += a[1]*b[1];
+ r[2] += a[2]*b[2];
+}
+
+MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f)
+{
+ r[0] = a[0] + b[0]*f;
+ r[1] = a[1] + b[1]*f;
+ r[2] = a[2] + b[2]*f;
+}
+
+MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3])
+{
+ r[0] = a[0] + b[0]*c[0];
+ r[1] = a[1] + b[1]*c[1];
+ r[2] = a[2] + b[2]*c[2];
+}
+
+MINLINE void mul_v3_v3v3(float *v, float *v1, float *v2)
+{
+ v[0] = v1[0] * v2[0];
+ v[1] = v1[1] * v2[1];
+ v[2] = v1[2] * v2[2];
+}
+
+MINLINE void negate_v3(float r[3])
+{
+ r[0]= -r[0];
+ r[1]= -r[1];
+ r[2]= -r[2];
+}
+
+MINLINE void negate_v3_v3(float r[3], float a[3])
+{
+ r[0]= -a[0];
+ r[1]= -a[1];
+ r[2]= -a[2];
+}
+
+MINLINE float dot_v2v2(float *a, float *b)
+{
+ return a[0]*b[0] + a[1]*b[1];
+}
+
+MINLINE float dot_v3v3(float a[3], float b[3])
+{
+ return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
+}
+
+MINLINE float cross_v2v2(float a[2], float b[2])
+{
+ return a[0]*b[1] - a[1]*b[0];
+}
+
+MINLINE void cross_v3_v3v3(float r[3], float a[3], float b[3])
+{
+ r[0]= a[1]*b[2] - a[2]*b[1];
+ r[1]= a[2]*b[0] - a[0]*b[2];
+ r[2]= a[0]*b[1] - a[1]*b[0];
+}
+
+MINLINE void star_m3_v3(float mat[][3], float *vec)
+{
+ mat[0][0]= mat[1][1]= mat[2][2]= 0.0;
+ mat[0][1]= -vec[2];
+ mat[0][2]= vec[1];
+ mat[1][0]= vec[2];
+ mat[1][2]= -vec[0];
+ mat[2][0]= -vec[1];
+ mat[2][1]= vec[0];
+}
+
+/*********************************** Length **********************************/
+
+MINLINE float len_v2(float *v)
+{
+ return (float)sqrt(v[0]*v[0] + v[1]*v[1]);
+}
+
+MINLINE float len_v2v2(float *v1, float *v2)
+{
+ float x, y;
+
+ x = v1[0]-v2[0];
+ y = v1[1]-v2[1];
+ return (float)sqrt(x*x+y*y);
+}
+
+MINLINE float len_v3(float a[3])
+{
+ return sqrtf(dot_v3v3(a, a));
+}
+
+MINLINE float len_v3v3(float a[3], float b[3])
+{
+ float d[3];
+
+ sub_v3_v3v3(d, b, a);
+ return len_v3(d);
+}
+
+MINLINE float normalize_v2(float n[2])
+{
+ float d= dot_v2v2(n, n);
+
+ if(d > 1.0e-35f) {
+ d= sqrtf(d);
+ mul_v2_fl(n, 1.0f/d);
+ } else {
+ zero_v2(n);
+ d= 0.0f;
+ }
+ return d;
+}
+
+MINLINE float normalize_v3(float n[3])
+{
+ float d= dot_v3v3(n, n);
+
+ /* a larger value causes normalize errors in a
+ scaled down models with camera xtreme close */
+ if(d > 1.0e-35f) {
+ d= sqrtf(d);
+ mul_v3_fl(n, 1.0f/d);
+ }
+ else {
+ zero_v3(n);
+ d= 0.0f;
+ }
+
+ return d;
+}
+
+MINLINE void normal_short_to_float_v3(float *out, short *in)
+{
+ out[0] = in[0]*(1.0f/32767.0f);
+ out[1] = in[1]*(1.0f/32767.0f);
+ out[2] = in[2]*(1.0f/32767.0f);
+}
+
+MINLINE void normal_float_to_short_v3(short *out, float *in)
+{
+ out[0] = (short)(in[0]*32767.0f);
+ out[1] = (short)(in[1]*32767.0f);
+ out[2] = (short)(in[2]*32767.0f);
+}
+
+#endif /* BLI_MATH_VECTOR_INLINE */
+
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index bd9ed85efa2..e54382c9392 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -40,7 +40,7 @@
#include "DNA_listBase.h"
#include "DNA_mesh_types.h"
#include "BLI_editVert.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_scanfill.h"
#include "BLI_callbacks.h"
@@ -432,13 +432,13 @@ static void testvertexnearedge(void)
eed= filledgebase.first;
while(eed) {
if(eve!=eed->v1 && eve!=eed->v2 && eve->xs==eed->f1) {
- if(FloatCompare(eve->co,eed->v1->co, COMPLIMIT)) {
+ if(compare_v3v3(eve->co,eed->v1->co, COMPLIMIT)) {
ed1->v2= eed->v1;
eed->v1->h++;
eve->h= 0;
break;
}
- else if(FloatCompare(eve->co,eed->v2->co, COMPLIMIT)) {
+ else if(compare_v3v3(eve->co,eed->v2->co, COMPLIMIT)) {
ed1->v2= eed->v2;
eed->v2->h++;
eve->h= 0;
@@ -450,7 +450,7 @@ static void testvertexnearedge(void)
vec2[0]= eed->v2->co[cox];
vec2[1]= eed->v2->co[coy];
if(boundinsideEV(eed,eve)) {
- dist= DistVL2Dfl(vec1,vec2,vec3);
+ dist= dist_to_line_v2(vec1,vec2,vec3);
if(distv1, eve);
@@ -819,12 +819,12 @@ int BLI_edgefill(int mode, int mat_nr)
eve= fillvertbase.first;
while(eve) {
if(v2) {
- if( FloatCompare(v2, eve->co, COMPLIMIT)==0) {
- len= CalcNormFloat(v1, v2, eve->co, norm);
+ if( compare_v3v3(v2, eve->co, COMPLIMIT)==0) {
+ len= normal_tri_v3( norm,v1, v2, eve->co);
if(len != 0.0) break;
}
}
- else if(FloatCompare(v1, eve->co, COMPLIMIT)==0) {
+ else if(compare_v3v3(v1, eve->co, COMPLIMIT)==0) {
v2= eve->co;
}
eve= eve->next;
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 39afced92bc..5ff4dfe4e96 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -223,7 +223,7 @@ void BLI_newname(char *name, int add)
* defname: the name that should be used by default if none is specified already
* delim: the character which acts as a delimeter between parts of the name
*/
-void BLI_uniquename(ListBase *list, void *vlink, char defname[], char delim, short name_offs, short len)
+void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len)
{
Link *link;
char tempname[128];
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 7cdcbff1dae..4437107f9ae 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -102,7 +102,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_storage_types.h" // for relname flags
#include "BKE_animsys.h"
@@ -1694,6 +1694,12 @@ static void lib_link_fmodifiers(FileData *fd, ID *id, ListBase *list)
data->script = newlibadr(fd, id->lib, data->script);
}
break;
+ case FMODIFIER_TYPE_SOUND:
+ {
+ FMod_Sound *data= (FMod_Sound *)fcm->data;
+ data->sound = newlibadr(fd, id->lib, data->sound);
+ }
+ break;
}
}
}
@@ -1702,6 +1708,9 @@ static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list)
{
FCurve *fcu;
+ if (list == NULL)
+ return;
+
/* relink ID-block references... */
for (fcu= list->first; fcu; fcu= fcu->next) {
/* driver data */
@@ -1848,6 +1857,9 @@ static void lib_link_nladata_strips(FileData *fd, ID *id, ListBase *list)
/* check strip's children */
lib_link_nladata_strips(fd, id, &strip->strips);
+ /* check strip's F-Curves */
+ lib_link_fcurves(fd, id, &strip->fcurves);
+
/* reassign the counted-reference to action */
strip->act = newlibadr_us(fd, id->lib, strip->act);
}
@@ -1983,6 +1995,8 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree)
if(ntree->adt) lib_link_animdata(fd, &ntree->id, ntree->adt);
+ ntree->gpd= newlibadr_us(fd, id->lib, ntree->gpd);
+
for(node= ntree->nodes.first; node; node= node->next)
node->id= newlibadr_us(fd, id->lib, node->id);
}
@@ -2383,7 +2397,9 @@ static void direct_link_armature(FileData *fd, bArmature *arm)
link_list(fd, &arm->bonebase);
arm->edbo= NULL;
arm->sketch = NULL;
+
arm->adt= newdataadr(fd, arm->adt);
+ direct_link_animdata(fd, arm->adt);
bone=arm->bonebase.first;
while (bone) {
@@ -3779,6 +3795,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
if(clmd->sim_parms) {
if(clmd->sim_parms->presets > 10)
clmd->sim_parms->presets = 0;
+
+ clmd->sim_parms->reset = 0;
}
if(clmd->sim_parms->effector_weights)
@@ -3861,7 +3879,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
collmd->current_x = NULL;
collmd->current_xnew = NULL;
collmd->current_v = NULL;
- collmd->time = -1;
+ collmd->time = -1000;
collmd->numverts = 0;
collmd->bvhtree = NULL;
collmd->mfaces = NULL;
@@ -4199,11 +4217,6 @@ static void lib_link_scene(FileData *fd, Main *main)
MEM_freeN(base);
}
}
-
- if (sce->ed) {
- Editing *ed= sce->ed;
- ed->act_seq= NULL; // ed->act_seq= newlibadr(fd, ed->act_seq); // FIXME
- }
SEQ_BEGIN(sce->ed, seq) {
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
@@ -4305,7 +4318,8 @@ static void direct_link_scene(FileData *fd, Scene *sce)
ListBase *old_seqbasep= &((Editing *)sce->ed)->seqbase;
ed= sce->ed= newdataadr(fd, sce->ed);
- ed->act_seq= NULL; // ed->act_seq= newdataadr(fd, ed->act_seq); // FIXME
+
+ ed->act_seq= newdataadr(fd, ed->act_seq);
/* recursive link sequences, lb will be correctly initialized */
link_recurs_seq(fd, &ed->seqbase);
@@ -5264,7 +5278,7 @@ static void lib_link_group(FileData *fd, Main *main)
go= go->next;
}
if(add_us) group->id.us++;
- rem_from_group(group, NULL); /* removes NULL entries */
+ rem_from_group(group, NULL, NULL, NULL); /* removes NULL entries */
}
group= group->id.next;
}
@@ -5993,13 +6007,38 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->regiontype= RGN_TYPE_UI;
ar->alignment= RGN_ALIGN_TOP;
break;
+ case SPACE_VIEW3D:
+ /* toolbar */
+ ar= MEM_callocN(sizeof(ARegion), "toolbar for view3d");
+
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_UI;
+ ar->alignment= RGN_ALIGN_LEFT;
+ ar->flag = RGN_FLAG_HIDDEN;
+
+ /* tool properties */
+ ar= MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_UI;
+ ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV;
+ ar->flag = RGN_FLAG_HIDDEN;
+
+ /* buttons/list view */
+ ar= MEM_callocN(sizeof(ARegion), "buttons for view3d");
+
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_UI;
+ ar->alignment= RGN_ALIGN_RIGHT;
+ ar->flag = RGN_FLAG_HIDDEN;
#if 0
case SPACE_BUTS:
/* context UI region */
ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
BLI_addtail(lb, ar);
- ar->regiontype= RGN_TYPE_CHANNELS;
- ar->alignment= RGN_ALIGN_TOP;
+ ar->regiontype= RGN_TYPE_UI;
+ ar->alignment= RGN_ALIGN_RIGHT;
+
break;
#endif
}
@@ -8469,7 +8508,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* correctly initialise constinv matrix */
- Mat4One(ob->constinv);
+ unit_m4(ob->constinv);
if (ob->type == OB_ARMATURE) {
if (ob->pose) {
@@ -8499,7 +8538,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* correctly initialise constinv matrix */
- Mat4One(pchan->constinv);
+ unit_m4(pchan->constinv);
}
}
}
@@ -9904,7 +9943,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* Add default gravity to scenes */
for(sce= main->scene.first; sce; sce= sce->id.next) {
if((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0
- && VecLength(sce->physics_settings.gravity) == 0.0f) {
+ && len_v3(sce->physics_settings.gravity) == 0.0f) {
sce->physics_settings.gravity[0] = sce->physics_settings.gravity[1] = 0.0f;
sce->physics_settings.gravity[2] = -9.81f;
@@ -10035,11 +10074,45 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
{
Scene *sce= main->scene.first;
while(sce) {
+ Sequence *seq;
+
if(sce->r.frame_step==0)
sce->r.frame_step= 1;
+
+ if(sce->ed && sce->ed->seqbasep)
+ {
+ seq=sce->ed->seqbasep->first;
+ while(seq) {
+ seqUniqueName(sce->ed->seqbasep, seq);
+ seq=seq->next;
+ }
+ }
+
sce= sce->id.next;
}
}
+ {
+ /* ensure all nodes have unique names */
+ bNodeTree *ntree= main->nodetree.first;
+ while(ntree) {
+ bNode *node=ntree->nodes.first;
+
+ while(node) {
+ nodeUniqueName(ntree, node);
+ node= node->next;
+ }
+
+ ntree= ntree->id.next;
+ }
+ }
+ {
+ Object *ob=main->object.first;
+ while (ob) {
+ /* shaded mode disabled for now */
+ if (ob->dt == OB_SHADED) ob->dt = OB_TEXTURE;
+ ob=ob->id.next;
+ }
+ }
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@ -10380,15 +10453,63 @@ static void expand_constraint_channels(FileData *fd, Main *mainvar, ListBase *ch
}
}
-// XXX depreceated - old animation system
+static void expand_fmodifiers(FileData *fd, Main *mainvar, ListBase *list)
+{
+ FModifier *fcm;
+
+ for (fcm= list->first; fcm; fcm= fcm->next) {
+ /* library data for specific F-Modifier types */
+ switch (fcm->type) {
+ case FMODIFIER_TYPE_PYTHON:
+ {
+ FMod_Python *data= (FMod_Python *)fcm->data;
+
+ expand_doit(fd, mainvar, data->script);
+ }
+ break;
+ case FMODIFIER_TYPE_SOUND:
+ {
+ FMod_Sound *data= (FMod_Sound *)fcm->data;
+
+ expand_doit(fd, mainvar, data->sound);
+ }
+ break;
+ }
+ }
+}
+
+static void expand_fcurves(FileData *fd, Main *mainvar, ListBase *list)
+{
+ FCurve *fcu;
+
+ for (fcu= list->first; fcu; fcu= fcu->next) {
+ /* Driver targets if there is a driver */
+ if (fcu->driver) {
+ ChannelDriver *driver= fcu->driver;
+ DriverTarget *dtar;
+
+ for (dtar= driver->targets.first; dtar; dtar= dtar->next)
+ expand_doit(fd, mainvar, dtar->id);
+ }
+
+ /* F-Curve Modifiers */
+ expand_fmodifiers(fd, mainvar, &fcu->modifiers);
+ }
+}
+
static void expand_action(FileData *fd, Main *mainvar, bAction *act)
{
bActionChannel *chan;
+ // XXX depreceated - old animation system --------------
for (chan=act->chanbase.first; chan; chan=chan->next) {
expand_doit(fd, mainvar, chan->ipo);
expand_constraint_channels(fd, mainvar, &chan->constraintChannels);
}
+ // ---------------------------------------------------
+
+ /* F-Curves in Action */
+ expand_fcurves(fd, mainvar, &act->curves);
}
static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list)
@@ -10412,6 +10533,12 @@ static void expand_animdata_nlastrips(FileData *fd, Main *mainvar, ListBase *lis
/* check child strips */
expand_animdata_nlastrips(fd, mainvar, &strip->strips);
+ /* check F-Curves */
+ expand_fcurves(fd, mainvar, &strip->fcurves);
+
+ /* check F-Modifiers */
+ expand_fmodifiers(fd, mainvar, &strip->modifiers);
+
/* relink referenced action */
expand_doit(fd, mainvar, strip->act);
}
@@ -10419,7 +10546,6 @@ static void expand_animdata_nlastrips(FileData *fd, Main *mainvar, ListBase *lis
static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt)
{
- FCurve *fcd;
NlaTrack *nlt;
/* own action */
@@ -10427,13 +10553,7 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt)
expand_doit(fd, mainvar, adt->tmpact);
/* drivers - assume that these F-Curves have driver data to be in this list... */
- for (fcd= adt->drivers.first; fcd; fcd= fcd->next) {
- ChannelDriver *driver= fcd->driver;
- DriverTarget *dtar;
-
- for (dtar= driver->targets.first; dtar; dtar= dtar->next)
- expand_doit(fd, mainvar, dtar->id);
- }
+ expand_fcurves(fd, mainvar, &adt->drivers);
/* nla-data - referenced actions */
for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next)
@@ -10474,6 +10594,9 @@ static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
if(ntree->adt)
expand_animdata(fd, mainvar, ntree->adt);
+
+ if(ntree->gpd)
+ expand_doit(fd, mainvar, ntree->gpd);
for(node= ntree->nodes.first; node; node= node->next)
if(node->id && node->type!=CMP_NODE_R_LAYERS)
diff --git a/source/blender/collada/CMakeLists.txt b/source/blender/collada/CMakeLists.txt
index f510e7ee9ad..a0a4fb78b9b 100644
--- a/source/blender/collada/CMakeLists.txt
+++ b/source/blender/collada/CMakeLists.txt
@@ -53,10 +53,10 @@ SET(INC
../makesrna
../editors/include
../../../intern/guardedalloc
- ${OPENCOLLADA}/COLLADAStreamWriter/include
- ${OPENCOLLADA}/COLLADABaseUtils/include
- ${OPENCOLLADA}/COLLADAFramework/include
- ${OPENCOLLADA}/COLLADASaxFrameworkLoader/include
+ ${OPENCOLLADA_INC}/COLLADAStreamWriter/include
+ ${OPENCOLLADA_INC}/COLLADABaseUtils/include
+ ${OPENCOLLADA_INC}/COLLADAFramework/include
+ ${OPENCOLLADA_INC}/COLLADASaxFrameworkLoader/include
)
ENDIF(APPLE)
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp
index b626635d021..c3550dfd408 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -37,7 +37,7 @@ extern "C"
#include "BKE_image.h"
#include "BKE_utildefines.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_listbase.h"
@@ -87,7 +87,7 @@ extern "C"
// This function assumes that quat is normalized.
// The following document was used as reference:
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
-void QuatToAxisAngle(float *q, float *axis, float *angle)
+void quat_to_axis_angle( float *axis, float *angle,float *q)
{
// quat to axis angle
*angle = 2 * acos(q[0]);
@@ -666,14 +666,14 @@ protected:
if (parent_mat) {
float invpar[4][4];
- Mat4Invert(invpar, parent_mat);
- Mat4MulMat4(local, mat, invpar);
+ invert_m4_m4(invpar, parent_mat);
+ mul_m4_m4m4(local, mat, invpar);
}
else {
- Mat4CpyMat4(local, mat);
+ copy_m4_m4(local, mat);
}
- TransformBase::decompose(local, loc, rot, size);
+ TransformBase::decompose(local, loc, rot, NULL, size);
/*
// this code used to create a single representing object rotation
@@ -681,9 +681,9 @@ protected:
float axis[3];
float angle;
double angle_deg;
- EulToQuat(rot, quat);
- NormalQuat(quat);
- QuatToAxisAngle(quat, axis, &angle);
+ 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);
*/
@@ -901,12 +901,12 @@ private:
bPoseChannel *parchan = get_pose_channel(ob_arm->pose, bone->parent->name);
float invpar[4][4];
- Mat4Invert(invpar, parchan->pose_mat);
- Mat4MulMat4(mat, pchan->pose_mat, invpar);
+ invert_m4_m4(invpar, parchan->pose_mat);
+ mul_m4_m4m4(mat, pchan->pose_mat, invpar);
}
else {
// get world-space from armature-space
- Mat4MulMat4(mat, pchan->pose_mat, ob_arm->obmat);
+ mul_m4_m4m4(mat, pchan->pose_mat, ob_arm->obmat);
}
TransformWriter::add_node_transform(node, mat, NULL);
@@ -1059,9 +1059,9 @@ private:
float inv_bind_mat[4][4];
// make world-space matrix, pose_mat is armature-space
- Mat4MulMat4(world, pchan->pose_mat, ob_arm->obmat);
+ mul_m4_m4m4(world, pchan->pose_mat, ob_arm->obmat);
- Mat4Invert(mat, world);
+ invert_m4_m4(mat, world);
converter.mat4_to_dae(inv_bind_mat, mat);
source.appendValues(inv_bind_mat);
@@ -1241,9 +1241,9 @@ public:
if (ob->type == OB_MESH && is_skinned_mesh)
// for skinned mesh we write obmat in
- Mat4One(mat);
+ unit_m4(mat);
else
- Mat4CpyMat4(mat, ob->obmat);
+ copy_m4_m4(mat, ob->obmat);
TransformWriter::add_node_transform(node, mat, ob->parent ? ob->parent->obmat : NULL);
@@ -2048,7 +2048,7 @@ public:
float eul[3];
- QuatToEul(quat, eul);
+ quat_to_eul( eul,quat);
for (int k = 0; k < 3; k++)
create_bezt(eulcu[k], frame, eul[k]);
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 0aa69d11949..9ebcc8b191f 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -1,3 +1,7 @@
+// TODO:
+// * name imported objects
+// * import object rotation as euler
+
#include "COLLADAFWRoot.h"
#include "COLLADAFWIWriter.h"
#include "COLLADAFWStableHeaders.h"
@@ -50,7 +54,8 @@ extern "C"
#include "BKE_depsgraph.h"
#include "BLI_util.h"
#include "BKE_displist.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
+#include "BKE_scene.h"
}
#include "BKE_armature.h"
#include "BKE_mesh.h"
@@ -62,7 +67,7 @@ extern "C"
#include "BKE_utildefines.h"
#include "BKE_action.h"
-#include "BLI_arithb.h"
+#include "BLI_math.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
@@ -85,17 +90,16 @@ extern "C"
#include
#include